Skip to content

Commit

Permalink
Rename root_relation_id -> root_id
Browse files Browse the repository at this point in the history
  • Loading branch information
rmarianski committed Aug 18, 2016
1 parent 0691531 commit bf06a5b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/layers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`):

Expand Down
14 changes: 14 additions & 0 deletions integration-test/653-unify-building-part.py
Original file line number Diff line number Diff line change
Expand Up @@ -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) })
2 changes: 1 addition & 1 deletion vectordatasource/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bf06a5b

Please sign in to comment.