voxcity 0.5.4__py3-none-any.whl → 0.5.6__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/citygml.py +6 -6
- voxcity/generator.py +8 -4
- voxcity/geoprocessor/grid.py +2 -1
- {voxcity-0.5.4.dist-info → voxcity-0.5.6.dist-info}/METADATA +1 -1
- {voxcity-0.5.4.dist-info → voxcity-0.5.6.dist-info}/RECORD +9 -9
- {voxcity-0.5.4.dist-info → voxcity-0.5.6.dist-info}/WHEEL +0 -0
- {voxcity-0.5.4.dist-info → voxcity-0.5.6.dist-info}/licenses/AUTHORS.rst +0 -0
- {voxcity-0.5.4.dist-info → voxcity-0.5.6.dist-info}/licenses/LICENSE +0 -0
- {voxcity-0.5.4.dist-info → voxcity-0.5.6.dist-info}/top_level.txt +0 -0
voxcity/downloader/citygml.py
CHANGED
|
@@ -488,8 +488,8 @@ def load_plateau_with_terrain(url, base_dir):
|
|
|
488
488
|
|
|
489
489
|
# Save
|
|
490
490
|
gdf_buildings_swapped['id'] = gdf_buildings_swapped.index
|
|
491
|
-
gdf_buildings_swapped.to_file('all_buildings_with_elevation.geojson', driver='GeoJSON')
|
|
492
|
-
print(f"\nBuildings saved to all_buildings_with_elevation.geojson")
|
|
491
|
+
# gdf_buildings_swapped.to_file('all_buildings_with_elevation.geojson', driver='GeoJSON')
|
|
492
|
+
# print(f"\nBuildings saved to all_buildings_with_elevation.geojson")
|
|
493
493
|
else:
|
|
494
494
|
gdf_buildings_swapped = None
|
|
495
495
|
|
|
@@ -520,8 +520,8 @@ def load_plateau_with_terrain(url, base_dir):
|
|
|
520
520
|
}
|
|
521
521
|
|
|
522
522
|
gdf_terrain_swapped = gpd.GeoDataFrame(terrain_data, geometry='geometry', crs='EPSG:6697')
|
|
523
|
-
gdf_terrain_swapped.to_file('terrain_elevation.geojson', driver='GeoJSON')
|
|
524
|
-
print(f"Terrain saved to terrain_elevation.geojson")
|
|
523
|
+
# gdf_terrain_swapped.to_file('terrain_elevation.geojson', driver='GeoJSON')
|
|
524
|
+
# print(f"Terrain saved to terrain_elevation.geojson")
|
|
525
525
|
else:
|
|
526
526
|
gdf_terrain_swapped = None
|
|
527
527
|
|
|
@@ -548,8 +548,8 @@ def load_plateau_with_terrain(url, base_dir):
|
|
|
548
548
|
'geometry': swapped_geometries
|
|
549
549
|
}
|
|
550
550
|
gdf_vegetation_swapped = gpd.GeoDataFrame(vegetation_data, geometry='geometry', crs='EPSG:6697')
|
|
551
|
-
gdf_vegetation_swapped.to_file('vegetation_elevation.geojson', driver='GeoJSON')
|
|
552
|
-
print(f"Vegetation saved to vegetation_elevation.geojson")
|
|
551
|
+
# gdf_vegetation_swapped.to_file('vegetation_elevation.geojson', driver='GeoJSON')
|
|
552
|
+
# print(f"Vegetation saved to vegetation_elevation.geojson")
|
|
553
553
|
else:
|
|
554
554
|
gdf_vegetation_swapped = None
|
|
555
555
|
|
voxcity/generator.py
CHANGED
|
@@ -16,7 +16,6 @@ The main functions are:
|
|
|
16
16
|
|
|
17
17
|
import numpy as np
|
|
18
18
|
import os
|
|
19
|
-
|
|
20
19
|
# Local application/library specific imports
|
|
21
20
|
from .downloader.mbfp import get_mbfp_gdf
|
|
22
21
|
from .downloader.osm import load_gdf_from_openstreetmap, load_land_cover_gdf_from_osm
|
|
@@ -219,8 +218,6 @@ def get_building_height_grid(rectangle_vertices, meshsize, source, output_dir, *
|
|
|
219
218
|
gdf_comp = get_mbfp_gdf(output_dir, rectangle_vertices)
|
|
220
219
|
elif building_complementary_source == 'OpenStreetMap':
|
|
221
220
|
gdf_comp = load_gdf_from_openstreetmap(rectangle_vertices)
|
|
222
|
-
elif building_complementary_source == 'OSM Buildings':
|
|
223
|
-
gdf_comp = load_gdf_from_osmbuildings(rectangle_vertices)
|
|
224
221
|
elif building_complementary_source == 'EUBUCCO v0.1':
|
|
225
222
|
gdf_comp = load_gdf_from_eubucco(rectangle_vertices, output_dir)
|
|
226
223
|
elif building_complementary_source == "OpenMapTiles":
|
|
@@ -765,7 +762,14 @@ def get_voxcity_CityGML(rectangle_vertices, url_citygml, land_cover_source, cano
|
|
|
765
762
|
else:
|
|
766
763
|
canopy_height_grid_comp = get_canopy_height_grid(rectangle_vertices, meshsize, canopy_height_source, output_dir, **kwargs)
|
|
767
764
|
|
|
768
|
-
|
|
765
|
+
# In the get_voxcity_CityGML function, modify it to handle None vegetation_gdf
|
|
766
|
+
if vegetation_gdf is not None:
|
|
767
|
+
canopy_height_grid = create_vegetation_height_grid_from_gdf_polygon(vegetation_gdf, meshsize, rectangle_vertices)
|
|
768
|
+
else:
|
|
769
|
+
# Create an empty canopy_height_grid with the same shape as your other grids
|
|
770
|
+
# This depends on the expected shape, you might need to adjust
|
|
771
|
+
canopy_height_grid = np.zeros_like(building_height_grid)
|
|
772
|
+
|
|
769
773
|
mask = (canopy_height_grid == 0) & (canopy_height_grid_comp != 0)
|
|
770
774
|
canopy_height_grid[mask] = canopy_height_grid_comp[mask]
|
|
771
775
|
|
voxcity/geoprocessor/grid.py
CHANGED
|
@@ -10,7 +10,8 @@ from scipy.ndimage import label, generate_binary_structure
|
|
|
10
10
|
from pyproj import Geod, Transformer, CRS
|
|
11
11
|
import rasterio
|
|
12
12
|
from affine import Affine
|
|
13
|
-
from shapely.geometry import box
|
|
13
|
+
from shapely.geometry import box, Polygon, Point, MultiPolygon
|
|
14
|
+
|
|
14
15
|
from scipy.interpolate import griddata
|
|
15
16
|
from shapely.errors import GEOSException
|
|
16
17
|
import geopandas as gpd
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: voxcity
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.6
|
|
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,7 +1,7 @@
|
|
|
1
1
|
voxcity/__init__.py,sha256=el9v3gfybHOF_GUYPeSOqN0-vCrTW0eU1mcvi0sEfeU,252
|
|
2
|
-
voxcity/generator.py,sha256=
|
|
2
|
+
voxcity/generator.py,sha256=XP5-_ojHvKdJ1aTY2EHDaegkRQJFYLLprTIV7zAco0k,42541
|
|
3
3
|
voxcity/downloader/__init__.py,sha256=OgGcGxOXF4tjcEL6DhOnt13DYPTvOigUelp5xIpTqM0,171
|
|
4
|
-
voxcity/downloader/citygml.py,sha256=
|
|
4
|
+
voxcity/downloader/citygml.py,sha256=NUqtxQ2aBjdVxxsrPGh3DFHCa1ZcRFWZb3SmLyx8byg,24479
|
|
5
5
|
voxcity/downloader/eubucco.py,sha256=XCkkdEPNuWdrnuxzL80Ext37WsgiCiZGueb-aQV5rvI,14476
|
|
6
6
|
voxcity/downloader/gee.py,sha256=hEN5OvQAltORYnrlPbmYcDequ6lKLmwyTbNaCZ81Vj8,16089
|
|
7
7
|
voxcity/downloader/mbfp.py,sha256=pGJuXXLRuRedlORXfg8WlgAVwmKI30jxki9t-v5NejY,3972
|
|
@@ -16,7 +16,7 @@ voxcity/exporter/magicavoxel.py,sha256=Fsv7yGRXeKmp82xcG3rOb0t_HtoqltNq2tHl08xVl
|
|
|
16
16
|
voxcity/exporter/obj.py,sha256=0RBFPMKGRH6uNmCLIwAoYFko1bOZKtTSwg7QnoPMud0,21593
|
|
17
17
|
voxcity/geoprocessor/__init_.py,sha256=JzPVhhttxBWvaZ0IGX2w7OWL5bCo_TIvpHefWeNXruA,133
|
|
18
18
|
voxcity/geoprocessor/draw.py,sha256=8Em2NvazFpYfFJUqG9LofNXaxdghKLL_rNuztmPwn8Q,13911
|
|
19
|
-
voxcity/geoprocessor/grid.py,sha256=
|
|
19
|
+
voxcity/geoprocessor/grid.py,sha256=JNTtapcVypZduryGUfOURj_s8rq3ZbtJMapdbmx7PJ0,56372
|
|
20
20
|
voxcity/geoprocessor/mesh.py,sha256=r3cRPLgpbhjwgESBemHWWJ5pEWl2KdkRhID6mdLhios,11171
|
|
21
21
|
voxcity/geoprocessor/network.py,sha256=opb_kpUCAxDd1qtrWPStqR5reYZtVe96XxazNSen7Lk,18851
|
|
22
22
|
voxcity/geoprocessor/polygon.py,sha256=8Vb2AbkpKYhq1kk2hQMc-gitmUo9pFIe910v4p1vP2g,37772
|
|
@@ -30,9 +30,9 @@ voxcity/utils/lc.py,sha256=RwPd-VY3POV3gTrBhM7TubgGb9MCd3nVah_G8iUEF7k,11562
|
|
|
30
30
|
voxcity/utils/material.py,sha256=Vt3IID5Ft54HNJcEC4zi31BCPqi_687X3CSp7rXaRVY,5907
|
|
31
31
|
voxcity/utils/visualization.py,sha256=SF8W7sqvBl3sZbB5noWCY9ic2D34Gq01VZYJ9NDNZ4Y,85237
|
|
32
32
|
voxcity/utils/weather.py,sha256=CFPtoqRTajwMRswswDChwQ3BW1cGsnA3orgWHgz7Ehg,26304
|
|
33
|
-
voxcity-0.5.
|
|
34
|
-
voxcity-0.5.
|
|
35
|
-
voxcity-0.5.
|
|
36
|
-
voxcity-0.5.
|
|
37
|
-
voxcity-0.5.
|
|
38
|
-
voxcity-0.5.
|
|
33
|
+
voxcity-0.5.6.dist-info/licenses/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
|
|
34
|
+
voxcity-0.5.6.dist-info/licenses/LICENSE,sha256=s_jE1Df1nTPL4A_5GCGic5Zwex0CVaPKcAmSilxJPPE,1089
|
|
35
|
+
voxcity-0.5.6.dist-info/METADATA,sha256=ObAFnBoJ-6FuRW6sqfrcrp9AW7gcKZz-T0W0vd40wcY,25733
|
|
36
|
+
voxcity-0.5.6.dist-info/WHEEL,sha256=1tXe9gY0PYatrMPMDd6jXqjfpz_B-Wqm32CPfRC58XU,91
|
|
37
|
+
voxcity-0.5.6.dist-info/top_level.txt,sha256=00b2U-LKfDllt6RL1R33MXie5MvxzUFye0NGD96t_8I,8
|
|
38
|
+
voxcity-0.5.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|