Skip to content

Commit

Permalink
MVT Changes have merged
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Sep 6, 2023
1 parent 10d266c commit f8c199c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions openaddr/preview.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ def projected_geom(geometry, mx, bx, my, by):

for (row, col) in row_cols:
url = uritemplate.expand(TILE_URL, dict(z=zoom, x=col, y=row, access_token=mapbox_key))

_L.debug('Getting tile {}'.format(url))

got = requests.get(url)
tile = mapbox_vector_tile.decode(got.content)
bounds = tile_bounds(row, col, zoom)
Expand All @@ -213,8 +216,6 @@ def projected_geom(geometry, mx, bx, my, by):
if feature['properties'].get('class') in ('motorway', 'motorway_link', 'trunk', 'primary', 'secondary', 'tertiary', 'link', 'street', 'street_limited', 'pedestrian', 'construction', 'track', 'service', 'major_rail', 'minor_rail'):
roads_geoms.append(projected_geom(feature['geometry'], *road_xform))

_L.debug('Getting tile {}'.format(url))

return landuse_geoms, water_geoms, roads_geoms

def get_projection():
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
'Shapely == 2.0.1',

# https://github.com/tilezen/mapbox-vector-tile
'mapbox-vector-tile @ git+https://github.com/tilezen/mapbox-vector-tile.git@5249a23da696515f118564dbcc83b39216792454#egg=mapbox-vector-tile',
'mapbox-vector-tile == 2.0.1',
'future==0.18.3',
'protobuf==4.24',
]
Expand Down

0 comments on commit f8c199c

Please sign in to comment.