voxcity 0.5.28__py3-none-any.whl → 0.5.29__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/geoprocessor/draw.py +32 -11
- {voxcity-0.5.28.dist-info → voxcity-0.5.29.dist-info}/METADATA +1 -1
- {voxcity-0.5.28.dist-info → voxcity-0.5.29.dist-info}/RECORD +7 -7
- {voxcity-0.5.28.dist-info → voxcity-0.5.29.dist-info}/WHEEL +0 -0
- {voxcity-0.5.28.dist-info → voxcity-0.5.29.dist-info}/licenses/AUTHORS.rst +0 -0
- {voxcity-0.5.28.dist-info → voxcity-0.5.29.dist-info}/licenses/LICENSE +0 -0
- {voxcity-0.5.28.dist-info → voxcity-0.5.29.dist-info}/top_level.txt +0 -0
voxcity/geoprocessor/draw.py
CHANGED
|
@@ -513,7 +513,12 @@ def draw_additional_buildings(building_gdf=None, initial_center=None, zoom=17):
|
|
|
513
513
|
Args:
|
|
514
514
|
building_gdf (GeoDataFrame, optional): Existing building footprints to display.
|
|
515
515
|
If None, creates a new empty GeoDataFrame.
|
|
516
|
-
|
|
516
|
+
Expected columns: ['id', 'height', 'min_height', 'geometry', 'building_id']
|
|
517
|
+
- 'id': Integer ID from data sources (e.g., OSM building id)
|
|
518
|
+
- 'height': Building height in meters (set by user input)
|
|
519
|
+
- 'min_height': Minimum height in meters (defaults to 0.0)
|
|
520
|
+
- 'geometry': Building footprint polygon
|
|
521
|
+
- 'building_id': Unique building identifier
|
|
517
522
|
initial_center (tuple, optional): Initial map center as (lon, lat).
|
|
518
523
|
If None, centers on existing buildings or defaults to (-100, 40).
|
|
519
524
|
zoom (int): Initial zoom level (default=17).
|
|
@@ -534,16 +539,21 @@ def draw_additional_buildings(building_gdf=None, initial_center=None, zoom=17):
|
|
|
534
539
|
if building_gdf is None:
|
|
535
540
|
# Create empty GeoDataFrame with required columns
|
|
536
541
|
updated_gdf = gpd.GeoDataFrame(
|
|
537
|
-
columns=['
|
|
542
|
+
columns=['id', 'height', 'min_height', 'geometry', 'building_id'],
|
|
538
543
|
crs='EPSG:4326'
|
|
539
544
|
)
|
|
540
545
|
else:
|
|
541
546
|
# Make a copy to avoid modifying the original
|
|
542
547
|
updated_gdf = building_gdf.copy()
|
|
548
|
+
# Ensure all required columns exist
|
|
543
549
|
if 'height' not in updated_gdf.columns:
|
|
544
550
|
updated_gdf['height'] = 10.0 # Default height
|
|
551
|
+
if 'min_height' not in updated_gdf.columns:
|
|
552
|
+
updated_gdf['min_height'] = 0.0 # Default min_height
|
|
545
553
|
if 'building_id' not in updated_gdf.columns:
|
|
546
554
|
updated_gdf['building_id'] = range(len(updated_gdf))
|
|
555
|
+
if 'id' not in updated_gdf.columns:
|
|
556
|
+
updated_gdf['id'] = range(len(updated_gdf))
|
|
547
557
|
|
|
548
558
|
# Determine map center
|
|
549
559
|
if initial_center is not None:
|
|
@@ -567,14 +577,19 @@ def draw_additional_buildings(building_gdf=None, initial_center=None, zoom=17):
|
|
|
567
577
|
lat_lon_coords = [(c[1], c[0]) for c in coords[:-1]]
|
|
568
578
|
|
|
569
579
|
height = row.get('height', 10.0)
|
|
580
|
+
min_height = row.get('min_height', 0.0)
|
|
581
|
+
building_id = row.get('building_id', idx)
|
|
582
|
+
bldg_id = row.get('id', idx)
|
|
570
583
|
bldg_layer = LeafletPolygon(
|
|
571
584
|
locations=lat_lon_coords,
|
|
572
585
|
color="blue",
|
|
573
586
|
fill_color="blue",
|
|
574
587
|
fill_opacity=0.3,
|
|
575
588
|
weight=2,
|
|
576
|
-
popup=HTML(f"<b>Building ID:</b> {
|
|
577
|
-
f"<b>
|
|
589
|
+
popup=HTML(f"<b>Building ID:</b> {building_id}<br>"
|
|
590
|
+
f"<b>ID:</b> {bldg_id}<br>"
|
|
591
|
+
f"<b>Height:</b> {height}m<br>"
|
|
592
|
+
f"<b>Min Height:</b> {min_height}m")
|
|
578
593
|
)
|
|
579
594
|
m.add_layer(bldg_layer)
|
|
580
595
|
building_layers[idx] = bldg_layer
|
|
@@ -664,17 +679,21 @@ def draw_additional_buildings(building_gdf=None, initial_center=None, zoom=17):
|
|
|
664
679
|
# Create polygon geometry
|
|
665
680
|
polygon = geom.Polygon(current_polygon['vertices'])
|
|
666
681
|
|
|
667
|
-
# Get next building ID
|
|
682
|
+
# Get next building ID and ID values (ensure uniqueness)
|
|
668
683
|
if len(updated_gdf) > 0:
|
|
669
|
-
|
|
684
|
+
next_building_id = int(updated_gdf['building_id'].max() + 1)
|
|
685
|
+
next_id = int(updated_gdf['id'].max() + 1)
|
|
670
686
|
else:
|
|
687
|
+
next_building_id = 1
|
|
671
688
|
next_id = 1
|
|
672
689
|
|
|
673
690
|
# Create new row data
|
|
674
691
|
new_row_data = {
|
|
675
692
|
'geometry': polygon,
|
|
676
693
|
'height': float(height_input.value),
|
|
677
|
-
'
|
|
694
|
+
'min_height': 0.0, # Default value as requested
|
|
695
|
+
'building_id': next_building_id,
|
|
696
|
+
'id': next_id
|
|
678
697
|
}
|
|
679
698
|
|
|
680
699
|
# Add any additional columns
|
|
@@ -696,8 +715,10 @@ def draw_additional_buildings(building_gdf=None, initial_center=None, zoom=17):
|
|
|
696
715
|
fill_color="blue",
|
|
697
716
|
fill_opacity=0.3,
|
|
698
717
|
weight=2,
|
|
699
|
-
popup=HTML(f"<b>Building ID:</b> {
|
|
700
|
-
f"<b>
|
|
718
|
+
popup=HTML(f"<b>Building ID:</b> {next_building_id}<br>"
|
|
719
|
+
f"<b>ID:</b> {next_id}<br>"
|
|
720
|
+
f"<b>Height:</b> {height_input.value}m<br>"
|
|
721
|
+
f"<b>Min Height:</b> 0.0m")
|
|
701
722
|
)
|
|
702
723
|
m.add_layer(new_layer)
|
|
703
724
|
|
|
@@ -707,8 +728,8 @@ def draw_additional_buildings(building_gdf=None, initial_center=None, zoom=17):
|
|
|
707
728
|
add_button.disabled = True
|
|
708
729
|
clear_button.disabled = True
|
|
709
730
|
|
|
710
|
-
print(f"Building {
|
|
711
|
-
print(f"Height: {height_input.value}m")
|
|
731
|
+
print(f"Building {next_building_id} added successfully!")
|
|
732
|
+
print(f"ID: {next_id}, Height: {height_input.value}m, Min Height: 0.0m")
|
|
712
733
|
print(f"Total buildings: {len(updated_gdf)}")
|
|
713
734
|
|
|
714
735
|
def clear_drawing_click(b):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: voxcity
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.29
|
|
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>
|
|
@@ -15,7 +15,7 @@ voxcity/exporter/envimet.py,sha256=Sh7s1JdQ6SgT_L2Xd_c4gtEGWK2hTS87bccaoIqik-s,3
|
|
|
15
15
|
voxcity/exporter/magicavoxel.py,sha256=SfGEgTZRlossKx3Xrv9d3iKSX-HmfQJEL9lZHgWMDX4,12782
|
|
16
16
|
voxcity/exporter/obj.py,sha256=h1_aInpemcsu96fSTwjKMqX2VZAFYbZbElWd4M1ogyI,27973
|
|
17
17
|
voxcity/geoprocessor/__init__.py,sha256=JzPVhhttxBWvaZ0IGX2w7OWL5bCo_TIvpHefWeNXruA,133
|
|
18
|
-
voxcity/geoprocessor/draw.py,sha256=
|
|
18
|
+
voxcity/geoprocessor/draw.py,sha256=t0W7M8ZflJRjXIBuyvszQm_f6r39dK_fBO_7_0dKFAs,33354
|
|
19
19
|
voxcity/geoprocessor/grid.py,sha256=lhELyznlk4Jt7vnd0uOpMCLPCjrYQjX7qtQq-xHkYE4,64161
|
|
20
20
|
voxcity/geoprocessor/mesh.py,sha256=ElqAE2MA8KZs7yD7B1P88XYmryC6F9nkkP6cXv7FzIk,30777
|
|
21
21
|
voxcity/geoprocessor/network.py,sha256=YynqR0nq_NUra_cQ3Z_56KxfRia1b6-hIzGCj3QT-wE,25137
|
|
@@ -30,9 +30,9 @@ voxcity/utils/lc.py,sha256=h2yOWLUIrrummkyMyhRK5VbyrsPtslS0MJov_y0WGIQ,18925
|
|
|
30
30
|
voxcity/utils/material.py,sha256=H8K8Lq4wBL6dQtgj7esUW2U6wLCOTeOtelkTDJoRgMo,10007
|
|
31
31
|
voxcity/utils/visualization.py,sha256=T-jKrCA4UMm93p-1O678RWM7e99iE0_Lj4wD07efcwI,112918
|
|
32
32
|
voxcity/utils/weather.py,sha256=2Jtg-rIVJcsTtiKE-KuDnhIqS1-MSS16_zFRzj6zmu4,36435
|
|
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.29.dist-info/licenses/AUTHORS.rst,sha256=m82vkI5QokEGdcHof2OxK39lf81w1P58kG9ZNNAKS9U,175
|
|
34
|
+
voxcity-0.5.29.dist-info/licenses/LICENSE,sha256=s_jE1Df1nTPL4A_5GCGic5Zwex0CVaPKcAmSilxJPPE,1089
|
|
35
|
+
voxcity-0.5.29.dist-info/METADATA,sha256=ssD5wLFfzw97c49s0o1_CFpgBaKMeG2AxKzJ2-n3ufY,26724
|
|
36
|
+
voxcity-0.5.29.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
37
|
+
voxcity-0.5.29.dist-info/top_level.txt,sha256=00b2U-LKfDllt6RL1R33MXie5MvxzUFye0NGD96t_8I,8
|
|
38
|
+
voxcity-0.5.29.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|