Create road and water features from OpenStreetMap
You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.
A road or water feature holds OpenStreetMap geometry for a domain. Road and water are separate features, each with its own endpoint, and each section below creates one. For what a feature is and how grids and inventories use one, see About features.
Prerequisites
Section titled “Prerequisites”-
An API key: my-api-key.
-
A domain: your-domain-id. See Create a domain. Geometry is clipped to this domain and stored in its CRS.
Create a road feature
Section titled “Create a road feature”To fetch the road network, POST to features/road/osm. Every body field is
optional: name, description, tags, and extent_buffer_m. type
defaults to road and must be road when sent.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/features/road/osm' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "type": "road", "name": "OSM road"}'import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
domain = ff.Domain.from_id("your-domain-id")
road = ff.features.create_road_feature_from_osm(domain, name="OSM road"){ "id": "your-road-feature-id", "domain_id": "your-domain-id", "type": "road", "name": "OSM road", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-03T16:28:59.523122", "modified_on": "2026-11-03T16:28:59.523122", "source": { "product": "osm", "description": "OpenStreetMap road network", "extent_buffer_m": 0.0 }, "georeference": null, "error": null, "tags": []}The 201 mints a feature id. Record it: your-road-feature-id.
Status starts pending.
Create a water feature
Section titled “Create a water feature”To fetch water bodies, POST the same body to features/water/osm. type
defaults to water.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/features/water/osm' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "type": "water", "name": "OSM water"}'water = ff.features.create_water_feature_from_osm(domain, name="OSM water")Record this id too: your-water-feature-id.
Poll until completed
Section titled “Poll until completed”The two features complete independently. Poll each id, or wait() on each
feature:
curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/features/your-road-feature-id' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'road.wait()water.wait()Status walks pending → running → completed. A completed feature has its
georeference.bounds populated:
{ "id": "your-road-feature-id", "domain_id": "your-domain-id", "type": "road", "name": "OSM road", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-11-03T16:28:59.523122Z", "modified_on": "2026-11-03T16:29:00.541082Z", "source": { "extent_buffer_m": 0.0, "product": "osm", "description": "OpenStreetMap road network" }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}{ "id": "your-water-feature-id", "domain_id": "your-domain-id", "type": "water", "name": "OSM water", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-11-03T16:28:59.692379Z", "modified_on": "2026-11-03T16:29:01.702147Z", "source": { "extent_buffer_m": 0.0, "product": "osm", "description": "OpenStreetMap water features" }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}To create both features and wait on both in one script:
import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
domain = ff.Domain.from_id("your-domain-id")
road = ff.features.create_road_feature_from_osm(domain, name="OSM road")water = ff.features.create_water_feature_from_osm(domain, name="OSM water")
road.wait()water.wait()Check the feature count
Section titled “Check the feature count”curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/features/your-road-feature-id/data/metadata' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'metadata = road.get_data_metadata()print(metadata.total_features, metadata.partition_count){ "total_features": 112, "partition_count": 1, "partitions": [ { "index": 0, "num_features": 112 } ]}On the Bigfork domain the road feature holds 112 geometries in one partition.
A domain with no OSM roads or water gives a completed feature with
total_features: 0. A grid or inventory rule that references an empty feature
still completes, but selects nothing with within or intersects and
everything with outside, so check the count before you use the feature.
Read the geometry
Section titled “Read the geometry”GET .../data/{partition_index} returns one partition as GeoJSON in the
domain CRS. Iterate partition_index from 0 to partition_count - 1. In the
SDK, to_geodataframe() reads every partition.
- Road geometry is polygons: each OSM centerline widened by its road class.
- Water keeps lakes and ponds as polygons and widens rivers, canals, streams, drains and ditches into polygons by class. Other waterway lines stay LineStrings.
Keep roads and water whole at the domain edge
Section titled “Keep roads and water whole at the domain edge”Geometry is clipped to the domain, so a road or river that crosses the boundary
is cut at it. To include the geometry just outside the domain, set
extent_buffer_m (0 to 100 m) in the create body. The geometry is then clipped
to the domain grown by that distance.
Next steps
Section titled “Next steps”- Remove surface fuel under roads, water and buildings
- Remove trees with road, water and building features
Common pitfalls
Section titled “Common pitfalls”- Polling only one id. Each create call returns its own feature id, and the two features complete independently. Poll both before you use either.