Repository navigation
Support building features from Overture Maps - #256
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #254.
Adds building features: footprints from Overture Maps, served by
POST /v2/domains/{domain_id}/features/building.Bug fix
FeatureTypehad nobuildingmember. Any response containing a building feature raisedValueError: 'building' is not a valid FeatureType. That brokeget_feature,Feature.from_id/refresh, andlist_featuresfor any domain holding a building feature, and the cross-domain listing too. Regenerating the client addsFeatureType.BUILDING.The same failure can happen with any enum the API extends after a regen; #255 covers that.
Changes
FeatureType.BUILDING,CreateOvertureBuildingFeatureRequest, thecreate_overture_building_featureendpoint, andFeature.attributions(Attribution: dataset, license, citation).OvertureBuildingSource. The spec has no such schema:Feature.sourceis a free-form object.source["release"]carries the Overture release.ff.features.create_building_feature_from_overture(domain, name="", description="", tags=None, extent_buffer_m=0.0). It mirrorscreate_road_feature_from_osm, which wrapscreate_osm_road_featurethe same way.Feature,list_features, andff.masknow list buildings among the feature types;Featuredocumentsattributions.source["release"]andattributionscitation.v2_api_design.mdgains the building row.extent_buffer_mreturns 422, the completed feature's source, georeference and attributions, the data columns (geometry,height,height_source,source_dataset), get/list deserialization, and a gridmaskreferencing a building feature.tests/data/miller_creek.geojson, about 280 buildings). The Blue Mountain domain has none.Checks
pytest tests/v2against the live API: 585 passed, 2 skipped.mkdocs build --strictfordocs/v2: passed.ff.mask(buildings, "fbfm", 91), FBFM40 at 2 m): 2,382 more cells became FBFM 91.grid.apply_modificationsin place gave the same count.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_modificationsin 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.mdxalready 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 acreate_building_feature_from_overturetab can follow once 0.27.0 is out.