Skip to content

Resample or reproject a grid

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

Grids from different sources land on different lattices — LANDFIRE fuels at 30 m, 3DEP topography at 10 m, an uploaded raster at whatever it shipped with. Before you combine or export them together, they need to share one grid. Resample re-grids a source grid onto a target lattice or resolution.

Two ways to specify the target:

  • Align to another grid — match an existing grid’s cell size and origin exactly. This is the one you want 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”

Set alignment.target to "grid" and grid_id to the grid you want to match. 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-v2-prod-nyvjyh5ywa-uw.a.run.app/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-v2-prod-nyvjyh5ywa-uw.a.run.app/domains/your-domain-id/grids/your-grid-id' \
-H 'accept: application/json' \
-H 'api-key: my-api-key'

The 30 m fuel grid (45×30 cells) comes back on the 10 m topography lattice (170×116) — 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”

When you just want a specific cell size (not a specific other 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-v2-prod-nyvjyh5ywa-uw.a.run.app/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
}
}'
  • Extreme upsampling in one step can fail. Jumping a 30 m grid straight to 2 m (a 15× increase per axis) can fail with a generic processing error. Resample to a moderate factor, or align to a grid that’s already near the target resolution.
  • Categorical bands averaged into garbage. 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").