Skip to content

Resample or reproject a grid

You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.

POST /domains/{domain_id}/grids/resample re-grids a source grid onto a target lattice or resolution. Grids from different sources land on different lattices — LANDFIRE fuels at 30 m, 3DEP topography at 1 to 30 m, an uploaded raster at its own resolution. To combine or export them together, they must share one grid.

Two ways to specify the target:

  • Align to another grid — match an existing grid’s cell size and origin. Use this before a combined export.
  • Resample to a resolution — re-grid to a cell size, anchored to the domain.
  1. An API key: my-api-key.

  2. A domain: your-domain-id.

  3. A completed source grid to resample — e.g. the fuel-load grid from Build a surface fuel grid from LANDFIRE. Record its id: grid-to-resample.

Recipe A — align to another grid’s lattice

Section titled “Recipe A — align to another grid’s lattice”

To match another grid’s lattice, set alignment.target to "grid" and grid_id to that grid. The result adopts that grid’s cell size and origin, so the two line up cell-for-cell.

Resample — align to a target grid
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/resample' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"name": "Surface fuel loads aligned to topography grid",
"source_grid_id": "grid-to-resample",
"alignment": {
"target": "grid",
"grid_id": "grid-to-align-to"
}
}'

Record the new grid id (your-grid-id) and the grid you aligned to (grid-to-align-to). Poll until completed:

GET grid status
curl -X 'GET' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-grid-id' \
-H 'accept: application/json' \
-H 'api-key: my-api-key'

The fuel grid comes back on the topography lattice (shape [115, 169], ≈7.73 m cells) — the same cell size, origin, and CRS as the target grid. The two now share a grid and can be exported together.

Recipe B — resample to a target resolution

Section titled “Recipe B — resample to a target resolution”

To set a cell size instead of matching another grid, set target: "domain" and a resolution in meters. The output is anchored to the domain origin.

Resample — to 10 m
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/resample' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"name": "Surface fuel loads resampled to 10 m",
"source_grid_id": "grid-to-resample",
"alignment": {
"target": "domain",
"resolution": 10
}
}'
  • Categorical bands averaged. If you resample an FBFM (fuel-model code) grid with a continuous method, neighboring codes get averaged into meaningless values. Let the default per-type method apply, or set nearest for categorical bands.
  • Source grid not completed. Resample reads the source grid’s data — source_grid_id must point at a finished grid.
  • Reprojection. Resampling also reprojects when needed: output lands in the domain CRS (or the target grid’s CRS for target: "grid").