voxcity 0.6.3__tar.gz → 0.6.5__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.6.3 → voxcity-0.6.5}/PKG-INFO +534 -537
- voxcity-0.6.5/pyproject.toml +96 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/gee.py +19 -14
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/exporter/cityles.py +6 -4
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/__init__.py +6 -6
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/utils.py +820 -785
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/simulator/solar.py +101 -25
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/simulator/view.py +2285 -2238
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/utils/visualization.py +28 -2
- voxcity-0.6.3/CONTRIBUTING.rst +0 -137
- voxcity-0.6.3/HISTORY.rst +0 -8
- voxcity-0.6.3/MANIFEST.in +0 -11
- voxcity-0.6.3/docs/Makefile +0 -19
- voxcity-0.6.3/docs/_static/logo.png +0 -0
- voxcity-0.6.3/docs/conf.py +0 -126
- voxcity-0.6.3/docs/logo.png +0 -0
- voxcity-0.6.3/docs/make.bat +0 -36
- voxcity-0.6.3/pyproject.toml +0 -89
- voxcity-0.6.3/setup.cfg +0 -4
- voxcity-0.6.3/src/voxcity.egg-info/PKG-INFO +0 -537
- voxcity-0.6.3/src/voxcity.egg-info/SOURCES.txt +0 -51
- voxcity-0.6.3/src/voxcity.egg-info/dependency_links.txt +0 -1
- voxcity-0.6.3/src/voxcity.egg-info/requires.txt +0 -44
- voxcity-0.6.3/src/voxcity.egg-info/top_level.txt +0 -1
- voxcity-0.6.3/tests/__init__.py +0 -1
- voxcity-0.6.3/tests/voxelcity.py +0 -21
- {voxcity-0.6.3 → voxcity-0.6.5}/AUTHORS.rst +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/LICENSE +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/README.md +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/__init__.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/__init__.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/citygml.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/eubucco.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/mbfp.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/oemj.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/osm.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/overture.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/downloader/utils.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/exporter/__init__.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/exporter/envimet.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/exporter/magicavoxel.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/exporter/obj.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/generator.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/draw.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/grid.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/mesh.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/network.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/geoprocessor/polygon.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/simulator/__init__.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/simulator/utils.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/utils/__init__.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/utils/lc.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/utils/material.py +0 -0
- {voxcity-0.6.3 → voxcity-0.6.5}/src/voxcity/utils/weather.py +0 -0
|
@@ -1,537 +1,534 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name: voxcity
|
|
3
|
-
Version: 0.6.
|
|
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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
Classifier:
|
|
12
|
-
Classifier: Programming Language :: Python :: 3
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
Requires-Dist:
|
|
19
|
-
Requires-Dist:
|
|
20
|
-
Requires-Dist:
|
|
21
|
-
Requires-Dist:
|
|
22
|
-
Requires-Dist:
|
|
23
|
-
Requires-Dist:
|
|
24
|
-
Requires-Dist:
|
|
25
|
-
Requires-Dist:
|
|
26
|
-
Requires-Dist:
|
|
27
|
-
Requires-Dist:
|
|
28
|
-
Requires-Dist:
|
|
29
|
-
Requires-Dist:
|
|
30
|
-
Requires-Dist:
|
|
31
|
-
Requires-Dist:
|
|
32
|
-
Requires-Dist:
|
|
33
|
-
Requires-Dist:
|
|
34
|
-
Requires-Dist:
|
|
35
|
-
Requires-Dist:
|
|
36
|
-
Requires-Dist:
|
|
37
|
-
Requires-Dist:
|
|
38
|
-
Requires-Dist:
|
|
39
|
-
Requires-Dist:
|
|
40
|
-
Requires-Dist:
|
|
41
|
-
Requires-Dist:
|
|
42
|
-
Requires-Dist:
|
|
43
|
-
Requires-Dist:
|
|
44
|
-
Requires-Dist:
|
|
45
|
-
Requires-Dist:
|
|
46
|
-
Requires-Dist:
|
|
47
|
-
Requires-Dist:
|
|
48
|
-
Requires-Dist:
|
|
49
|
-
Requires-Dist:
|
|
50
|
-
Requires-Dist:
|
|
51
|
-
Requires-Dist:
|
|
52
|
-
Requires-Dist:
|
|
53
|
-
Requires-Dist:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
[](https://pypi.python.org/pypi/voxcity)
|
|
60
|
+
[](https://pypi.org/project/voxcity/)
|
|
61
|
+
[](https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing)
|
|
62
|
+
[](https://pypi.org/project/voxcity/)
|
|
63
|
+
[](https://pepy.tech/project/voxcity)
|
|
64
|
+
[](https://voxcity.readthedocs.io/en/latest/?badge=latest)
|
|
65
|
+
<!-- [](https://creativecommons.org/licenses/by-sa/4.0/) -->
|
|
66
|
+
|
|
67
|
+
<p align="center">
|
|
68
|
+
Tutorial preview: <a href="https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing">[Google Colab]</a> | Documentation: <a href="https://voxcity.readthedocs.io/en/latest">[Read the Docs]</a>
|
|
69
|
+
</p>
|
|
70
|
+
|
|
71
|
+
<p align="center">
|
|
72
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/logo.png" alt="Voxcity logo" width="550">
|
|
73
|
+
</p>
|
|
74
|
+
|
|
75
|
+
# VoxCity
|
|
76
|
+
|
|
77
|
+
**voxcity** is a Python package that provides a seamless solution for grid-based 3D city model generation and urban simulation for cities worldwide. VoxCity's generator module automatically downloads building heights, tree canopy heights, land cover, and terrain elevation within a specified target area, and voxelizes buildings, trees, land cover, and terrain to generate an integrated voxel city model. The simulator module enables users to conduct environmental simulations, including solar radiation and view index analyses. Users can export the generated models using several file formats compatible with external software, such as ENVI-met (INX), Blender, and Rhino (OBJ). Try it out using the [Google Colab Demo](https://colab.research.google.com/drive/1Lofd3RawKMr6QuUsamGaF48u2MN0hfrP?usp=sharing) or your local environment. For detailed documentation, API reference, and tutorials, visit our [Read the Docs](https://voxcity.readthedocs.io/en/latest) page.
|
|
78
|
+
|
|
79
|
+
<!-- <p align="center">
|
|
80
|
+
<picture>
|
|
81
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/kunifujiwara/VoxCity/blob/main/images/concept.png">
|
|
82
|
+
<img src="https://github.com/kunifujiwara/VoxCity/blob/main/images/concept.png" alt="Conceptual Diagram of voxcity" width="800">
|
|
83
|
+
</picture>
|
|
84
|
+
</p> -->
|
|
85
|
+
<p align="center">
|
|
86
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/concept.png" alt="Conceptual Diagram of voxcity" width="800">
|
|
87
|
+
</p>
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## Key Features
|
|
91
|
+
|
|
92
|
+
- **Integration of Multiple Data Sources:**
|
|
93
|
+
Combines building footprints, land cover data, canopy height maps, and DEMs to generate a consistent 3D voxel representation of an urban scene.
|
|
94
|
+
|
|
95
|
+
- **Flexible Input Sources:**
|
|
96
|
+
Supports various building and terrain data sources including:
|
|
97
|
+
- Building Footprints: OpenStreetMap, Overture, EUBUCCO, Microsoft Building Footprints, Open Building 2.5D
|
|
98
|
+
- Land Cover: UrbanWatch, OpenEarthMap Japan, ESA WorldCover, ESRI Land Cover, Dynamic World, OpenStreetMap
|
|
99
|
+
- Canopy Height: High Resolution 1m Global Canopy Height Maps, ETH Global Sentinel-2 10m
|
|
100
|
+
- DEM: DeltaDTM, FABDEM, NASA, COPERNICUS, and more
|
|
101
|
+
|
|
102
|
+
*Detailed information about each data source can be found in the [References of Data Sources](#references-of-data-sources) section.*
|
|
103
|
+
|
|
104
|
+
- **Customizable Domain and Resolution:**
|
|
105
|
+
Easily define a target area by drawing a rectangle on a map or specifying center coordinates and dimensions. Adjust the mesh size to meet resolution needs.
|
|
106
|
+
|
|
107
|
+
- **Integration with Earth Engine:**
|
|
108
|
+
Leverages Google Earth Engine for large-scale geospatial data processing (authentication and project setup required).
|
|
109
|
+
|
|
110
|
+
- **Output Formats:**
|
|
111
|
+
- **ENVI-MET**: Export INX and EDB files suitable for ENVI-MET microclimate simulations.
|
|
112
|
+
- **MagicaVoxel**: Export vox files for 3D editing and visualization in MagicaVoxel.
|
|
113
|
+
- **OBJ**: Export wavefront OBJ for rendering and integration into other workflows.
|
|
114
|
+
|
|
115
|
+
- **Analytical Tools:**
|
|
116
|
+
- **View Index Simulations**: Compute sky view index (SVI) and green view index (GVI) from a specified viewpoint.
|
|
117
|
+
- **Landmark Visibility Maps**: Assess the visibility of selected landmarks within the voxelized environment.
|
|
118
|
+
|
|
119
|
+
## Installation
|
|
120
|
+
|
|
121
|
+
Make sure you have Python 3.12 installed. Install voxcity with:
|
|
122
|
+
|
|
123
|
+
### For Local Environment
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
conda create --name voxcity python=3.12
|
|
127
|
+
conda activate voxcity
|
|
128
|
+
conda install -c conda-forge gdal
|
|
129
|
+
pip install voxcity
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### For Google Colab
|
|
133
|
+
|
|
134
|
+
```python
|
|
135
|
+
!pip install voxcity
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Setup for Earth Engine
|
|
139
|
+
|
|
140
|
+
To use Earth Engine data, set up your Earth Engine enabled Cloud Project by following the instructions here:
|
|
141
|
+
https://developers.google.com/earth-engine/cloud/earthengine_cloud_project_setup
|
|
142
|
+
|
|
143
|
+
After setting up, authenticate and initialize Earth Engine:
|
|
144
|
+
|
|
145
|
+
### For Local Environment
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
earthengine authenticate
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### For Google Colab
|
|
152
|
+
|
|
153
|
+
```python
|
|
154
|
+
# Click displayed link, generate token, copy and paste the token
|
|
155
|
+
!earthengine authenticate --auth_mode=notebook
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
## Usage Overview
|
|
159
|
+
|
|
160
|
+
### 1. Authenticate Earth Engine
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
import ee
|
|
164
|
+
ee.Authenticate()
|
|
165
|
+
ee.Initialize(project='your-project-id')
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### 2. Define Target Area
|
|
169
|
+
|
|
170
|
+
You can define your target area in three ways:
|
|
171
|
+
|
|
172
|
+
#### Option 1: Direct Coordinate Input
|
|
173
|
+
Define the target area by directly specifying the coordinates of the rectangle vertices.
|
|
174
|
+
|
|
175
|
+
```python
|
|
176
|
+
rectangle_vertices = [
|
|
177
|
+
(-122.33587348582083, 47.59830044521263), # Southwest corner (longitude, latitude)
|
|
178
|
+
(-122.33587348582083, 47.60279755390168), # Northwest corner (longitude, latitude)
|
|
179
|
+
(-122.32922451417917, 47.60279755390168), # Northeast corner (longitude, latitude)
|
|
180
|
+
(-122.32922451417917, 47.59830044521263) # Southeast corner (longitude, latitude)
|
|
181
|
+
]
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
#### Option 2: Draw a Rectangle (for Jupyter Notebook)
|
|
185
|
+
Use the GUI map interface to draw a rectangular domain of interest.
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
from voxcity.geoprocessor.draw import draw_rectangle_map_cityname
|
|
189
|
+
|
|
190
|
+
cityname = "tokyo"
|
|
191
|
+
m, rectangle_vertices = draw_rectangle_map_cityname(cityname, zoom=15)
|
|
192
|
+
m
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
#### Option 3: Specify Center and Dimensions (for Jupyter Notebook)
|
|
196
|
+
Choose the width and height in meters and select the center point on the map.
|
|
197
|
+
|
|
198
|
+
```python
|
|
199
|
+
from voxcity.geoprocessor.draw import center_location_map_cityname
|
|
200
|
+
|
|
201
|
+
width = 500
|
|
202
|
+
height = 500
|
|
203
|
+
m, rectangle_vertices = center_location_map_cityname(cityname, width, height, zoom=15)
|
|
204
|
+
m
|
|
205
|
+
```
|
|
206
|
+
<p align="center">
|
|
207
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/draw_rect.png" alt="Draw Rectangle on Map GUI" width="400">
|
|
208
|
+
</p>
|
|
209
|
+
|
|
210
|
+
### 3. Set Parameters
|
|
211
|
+
|
|
212
|
+
Define data sources and mesh size (m):
|
|
213
|
+
|
|
214
|
+
```python
|
|
215
|
+
building_source = 'OpenStreetMap' # Building footprint and height data source
|
|
216
|
+
land_cover_source = 'OpenStreetMap' # Land cover classification data source
|
|
217
|
+
canopy_height_source = 'High Resolution 1m Global Canopy Height Maps' # Tree canopy height data source
|
|
218
|
+
dem_source = 'DeltaDTM' # Digital elevation model data source
|
|
219
|
+
meshsize = 5 # Grid cell size in meters
|
|
220
|
+
|
|
221
|
+
kwargs = {
|
|
222
|
+
"output_dir": "output", # Directory to save output files
|
|
223
|
+
"dem_interpolation": True # Enable DEM interpolation
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### 4. Get voxcity Output
|
|
228
|
+
|
|
229
|
+
Generate voxel data grids and corresponding building geoJSON:
|
|
230
|
+
|
|
231
|
+
```python
|
|
232
|
+
from voxcity.generator import get_voxcity
|
|
233
|
+
|
|
234
|
+
voxcity_grid, building_height_grid, building_min_height_grid, \
|
|
235
|
+
building_id_grid, canopy_height_grid, land_cover_grid, dem_grid, \
|
|
236
|
+
building_gdf = get_voxcity(
|
|
237
|
+
rectangle_vertices,
|
|
238
|
+
building_source,
|
|
239
|
+
land_cover_source,
|
|
240
|
+
canopy_height_source,
|
|
241
|
+
dem_source,
|
|
242
|
+
meshsize,
|
|
243
|
+
**kwargs
|
|
244
|
+
)
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### 5. Exporting Files
|
|
248
|
+
|
|
249
|
+
#### ENVI-MET INX/EDB Files:
|
|
250
|
+
[ENVI-MET](https://www.envi-met.com/) is an advanced microclimate simulation software specialized in modeling urban environments. It simulates the interactions between buildings, vegetation, and various climate parameters like temperature, wind flow, humidity, and radiation. The software is used widely in urban planning, architecture, and environmental studies (Commercial, offers educational licenses).
|
|
251
|
+
|
|
252
|
+
```python
|
|
253
|
+
from voxcity.exporter.envimet import export_inx, generate_edb_file
|
|
254
|
+
|
|
255
|
+
envimet_kwargs = {
|
|
256
|
+
"output_directory": "output", # Directory where output files will be saved
|
|
257
|
+
"author_name": "your name", # Name of the model author
|
|
258
|
+
"model_description": "generated with voxcity", # Description text for the model
|
|
259
|
+
"domain_building_max_height_ratio": 2, # Maximum ratio between domain height and tallest building height
|
|
260
|
+
"useTelescoping_grid": True, # Enable telescoping grid for better computational efficiency
|
|
261
|
+
"verticalStretch": 20, # Vertical grid stretching factor (%)
|
|
262
|
+
"min_grids_Z": 20, # Minimum number of vertical grid cells
|
|
263
|
+
"lad": 1.0 # Leaf Area Density (m2/m3) for vegetation modeling
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export_inx(building_height_grid, building_id_grid, canopy_height_grid, land_cover_grid, dem_grid, meshsize, land_cover_source, rectangle_vertices, **envimet_kwargs)
|
|
267
|
+
generate_edb_file(**envimet_kwargs)
|
|
268
|
+
```
|
|
269
|
+
<p align="center">
|
|
270
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/envimet.png" alt="Generated 3D City Model on Envi-MET GUI" width="600">
|
|
271
|
+
</p>
|
|
272
|
+
<p align="center">
|
|
273
|
+
<em>Example Output Exported in INX and Inported in ENVI-met</em>
|
|
274
|
+
</p>
|
|
275
|
+
|
|
276
|
+
#### OBJ Files:
|
|
277
|
+
|
|
278
|
+
```python
|
|
279
|
+
from voxcity.exporter.obj import export_obj
|
|
280
|
+
|
|
281
|
+
output_directory = "output" # Directory where output files will be saved
|
|
282
|
+
output_file_name = "voxcity" # Base name for the output OBJ file
|
|
283
|
+
export_obj(voxcity_grid, output_directory, output_file_name, meshsize)
|
|
284
|
+
```
|
|
285
|
+
The generated OBJ files can be opened and rendered in the following 3D visualization software:
|
|
286
|
+
|
|
287
|
+
- [Twinmotion](https://www.twinmotion.com/): Real-time visualization tool (Free for personal use)
|
|
288
|
+
- [Blender](https://www.blender.org/): Professional-grade 3D creation suite (Free)
|
|
289
|
+
- [Rhino](https://www.rhino3d.com/): Professional 3D modeling software (Commercial, offers educational licenses)
|
|
290
|
+
|
|
291
|
+
<p align="center">
|
|
292
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/obj.png" alt="OBJ 3D City Model Rendered in Rhino" width="600">
|
|
293
|
+
</p>
|
|
294
|
+
<p align="center">
|
|
295
|
+
<em>Example Output Exported in OBJ and Rendered in Rhino</em>
|
|
296
|
+
</p>
|
|
297
|
+
|
|
298
|
+
#### MagicaVoxel VOX Files:
|
|
299
|
+
|
|
300
|
+
[MagicaVoxel](https://ephtracy.github.io/) is a lightweight and user-friendly voxel art editor. It allows users to create, edit, and render voxel-based 3D models with an intuitive interface, making it perfect for modifying and visualizing voxelized city models. The software is free and available for Windows and Mac.
|
|
301
|
+
|
|
302
|
+
```python
|
|
303
|
+
from voxcity.exporter.magicavoxel import export_magicavoxel_vox
|
|
304
|
+
|
|
305
|
+
output_path = "output"
|
|
306
|
+
base_filename = "voxcity"
|
|
307
|
+
export_magicavoxel_vox(voxcity_grid, output_path, base_filename=base_filename)
|
|
308
|
+
```
|
|
309
|
+
<p align="center">
|
|
310
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/vox.png" alt="Generated 3D City Model on MagicaVoxel GUI" width="600">
|
|
311
|
+
</p>
|
|
312
|
+
<p align="center">
|
|
313
|
+
<em>Example Output Exported in VOX and Rendered in MagicaVoxel</em>
|
|
314
|
+
</p>
|
|
315
|
+
|
|
316
|
+
### 6. Additional Use Cases
|
|
317
|
+
|
|
318
|
+
#### Compute Solar Irradiance:
|
|
319
|
+
|
|
320
|
+
```python
|
|
321
|
+
from voxcity.simulator.solar import get_global_solar_irradiance_using_epw
|
|
322
|
+
|
|
323
|
+
solar_kwargs = {
|
|
324
|
+
"download_nearest_epw": True, # Whether to automatically download nearest EPW weather file based on location from Climate.OneBuilding.Org
|
|
325
|
+
"rectangle_vertices": rectangle_vertices, # Coordinates defining the area of interest for calculation
|
|
326
|
+
# "epw_file_path": "./output/new.york-downtown.manhattan.heli_ny_usa_1.epw", # Path to EnergyPlus Weather (EPW) file containing climate data. Set if you already have an EPW file.
|
|
327
|
+
"calc_time": "01-01 12:00:00", # Time for instantaneous calculation in format "MM-DD HH:MM:SS"
|
|
328
|
+
"view_point_height": 1.5, # Height of view point in meters for calculating solar access. Default: 1.5 m
|
|
329
|
+
"tree_k": 0.6, # Static extinction coefficient - controls how much sunlight is blocked by trees (higher = more blocking)
|
|
330
|
+
"tree_lad": 1.0, # Leaf area density of trees - density of leaves/branches that affect shading (higher = denser foliage)
|
|
331
|
+
"dem_grid": dem_grid, # Digital elevation model grid for terrain heights
|
|
332
|
+
"colormap": 'magma', # Matplotlib colormap for visualization. Default: 'viridis'
|
|
333
|
+
"obj_export": True, # Whether to export results as 3D OBJ file
|
|
334
|
+
"output_directory": 'output/test', # Directory for saving output files
|
|
335
|
+
"output_file_name": 'instantaneous_solar_irradiance', # Base filename for outputs (without extension)
|
|
336
|
+
"alpha": 1.0, # Transparency of visualization (0.0-1.0)
|
|
337
|
+
"vmin": 0, # Minimum value for colormap scaling in visualization
|
|
338
|
+
# "vmax": 900, # Maximum value for colormap scaling in visualization
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
# Compute global solar irradiance map (direct + diffuse radiation)
|
|
342
|
+
solar_grid = get_global_solar_irradiance_using_epw(
|
|
343
|
+
voxcity_grid, # 3D voxel grid representing the urban environment
|
|
344
|
+
meshsize, # Size of each voxel in meters
|
|
345
|
+
calc_type='instantaneous', # Calculate instantaneous irradiance at specified time
|
|
346
|
+
direct_normal_irradiance_scaling=1.0, # Scaling factor for direct solar radiation (1.0 = no scaling)
|
|
347
|
+
diffuse_irradiance_scaling=1.0, # Scaling factor for diffuse solar radiation (1.0 = no scaling)
|
|
348
|
+
**solar_kwargs # Pass all the parameters defined above
|
|
349
|
+
)
|
|
350
|
+
|
|
351
|
+
# Adjust parameters for cumulative calculation
|
|
352
|
+
solar_kwargs["start_time"] = "01-01 01:00:00" # Start time for cumulative calculation
|
|
353
|
+
solar_kwargs["end_time"] = "01-31 23:00:00" # End time for cumulative calculation
|
|
354
|
+
solar_kwargs["output_file_name"] = 'cummulative_solar_irradiance', # Base filename for outputs (without extension)
|
|
355
|
+
|
|
356
|
+
# Calculate cumulative solar irradiance over the specified time period
|
|
357
|
+
cum_solar_grid = get_global_solar_irradiance_using_epw(
|
|
358
|
+
voxcity_grid, # 3D voxel grid representing the urban environment
|
|
359
|
+
meshsize, # Size of each voxel in meters
|
|
360
|
+
calc_type='cumulative', # Calculate cumulative irradiance over time period instead of instantaneous
|
|
361
|
+
direct_normal_irradiance_scaling=1.0, # Scaling factor for direct solar radiation (1.0 = no scaling)
|
|
362
|
+
diffuse_irradiance_scaling=1.0, # Scaling factor for diffuse solar radiation (1.0 = no scaling)
|
|
363
|
+
**solar_kwargs # Pass all the parameters defined above
|
|
364
|
+
)
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
<p align="center">
|
|
368
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/solar.png" alt="Solar Irradiance Maps Rendered in Rhino" width="800">
|
|
369
|
+
</p>
|
|
370
|
+
<p align="center">
|
|
371
|
+
<em>Example Results Saved as OBJ and Rendered in Rhino</em>
|
|
372
|
+
</p>
|
|
373
|
+
|
|
374
|
+
#### Compute Green View Index (GVI) and Sky View Index (SVI):
|
|
375
|
+
|
|
376
|
+
```python
|
|
377
|
+
from voxcity.simulator.view import get_view_index
|
|
378
|
+
|
|
379
|
+
view_kwargs = {
|
|
380
|
+
"view_point_height": 1.5, # Height of observer viewpoint in meters
|
|
381
|
+
"dem_grid": dem_grid, # Digital elevation model grid
|
|
382
|
+
"colormap": "viridis", # Colormap for visualization
|
|
383
|
+
"obj_export": True, # Whether to export as OBJ file
|
|
384
|
+
"output_directory": "output", # Directory to save output files
|
|
385
|
+
"output_file_name": "gvi" # Base filename for outputs
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
# Compute Green View Index using mode='green'
|
|
389
|
+
gvi_grid = get_view_index(voxcity_grid, meshsize, mode='green', **view_kwargs)
|
|
390
|
+
|
|
391
|
+
# Adjust parameters for Sky View Index
|
|
392
|
+
view_kwargs["colormap"] = "BuPu_r"
|
|
393
|
+
view_kwargs["output_file_name"] = "svi"
|
|
394
|
+
view_kwargs["elevation_min_degrees"] = 0 # Start ray-tracing from the horizon
|
|
395
|
+
|
|
396
|
+
# Compute Sky View Index using mode='sky'
|
|
397
|
+
svi_grid = get_view_index(voxcity_grid, meshsize, mode='sky', **view_kwargs)
|
|
398
|
+
```
|
|
399
|
+
<p align="center">
|
|
400
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/view_index.png" alt="View Index Maps Rendered in Rhino" width="800">
|
|
401
|
+
</p>
|
|
402
|
+
<p align="center">
|
|
403
|
+
<em>Example Results Saved as OBJ and Rendered in Rhino</em>
|
|
404
|
+
</p>
|
|
405
|
+
|
|
406
|
+
#### Landmark Visibility Map:
|
|
407
|
+
|
|
408
|
+
```python
|
|
409
|
+
from voxcity.simulator.view import get_landmark_visibility_map
|
|
410
|
+
|
|
411
|
+
# Dictionary of parameters for landmark visibility analysis
|
|
412
|
+
landmark_kwargs = {
|
|
413
|
+
"view_point_height": 1.5, # Height of observer viewpoint in meters
|
|
414
|
+
"rectangle_vertices": rectangle_vertices, # Vertices defining simulation domain boundary
|
|
415
|
+
"dem_grid": dem_grid, # Digital elevation model grid
|
|
416
|
+
"colormap": "cool", # Colormap for visualization
|
|
417
|
+
"obj_export": True, # Whether to export as OBJ file
|
|
418
|
+
"output_directory": "output", # Directory to save output files
|
|
419
|
+
"output_file_name": "landmark_visibility" # Base filename for outputs
|
|
420
|
+
}
|
|
421
|
+
landmark_vis_map = get_landmark_visibility_map(voxcity_grid, building_id_grid, building_gdf, meshsize, **landmark_kwargs)
|
|
422
|
+
```
|
|
423
|
+
<p align="center">
|
|
424
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/landmark.png" alt="Landmark Visibility Map Rendered in Rhino" width="500">
|
|
425
|
+
</p>
|
|
426
|
+
<p align="center">
|
|
427
|
+
<em>Example Result Saved as OBJ and Rendered in Rhino</em>
|
|
428
|
+
</p>
|
|
429
|
+
|
|
430
|
+
#### Network Analysis:
|
|
431
|
+
|
|
432
|
+
```python
|
|
433
|
+
from voxcity.geoprocessor.network import get_network_values
|
|
434
|
+
|
|
435
|
+
network_kwargs = {
|
|
436
|
+
"network_type": "walk", # Type of network to download from OSM (walk, drive, all, etc.)
|
|
437
|
+
"colormap": "magma", # Matplotlib colormap for visualization
|
|
438
|
+
"vis_graph": True, # Whether to display the network visualization
|
|
439
|
+
"vmin": 0.0, # Minimum value for color scaling
|
|
440
|
+
"vmax": 600000, # Maximum value for color scaling
|
|
441
|
+
"edge_width": 2, # Width of network edges in visualization
|
|
442
|
+
"alpha": 0.8, # Transparency of network edges
|
|
443
|
+
"zoom": 16 # Zoom level for basemap
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
G, edge_gdf = get_network_values(
|
|
447
|
+
cum_solar_grid, # Grid of cumulative solar irradiance values
|
|
448
|
+
rectangle_vertices, # Coordinates defining simulation domain boundary
|
|
449
|
+
meshsize, # Size of each grid cell in meters
|
|
450
|
+
value_name='Cumulative Global Solar Irradiance (W/m²·hour)', # Label for values in visualization
|
|
451
|
+
**network_kwargs # Additional visualization and network parameters
|
|
452
|
+
)
|
|
453
|
+
```
|
|
454
|
+
|
|
455
|
+
<p align="center">
|
|
456
|
+
<img src="https://raw.githubusercontent.com/kunifujiwara/VoxCity/main/images/network.png" alt="Example of Graph Output" width="500">
|
|
457
|
+
</p>
|
|
458
|
+
<p align="center">
|
|
459
|
+
<em>Cumulative Global Solar Irradiance (kW/m²·hour) on Road Network</em>
|
|
460
|
+
</p>
|
|
461
|
+
|
|
462
|
+
## References of Data Sources
|
|
463
|
+
|
|
464
|
+
### Building
|
|
465
|
+
|
|
466
|
+
| Dataset | Spatial Coverage | Source/Data Acquisition |
|
|
467
|
+
|---------|------------------|------------------------|
|
|
468
|
+
| [OpenStreetMap](https://www.openstreetmap.org) | Worldwide (24% completeness in city centers) | Volunteered / updated continuously |
|
|
469
|
+
| [Microsoft Building Footprints](https://github.com/microsoft/GlobalMLBuildingFootprints) | North America, Europe, Australia | Prediction from satellite or aerial imagery / 2018-2019 for majority of the input imagery |
|
|
470
|
+
| [Open Buildings 2.5D Temporal Dataset](https://sites.research.google/gr/open-buildings/temporal/) | Africa, Latin America, and South and Southeast Asia | Prediction from satellite imagery / 2016-2023 |
|
|
471
|
+
| [EUBUCCO v0.1](https://eubucco.com/) | 27 EU countries and Switzerland (378 regions and 40,829 cities) | OpenStreetMap, government datasets / 2003-2021 (majority is after 2019) |
|
|
472
|
+
| [UT-GLOBUS](https://zenodo.org/records/11156602) | Worldwide (more than 1200 cities or locales) | Prediction from building footprints, population, spaceborne nDSM / not provided |
|
|
473
|
+
| [Overture Maps](https://overturemaps.org/) | Worldwide | OpenStreetMap, Esri Community Maps Program, Google Open Buildings, etc. / updated continuously |
|
|
474
|
+
|
|
475
|
+
### Tree Canopy Height
|
|
476
|
+
|
|
477
|
+
| Dataset | Coverage | Resolution | Source/Data Acquisition |
|
|
478
|
+
|---------|-----------|------------|------------------------|
|
|
479
|
+
| [High Resolution 1m Global Canopy Height Maps](https://sustainability.atmeta.com/blog/2024/04/22/using-artificial-intelligence-to-map-the-earths-forests/) | Worldwide | 1 m | Prediction from satellite imagery / 2009 and 2020 (80% are 2018-2020) |
|
|
480
|
+
| [ETH Global Sentinel-2 10m Canopy Height (2020)](https://langnico.github.io/globalcanopyheight/) | Worldwide | 10 m | Prediction from satellite imagery / 2020 |
|
|
481
|
+
|
|
482
|
+
### Land Cover
|
|
483
|
+
|
|
484
|
+
| Dataset | Spatial Coverage | Resolution | Source/Data Acquisition |
|
|
485
|
+
|---------|------------------|------------|----------------------|
|
|
486
|
+
| [ESA World Cover 10m 2021 V200](https://zenodo.org/records/7254221) | Worldwide | 10 m | Prediction from satellite imagery / 2021 |
|
|
487
|
+
| [ESRI 10m Annual Land Cover (2017-2023)](https://www.arcgis.com/home/item.html?id=cfcb7609de5f478eb7666240902d4d3d) | Worldwide | 10 m | Prediction from satellite imagery / 2017-2023 |
|
|
488
|
+
| [Dynamic World V1](https://dynamicworld.app) | Worldwide | 10 m | Prediction from satellite imagery / updated continuously |
|
|
489
|
+
| [OpenStreetMap](https://www.openstreetmap.org) | Worldwide | - (Vector) | Volunteered / updated continuously |
|
|
490
|
+
| [OpenEarthMap Japan](https://www.open-earth-map.org/demo/Japan/leaflet.html) | Japan | ~1 m | Prediction from aerial imagery / 1974-2022 (mostly after 2018 in major cities) |
|
|
491
|
+
| [UrbanWatch](https://urbanwatch.charlotte.edu/) | 22 major cities in the US | 1 m | Prediction from aerial imagery / 2014–2017 |
|
|
492
|
+
|
|
493
|
+
### Terrain Elevation
|
|
494
|
+
|
|
495
|
+
| Dataset | Coverage | Resolution | Source/Data Acquisition |
|
|
496
|
+
|---------|-----------|------------|------------------------|
|
|
497
|
+
| [FABDEM](https://doi.org/10.5523/bris.25wfy0f9ukoge2gs7a5mqpq2j7) | Worldwide | 30 m | Correction of Copernicus DEM using canopy height and building footprints data / 2011-2015 (Copernicus DEM) |
|
|
498
|
+
| [DeltaDTM](https://gee-community-catalog.org/projects/delta_dtm/) | Worldwide (Only for coastal areas below 10m + mean sea level) | 30 m | Copernicus DEM, spaceborne LiDAR / 2011-2015 (Copernicus DEM) |
|
|
499
|
+
| [USGS 3DEP 1m DEM](https://www.usgs.gov/3d-elevation-program) | United States | 1 m | Aerial LiDAR / 2004-2024 (mostly after 2015) |
|
|
500
|
+
| [England 1m Composite DTM](https://environment.data.gov.uk/dataset/13787b9a-26a4-4775-8523-806d13af58fc) | England | 1 m | Aerial LiDAR / 2000-2022 |
|
|
501
|
+
| [Australian 5M DEM](https://ecat.ga.gov.au/geonetwork/srv/eng/catalog.search#/metadata/89644) | Australia | 5 m | Aerial LiDAR / 2001-2015 |
|
|
502
|
+
| [RGE Alti](https://geoservices.ign.fr/rgealti) | France | 1 m | Aerial LiDAR |
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
## Citation
|
|
506
|
+
|
|
507
|
+
Please cite the [paper](https://doi.org/10.48550/arXiv.2504.13934) if you use `voxcity` in a scientific publication:
|
|
508
|
+
|
|
509
|
+
Fujiwara K, Tsurumi R, Kiyono T, Fan Z, Liang X, Lei B, Yap W, Ito K, Biljecki F. VoxCity: A Seamless Framework for Open Geospatial Data Integration, Grid-Based Semantic 3D City Model Generation, and Urban Environment Simulation. arXiv preprint arXiv:2504.13934. 2025.
|
|
510
|
+
|
|
511
|
+
```bibtex
|
|
512
|
+
@article{fujiwara2025voxcity,
|
|
513
|
+
title={VoxCity: A Seamless Framework for Open Geospatial Data Integration, Grid-Based Semantic 3D City Model Generation, and Urban Environment Simulation},
|
|
514
|
+
author={Fujiwara, Kunihiko and Tsurumi, Ryuta and Kiyono, Tomoki and Fan, Zicheng and Liang, Xiucheng and Lei, Binyu and Yap, Winston and Ito, Koichi and Biljecki, Filip},
|
|
515
|
+
journal={arXiv preprint arXiv:2504.13934},
|
|
516
|
+
year={2025},
|
|
517
|
+
doi = {10.48550/arXiv.2504.13934},
|
|
518
|
+
}
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
## Credit
|
|
522
|
+
|
|
523
|
+
This package was created with [Cookiecutter](https://github.com/audreyr/cookiecutter) and the [`audreyr/cookiecutter-pypackage`](https://github.com/audreyr/cookiecutter-pypackage) project template.
|
|
524
|
+
|
|
525
|
+
--------------------------------------------------------------------------------
|
|
526
|
+
<br>
|
|
527
|
+
<br>
|
|
528
|
+
<p align="center">
|
|
529
|
+
<a href="https://ual.sg/">
|
|
530
|
+
<img src="https://raw.githubusercontent.com/winstonyym/urbanity/main/images/ualsg.jpeg" width = 55% alt="Logo">
|
|
531
|
+
</a>
|
|
532
|
+
</p>
|
|
533
|
+
|
|
534
|
+
|