From bf06a5b6886e3af2038aebb910ec6e7ba113abbb Mon Sep 17 00:00:00 2001 From: Robert Marianski Date: Tue, 16 Aug 2016 15:00:57 -0400 Subject: [PATCH] Rename root_relation_id -> root_id --- docs/layers.md | 2 +- integration-test/653-unify-building-part.py | 14 ++++++++++++++ vectordatasource/transform.py | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/docs/layers.md b/docs/layers.md index d2cab62ff..569f13156 100644 --- a/docs/layers.md +++ b/docs/layers.md @@ -480,7 +480,7 @@ To resolve inconsistency in data tagging in OpenStreetMap we normalize several o * `light_rail_routes` a list of light rail or rapid-transit passenger train routes. * `tram_routes` a list of tram routes. * `is_*` a set of boolean flags indicating whether this station has any routes of the given type. These are: `is_train`, `is_subway`, `is_light_rail`, `is_tram`, corresponding to the above `*_routes`. This is provided as a convenience for styling. -* `root_relation_id` an integer ID (of an OSM relation) which can be used to link or group together features which are related by being part of a larger feature. A full explanation of [relations](http://wiki.openstreetmap.org/wiki/Relation) wouldn't fit here, but the general idea is that all the station features which are part of the same [site](http://wiki.openstreetmap.org/wiki/Relation:site), [stop area](http://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area) or [stop area group](http://wiki.openstreetmap.org/wiki/Relation:public_transport) should have the same ID to show they're related. Note that this information is only present on some stations. +* `root_id` an integer ID (of an OSM relation) which can be used to link or group together features which are related by being part of a larger feature. A full explanation of [relations](http://wiki.openstreetmap.org/wiki/Relation) wouldn't fit here, but the general idea is that all the station features which are part of the same [site](http://wiki.openstreetmap.org/wiki/Relation:site), [stop area](http://wiki.openstreetmap.org/wiki/Tag:public_transport%3Dstop_area) or [stop area group](http://wiki.openstreetmap.org/wiki/Relation:public_transport) should have the same ID to show they're related. Note that this information is only present on some stations. #### POI properties (only on `kind:bicycle_rental_station`): diff --git a/integration-test/653-unify-building-part.py b/integration-test/653-unify-building-part.py index 40b1ae5a0..b3f7ba07c 100644 --- a/integration-test/653-unify-building-part.py +++ b/integration-test/653-unify-building-part.py @@ -25,3 +25,17 @@ assert_has_feature( 16, 10486, 25326, 'buildings', { 'id': 404449724, 'kind': 'building_part', 'root_id': 24460886 }) + + +# http://www.openstreetmap.org/relation/1242762 +# Relation: Waterloo (tube and rail) +# http://www.openstreetmap.org/relation/238793 +# Relation: Waterloo (tube station) +# http://www.openstreetmap.org/relation/238792 +# Relation: London Waterloo +assert_has_feature( + 16, 32747, 21793, 'pois', + { 'id': 3638795617, 'root_id': 1242762, 'root_relation_id': type(None) }) +assert_has_feature( + 16, 32747, 21793, 'pois', + { 'id': 3638795618, 'root_id': 1242762, 'root_relation_id': type(None) }) diff --git a/vectordatasource/transform.py b/vectordatasource/transform.py index 82c00a224..c36774328 100644 --- a/vectordatasource/transform.py +++ b/vectordatasource/transform.py @@ -2441,7 +2441,7 @@ def normalize_station_properties(ctx): # that as a way for the client to link together related # features. if root_relation_id: - props['root_relation_id'] = root_relation_id + props['root_id'] = root_relation_id return layer