Skip to content

Support building features from Overture Maps - #256

Merged
amarcozzi merged 1 commit into
mainfrom
254-building-features
Nov 6, 2026
Merged

amarcozzi merged 1 commit into
mainfrom
254-building-features

Conversation

@amarcozzi

Copy link
Copy Markdown
Contributor

Closes #254.

Adds building features: footprints from Overture Maps, served by POST /v2/domains/{domain_id}/features/building.

Bug fix

FeatureType had no building member. Any response containing a building feature raised ValueError: 'building' is not a valid FeatureType. That broke get_feature, Feature.from_id/refresh, and list_features for any domain holding a building feature, and the cross-domain listing too. Regenerating the client adds FeatureType.BUILDING.

The same failure can happen with any enum the API extends after a regen; #255 covers that.

Changes

  • Regenerated client: FeatureType.BUILDING, CreateOvertureBuildingFeatureRequest, the create_overture_building_feature endpoint, and Feature.attributions (Attribution: dataset, license, citation).
  • New SDK function: ff.features.create_building_feature_from_overture(domain, name="", description="", tags=None, extent_buffer_m=0.0). It mirrors create_road_feature_from_osm, which wraps create_osm_road_feature the same way.
  • Docstrings: Feature, list_features, and ff.mask now list buildings among the feature types; Feature documents attributions.
  • Docs:
    • Features guide: a building section showing real output, plus the source["release"] and attributions citation.
    • Creating grids: a building-footprint mask example.
    • Modify and treat inventories: a new "Remove trees inside buildings" section.
  • Design doc: v2_api_design.md gains the building row.
  • Tests:
    • Unit: parsing a building feature with its attributions; the creator's request body.
    • Live: create, invalid extent_buffer_m returns 422, the completed feature's source, georeference and attributions, the data columns (geometry, height, height_source, source_dataset), get/list deserialization, and a grid mask referencing a building feature.
    • The live tests run in a new session domain over Lower Miller Creek, Missoula (tests/data/miller_creek.geojson, about 280 buildings). The Blue Mountain domain has none.

Checks

  • pytest tests/v2 against the live API: 585 passed, 2 skipped.
  • mkdocs build --strict for docs/v2: passed.
  • pre-commit (black, flake8): passed.
  • The doc examples were run live in the Miller Creek domain:
    • Grid masking at creation (ff.mask(buildings, "fbfm", 91), FBFM40 at 2 m): 2,382 more cells became FBFM 91. grid.apply_modifications in place gave the same count.
    • Removing trees at creation (ff.remove_trees(ff.tree_within(buildings, buffer_m=2)) on a 1 m Meta CHM inventory): 5,070 trees became 4,826. All 244 trees inside the buffered footprints were removed and none remained.
    • inventory.apply_modifications in place with the same rule completed, recording 1 modification.

Release

A bug fix plus a new function: minor bump, release as 0.27.0.

Downstream

FastFuels-Web: explanation/features.mdx already covers building features. The how-to guides have Python SDK tabs for the OSM features (how-to-guides/features/create_osm_features/python-sdk/) but none for buildings. A building how-to with a create_building_feature_from_overture tab can follow once 0.27.0 is out.

Regenerate the v2 client for the API's building features. FeatureType
gains "building", so a response that contains a building feature no
longer raises "ValueError: 'building' is not a valid FeatureType" (this
broke get_feature and list_features on any domain holding one). The
regen also brings CreateOvertureBuildingFeatureRequest, the
create_overture_building_feature endpoint, and Feature.attributions.

- Add ff.features.create_building_feature_from_overture(domain, name,
  description, tags, extent_buffer_m), alongside the OSM creators.
- Mention buildings in the Feature, list_features, and mask docstrings.
- Docs: a building section in the features guide, a building-footprint
  mask in the grid masking section, and a "Remove trees inside
  buildings" section in the inventory modification guide.
- Tests: building feature parsing and request bodies (unit); the
  creator, data columns, get/list, and a grid mask referencing a
  building feature (live). Live tests use a new test domain over a
  residential area of Missoula, since Blue Mountain has no buildings.
@amarcozzi amarcozzi added 🐛 cold fix There's a bug, but it's not critical to fix right away ✨ feature New feature or request v2 FastFuels v2 API / SDK work labels Nov 5, 2026
@amarcozzi amarcozzi self-assigned this Nov 5, 2026
@amarcozzi
amarcozzi merged commit f3971a3 into main Nov 6, 2026
3 of 4 checks passed
@amarcozzi
amarcozzi deleted the 254-building-features branch November 6, 2026 00:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 cold fix There's a bug, but it's not critical to fix right away ✨ feature New feature or request v2 FastFuels v2 API / SDK work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2: support building features (fixes 'building' is not a valid FeatureType)

1 participant