Skip to content

Commit

Permalink
update osmnx
Browse files Browse the repository at this point in the history
  • Loading branch information
weiqi-tori committed Dec 20, 2024
1 parent bab3291 commit 1c0979b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion city_metrix/layers/layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import shapely.geometry as geometry
import pandas as pd

MAX_TILE_SIZE_DEGREES = 0.2 # TODO Why was this value selected?
MAX_TILE_SIZE_DEGREES = 0.5 # TODO Why was this value selected?

class Layer:
def __init__(self, aggregate=None, masks=[]):
Expand Down
4 changes: 2 additions & 2 deletions city_metrix/layers/open_street_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ def __init__(self, osm_class=None, **kwargs):
self.osm_class = osm_class

def get_data(self, bbox):
north, south, east, west = bbox[3], bbox[1], bbox[0], bbox[2]
left, top, right, bottom = bbox
# Set the OSMnx configuration to disable caching
ox.settings.use_cache = False
try:
osm_feature = ox.features_from_bbox(bbox=(north, south, east, west), tags=self.osm_class.value)
osm_feature = ox.features_from_bbox(bbox=(left, bottom, right, top), tags=self.osm_class.value)
# When no feature in bbox, return an empty gdf
except ox._errors.InsufficientResponseError as e:
osm_feature = gpd.GeoDataFrame(pd.DataFrame(columns=['osmid', 'geometry']+list(self.osm_class.value.keys())), geometry='geometry')
Expand Down
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies:
- python=3.10
- earthengine-api=0.1.411
- geocube=0.4.2
- geopandas=0.14.4
- geopandas=1.0.1
- xarray=2024.7.0
- rioxarray=0.15.0
- odc-stac=0.3.8
Expand All @@ -14,7 +14,7 @@ dependencies:
- xarray-spatial=0.3.7
- xee=0.0.15
- utm=0.7.0
- osmnx=1.9.0
- osmnx=2.0.0
- dask[complete]=2023.11.0
- matplotlib=3.8.2
- jupyterlab=4.0.10
Expand Down

0 comments on commit 1c0979b

Please sign in to comment.