voxcity 0.3.19__tar.gz → 0.3.20__tar.gz
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-0.3.19 → voxcity-0.3.20}/PKG-INFO +1 -1
- {voxcity-0.3.19 → voxcity-0.3.20}/pyproject.toml +1 -1
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/mesh.py +11 -4
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/utils/visualization.py +17 -5
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity.egg-info/PKG-INFO +1 -1
- {voxcity-0.3.19 → voxcity-0.3.20}/AUTHORS.rst +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/CONTRIBUTING.rst +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/HISTORY.rst +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/LICENSE +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/MANIFEST.in +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/README.md +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/docs/Makefile +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/docs/archive/README.rst +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/docs/authors.rst +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/docs/conf.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/docs/index.rst +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/docs/make.bat +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/setup.cfg +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/__init__.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/__init__.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/eubucco.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/gee.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/mbfp.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/oemj.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/omt.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/osm.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/overture.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/downloader/utils.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/exporter/__init_.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/exporter/envimet.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/exporter/magicavoxel.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/exporter/obj.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/generator.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/__init_.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/draw.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/grid.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/network.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/polygon.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/geoprocessor/utils.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/simulator/__init_.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/simulator/solar.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/simulator/utils.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/simulator/view.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/utils/__init_.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/utils/lc.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/utils/material.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity/utils/weather.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity.egg-info/SOURCES.txt +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity.egg-info/dependency_links.txt +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity.egg-info/requires.txt +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/src/voxcity.egg-info/top_level.txt +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/tests/__init__.py +0 -0
- {voxcity-0.3.19 → voxcity-0.3.20}/tests/voxelcity.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: voxcity
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.20
|
|
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>
|
|
@@ -2,6 +2,7 @@ import numpy as np
|
|
|
2
2
|
import trimesh
|
|
3
3
|
import matplotlib.colors as mcolors
|
|
4
4
|
import matplotlib.cm as cm
|
|
5
|
+
import matplotlib.pyplot as plt
|
|
5
6
|
|
|
6
7
|
def create_voxel_mesh(voxel_array, class_id, meshsize=1.0):
|
|
7
8
|
"""
|
|
@@ -158,13 +159,19 @@ def create_sim_surface_mesh(sim_grid, dem_grid,
|
|
|
158
159
|
|
|
159
160
|
# If vmin/vmax not provided, use actual min/max of the valid sim data
|
|
160
161
|
if vmin is None:
|
|
161
|
-
vmin = np.nanmin(valid_values)
|
|
162
|
+
vmin = np.nanmin(valid_values)
|
|
162
163
|
if vmax is None:
|
|
163
164
|
vmax = np.nanmax(valid_values)
|
|
164
|
-
|
|
165
|
-
# Prepare the colormap
|
|
165
|
+
|
|
166
|
+
# Prepare the colormap and create colorbar
|
|
166
167
|
norm = mcolors.Normalize(vmin=vmin, vmax=vmax)
|
|
167
168
|
scalar_map = cm.ScalarMappable(norm=norm, cmap=cmap_name)
|
|
169
|
+
|
|
170
|
+
# Create a figure just for the colorbar
|
|
171
|
+
fig, ax = plt.subplots(figsize=(6, 1))
|
|
172
|
+
plt.colorbar(scalar_map, cax=ax, orientation='horizontal')
|
|
173
|
+
plt.tight_layout()
|
|
174
|
+
plt.close()
|
|
168
175
|
|
|
169
176
|
vertices = []
|
|
170
177
|
faces = []
|
|
@@ -180,7 +187,7 @@ def create_sim_surface_mesh(sim_grid, dem_grid,
|
|
|
180
187
|
if np.isnan(val):
|
|
181
188
|
continue
|
|
182
189
|
|
|
183
|
-
z_base = dem_grid_flipped[x, y] + z_offset
|
|
190
|
+
z_base = meshsize * int(dem_grid_flipped[x, y] / meshsize + 1.5) + z_offset
|
|
184
191
|
|
|
185
192
|
# 4 corners in (x,y)*meshsize
|
|
186
193
|
v0 = [ x * meshsize, y * meshsize, z_base ]
|
|
@@ -4,6 +4,7 @@ from mpl_toolkits.mplot3d import Axes3D
|
|
|
4
4
|
from tqdm import tqdm
|
|
5
5
|
import matplotlib.colors as mcolors
|
|
6
6
|
from matplotlib.colors import ListedColormap, BoundaryNorm
|
|
7
|
+
import matplotlib.cm as cm
|
|
7
8
|
import contextily as ctx
|
|
8
9
|
from shapely.geometry import Polygon
|
|
9
10
|
import plotly.graph_objects as go
|
|
@@ -999,7 +1000,7 @@ def create_multi_view_scene(meshes, output_directory="output"):
|
|
|
999
1000
|
|
|
1000
1001
|
return images
|
|
1001
1002
|
|
|
1002
|
-
def visualize_voxcity_multi_view(voxel_array, **kwargs):
|
|
1003
|
+
def visualize_voxcity_multi_view(voxel_array, meshsize, **kwargs):
|
|
1003
1004
|
"""
|
|
1004
1005
|
Create multiple views of the voxel city data.
|
|
1005
1006
|
"""
|
|
@@ -1030,12 +1031,12 @@ def visualize_voxcity_multi_view(voxel_array, **kwargs):
|
|
|
1030
1031
|
output_directory = kwargs.get("output_directory", 'output')
|
|
1031
1032
|
base_filename = kwargs.get("output_file_name", None)
|
|
1032
1033
|
sim_grid = kwargs.get("sim_grid", None)
|
|
1033
|
-
|
|
1034
|
-
|
|
1034
|
+
dem_grid_ori = kwargs.get("dem_grid", None)
|
|
1035
|
+
dem_grid = dem_grid_ori - np.min(dem_grid_ori)
|
|
1035
1036
|
z_offset = kwargs.get("view_point_height", 1.5)
|
|
1036
1037
|
cmap_name = kwargs.get("colormap", "viridis")
|
|
1037
|
-
vmin = kwargs.get("vmin",
|
|
1038
|
-
vmax = kwargs.get("vmax",
|
|
1038
|
+
vmin = kwargs.get("vmin", np.nanmin(sim_grid))
|
|
1039
|
+
vmax = kwargs.get("vmax", np.nanmax(sim_grid))
|
|
1039
1040
|
|
|
1040
1041
|
# Create meshes
|
|
1041
1042
|
print("Creating voxel meshes...")
|
|
@@ -1054,6 +1055,17 @@ def visualize_voxcity_multi_view(voxel_array, **kwargs):
|
|
|
1054
1055
|
)
|
|
1055
1056
|
if sim_mesh is not None:
|
|
1056
1057
|
meshes["sim_surface"] = sim_mesh
|
|
1058
|
+
# If vmin/vmax not provided, use actual min/max of the valid sim data
|
|
1059
|
+
|
|
1060
|
+
# Prepare the colormap and create colorbar
|
|
1061
|
+
norm = mcolors.Normalize(vmin=vmin, vmax=vmax)
|
|
1062
|
+
scalar_map = cm.ScalarMappable(norm=norm, cmap=cmap_name)
|
|
1063
|
+
|
|
1064
|
+
# Create a figure and axis for the colorbar but don't display
|
|
1065
|
+
fig, ax = plt.subplots(figsize=(6, 1))
|
|
1066
|
+
plt.colorbar(scalar_map, cax=ax, orientation='horizontal')
|
|
1067
|
+
plt.tight_layout()
|
|
1068
|
+
plt.show()
|
|
1057
1069
|
|
|
1058
1070
|
# Export if filename provided
|
|
1059
1071
|
if base_filename is not None:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: voxcity
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.20
|
|
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>
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|