Commit 0545b219 authored by Tobias Steiner's avatar Tobias Steiner
Browse files

Update to new fundmuenzen schema

parent 8f62963a
......@@ -17,7 +17,7 @@ class Fundmuenzen extends CsvReadable {
}
public transformDataKey(records: any) {
return `fundmuenzen${records[3].toString()}`;
return `${records.provider}${records.identifier}`;
}
public transformData(records: any): InterfaceGeolinker | null {
......@@ -26,20 +26,20 @@ class Fundmuenzen extends CsvReadable {
}
// we need lat,lon and the id
if (typeof records[1] === 'undefined' || records[1] === '' ||
typeof records[2] === 'undefined' || records[2] === '' ||
typeof records[3] === 'undefined' || records[3] === '') {
typeof records[5] === 'undefined' || records[2] === '' ||
typeof records[3] === 'undefined' || records[6] === '') {
return null;
}
return {
id: records[3].toString(),
id: records[7].toString(),
provider: 'fundmuenzen',
url: `https://www.muenzfunde.ch/id/country/ch/municipality/${records[3].toString()}/`,
url: `https://www.muenzfunde.ch/id/country/ch/municipality/${records[7].toString()}/`,
name: records[0].toString(),
alternative_name: null,
alternative_name: records[1].toString() + ' ' + records[2].toString() + ' ' + records[3].toString() + ' ' + records[4].toString(),
typology: 'municipality',
country: records[14],
location: this.buildLocation(parseFloat(records[1]), parseFloat(records[2])),
location: this.buildLocation(parseFloat(records[5]), parseFloat(records[6])),
modification_date: this.getDate(),
};
}
......@@ -48,14 +48,14 @@ class Fundmuenzen extends CsvReadable {
const urls = [];
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[3]}`));
urls.push(this.core.getUriBuilder().urlResolver('dodis', `${records[6]}`));
urls.push(this.core.getUriBuilder().urlResolver('ssrq', records[7]));
urls.push(this.core.getUriBuilder().urlResolver('hls', records[4]));
urls.push(this.core.getUriBuilder().urlResolver('ortsnamen', records[5]));
urls.push(this.core.getUriBuilder().urlResolver('gnd', records[9]));
urls.push(this.core.getUriBuilder().urlResolver('tgn', records[11]));
urls.push(this.core.getUriBuilder().urlResolver('wikidata', records[10]));
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[1]));
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]));
return {
from,
......@@ -69,6 +69,8 @@ class Fundmuenzen extends CsvReadable {
}
private buildLocation(lon: number, lat: number) {
console.log(lon);
console.log(lat);
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