voxcity 0.3.16__py3-none-any.whl → 0.3.17__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of voxcity might be problematic. Click here for more details.
- voxcity/downloader/gee.py +32 -1
- voxcity/generator.py +9 -1
- {voxcity-0.3.16.dist-info → voxcity-0.3.17.dist-info}/METADATA +1 -1
- {voxcity-0.3.16.dist-info → voxcity-0.3.17.dist-info}/RECORD +8 -8
- {voxcity-0.3.16.dist-info → voxcity-0.3.17.dist-info}/AUTHORS.rst +0 -0
- {voxcity-0.3.16.dist-info → voxcity-0.3.17.dist-info}/LICENSE +0 -0
- {voxcity-0.3.16.dist-info → voxcity-0.3.17.dist-info}/WHEEL +0 -0
- {voxcity-0.3.16.dist-info → voxcity-0.3.17.dist-info}/top_level.txt +0 -0
voxcity/downloader/gee.py
CHANGED
|
@@ -393,4 +393,35 @@ def save_geotiff_open_buildings_temporal(aoi, geotiff_path):
|
|
|
393
393
|
scale=4,
|
|
394
394
|
region=aoi,
|
|
395
395
|
file_per_band=False
|
|
396
|
-
)
|
|
396
|
+
)
|
|
397
|
+
|
|
398
|
+
def save_geotiff_england_dsm_minus_dtm(roi, geotiff_path, meshsize):
|
|
399
|
+
"""Get the height difference between DSM and DTM from England 1m terrain data.
|
|
400
|
+
|
|
401
|
+
Args:
|
|
402
|
+
roi: Earth Engine geometry defining area of interest
|
|
403
|
+
geotiff_path: Output path for GeoTIFF file
|
|
404
|
+
meshsize: Size of each grid cell in meters
|
|
405
|
+
|
|
406
|
+
Returns:
|
|
407
|
+
ee.Image: Image representing DSM minus DTM (building/vegetation heights)
|
|
408
|
+
"""
|
|
409
|
+
# Initialize Earth Engine
|
|
410
|
+
ee.Initialize()
|
|
411
|
+
|
|
412
|
+
# Add buffer around ROI to ensure smooth interpolation at edges
|
|
413
|
+
buffer_distance = 100
|
|
414
|
+
roi_buffered = roi.buffer(buffer_distance)
|
|
415
|
+
|
|
416
|
+
collection_name = 'UK/EA/ENGLAND_1M_TERRAIN/2022'
|
|
417
|
+
dtm = ee.Image(collection_name).select('dtm')
|
|
418
|
+
dsm = ee.Image(collection_name).select('dsm_first')
|
|
419
|
+
|
|
420
|
+
# Subtract DTM from DSM to get height difference
|
|
421
|
+
height_diff = dsm.subtract(dtm)
|
|
422
|
+
|
|
423
|
+
# Clip to buffered ROI
|
|
424
|
+
image = height_diff.clip(roi_buffered)
|
|
425
|
+
|
|
426
|
+
# Export as GeoTIFF using meshsize as scale
|
|
427
|
+
save_geotiff(image, geotiff_path, scale=meshsize, region=roi_buffered, crs='EPSG:4326')
|
voxcity/generator.py
CHANGED
|
@@ -34,7 +34,8 @@ from .downloader.gee import (
|
|
|
34
34
|
save_geotiff_esa_land_cover,
|
|
35
35
|
save_geotiff_esri_landcover,
|
|
36
36
|
save_geotiff_dynamic_world_v1,
|
|
37
|
-
save_geotiff_open_buildings_temporal
|
|
37
|
+
save_geotiff_open_buildings_temporal,
|
|
38
|
+
save_geotiff_england_dsm_minus_dtm
|
|
38
39
|
)
|
|
39
40
|
from .geoprocessor.grid import (
|
|
40
41
|
group_and_label_cells,
|
|
@@ -200,6 +201,13 @@ def get_building_height_grid(rectangle_vertices, meshsize, source, output_dir, *
|
|
|
200
201
|
geotiff_path_comp = os.path.join(output_dir, "building_height.tif")
|
|
201
202
|
save_geotiff_open_buildings_temporal(roi, geotiff_path_comp)
|
|
202
203
|
building_height_grid, building_min_height_grid, building_id_grid, filtered_buildings = create_building_height_grid_from_gdf_polygon(gdf, meshsize, rectangle_vertices, geotiff_path_comp=geotiff_path_comp, complement_height=building_complement_height)
|
|
204
|
+
elif building_complementary_source == "England 1m DSM - DTM":
|
|
205
|
+
# Special case: use temporal height data as complement
|
|
206
|
+
roi = get_roi(rectangle_vertices)
|
|
207
|
+
os.makedirs(output_dir, exist_ok=True)
|
|
208
|
+
geotiff_path_comp = os.path.join(output_dir, "building_height.tif")
|
|
209
|
+
save_geotiff_england_dsm_minus_dtm(roi, geotiff_path_comp, meshsize)
|
|
210
|
+
building_height_grid, building_min_height_grid, building_id_grid, filtered_buildings = create_building_height_grid_from_gdf_polygon(gdf, meshsize, rectangle_vertices, geotiff_path_comp=geotiff_path_comp, complement_height=building_complement_height)
|
|
203
211
|
else:
|
|
204
212
|
# Get complementary data from other sources
|
|
205
213
|
if building_complementary_source == 'Microsoft Building Footprints':
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: voxcity
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.17
|
|
4
4
|
Summary: voxcity is an easy and one-stop tool to output 3d city models for microclimate simulation by integrating multiple geospatial open-data
|
|
5
5
|
Author-email: Kunihiko Fujiwara <kunihiko@nus.edu.sg>
|
|
6
6
|
Maintainer-email: Kunihiko Fujiwara <kunihiko@nus.edu.sg>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
voxcity/__init__.py,sha256=el9v3gfybHOF_GUYPeSOqN0-vCrTW0eU1mcvi0sEfeU,252
|
|
2
|
-
voxcity/generator.py,sha256=
|
|
2
|
+
voxcity/generator.py,sha256=2wmfiCXJREOC0zxq6GB8ECxtGjk42UYzGvf5vGZuEOg,34359
|
|
3
3
|
voxcity/downloader/__init__.py,sha256=OgGcGxOXF4tjcEL6DhOnt13DYPTvOigUelp5xIpTqM0,171
|
|
4
4
|
voxcity/downloader/eubucco.py,sha256=XCkkdEPNuWdrnuxzL80Ext37WsgiCiZGueb-aQV5rvI,14476
|
|
5
|
-
voxcity/downloader/gee.py,sha256=
|
|
5
|
+
voxcity/downloader/gee.py,sha256=C5Y3UFAK4-AcBQwUd5FQNDwwxT_iqfElAHWiVJTkF9k,15471
|
|
6
6
|
voxcity/downloader/mbfp.py,sha256=5fXq9S7qNVSLDdVtj67Da1pBAJP6kL4P8qLZTOmWqdw,3895
|
|
7
7
|
voxcity/downloader/oemj.py,sha256=YlCuWBQfi40gfmwQcGDeHiPOs4Pk_jLZq65d5R3IGMU,7886
|
|
8
8
|
voxcity/downloader/omt.py,sha256=ByFvoQDnBOJF4qdVYNkDjn7cMvEhWwtD0mIV_T-zMEs,9017
|
|
@@ -28,9 +28,9 @@ voxcity/utils/lc.py,sha256=RwPd-VY3POV3gTrBhM7TubgGb9MCd3nVah_G8iUEF7k,11562
|
|
|
28
28
|
voxcity/utils/material.py,sha256=Vt3IID5Ft54HNJcEC4zi31BCPqi_687X3CSp7rXaRVY,5907
|
|
29
29
|
voxcity/utils/visualization.py,sha256=2bv3y-1zkUX0cm_YbMHwe_Vt9J2R3QhouaVAGNifQXg,36805
|
|
30
30
|
voxcity/utils/weather.py,sha256=P6s1y_EstBL1OGP_MR_6u3vr-t6Uawg8uDckJnoI7FI,21482
|
|
31
|
-
voxcity-0.3.
|
|
32
|
-
voxcity-0.3.
|
|
33
|
-
voxcity-0.3.
|
|
34
|
-
voxcity-0.3.
|
|
35
|
-
voxcity-0.3.
|
|
36
|
-
voxcity-0.3.
|
|
31
|
+
voxcity-0.3.17.dist-info/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
|
|
32
|
+
voxcity-0.3.17.dist-info/LICENSE,sha256=-hGliOFiwUrUSoZiB5WF90xXGqinKyqiDI2t6hrnam8,1087
|
|
33
|
+
voxcity-0.3.17.dist-info/METADATA,sha256=dfAutO0AwS9HIxV4cB7QIWg6Ylua-bMfiOZIgJ_5kHU,25114
|
|
34
|
+
voxcity-0.3.17.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
|
35
|
+
voxcity-0.3.17.dist-info/top_level.txt,sha256=00b2U-LKfDllt6RL1R33MXie5MvxzUFye0NGD96t_8I,8
|
|
36
|
+
voxcity-0.3.17.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|