Utilities for parsing and understanding building-related data to support covered building list development.
Project description
Building Data Utilities
Building Data Utilities Workflow
Given a list of addresses, this workflow will automatically go through the following steps:
- Normalize each address - address consists of (at least) street, city, state. Could contain postal_code and country.
- Geocode each address via Amazon Location Services to a lat/long coordinate
- Download the Microsoft Building Footprints for all areas encompassed by the geocoded coordinates
- Find the footprint that intersects (or is closest to) each geocoded coordinate
- Generate the UBID for each footprint
- Export the resulting data as csv and GeoJSON
Prerequisites
-
Optionally create a Virtualenv Environment
-
Dependencies are managed through Poetry, install with
pip install poetry -
Install dependencies with
poetry install -
Create a
.envfile in the root with your Amazon Location Services API key in the following format. You will also need to specify the Amazon base url. If none is specified, the following will be used: https://places.geo.us-east-2.api.aws/v2. For NREL gateway, you will also need to specify an APP ID.AMAZON_API_KEY=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX AMAZON_BASE_URL=https://places.geo.us-east-2.api.aws/v2 AMAZON_APP_ID=XXXXXXXXX
Note that if the env keys for AMAZON_API_KEY, AMAZON_BASE_URL, and AMAZON_APP_ID exist in your profile, then it use that over the .env file.
For NREL users using the rate-limited key, use the following as the AMAZON_BASE_URL: https://developer.nrel.gov/api/tada/amazon-location-service/places/v2
Due to the nature of this application, we are passing IntendedUse=Storage to the Amazon Location Services API. This results in a slightly higher rate per transaction, but allows us to store the results.
-
Create a
locations.jsonfile in the root containing a list of addresses to process in the format:[ { "street": "100 W 14th Ave Pkwy", "city": "Denver", "state": "CO" }, { "street": "200 E Colfax Ave", "city": "Denver", "state": "CO" }, { "street": "320 W Colfax Ave", "city": "Denver", "state": "CO" } ]
Running the Workflow
- Run the workflow with
python main.pyorpoetry run python main.py - The results will be saved to
./data/covered-buildings.csvand./data/covered-buildings.geojson. Example of these files are in thetests/datadirectory as well.
Notes
- This workflow is optimized to be self-updating, and only downloads quadkeys and quadkey dataset-links if they haven't previously been downloaded or if an update is available
- Possible next steps:
- Cache geocoding results (if allowed) to avoid API limit penalties when re-running
- Allow other geocoders like Google, without persisting the geocoding results
- Add distance from geocoded result to footprint boundary,
proximity_to_geocoding_coord(intersections would be 0)
Disclaimer
When using this tool with the Amazon Location Services geocoding API (or any other geocoder) always confirm that the terms of service allow for using and storing geocoding results. For Amazon Location Services, passing the IntendedUse=Storage parameter to each query allows the user to store the geocoding results.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file building_data_utilities-0.1.0.tar.gz.
File metadata
- Download URL: building_data_utilities-0.1.0.tar.gz
- Upload date:
- Size: 14.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f661b332608c012c6008191251445d8181ad1fa7704056d05ee8d7033bba5fac
|
|
| MD5 |
66c6c4cdc2a0425fd83a50d07510a75b
|
|
| BLAKE2b-256 |
23ca84a73a8b56353cb78e24992aece6a906e5f43b4050389f4271ad956a1e9f
|
Provenance
The following attestation bundles were made for building_data_utilities-0.1.0.tar.gz:
Publisher:
pypi_release.yml on SEED-platform/building-data-utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
building_data_utilities-0.1.0.tar.gz -
Subject digest:
f661b332608c012c6008191251445d8181ad1fa7704056d05ee8d7033bba5fac - Sigstore transparency entry: 594316007
- Sigstore integration time:
-
Permalink:
SEED-platform/building-data-utilities@c3c0a7be598123f454f8d8cd88be507e27f53d9e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SEED-platform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@c3c0a7be598123f454f8d8cd88be507e27f53d9e -
Trigger Event:
release
-
Statement type:
File details
Details for the file building_data_utilities-0.1.0-py3-none-any.whl.
File metadata
- Download URL: building_data_utilities-0.1.0-py3-none-any.whl
- Upload date:
- Size: 18.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9e13e29f4083acd41498eadf93c9ba48efd63ac3c31ef78a6f72fbba6c282c4c
|
|
| MD5 |
589edb7cf9101a37e1112798b0d9e0a3
|
|
| BLAKE2b-256 |
94dae156e241f7079173277bd01c826fe1c2b415b39764df97ffeddb3e5ce63f
|
Provenance
The following attestation bundles were made for building_data_utilities-0.1.0-py3-none-any.whl:
Publisher:
pypi_release.yml on SEED-platform/building-data-utilities
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
building_data_utilities-0.1.0-py3-none-any.whl -
Subject digest:
9e13e29f4083acd41498eadf93c9ba48efd63ac3c31ef78a6f72fbba6c282c4c - Sigstore transparency entry: 594316065
- Sigstore integration time:
-
Permalink:
SEED-platform/building-data-utilities@c3c0a7be598123f454f8d8cd88be507e27f53d9e -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/SEED-platform
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi_release.yml@c3c0a7be598123f454f8d8cd88be507e27f53d9e -
Trigger Event:
release
-
Statement type: