Commit 3c7b3b12 authored by Tobinsk's avatar Tobinsk
Browse files

Merge branch '2-new-schema' into 'master'

Resolve "New schema"

Closes #2

See merge request !5
parents 62fbaa03 590a5fdd
......@@ -32,31 +32,29 @@ class Fundmuenzen extends CsvReadable {
}
return {
id: records[7].toString(),
id: records[3].toString(),
provider: 'fundmuenzen',
url: `https://www.muenzfunde.ch/id/country/ch/municipality/${records[7].toString()}`,
name: records[0].toString(),
alternative_name: records[1].toString() + ' ' + records[2].toString() + ' '
+ records[3].toString() + ' ' + records[4].toString(),
alternative_name: records[17].toString() ,
typology: ['municipality'],
country: records[14],
location: this.buildLocation(parseFloat(records[5]), parseFloat(records[6])),
modification_date: this.getDate(),
country: 'ch',
location: Fundmuenzen.buildLocation(parseFloat(records[1]), parseFloat(records[2])),
modification_date: Fundmuenzen.getDate(),
};
}
public transformLinks(records: any): InterfaceConcordance | null {
const urls = [];
const from = `https://www.muenzfunde.ch/id/country/ch/municipality/${records[7].toString()}`;
const from = `https://www.muenzfunde.ch/id/country/ch/municipality/${records[3].toString()}`;
// transform the identifiers to links
urls.push(this.core.getUriBuilder().urlResolver('fundmuenzen', `${records[7]}`));
urls.push(this.core.getUriBuilder().urlResolver('dodis', `${records[10]}`));
urls.push(this.core.getUriBuilder().urlResolver('ssrq', records[11]));
urls.push(this.core.getUriBuilder().urlResolver('hls', records[8]));
urls.push(this.core.getUriBuilder().urlResolver('ortsnamen', records[9]));
urls.push(this.core.getUriBuilder().urlResolver('gnd', records[13]));
urls.push(this.core.getUriBuilder().urlResolver('tgn', records[15]));
urls.push(this.core.getUriBuilder().urlResolver('wikidata', records[14]));
urls.push(this.core.getUriBuilder().urlResolver('dodis', `${records[7]}`));
urls.push(this.core.getUriBuilder().urlResolver('ssrq', records[8]));
urls.push(this.core.getUriBuilder().urlResolver('hls', records[5]));
urls.push(this.core.getUriBuilder().urlResolver('ortsnamen', records[6]));
urls.push(this.core.getUriBuilder().urlResolver('gnd', records[10]));
urls.push(this.core.getUriBuilder().urlResolver('tgn', records[12]));
urls.push(this.core.getUriBuilder().urlResolver('wikidata', records[11]));
return {
from,
......@@ -64,12 +62,14 @@ class Fundmuenzen extends CsvReadable {
};
}
private getDate() {
// tslint:disable-next-line:member-ordering
private static getDate() {
const date = new Date();
return `${date.getFullYear()}-${date.getMonth()}-${date.getDate()}`;
}
private buildLocation(lon: number, lat: number) {
// tslint:disable-next-line:member-ordering
private static buildLocation(lon: number, lat: number) {
proj4.defs('EPSG:2056', '+proj=somerc +lat_0=46.95240555555556 +lon_0=7.439583333333333 +k_0=1 +x_0=2600000 +y_0=1200000 +ellps=bessel +towgs84=674.374,15.056,405.346,0,0,0,0 +units=m +no_defs');
proj4.defs('EPSG:4326', '+proj=longlat +datum=WGS84 +no_defs');
const coordinates = proj4('EPSG:2056', 'EPSG:4326', [lon, lat]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment