Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
histhub
fundmuenzen
Commits
590a5fdd
Commit
590a5fdd
authored
Oct 15, 2020
by
Tobinsk
Browse files
Resolve "New csv schema for fundmuenzen.ch"
parent
62fbaa03
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/index.ts
View file @
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
]);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment