voxcity.geoprocessor.draw.polygonยถ

Building footprint display and polygon drawing utilities.

Provides: - display_buildings_and_draw_polygon: Visualise buildings and draw polygons - get_polygon_vertices: Extract vertices from drawn polygons

Functionsยถ

display_buildings_and_draw_polygon([voxcity, ...])

Display building footprints and enable polygon drawing on an interactive map.

get_polygon_vertices(drawn_polygons[, polygon_id])

Extract vertices from drawn polygons data structure.

Module Contentsยถ

voxcity.geoprocessor.draw.polygon.display_buildings_and_draw_polygon(voxcity=None, building_gdf=None, rectangle_vertices=None, zoom=17)[source]ยถ

Display building footprints and enable polygon drawing on an interactive map.

Parameters:
  • voxcity (VoxCity, optional) โ€“ VoxCity object to extract data from.

  • building_gdf (GeoDataFrame, optional) โ€“ Building footprints.

  • rectangle_vertices (list, optional) โ€“ [lon, lat] rectangle corners.

  • zoom (int) โ€“ Initial zoom level. Default=17.

Returns:

(Map, drawn_polygons list of dicts with โ€˜idโ€™, โ€˜verticesโ€™, โ€˜colorโ€™)

Return type:

tuple

voxcity.geoprocessor.draw.polygon.get_polygon_vertices(drawn_polygons, polygon_id=None)[source]ยถ

Extract vertices from drawn polygons data structure.

Parameters:
  • drawn_polygons โ€“ List returned from display_buildings_and_draw_polygon().

  • polygon_id (int, optional) โ€“ Specific polygon ID. If None, returns all.

Returns:

List of (lon, lat) tuples for the specified polygon, or list of lists for all.