Skip to content

Commit

Permalink
Merge pull request #147 from mapzen/523-add-elevation-to-peaks
Browse files Browse the repository at this point in the history
Add function to convert elevations to meters.
  • Loading branch information
zerebubuth committed Apr 26, 2016
2 parents e5bbff1 + c5a6170 commit 49a17c0
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions TileStache/Goodies/VecTiles/transform.py
Original file line number Diff line number Diff line change
Expand Up @@ -3141,6 +3141,7 @@ def add_state_to_stations(shape, properties, fid, zoom):
"""

kind = properties.get('kind')
assert kind, "WTF: kind should be set on [%r]: %r" % (fid, properties)
if kind not in ('station'):
return shape, properties, fid

Expand Down Expand Up @@ -3168,3 +3169,15 @@ def height_to_meters(shape, props, fid, zoom):

props['height'] = _to_float_meters(height)
return shape, props, fid

def elevation_to_meters(shape, props, fid, zoom):
"""
If the properties has an "elevation" entry, then convert that to meters.
"""

elevation = props.get('elevation')
if not elevation:
return shape, props, fid

props['elevation'] = _to_float_meters(elevation)
return shape, props, fid

0 comments on commit 49a17c0

Please sign in to comment.