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.