Skip to main content

A tool to extract the microsoft building footprints with user defined boundary.

Project description

Version PyPI version PyPI Downloads DOI

msfootprint: A Python package for extracting Microsoft's global building footprints based on user-defined boundaries

This tool allows users to retrieve microsoft global building footprint data based on a specified boundary (such as a shapefile or GeoJSON). The footprints are then saved as Geopackage file to a specified output directory.

The computational engine of msfootprint leverages PySpark and split large areas into smaller tiles for parallel processing. Each tile is processed concurrently, significantly reducing execution time. PySpark's distributed architecture ensures efficient data handling and fault tolerance, enabling fast and reliable downloading of large geospatial datasets.

Features

  • Supports multiple boundary input file formats: .shp, .gpkg, .kml, .geojson.
  • Allows users to specify a boundary and retrieve building footprint data for a specific country or region or small study area.
  • Faster downloading, feasible for large scale data download.
  • Compatible with Google Earth Engine (GEE)/ required GEE authentications.

Usage

It needs a GEE account to access the data.

To install the required dependencies, run the following:

pip install msfootprint

W Once installed, import it in notebook or any python compiler.

import msfootprint as msf

Initialize all the variables

#Import all necessary things
import pathlib as Path
boundary_shp = Path('./shapefile_directory')
out_dir = Path('./output_directory')

#Import the 3 letter country ISO code of your study area, Eg. For Nepal, NPL, for United States of America it will be 'USA'
countryISO = 'USA'

For US, it is automated, so no need to give statename but for other countries having multiple tables need to follow aforementioned step

Now, run the main script

msf.BuildingFootprintwithISO(countryISO, boundary_shp, out_dir)

It will save the building footprint as geojson format in designated location.

Sometimes if above code doesnot works and has a error on accessing data, it needs earth-engine projectID to access the building footprint data If so,

#mention the ee projectID
geeprojectID = 'your-earth-engine-existing-projrct-id'

#run the code
msf.BuildingFootprintwithISO(countryISO, boundary_shp, out_dir, geeprojectID)

‼️ If Java RUN time error or something related to JAVA pops up!, it might be because of outdated JAVA in your system. For detailed configuration notes, see: JAVA setup.

Developers Usage

# Clone the repository
git clone https://github.com/supathdhitalGEO/msfootprint.git

cd msfootprint

uv venv   #Creating a virtual environment

#In Mac, Activate the environment
source .venv/bin/activate

#install development and testing dependencies
uv pip install -e .

uv pip install -e ".[dev]"

#and run the test
pytest tests/test_function.py

Cite this Work

If you use msfootprint in your work, please cite it as follows:

Dhital, S. (2025). msfootprint: A Python package for extracting Microsoft's global building footprints based on user-defined boundaries. Zenodo. https://doi.org/10.5281/zenodo.14595247

in BibTex,

@software{dhital2025msfootprint,
  author       = {S. Dhital},
  title        = {msfootprint: A Python package for extracting Microsoft's global building footprints based on user-defined boundaries},
  year         = {2025},
  publisher    = {Zenodo},
  doi          = {10.5281/zenodo.14595247},
  url          = {https://doi.org/10.5281/zenodo.14595247}
}

For Any Information

Feel free to reach out to me: Supath Dhital
Email: sdhital@crimson.ua.edu

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

msfootprint-0.1.30.tar.gz (12.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

msfootprint-0.1.30-py3-none-any.whl (12.9 MB view details)

Uploaded Python 3

File details

Details for the file msfootprint-0.1.30.tar.gz.

File metadata

  • Download URL: msfootprint-0.1.30.tar.gz
  • Upload date:
  • Size: 12.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.22

File hashes

Hashes for msfootprint-0.1.30.tar.gz
Algorithm Hash digest
SHA256 c335448008be42cd9f6bbbe20f3e4bf84c24da50606f131acac57ba12dbfd972
MD5 11eeae248cf99a1e229b97827c78ae4c
BLAKE2b-256 2b51ecc39e5687b7b7c7e1582d45680f2270ec48845d94e56878766b1ec76f38

See more details on using hashes here.

File details

Details for the file msfootprint-0.1.30-py3-none-any.whl.

File metadata

File hashes

Hashes for msfootprint-0.1.30-py3-none-any.whl
Algorithm Hash digest
SHA256 20534f8faace1c0afcd28177f3401e0e363195c5d1353754da503889259128bb
MD5 fcd4bee70f86dfc33a19e372243bf3a8
BLAKE2b-256 a022e3a4de630e4caab057a9546845428bb628c8f091d28826c275e559464d34

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page