Skip to content

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.

  1. An API key: my-api-key.

  2. A domain: your-domain-id. See Create a domain. Geometry is clipped to this domain and stored in its CRS.

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.

POST road/osm
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"
}'

The 201 mints a feature id. Record it: your-road-feature-id. Status starts pending.

To fetch water bodies, POST the same body to features/water/osm. type defaults to water.

POST water/osm
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"
}'

Record this id too: your-water-feature-id.

The two features complete independently. Poll each id, or wait() on each feature:

GET feature status
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'

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": []
}

To create both features and wait on both in one script:

Create both features and wait
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()
GET road data/metadata
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'

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.

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.
Domain Roads Water
The Bigfork domain (grey outline) with its OSM roads (red) and water (blue). Click a road or water feature to see its properties.

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.

  • Polling only one id. Each create call returns its own feature id, and the two features complete independently. Poll both before you use either.