Generate a tree inventory from TreeMap
You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.
A tree inventory is a list of individual stems — location, species, DBH, height, crown ratio, crown base height — and it’s the basis for 3D canopy fuels. FastFuels can generate one for any CONUS domain from the USGS/USFS TreeMap product in two steps:
- Build a PIM grid — a per-cell summary of species composition and stem
density from TreeMap (
pim/treemap). - Realize individual trees — a point process places individual stems
consistent with that grid (
tree/pim).
If you also have a canopy height model (CHM) of the domain, a third,
optional step places those stems only where the CHM shows canopy
(tree/pim/fusion/chm) — see
Condition the trees on a CHM.
Prerequisites
Section titled “Prerequisites”-
An API key: my-api-key.
-
A domain within CONUS: your-domain-id. See Create a domain. TreeMap covers forested lands across the conterminous US.
Step 1 — Build the TreeMap PIM grid
Section titled “Step 1 — Build the TreeMap PIM grid”curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/pim/treemap' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "name": "TreeMap PIM grid"}'Record the id from the response as your-pim-grid-id, then poll
the grid until its status is completed:
curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-pim-grid-id' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
domain = ff.Domain.from_id("your-domain-id")
pim = ff.grids.create_pim_grid_from_treemap(domain, name="TreeMap PIM grid")pim.wait(){ "id": "your-pim-grid-id", "domain_id": "your-domain-id", "name": "TreeMap PIM grid", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-10-31T05:47:30.792685Z", "modified_on": "2026-10-31T05:47:32.998898Z", "checksum": "840601f20daf4f0c9cf9085a50863284", "source": { "bands": ["tm_id"], "name": "pim", "alignment": { "target": "domain", "method": null, "resolution": null }, "description": "TreeMap plot imputation raster (FIA plot IDs at 30m)", "product": "treemap", "extent_buffer_cells": 0, "version": "2022" }, "modifications": [], "bands": [ { "key": "tm_id", "name": "TreeMap ID", "description": "TreeMap raster pixel value identifying the matched FIA plot (small integer, ~1-70k).", "type": "categorical", "unit": null, "index": 0, "nodata": 4294967295, "summary": { "type": "categorical", "count": 655, "nodata_count": 695, "unique_count": 46 } } ], "georeference": { "crs": "EPSG:32611", "transform": [ 29.49945488757609, 0.0, 720226.0, 0.0, -29.499454887583852, 5190646.9836466275 ], "shape": [30, 45] }, "error": null, "chunks": { "shape": [512, 512], "count": 1, "count_by_axis": { "y": 1, "x": 1 } }, "tags": []}TreeMap is coarse, so the grid is small and finishes quickly. Record its id: your-pim-grid-id.
Step 2 — Realize the tree inventory
Section titled “Step 2 — Realize the tree inventory”Point source_pim_grid_id at the completed PIM grid. seed fixes the
stochastic point process: the same PIM grid and seed give the same trees, so
you can compare a
modification
against an unmodified baseline.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/tree/pim' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "name": "TreeMap tree inventory", "source_pim_grid_id": "your-pim-grid-id", "seed": 42}'inventory = ff.inventories.create_tree_inventory_from_pim_grid( domain, pim, seed=42, name="TreeMap tree inventory",){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory", "description": "", "status": "pending", "progress": null, "created_on": "2026-10-31T05:47:41.432658", "modified_on": "2026-10-31T05:47:41.432658", "checksum": "2145c7f655ac4265b1cf8d4acdb0ec4e", "source": { "name": "pim", "source_pim_grid_id": "your-pim-grid-id", "source_pim_grid_checksum": "840601f20daf4f0c9cf9085a50863284", "point_process": "inhomogeneous_poisson", "seed": 42, "crown_base_height_model": { "name": "fia_national_logit_2026" } }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": null }, { "key": "x", "type": "continuous", "unit": "m", "summary": null }, { "key": "y", "type": "continuous", "unit": "m", "summary": null }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": null }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": null }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": null }, { "key": "height", "type": "continuous", "unit": "m", "summary": null }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": null }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": null } ], "forestry_metrics": null, "georeference": null, "error": null, "tags": []}Record the inventory id: your-inventory-id. Poll until completed:
curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/your-inventory-id' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'inventory.wait(){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-10-31T05:47:41.432658Z", "modified_on": "2026-10-31T05:47:44.201259Z", "checksum": "2145c7f655ac4265b1cf8d4acdb0ec4e", "source": { "source_pim_grid_checksum": "840601f20daf4f0c9cf9085a50863284", "name": "pim", "point_process": "inhomogeneous_poisson", "source_pim_grid_id": "your-pim-grid-id", "seed": 42, "crown_base_height_model": { "name": "fia_national_logit_2026" } }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 44099, "null_count": 0, "unique_count": 44099 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 44099, "null_count": 0, "min": 720226.2707794398, "max": 721530.886807579, "mean": 720789.4367628647, "std": 358.8818402915209 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 44099, "null_count": 0, "min": 5189762.016251005, "max": 5190645.954343839, "mean": 5190180.848408101, "std": 255.37602365689511 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 44099, "null_count": 0, "unique_count": 12 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 44099, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 44099, "null_count": 0, "min": 2.54, "max": 93.218, "mean": 13.914003537495182, "std": 10.960855388137494 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 44099, "null_count": 0, "min": 1.8287999999999998, "max": 44.50079999999999, "mean": 8.881181795505565, "std": 5.694699103787507 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 44099, "null_count": 0, "min": 0.0, "max": 0.95, "mean": 0.4147041883035897, "std": 0.23805677585497212 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 44099, "null_count": 0, "min": 0.10020009063207364, "max": 44.50079999999999, "mean": 3.988481478462878, "std": 3.7490861563839766 } } ], "forestry_metrics": { "type": "tree", "tree_count": 44099, "basal_area_per_area": 40.936822409254845, "tree_density": 154.3434721439632, "quadratic_mean_diameter": 6.973474815735105, "dominant_species_groups": [ { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.7471417784727319 }, { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.1691405257365246 }, { "spgrpcd": 6, "name": "Aspen/alder/cottonwood-willow", "basal_area_share": 0.02945535585530605 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.021848703366731472 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.01580769834727652 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [720226.0, 5189762.0, 721534.0, 5190646.0] }, "error": null, "tags": []}The completed inventory’s columns describe each tree: tree_id, x, y,
fia_species_code, fia_status_code, dbh (cm), height (m),
crown_ratio, and crown_base_height (m). source.crown_base_height_model
names the equation that computed crown_base_height.
The examples on this page run on Blue Mountain, a 1.3 by 0.9 km domain near Missoula, Montana. There this seed produces ≈44,000 stems.
Step 3 — Condition the trees on a CHM (optional)
Section titled “Step 3 — Condition the trees on a CHM (optional)”Use this step when the tree/pim inventory leaves forest empty or puts trees
on open ground. If you have a canopy height model of the domain,
tree/pim/fusion/chm expands the same PIM grid but decides cell by cell, from
the CHM, whether trees belong there:
- Where the CHM shows canopy over a cell TreeMap left empty, trees from the nearest TreeMap plot are placed. This fills TreeMap’s gaps.
- Where the CHM shows no canopy over a cell TreeMap matched, the plot is dropped and no trees are placed. This removes trees from open ground.
The trees keep TreeMap’s full attribute set — species, DBH, height, crown ratio, crown base height. The CHM decides which cells keep or receive a plot. The point process interpolates tree density between cell centres, so some stems land in neighbouring cells that hold no plot. Inventories explains why TreeMap alone misses in both directions.
Build or pick a CHM grid
Section titled “Build or pick a CHM grid”Any completed grid in this domain with a chm band in meters will do. The
examples below use the NAIP canopy height model, the same grid
Generate a tree inventory from a CHM
builds in its first step. A CHM
built from a point cloud
or uploaded as a GeoTIFF
works the same way. Poll it to completed and record its id:
your-chm-grid-id.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/canopy/naip' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "name": "NAIP CHM grid"}'curl -X 'GET' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/grids/your-chm-grid-id' \ -H 'accept: application/json' \ -H 'api-key: my-api-key'chm = ff.grids.create_canopy_height_grid_from_naip_chm(domain, name="NAIP CHM grid")chm.wait()Create the conditioned inventory
Section titled “Create the conditioned inventory”Point source_pim_grid_id at the PIM grid from Step 1 and source_chm_grid_id
at the CHM grid. method names the fusion algorithm and its parameters. The
values below are the defaults, so you can omit method to get the same
result. seed works as in Step 2.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/tree/pim/fusion/chm' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "name": "TreeMap tree inventory conditioned on CHM", "source_pim_grid_id": "your-pim-grid-id", "source_chm_grid_id": "your-chm-grid-id", "seed": 42, "method": { "name": "reimputation", "resolution": 7.5, "min_height": 2.0, "cover_threshold": 0.2 }}'inventory = ff.inventories.create_tree_inventory_from_pim_chm_fusion( domain, pim, chm, seed=42, method={"resolution": 7.5, "min_height": 2.0, "cover_threshold": 0.2}, name="TreeMap tree inventory conditioned on CHM",){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory conditioned on CHM", "description": "", "status": "pending", "progress": null, "created_on": "2026-10-31T05:47:52.105449", "modified_on": "2026-10-31T05:47:52.105449", "checksum": "e6e141cfe16d48f0a65f45682ba93701", "source": { "name": "pim", "fusion": ["chm"], "source_pim_grid_id": "your-pim-grid-id", "source_pim_grid_checksum": "840601f20daf4f0c9cf9085a50863284", "source_chm_grid_id": "your-chm-grid-id", "source_chm_grid_checksum": "229aad3f8f1e4b85a676879e414d2ea9", "method": { "name": "reimputation", "resolution": 7.5, "min_height": 2.0, "cover_threshold": 0.2 }, "point_process": "inhomogeneous_poisson", "seed": 42, "crown_base_height_model": { "name": "fia_national_logit_2026" } }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": null }, { "key": "x", "type": "continuous", "unit": "m", "summary": null }, { "key": "y", "type": "continuous", "unit": "m", "summary": null }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": null }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": null }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": null }, { "key": "height", "type": "continuous", "unit": "m", "summary": null }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": null }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": null } ], "forestry_metrics": null, "georeference": null, "error": null, "tags": []}{ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory conditioned on CHM", "description": "", "status": "completed", "progress": { "percent": 100, "message": "Complete" }, "created_on": "2026-10-31T05:47:52.105449Z", "modified_on": "2026-10-31T05:47:55.818346Z", "checksum": "e6e141cfe16d48f0a65f45682ba93701", "source": { "fusion": ["chm"], "name": "pim", "method": { "cover_threshold": 0.2, "name": "reimputation", "min_height": 2.0, "resolution": 7.5 }, "seed": 42, "source_chm_grid_checksum": "229aad3f8f1e4b85a676879e414d2ea9", "source_pim_grid_id": "your-pim-grid-id", "point_process": "inhomogeneous_poisson", "source_chm_grid_id": "your-chm-grid-id", "source_pim_grid_checksum": "840601f20daf4f0c9cf9085a50863284", "crown_base_height_model": { "name": "fia_national_logit_2026" } }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 53282, "null_count": 0, "unique_count": 53282 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 53282, "null_count": 0, "min": 720226.0003150188, "max": 721530.8123194346, "mean": 720811.6062926742, "std": 351.7727544731188 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 53282, "null_count": 0, "min": 5189762.002975728, "max": 5190645.978815561, "mean": 5190211.076738614, "std": 260.548254236766 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 53282, "null_count": 0, "unique_count": 12 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 53282, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 53282, "null_count": 0, "min": 2.54, "max": 93.218, "mean": 13.836764648474155, "std": 10.643983186986262 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 53282, "null_count": 0, "min": 1.8287999999999998, "max": 44.50079999999999, "mean": 8.73625949476371, "std": 5.46624605271747 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 53282, "null_count": 0, "min": 0.0, "max": 0.95, "mean": 0.3985845125933712, "std": 0.24382835583863857 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 53282, "null_count": 0, "min": 0.10020009063207364, "max": 44.50079999999999, "mean": 4.097222364391347, "std": 3.806198141038836 } } ], "forestry_metrics": { "type": "tree", "tree_count": 53282, "basal_area_per_area": 48.044237087811275, "tree_density": 186.48334163528986, "quadratic_mean_diameter": 6.872851094457478, "dominant_species_groups": [ { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.7648563784486083 }, { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.15155806945040246 }, { "spgrpcd": 6, "name": "Aspen/alder/cottonwood-willow", "basal_area_share": 0.02977708178667226 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.018697315757069337 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.016043420887694754 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [720226.0, 5189762.0, 721534.0, 5190646.0] }, "error": null, "tags": []}The response’s source records both grids and their checksums, fusion: ["chm"], the method that was applied, and the crown_base_height_model, as
in Step 2. Record the inventory id:
your-inventory-id, and poll it to completed as in Step 2.
The columns are the same as a tree/pim inventory’s. On Blue Mountain this
seed produces ≈53,300 stems against ≈44,000 from Step 2. That is more, not
fewer: TreeMap has no plot for about half of this domain’s 7.5 m cells, and
the CHM fills about a third of those.
The
NAIP CHM
of Blue Mountain, with canopy below min_height (2 m) left blank, and the
fusion decision for each 7.5 m cell at the default cover_threshold (0.2).
3,441 cells without a TreeMap plot are filled because the CHM shows canopy,
and 628 cells lose their plot because it doesn’t. The decision is computed
from this run’s grids with the fusion functions the API calls
(fastfuels-core 0.17.1). The point process then spreads stems across
neighbouring cells, so 93% of the inventory’s stems stand in cells that
receive trees.
Choose cover_threshold
Section titled “Choose cover_threshold”method names the fusion algorithm (reimputation, the only one) and sets
three parameters. The decision is made per cell at resolution, and a cell
counts as canopy-covered when more than cover_threshold of the CHM cells
inside it are taller than min_height:
| Field | Default | What it does |
|---|---|---|
resolution | 7.5 m | Cell size at which the keep-or-drop decision is made. Must be no finer than the CHM grid’s cell and no coarser than the PIM grid’s. Each grid’s cell size is the first value of its georeference.transform (about 0.6 m for NAIP and 29.5 m for TreeMap on Blue Mountain). |
min_height | 2.0 m | CHM height a cell must exceed to count as canopy. Raise it to ignore shrubs and regeneration. |
cover_threshold | 0.2 | Fraction of a resolution cell that must be canopy for the cell to receive trees. Cells at or below it get none. |
cover_threshold sets the balance between the two effects. A low value fills
almost every TreeMap gap the CHM shows any canopy over and removes plots only
from cells that are nearly bare. A high value fills only well-covered gaps and
removes plots from every cell with broken canopy. On Blue Mountain, same seed:
cover_threshold | Trees |
|---|---|
| 0.05 | 56,645 |
| 0.2 (default) | 53,282 |
| 0.5 | 44,995 |
| 0.75 | 37,068 |
tree/pim, no CHM | 44,099 |
The fusion decision for each 7.5 m cell of Blue Mountain at four values of
cover_threshold, computed as in the figure above. As the threshold rises,
fewer TreeMap gaps are filled and more TreeMap plots are removed, starting
at the edges of the forest patches and in cells with scattered cover.
Raise the threshold when TreeMap places trees on ground you know is open — recent clearings, burns, meadows the CHM resolves — and lower it when the domain has many TreeMap gaps over real forest. Check the result against the CHM by exporting both and overlaying them, as you would for a detected inventory.
Next steps
Section titled “Next steps”- Trim it — remove trees near roads or water.
- Inspect the stems — fetch and stream the inventory data.
- Voxelize it — the inventory already carries the columns voxelization needs, with no allometry step.
Other ways to get a tree inventory: from a canopy height model (from a CHM) or by uploading your own tree list.
Common pitfalls
Section titled “Common pitfalls”- Domain outside CONUS. TreeMap is a conterminous-US product.
- Creating the inventory before the PIM grid is
completed.tree/pimreads the PIM grid’s data — poll step 1 tocompletedfirst. - Expecting identical trees without a seed. Omit
seedand each run draws a fresh random realization. Set it when you need reproducibility. - Expecting a conditioned inventory to have fewer trees. Fusion fills
TreeMap’s gaps as well as pruning its plots, so on a domain where TreeMap
left cells unmatched it can produce more trees than
tree/pim. Compare the two inventories on the map, not by count. Raisecover_thresholdif you want pruning to dominate. - A
resolutionoutside the grids’ cell sizes.tree/pim/fusion/chmreturns422ifmethod.resolutionis finer than the CHM’s cell or coarser than the PIM’s. The default 7.5 m sits between the NAIP or Meta CHM and the TreeMap PIM. For a CHM coarser than 7.5 m, setresolutionbetween the CHM’s cell size and the PIM’s. - A CHM grid that isn’t a 2D height surface in meters. The CHM grid must
carry a
chmband with unitm. A grid in feet, or a 3D grid, is rejected with422. Uploaded GeoTIFFs are the usual cause — set the band unit when you upload. - No canopy above the threshold anywhere. If no cell clears
cover_threshold, the inventory fails withEMPTY_AFTER_FUSIONand the error message reports the highest cover observed. Lowercover_thresholdormin_height, or check that the CHM covers vegetated ground.