-
Notifications
You must be signed in to change notification settings - Fork 1
/
4_process-3b_verkehrslinie.js
executable file
·67 lines (59 loc) · 1.45 KB
/
4_process-3b_verkehrslinie.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env node
'use strict'
const { processAlkis } = require('../lib/geohelper.js');
let getType = initLookup();
processAlkis({
slug: 'verkehrslinie',
ruleTypes: 'autobahn,bundesstr,landesstr,kreisstr,bahnlinie'.split(','),
cbFeature: feature => {
let type = getType.get(feature.properties.klasse);
if (type === undefined) throw Error(`Klasse "${feature.properties.klasse}" unbekannt`);
return type;
}
})
function initLookup() {
let lookup = new Map();
lookup.set('Bundesautobahn', 'autobahn');
lookup.set('Bundesstraße', 'bundesstr');
lookup.set('Landesstraße, Staatsstraße', 'landesstr');
lookup.set('Kreisstraße', 'kreisstr');
lookup.set('Eisenbahn', 'bahnlinie');
[
'(Kletter-)Steig im Gebirge',
'Attribut trifft nicht zu',
'Autofährverkehr',
'Bahn im Freizeitpark',
'Fußweg',
'Gemeindestraße',
'Gleis',
'Güterverkehr',
'Hauptwirtschaftsweg',
'Kabinenbahn, Umlaufseilbahn',
'Linienverkehr',
'Luftseilbahn, Großkabinenbahn',
'Magnetschwebebahn',
'Materialseilbahn',
'Museumsbahn',
'Personenfährverkehr',
'Rad- und Fußweg',
'Radweg',
'Reitweg',
'S-Bahn',
'Schwebebahn',
'Seilbahn, Bergbahn',
'Sessellift',
'Skaterstrecke',
'Ski-, Schlepplift',
'Sonstiges',
'Stadtbahn',
'Standseilbahn',
'Startbahn, Landebahn',
'Straßenbahn',
'U-Bahn',
'Weg, Pfad, Steig',
'Wirtschaftsweg',
'Zahnradbahn',
'Zurollbahn, Taxiway',
].forEach(label => lookup.set(label, false))
return lookup
}