voxcity 0.6.5__py3-none-any.whl → 0.6.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.
- voxcity/exporter/cityles.py +27 -6
- {voxcity-0.6.5.dist-info → voxcity-0.6.6.dist-info}/METADATA +1 -1
- {voxcity-0.6.5.dist-info → voxcity-0.6.6.dist-info}/RECORD +6 -6
- {voxcity-0.6.5.dist-info → voxcity-0.6.6.dist-info}/AUTHORS.rst +0 -0
- {voxcity-0.6.5.dist-info → voxcity-0.6.6.dist-info}/LICENSE +0 -0
- {voxcity-0.6.5.dist-info → voxcity-0.6.6.dist-info}/WHEEL +0 -0
voxcity/exporter/cityles.py
CHANGED
|
@@ -190,7 +190,7 @@ def _build_index_to_cityles_map(land_cover_source):
|
|
|
190
190
|
|
|
191
191
|
|
|
192
192
|
def export_topog(building_height_grid, building_id_grid, output_path,
|
|
193
|
-
building_material='default'):
|
|
193
|
+
building_material='default', cityles_landuse_grid=None):
|
|
194
194
|
"""
|
|
195
195
|
Export topog.txt file for CityLES
|
|
196
196
|
|
|
@@ -226,8 +226,17 @@ def export_topog(building_height_grid, building_id_grid, output_path,
|
|
|
226
226
|
i_1based = i + 1
|
|
227
227
|
j_1based = j + 1
|
|
228
228
|
height = float(building_height_grid[j, i])
|
|
229
|
+
# Decide material code per cell
|
|
230
|
+
if cityles_landuse_grid is not None:
|
|
231
|
+
cell_lu = int(cityles_landuse_grid[j, i])
|
|
232
|
+
material_code_cell = cell_lu + 100
|
|
233
|
+
else:
|
|
234
|
+
if height > 0:
|
|
235
|
+
material_code_cell = material_code
|
|
236
|
+
else:
|
|
237
|
+
material_code_cell = 102
|
|
229
238
|
# Format: i j height material_code depth1 depth2 changed_material
|
|
230
|
-
f.write(f"{i_1based} {j_1based} {height:.1f} {
|
|
239
|
+
f.write(f"{i_1based} {j_1based} {height:.1f} {material_code_cell} 0.0 0.0 102\n")
|
|
231
240
|
|
|
232
241
|
|
|
233
242
|
def export_landuse(land_cover_grid, output_path, land_cover_source=None):
|
|
@@ -254,6 +263,8 @@ def export_landuse(land_cover_grid, output_path, land_cover_source=None):
|
|
|
254
263
|
|
|
255
264
|
# Create mapping statistics
|
|
256
265
|
mapping_stats = {}
|
|
266
|
+
# Prepare grid to return
|
|
267
|
+
cityles_landuse_grid = np.zeros((ny, nx), dtype=int)
|
|
257
268
|
|
|
258
269
|
with open(filename, 'w') as f:
|
|
259
270
|
# Write in row-major order (j varies first, then i)
|
|
@@ -263,6 +274,8 @@ def export_landuse(land_cover_grid, output_path, land_cover_source=None):
|
|
|
263
274
|
cityles_code = index_to_code.get(idx, 4)
|
|
264
275
|
f.write(f"{cityles_code}\n")
|
|
265
276
|
|
|
277
|
+
cityles_landuse_grid[j, i] = cityles_code
|
|
278
|
+
|
|
266
279
|
# Track mapping statistics
|
|
267
280
|
if idx not in mapping_stats:
|
|
268
281
|
mapping_stats[idx] = {'cityles_code': cityles_code, 'count': 0}
|
|
@@ -277,6 +290,8 @@ def export_landuse(land_cover_grid, output_path, land_cover_source=None):
|
|
|
277
290
|
class_name = class_names[idx] if 0 <= idx < len(class_names) else 'Unknown'
|
|
278
291
|
print(f" {idx}: {class_name} -> CityLES {stats['cityles_code']}: "
|
|
279
292
|
f"{stats['count']} cells ({percentage:.1f}%)")
|
|
293
|
+
|
|
294
|
+
return cityles_landuse_grid
|
|
280
295
|
|
|
281
296
|
|
|
282
297
|
def export_dem(dem_grid, output_path):
|
|
@@ -434,11 +449,17 @@ def export_cityles(building_height_grid, building_id_grid, canopy_height_grid,
|
|
|
434
449
|
print(f"Land cover source: {land_cover_source}")
|
|
435
450
|
|
|
436
451
|
# Export individual files
|
|
437
|
-
print("\nExporting topog.txt...")
|
|
438
|
-
export_topog(building_height_grid, building_id_grid, output_path, building_material)
|
|
439
|
-
|
|
440
452
|
print("\nExporting landuse.txt...")
|
|
441
|
-
export_landuse(land_cover_grid, output_path, land_cover_source)
|
|
453
|
+
cityles_landuse_grid = export_landuse(land_cover_grid, output_path, land_cover_source)
|
|
454
|
+
|
|
455
|
+
print("\nExporting topog.txt...")
|
|
456
|
+
export_topog(
|
|
457
|
+
building_height_grid,
|
|
458
|
+
building_id_grid,
|
|
459
|
+
output_path,
|
|
460
|
+
building_material,
|
|
461
|
+
cityles_landuse_grid=cityles_landuse_grid,
|
|
462
|
+
)
|
|
442
463
|
|
|
443
464
|
print("\nExporting dem.txt...")
|
|
444
465
|
export_dem(dem_grid, output_path)
|
|
@@ -9,7 +9,7 @@ voxcity/downloader/osm.py,sha256=9nOVcVE50N76F5uquJbNIFr8Xajff4ac2Uj2oSGcFrc,425
|
|
|
9
9
|
voxcity/downloader/overture.py,sha256=4YG2DMwUSSyZKUw_o8cGhMmAkPJon82aPqOFBvrre-Y,11987
|
|
10
10
|
voxcity/downloader/utils.py,sha256=tz6wt4B9BhEOyvoF5OYXlr8rUd5cBEDedWL3j__oT70,3099
|
|
11
11
|
voxcity/exporter/__init__.py,sha256=dvyWJ184Eik9tFc0VviGbzTQzZi7O0JNyrqi_n39pVI,94
|
|
12
|
-
voxcity/exporter/cityles.py,sha256=
|
|
12
|
+
voxcity/exporter/cityles.py,sha256=OhsGODC8bFq0MTGc0nBnqRyqnqg1JXL7UaL66a-CKsQ,17418
|
|
13
13
|
voxcity/exporter/envimet.py,sha256=Sh7s1JdQ6SgT_L2Xd_c4gtEGWK2hTS87bccaoIqik-s,31105
|
|
14
14
|
voxcity/exporter/magicavoxel.py,sha256=SfGEgTZRlossKx3Xrv9d3iKSX-HmfQJEL9lZHgWMDX4,12782
|
|
15
15
|
voxcity/exporter/obj.py,sha256=h1_aInpemcsu96fSTwjKMqX2VZAFYbZbElWd4M1ogyI,27973
|
|
@@ -30,8 +30,8 @@ voxcity/utils/lc.py,sha256=722Gz3lPbgAp0mmTZ-g-QKBbAnbxrcgaYwb1sa7q8Sk,16189
|
|
|
30
30
|
voxcity/utils/material.py,sha256=H8K8Lq4wBL6dQtgj7esUW2U6wLCOTeOtelkTDJoRgMo,10007
|
|
31
31
|
voxcity/utils/visualization.py,sha256=ZR9N-XKfydeSStO53IM2hGXyZJoeBiAyIMWw9Cb2MPM,116449
|
|
32
32
|
voxcity/utils/weather.py,sha256=2Jtg-rIVJcsTtiKE-KuDnhIqS1-MSS16_zFRzj6zmu4,36435
|
|
33
|
-
voxcity-0.6.
|
|
34
|
-
voxcity-0.6.
|
|
35
|
-
voxcity-0.6.
|
|
36
|
-
voxcity-0.6.
|
|
37
|
-
voxcity-0.6.
|
|
33
|
+
voxcity-0.6.6.dist-info/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
|
|
34
|
+
voxcity-0.6.6.dist-info/LICENSE,sha256=s_jE1Df1nTPL4A_5GCGic5Zwex0CVaPKcAmSilxJPPE,1089
|
|
35
|
+
voxcity-0.6.6.dist-info/METADATA,sha256=5LiF0gG85QUFhEMuBEbnnWp0X2icylygNS0QlEGEsPY,26091
|
|
36
|
+
voxcity-0.6.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
37
|
+
voxcity-0.6.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|