From a1886374d8df63ab58c8f98097884df7da72966e Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Thu, 8 Aug 2024 15:51:51 +0800 Subject: [PATCH 1/9] update to use overture buildings --- city_metrix/layers/smart_surface_lulc.py | 3 ++- .../building_classifier.py | 20 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index d58f468..77d69b9 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -13,6 +13,7 @@ from .layer import Layer, get_utm_zone_epsg, create_fishnet_grid, MAX_TILE_SIZE from .open_street_map import OpenStreetMap, OpenStreetMapClass +from .overture_buildings import OvertureBuildings from ..models.building_classifier.building_classifier import BuildingClassifier @@ -80,7 +81,7 @@ def get_data(self, bbox): ulu_lulc_1m = BuildingClassifier().get_data_ulu(bbox, crs, esa_1m) anbh_1m = BuildingClassifier().get_data_anbh(bbox, esa_1m) # get building features - buildings = BuildingClassifier().get_data_buildings(bbox, crs) + buildings = OvertureBuildings().get_data(bbox) # extract ULU, ANBH, and Area_m buildings['ULU'] = exact_extract(ulu_lulc_1m, buildings, ["majority"], output='pandas')['majority'] buildings['ANBH'] = exact_extract(anbh_1m, buildings, ["mean"], output='pandas')['mean'] diff --git a/city_metrix/models/building_classifier/building_classifier.py b/city_metrix/models/building_classifier/building_classifier.py index 2241509..89e4d9b 100644 --- a/city_metrix/models/building_classifier/building_classifier.py +++ b/city_metrix/models/building_classifier/building_classifier.py @@ -16,8 +16,6 @@ from ...layers.esa_world_cover import EsaWorldCover, EsaWorldCoverClass from ...layers.urban_land_use import UrbanLandUse from ...layers.average_net_building_height import AverageNetBuildingHeight -from ...layers.open_street_map import OpenStreetMap, OpenStreetMapClass -from ...layers.open_buildings import OpenBuildings class BuildingClassifier(Layer): @@ -111,24 +109,6 @@ def get_data_anbh(self, bbox, snap_to): return anbh_1m - def get_data_buildings(self, bbox, crs): - # OSM buildings - building_osm = OpenStreetMap(osm_class=OpenStreetMapClass.BUILDING).get_data(bbox).to_crs(crs).reset_index(drop=True) - # Google-Microsoft Open Buildings Dataset buildings - openbuilds = OpenBuildings(country='USA').get_data(bbox).to_crs(crs).reset_index(drop=True) - - # Intersect buildings and keep the open buildings that don't intersect OSM buildings - intersect_buildings = gpd.sjoin(building_osm, openbuilds, how='inner', predicate='intersects') - openbuilds_non_intersect = openbuilds.loc[~openbuilds.index.isin(intersect_buildings.index)] - - buildings = pd.concat([building_osm['geometry'], openbuilds_non_intersect['geometry']], ignore_index=True).reset_index() - # Get rid of any 3d geometries that cause a problem - buildings = buildings[~buildings['geometry'].apply(lambda geom: 'Z' in geom.geom_type)] - - # Value not start with 0 - buildings['Value'] = buildings['index'] + 1 - - return buildings def rasterize_polygon(self, gdf, snap_to): if gdf.empty: From c69196bedf13b0cf98265f061143454f71bec8ec Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Thu, 8 Aug 2024 16:08:35 +0800 Subject: [PATCH 2/9] reproject buildings --- city_metrix/layers/smart_surface_lulc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index 77d69b9..e38fc0a 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -81,7 +81,7 @@ def get_data(self, bbox): ulu_lulc_1m = BuildingClassifier().get_data_ulu(bbox, crs, esa_1m) anbh_1m = BuildingClassifier().get_data_anbh(bbox, esa_1m) # get building features - buildings = OvertureBuildings().get_data(bbox) + buildings = OvertureBuildings().get_data(bbox).to_crs(crs) # extract ULU, ANBH, and Area_m buildings['ULU'] = exact_extract(ulu_lulc_1m, buildings, ["majority"], output='pandas')['majority'] buildings['ANBH'] = exact_extract(anbh_1m, buildings, ["mean"], output='pandas')['mean'] From 44f5bc834c391d24b02fefd58261e1fc0189776a Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Wed, 14 Aug 2024 16:33:00 +0800 Subject: [PATCH 3/9] update data type to use uint16 --- city_metrix/layers/smart_surface_lulc.py | 10 +++++----- .../models/building_classifier/building_classifier.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index e38fc0a..49b1814 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -34,12 +34,12 @@ def get_data(self, bbox): # Open space open_space_osm = OpenStreetMap(osm_class=OpenStreetMapClass.OPEN_SPACE_HEAT).get_data(bbox).to_crs(crs).reset_index() - open_space_osm['Value'] = np.int8(10) + open_space_osm['Value'] = np.uint16(10) # Water water_osm = OpenStreetMap(osm_class=OpenStreetMapClass.WATER).get_data(bbox).to_crs(crs).reset_index() - water_osm['Value'] = np.int8(20) + water_osm['Value'] = np.uint16(20) # Roads @@ -60,7 +60,7 @@ def get_data(self, bbox): roads_osm['lanes'] = roads_osm['lanes'].fillna(roads_osm['avg_lanes']) # Add value field (30) - roads_osm['Value'] = np.int8(30) + roads_osm['Value'] = np.uint16(30) # Buffer roads by lanes * 10 ft (3.048 m) # https://nacto.org/publication/urban-street-design-guide/street-design-elements/lane-width/#:~:text=wider%20lane%20widths.-,Lane%20widths%20of%2010%20feet%20are%20appropriate%20in%20urban%20areas,be%20used%20in%20each%20direction @@ -74,7 +74,7 @@ def get_data(self, bbox): ) else: # Add value field (30) - roads_osm['Value'] = np.int8(30) + roads_osm['Value'] = np.uint16(30) # Building @@ -113,7 +113,7 @@ def get_data(self, bbox): # Parking parking_osm = OpenStreetMap(osm_class=OpenStreetMapClass.PARKING).get_data(bbox).to_crs(crs).reset_index() - parking_osm['Value'] = np.int8(50) + parking_osm['Value'] = np.uint16(50) # combine features: open space, water, road, building, parking diff --git a/city_metrix/models/building_classifier/building_classifier.py b/city_metrix/models/building_classifier/building_classifier.py index 89e4d9b..08b5fce 100644 --- a/city_metrix/models/building_classifier/building_classifier.py +++ b/city_metrix/models/building_classifier/building_classifier.py @@ -51,7 +51,7 @@ def get_data_esa_reclass(self, bbox, crs): reclassified_esa = reclassify(esa_world_cover, bins=list(reclass_map.keys()), new_values=list(reclass_map.values())) # Convert to int8 and chunk the data for Dask processing - reclassified_esa = reclassified_esa.astype(np.int8).chunk({'x': 512, 'y': 512}) + reclassified_esa = reclassified_esa.astype(np.uint16).chunk({'x': 512, 'y': 512}) reclassified_esa = reclassified_esa.rio.write_crs(esa_world_cover.rio.crs, inplace=True) @@ -80,7 +80,7 @@ def get_data_ulu(self, bbox, crs, snap_to): ulu_lulc = ulu_lulc.where(ulu_lulc != from_val, to_val) # Convert to int8 and chunk the data for Dask processing - ulu_lulc = ulu_lulc.astype(np.int8).chunk({'x': 512, 'y': 512}) + ulu_lulc = ulu_lulc.astype(np.uint16).chunk({'x': 512, 'y': 512}) ####### 1-Non-residential as default # 0-Unclassified as nodata @@ -112,7 +112,7 @@ def get_data_anbh(self, bbox, snap_to): def rasterize_polygon(self, gdf, snap_to): if gdf.empty: - raster = np.full(snap_to.shape, 0, dtype=np.int8) + raster = np.full(snap_to.shape, 0, dtype=np.uint16) raster = xr.DataArray(raster, dims=snap_to.dims, coords=snap_to.coords) return raster.rio.write_crs(snap_to.rio.crs, inplace=True) @@ -121,7 +121,7 @@ def rasterize_polygon(self, gdf, snap_to): vector_data=gdf, measurements=["Value"], like=snap_to, - fill=np.int8(0) + fill=np.uint16(0) ).Value return raster.rio.reproject_match(snap_to) @@ -149,7 +149,7 @@ def building_classifier_tree(self): # set classifier parameters clf = DecisionTreeClassifier(max_depth=5) # encode labels - buildings_sample['Slope_encoded'] = buildings_sample['Slope'].map({'low': np.int8(42), 'high': np.int8(40)}) + buildings_sample['Slope_encoded'] = buildings_sample['Slope'].map({'low': np.uint16(42), 'high': np.uint16(40)}) # Select these rows for the training set build_train = buildings_sample[buildings_sample['Model']=='training'] From 94f751d2eec6af99b9f7fea9b72d384467162687 Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Thu, 22 Aug 2024 18:48:31 +0800 Subject: [PATCH 4/9] remove force data type and update classifier --- city_metrix/layers/smart_surface_lulc.py | 10 +++++----- .../building_classifier.pkl | Bin 4230 -> 4210 bytes .../building_classifier.py | 14 +++++++------- environment.yml | 2 +- setup.py | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index 49b1814..a8ce378 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -34,12 +34,12 @@ def get_data(self, bbox): # Open space open_space_osm = OpenStreetMap(osm_class=OpenStreetMapClass.OPEN_SPACE_HEAT).get_data(bbox).to_crs(crs).reset_index() - open_space_osm['Value'] = np.uint16(10) + open_space_osm['Value'] = 10 # Water water_osm = OpenStreetMap(osm_class=OpenStreetMapClass.WATER).get_data(bbox).to_crs(crs).reset_index() - water_osm['Value'] = np.uint16(20) + water_osm['Value'] = 20 # Roads @@ -60,7 +60,7 @@ def get_data(self, bbox): roads_osm['lanes'] = roads_osm['lanes'].fillna(roads_osm['avg_lanes']) # Add value field (30) - roads_osm['Value'] = np.uint16(30) + roads_osm['Value'] = 30 # Buffer roads by lanes * 10 ft (3.048 m) # https://nacto.org/publication/urban-street-design-guide/street-design-elements/lane-width/#:~:text=wider%20lane%20widths.-,Lane%20widths%20of%2010%20feet%20are%20appropriate%20in%20urban%20areas,be%20used%20in%20each%20direction @@ -74,7 +74,7 @@ def get_data(self, bbox): ) else: # Add value field (30) - roads_osm['Value'] = np.uint16(30) + roads_osm['Value'] = 30 # Building @@ -113,7 +113,7 @@ def get_data(self, bbox): # Parking parking_osm = OpenStreetMap(osm_class=OpenStreetMapClass.PARKING).get_data(bbox).to_crs(crs).reset_index() - parking_osm['Value'] = np.uint16(50) + parking_osm['Value'] = 50 # combine features: open space, water, road, building, parking diff --git a/city_metrix/models/building_classifier/building_classifier.pkl b/city_metrix/models/building_classifier/building_classifier.pkl index d1cee21536816784fea32165dc4b3ed218713d25..4907a22ba948cc5a655b205333d351118a1c1b18 100644 GIT binary patch delta 300 zcmZou{G`Crz%n&`BZ~{ubb#;naed}56J+jDPk%f0=~ev*nO5M7#lkWYNG O2frmFtKpQ=Bs~DsrC!GX delta 258 zcmeyQ(5A@Jz%sRZBZ~{uZM z#gxvD_9;PAG`yKJ>?glt77vceNcZMwo01U=qy>O<97tUniaI|(Kd=8l04BT{N~R=v zO8`~IXXJS+0O_8>7>mOEGL-wnHb=p;eBW6W_|WTMr6ScQ|_#tyq-gH zatCL|=1.5.0", + "scikit-learn>=1.5.1", ], ) From aebae7f930ad53ce3504b4e113b40b72767184c2 Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Thu, 8 Aug 2024 15:51:51 +0800 Subject: [PATCH 5/9] update to use overture buildings --- city_metrix/layers/smart_surface_lulc.py | 3 ++- .../building_classifier.py | 20 ------------------- 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index d58f468..77d69b9 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -13,6 +13,7 @@ from .layer import Layer, get_utm_zone_epsg, create_fishnet_grid, MAX_TILE_SIZE from .open_street_map import OpenStreetMap, OpenStreetMapClass +from .overture_buildings import OvertureBuildings from ..models.building_classifier.building_classifier import BuildingClassifier @@ -80,7 +81,7 @@ def get_data(self, bbox): ulu_lulc_1m = BuildingClassifier().get_data_ulu(bbox, crs, esa_1m) anbh_1m = BuildingClassifier().get_data_anbh(bbox, esa_1m) # get building features - buildings = BuildingClassifier().get_data_buildings(bbox, crs) + buildings = OvertureBuildings().get_data(bbox) # extract ULU, ANBH, and Area_m buildings['ULU'] = exact_extract(ulu_lulc_1m, buildings, ["majority"], output='pandas')['majority'] buildings['ANBH'] = exact_extract(anbh_1m, buildings, ["mean"], output='pandas')['mean'] diff --git a/city_metrix/models/building_classifier/building_classifier.py b/city_metrix/models/building_classifier/building_classifier.py index 2241509..89e4d9b 100644 --- a/city_metrix/models/building_classifier/building_classifier.py +++ b/city_metrix/models/building_classifier/building_classifier.py @@ -16,8 +16,6 @@ from ...layers.esa_world_cover import EsaWorldCover, EsaWorldCoverClass from ...layers.urban_land_use import UrbanLandUse from ...layers.average_net_building_height import AverageNetBuildingHeight -from ...layers.open_street_map import OpenStreetMap, OpenStreetMapClass -from ...layers.open_buildings import OpenBuildings class BuildingClassifier(Layer): @@ -111,24 +109,6 @@ def get_data_anbh(self, bbox, snap_to): return anbh_1m - def get_data_buildings(self, bbox, crs): - # OSM buildings - building_osm = OpenStreetMap(osm_class=OpenStreetMapClass.BUILDING).get_data(bbox).to_crs(crs).reset_index(drop=True) - # Google-Microsoft Open Buildings Dataset buildings - openbuilds = OpenBuildings(country='USA').get_data(bbox).to_crs(crs).reset_index(drop=True) - - # Intersect buildings and keep the open buildings that don't intersect OSM buildings - intersect_buildings = gpd.sjoin(building_osm, openbuilds, how='inner', predicate='intersects') - openbuilds_non_intersect = openbuilds.loc[~openbuilds.index.isin(intersect_buildings.index)] - - buildings = pd.concat([building_osm['geometry'], openbuilds_non_intersect['geometry']], ignore_index=True).reset_index() - # Get rid of any 3d geometries that cause a problem - buildings = buildings[~buildings['geometry'].apply(lambda geom: 'Z' in geom.geom_type)] - - # Value not start with 0 - buildings['Value'] = buildings['index'] + 1 - - return buildings def rasterize_polygon(self, gdf, snap_to): if gdf.empty: From f6250f300aab79516b889f4dade776ef9c778d2f Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Thu, 8 Aug 2024 16:08:35 +0800 Subject: [PATCH 6/9] reproject buildings --- city_metrix/layers/smart_surface_lulc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index 77d69b9..e38fc0a 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -81,7 +81,7 @@ def get_data(self, bbox): ulu_lulc_1m = BuildingClassifier().get_data_ulu(bbox, crs, esa_1m) anbh_1m = BuildingClassifier().get_data_anbh(bbox, esa_1m) # get building features - buildings = OvertureBuildings().get_data(bbox) + buildings = OvertureBuildings().get_data(bbox).to_crs(crs) # extract ULU, ANBH, and Area_m buildings['ULU'] = exact_extract(ulu_lulc_1m, buildings, ["majority"], output='pandas')['majority'] buildings['ANBH'] = exact_extract(anbh_1m, buildings, ["mean"], output='pandas')['mean'] From 2058d155d18e97c6f47b45c03b412fcd5e482d03 Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Wed, 14 Aug 2024 16:33:00 +0800 Subject: [PATCH 7/9] update data type to use uint16 --- city_metrix/layers/smart_surface_lulc.py | 10 +++++----- .../models/building_classifier/building_classifier.py | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index e38fc0a..49b1814 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -34,12 +34,12 @@ def get_data(self, bbox): # Open space open_space_osm = OpenStreetMap(osm_class=OpenStreetMapClass.OPEN_SPACE_HEAT).get_data(bbox).to_crs(crs).reset_index() - open_space_osm['Value'] = np.int8(10) + open_space_osm['Value'] = np.uint16(10) # Water water_osm = OpenStreetMap(osm_class=OpenStreetMapClass.WATER).get_data(bbox).to_crs(crs).reset_index() - water_osm['Value'] = np.int8(20) + water_osm['Value'] = np.uint16(20) # Roads @@ -60,7 +60,7 @@ def get_data(self, bbox): roads_osm['lanes'] = roads_osm['lanes'].fillna(roads_osm['avg_lanes']) # Add value field (30) - roads_osm['Value'] = np.int8(30) + roads_osm['Value'] = np.uint16(30) # Buffer roads by lanes * 10 ft (3.048 m) # https://nacto.org/publication/urban-street-design-guide/street-design-elements/lane-width/#:~:text=wider%20lane%20widths.-,Lane%20widths%20of%2010%20feet%20are%20appropriate%20in%20urban%20areas,be%20used%20in%20each%20direction @@ -74,7 +74,7 @@ def get_data(self, bbox): ) else: # Add value field (30) - roads_osm['Value'] = np.int8(30) + roads_osm['Value'] = np.uint16(30) # Building @@ -113,7 +113,7 @@ def get_data(self, bbox): # Parking parking_osm = OpenStreetMap(osm_class=OpenStreetMapClass.PARKING).get_data(bbox).to_crs(crs).reset_index() - parking_osm['Value'] = np.int8(50) + parking_osm['Value'] = np.uint16(50) # combine features: open space, water, road, building, parking diff --git a/city_metrix/models/building_classifier/building_classifier.py b/city_metrix/models/building_classifier/building_classifier.py index 89e4d9b..08b5fce 100644 --- a/city_metrix/models/building_classifier/building_classifier.py +++ b/city_metrix/models/building_classifier/building_classifier.py @@ -51,7 +51,7 @@ def get_data_esa_reclass(self, bbox, crs): reclassified_esa = reclassify(esa_world_cover, bins=list(reclass_map.keys()), new_values=list(reclass_map.values())) # Convert to int8 and chunk the data for Dask processing - reclassified_esa = reclassified_esa.astype(np.int8).chunk({'x': 512, 'y': 512}) + reclassified_esa = reclassified_esa.astype(np.uint16).chunk({'x': 512, 'y': 512}) reclassified_esa = reclassified_esa.rio.write_crs(esa_world_cover.rio.crs, inplace=True) @@ -80,7 +80,7 @@ def get_data_ulu(self, bbox, crs, snap_to): ulu_lulc = ulu_lulc.where(ulu_lulc != from_val, to_val) # Convert to int8 and chunk the data for Dask processing - ulu_lulc = ulu_lulc.astype(np.int8).chunk({'x': 512, 'y': 512}) + ulu_lulc = ulu_lulc.astype(np.uint16).chunk({'x': 512, 'y': 512}) ####### 1-Non-residential as default # 0-Unclassified as nodata @@ -112,7 +112,7 @@ def get_data_anbh(self, bbox, snap_to): def rasterize_polygon(self, gdf, snap_to): if gdf.empty: - raster = np.full(snap_to.shape, 0, dtype=np.int8) + raster = np.full(snap_to.shape, 0, dtype=np.uint16) raster = xr.DataArray(raster, dims=snap_to.dims, coords=snap_to.coords) return raster.rio.write_crs(snap_to.rio.crs, inplace=True) @@ -121,7 +121,7 @@ def rasterize_polygon(self, gdf, snap_to): vector_data=gdf, measurements=["Value"], like=snap_to, - fill=np.int8(0) + fill=np.uint16(0) ).Value return raster.rio.reproject_match(snap_to) @@ -149,7 +149,7 @@ def building_classifier_tree(self): # set classifier parameters clf = DecisionTreeClassifier(max_depth=5) # encode labels - buildings_sample['Slope_encoded'] = buildings_sample['Slope'].map({'low': np.int8(42), 'high': np.int8(40)}) + buildings_sample['Slope_encoded'] = buildings_sample['Slope'].map({'low': np.uint16(42), 'high': np.uint16(40)}) # Select these rows for the training set build_train = buildings_sample[buildings_sample['Model']=='training'] From cfa316a44822f78e53ffc46df07ba4601c0de2f6 Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Thu, 22 Aug 2024 18:48:31 +0800 Subject: [PATCH 8/9] remove force data type and update classifier --- city_metrix/layers/smart_surface_lulc.py | 10 +++++----- .../building_classifier.pkl | Bin 4230 -> 4210 bytes .../building_classifier.py | 14 +++++++------- environment.yml | 2 +- setup.py | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/city_metrix/layers/smart_surface_lulc.py b/city_metrix/layers/smart_surface_lulc.py index 49b1814..a8ce378 100644 --- a/city_metrix/layers/smart_surface_lulc.py +++ b/city_metrix/layers/smart_surface_lulc.py @@ -34,12 +34,12 @@ def get_data(self, bbox): # Open space open_space_osm = OpenStreetMap(osm_class=OpenStreetMapClass.OPEN_SPACE_HEAT).get_data(bbox).to_crs(crs).reset_index() - open_space_osm['Value'] = np.uint16(10) + open_space_osm['Value'] = 10 # Water water_osm = OpenStreetMap(osm_class=OpenStreetMapClass.WATER).get_data(bbox).to_crs(crs).reset_index() - water_osm['Value'] = np.uint16(20) + water_osm['Value'] = 20 # Roads @@ -60,7 +60,7 @@ def get_data(self, bbox): roads_osm['lanes'] = roads_osm['lanes'].fillna(roads_osm['avg_lanes']) # Add value field (30) - roads_osm['Value'] = np.uint16(30) + roads_osm['Value'] = 30 # Buffer roads by lanes * 10 ft (3.048 m) # https://nacto.org/publication/urban-street-design-guide/street-design-elements/lane-width/#:~:text=wider%20lane%20widths.-,Lane%20widths%20of%2010%20feet%20are%20appropriate%20in%20urban%20areas,be%20used%20in%20each%20direction @@ -74,7 +74,7 @@ def get_data(self, bbox): ) else: # Add value field (30) - roads_osm['Value'] = np.uint16(30) + roads_osm['Value'] = 30 # Building @@ -113,7 +113,7 @@ def get_data(self, bbox): # Parking parking_osm = OpenStreetMap(osm_class=OpenStreetMapClass.PARKING).get_data(bbox).to_crs(crs).reset_index() - parking_osm['Value'] = np.uint16(50) + parking_osm['Value'] = 50 # combine features: open space, water, road, building, parking diff --git a/city_metrix/models/building_classifier/building_classifier.pkl b/city_metrix/models/building_classifier/building_classifier.pkl index d1cee21536816784fea32165dc4b3ed218713d25..4907a22ba948cc5a655b205333d351118a1c1b18 100644 GIT binary patch delta 300 zcmZou{G`Crz%n&`BZ~{ubb#;naed}56J+jDPk%f0=~ev*nO5M7#lkWYNG O2frmFtKpQ=Bs~DsrC!GX delta 258 zcmeyQ(5A@Jz%sRZBZ~{uZM z#gxvD_9;PAG`yKJ>?glt77vceNcZMwo01U=qy>O<97tUniaI|(Kd=8l04BT{N~R=v zO8`~IXXJS+0O_8>7>mOEGL-wnHb=p;eBW6W_|WTMr6ScQ|_#tyq-gH zatCL|=1.5.0", + "scikit-learn>=1.5.1", ], ) From 4782e9113b7d29b822b3d8da3842fc6280f76acf Mon Sep 17 00:00:00 2001 From: weiqi-tori Date: Fri, 30 Aug 2024 17:17:51 +0800 Subject: [PATCH 9/9] update sklearn version --- .github/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/requirements.txt b/.github/requirements.txt index 9928a46..c636be4 100644 --- a/.github/requirements.txt +++ b/.github/requirements.txt @@ -15,6 +15,6 @@ s3fs==2024.5.0 geemap==0.32.0 pip==23.3.1 boto3==1.34.124 -scikit-learn==1.5.0 +scikit-learn==1.5.1 overturemaps==0.6.0 git+https://github.com/isciences/exactextract \ No newline at end of file