Skip to content

Commit

Permalink
Merge pull request #95 from HSLdevcom/DT-5404
Browse files Browse the repository at this point in the history
chore: one general parks source for parking areas
  • Loading branch information
vesameskanen authored May 18, 2022
2 parents 142222d + dbae6a7 commit db755b2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
5 changes: 2 additions & 3 deletions pelias.json.docker
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@
"version": "1.0",
"requestRetries": 0,
"targets": {
"canonical_sources": ["openstreetmap", "openaddresses", "nlsfi", "gtfs", "citybikes", "carparks", "bikeparks"],
"canonical_sources": ["openstreetmap", "openaddresses", "nlsfi", "gtfs", "citybikes", "parks"],
"layers_by_source": {
"nlsfi": ["venue", "stop", "station"],
"gtfs": ["stop", "station"],
"citybikes": ["bikestation"],
"carparks": ["carpark"],
"bikeparks": ["bikepark"]
"parks": ["carpark", "bikepark"],
},
"source_aliases": {
"gtfs": ["gtfs"],
Expand Down
8 changes: 3 additions & 5 deletions sanitizer/_ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,8 @@ function sanitizeId(rawId, messages) {
source = 'gtfs';
} else if(source.indexOf('citybikes') === 0) {
source = 'citybikes';
} else if(source.indexOf('carparks') === 0) {
source = 'carparks';
} else if(source.indexOf('bikeparks') === 0) {
source = 'bikeparks';
} else if(source.indexOf('parks') === 0) {
source = 'parks';
}
var layer = parts[1];
var id = parts.slice(2).join(ID_DELIM);
Expand All @@ -57,7 +55,7 @@ function sanitizeId(rawId, messages) {


return {
source: source === 'gtfs' || source === 'citybikes' || source === 'carparks' || source === 'bikeparks' ? parts[0] : type_mapping.source_mapping[source][0],
source: source === 'gtfs' || source === 'citybikes' || source === 'parks' ? parts[0] : type_mapping.source_mapping[source][0],
layer: layer,
id: id,
};
Expand Down
6 changes: 2 additions & 4 deletions sanitizer/_sources_and_layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@ function _sanitize( raw, clean ){
source = 'gtfs'; // map gtfs<feedid> to plain gtfs
} else if (source.indexOf('citybikes') === 0) {
source = 'citybikes';
} else if (source.indexOf('carparks') === 0) {
source = 'carparks';
} else if (source.indexOf('bikeparks') === 0) {
source = 'bikeparks';
} else if (source.indexOf('parks') === 0) {
source = 'parks';
}
var layers_for_source = type_mapping.layers_by_source[source];
clean.layers.forEach(function(layer) {
Expand Down

0 comments on commit db755b2

Please sign in to comment.