voxcity 0.3.19__tar.gz → 0.3.21__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.

Files changed (53) hide show
  1. {voxcity-0.3.19 → voxcity-0.3.21}/PKG-INFO +1 -1
  2. {voxcity-0.3.19 → voxcity-0.3.21}/pyproject.toml +1 -1
  3. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/mesh.py +11 -4
  4. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/utils/visualization.py +18 -5
  5. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity.egg-info/PKG-INFO +1 -1
  6. {voxcity-0.3.19 → voxcity-0.3.21}/AUTHORS.rst +0 -0
  7. {voxcity-0.3.19 → voxcity-0.3.21}/CONTRIBUTING.rst +0 -0
  8. {voxcity-0.3.19 → voxcity-0.3.21}/HISTORY.rst +0 -0
  9. {voxcity-0.3.19 → voxcity-0.3.21}/LICENSE +0 -0
  10. {voxcity-0.3.19 → voxcity-0.3.21}/MANIFEST.in +0 -0
  11. {voxcity-0.3.19 → voxcity-0.3.21}/README.md +0 -0
  12. {voxcity-0.3.19 → voxcity-0.3.21}/docs/Makefile +0 -0
  13. {voxcity-0.3.19 → voxcity-0.3.21}/docs/archive/README.rst +0 -0
  14. {voxcity-0.3.19 → voxcity-0.3.21}/docs/authors.rst +0 -0
  15. {voxcity-0.3.19 → voxcity-0.3.21}/docs/conf.py +0 -0
  16. {voxcity-0.3.19 → voxcity-0.3.21}/docs/index.rst +0 -0
  17. {voxcity-0.3.19 → voxcity-0.3.21}/docs/make.bat +0 -0
  18. {voxcity-0.3.19 → voxcity-0.3.21}/setup.cfg +0 -0
  19. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/__init__.py +0 -0
  20. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/__init__.py +0 -0
  21. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/eubucco.py +0 -0
  22. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/gee.py +0 -0
  23. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/mbfp.py +0 -0
  24. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/oemj.py +0 -0
  25. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/omt.py +0 -0
  26. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/osm.py +0 -0
  27. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/overture.py +0 -0
  28. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/downloader/utils.py +0 -0
  29. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/exporter/__init_.py +0 -0
  30. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/exporter/envimet.py +0 -0
  31. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/exporter/magicavoxel.py +0 -0
  32. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/exporter/obj.py +0 -0
  33. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/generator.py +0 -0
  34. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/__init_.py +0 -0
  35. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/draw.py +0 -0
  36. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/grid.py +0 -0
  37. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/network.py +0 -0
  38. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/polygon.py +0 -0
  39. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/geoprocessor/utils.py +0 -0
  40. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/simulator/__init_.py +0 -0
  41. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/simulator/solar.py +0 -0
  42. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/simulator/utils.py +0 -0
  43. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/simulator/view.py +0 -0
  44. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/utils/__init_.py +0 -0
  45. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/utils/lc.py +0 -0
  46. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/utils/material.py +0 -0
  47. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity/utils/weather.py +0 -0
  48. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity.egg-info/SOURCES.txt +0 -0
  49. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity.egg-info/dependency_links.txt +0 -0
  50. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity.egg-info/requires.txt +0 -0
  51. {voxcity-0.3.19 → voxcity-0.3.21}/src/voxcity.egg-info/top_level.txt +0 -0
  52. {voxcity-0.3.19 → voxcity-0.3.21}/tests/__init__.py +0 -0
  53. {voxcity-0.3.19 → voxcity-0.3.21}/tests/voxelcity.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voxcity
3
- Version: 0.3.19
3
+ Version: 0.3.21
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,6 +1,6 @@
1
1
  [project]
2
2
  name = "voxcity"
3
- version = "0.3.19"
3
+ version = "0.3.21"
4
4
  requires-python = ">=3.10,<3.13"
5
5
  classifiers = [
6
6
  "Programming Language :: Python :: 3.10",
@@ -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,13 @@ 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
- dem_grid = kwargs.get("dem_grid", None)
1034
- meshsize = kwargs.get("meshsize", 1.0) / 5
1034
+ dem_grid_ori = kwargs.get("dem_grid", None)
1035
+ if dem_grid_ori is not None:
1036
+ dem_grid = dem_grid_ori - np.min(dem_grid_ori)
1035
1037
  z_offset = kwargs.get("view_point_height", 1.5)
1036
1038
  cmap_name = kwargs.get("colormap", "viridis")
1037
- vmin = kwargs.get("vmin", 0)
1038
- vmax = kwargs.get("vmax", 1)
1039
+ vmin = kwargs.get("vmin", np.nanmin(sim_grid))
1040
+ vmax = kwargs.get("vmax", np.nanmax(sim_grid))
1039
1041
 
1040
1042
  # Create meshes
1041
1043
  print("Creating voxel meshes...")
@@ -1054,6 +1056,17 @@ def visualize_voxcity_multi_view(voxel_array, **kwargs):
1054
1056
  )
1055
1057
  if sim_mesh is not None:
1056
1058
  meshes["sim_surface"] = sim_mesh
1059
+ # If vmin/vmax not provided, use actual min/max of the valid sim data
1060
+
1061
+ # Prepare the colormap and create colorbar
1062
+ norm = mcolors.Normalize(vmin=vmin, vmax=vmax)
1063
+ scalar_map = cm.ScalarMappable(norm=norm, cmap=cmap_name)
1064
+
1065
+ # Create a figure and axis for the colorbar but don't display
1066
+ fig, ax = plt.subplots(figsize=(6, 1))
1067
+ plt.colorbar(scalar_map, cax=ax, orientation='horizontal')
1068
+ plt.tight_layout()
1069
+ plt.show()
1057
1070
 
1058
1071
  # Export if filename provided
1059
1072
  if base_filename is not None:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: voxcity
3
- Version: 0.3.19
3
+ Version: 0.3.21
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