voxcity.downloader.mbfp¶
Module for downloading and processing Microsoft Building Footprints data.
This module provides functionality to download building footprint data from Microsoft’s open dataset, which contains building polygons extracted from satellite imagery using AI. It handles downloading quadkey-based data files and converting them to GeoJSON format.
The data is organized using quadkeys, which are hierarchical spatial indexing strings that identify tiles on the map at different zoom levels. Each quadkey corresponds to a specific geographic area and zoom level.
Key Features: - Downloads building footprint data from Microsoft’s global buildings dataset - Handles quadkey-based spatial queries - Converts compressed data files to GeoJSON format - Supports rectangular region queries using vertex coordinates
Functions¶
|
Download and process building footprint data for a rectangular region. |
Module Contents¶
- voxcity.downloader.mbfp.get_mbfp_gdf(output_dir, rectangle_vertices)[source]¶
Download and process building footprint data for a rectangular region.
This function takes a list of coordinates defining a rectangular region and: 1. Downloads the necessary building footprint data files covering the region 2. Loads and combines the GeoJSON data from all relevant files 3. Processes the data to ensure consistent coordinate ordering 4. Assigns unique sequential IDs to each building
- Parameters:
output_dir (str) – Directory path where downloaded files will be saved
rectangle_vertices (list) – List of (lon, lat) tuples defining the rectangle corners. The coordinates should define a bounding box of the area of interest.
- Returns:
- GeoDataFrame containing building footprints with columns:
geometry: Building polygon geometries
id: Sequential unique identifier for each building
- Return type:
geopandas.GeoDataFrame
Note
Files are downloaded only if not already present in the output directory
Coordinates in the input vertices should be in (longitude, latitude) order
The function handles cases where some vertices might not have available data