Skip to content

Commit

Permalink
Merge pull request #112 from mapzen/440-zoos-and-other-attractions
Browse files Browse the repository at this point in the history
Add function to normalise tourism kind and related properties.
  • Loading branch information
zerebubuth committed Jan 19, 2016
2 parents 04a4cae + ed3d8c6 commit b5d7c92
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions TileStache/Goodies/VecTiles/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -2866,3 +2866,27 @@ def merge_features(
layer['features'] = new_features

return layer


def normalize_tourism_kind(shape, properties, fid, zoom):
"""
There are many tourism-related tags, including 'zoo=*' and 'attraction=*' in
addition to 'tourism=*'. This function promotes things with zoo and
attraction tags have those values as their main kind.
See https://github.com/mapzen/vector-datasource/issues/440 for more details.
"""

zoo = properties.pop('zoo', None)
if zoo is not None:
properties['kind'] = zoo
properties['tourism'] = 'attraction'
return (shape, properties, fid)

attraction = properties.pop('attraction', None)
if attraction is not None:
properties['kind'] = attraction
properties['tourism'] = 'attraction'
return (shape, properties, fid)

return (shape, properties, fid)

0 comments on commit b5d7c92

Please sign in to comment.