Modify an inventory
You are viewing in-progress documentation for v2. Switch to the stable version for the current production release.
POST .../modifications edits a tree inventory without regenerating it. It
applies rules to an inventory’s current stored trees and
writes the result back under the same id — no re-running the point process, no
new resource. Use it to remove trees by attribute, by a multi-attribute
expression, or by location, or to scale a numeric attribute, once the
inventory already exists.
The rules you submit are appended to the inventory’s list and applied on
top of whatever it already holds. To instead apply the same rules as you
first build an inventory, see
Remove trees with features
— same rule shape, applied at create time. For
the concepts — conditions, actions, the inventory-only remove action and
expression conditions, and the create-time-vs-in-place distinction — see
About modifications.
Prerequisites
Section titled “Prerequisites”-
An API key: my-api-key.
-
A domain in a projected CRS: your-domain-id. See Create a domain.
-
A completed tree inventory: your-inventory-id. See Generate a tree inventory from TreeMap.
-
Optional — a completed road and water feature in the same domain, for the spatial recipes. See Create road and water features from OpenStreetMap and record your-road-feature-id and your-water-feature-id.
The rest of this page walks the individual recipes. The inventory below starts with ≈84,200 trees.
Remove small trees
Section titled “Remove small trees”Match trees by a single attribute, delete them. Here every tree under 5 cm
DBH: an attribute condition plus a remove action. remove must be the
only action in its rule — you can’t both drop a tree and edit it.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/your-inventory-id/modifications' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "modifications": [ { "conditions": [ { "attribute": "dbh", "operator": "lt", "value": 5 } ], "actions": [ { "modifier": "remove" } ] } ]}'import fastfuels_sdk.v2 as ff
ff.set_api_key("my-api-key")
# A completed tree inventory (e.g. from inventories/tree/pim).inventory = ff.get_inventory("your-domain-id", "your-inventory-id")
# Remove every tree under 5 cm DBH: an attribute condition plus a remove action.# `remove` must be the only action in its rule.inventory.apply_modifications( [ff.remove_trees(ff.tree_attribute("dbh", "lt", 5))])inventory.wait(){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-05T17:24:19.539430Z", "modified_on": "2026-11-05T17:25:00.649598", "checksum": "4d540892068e4e91965fdbdb10f11fa9", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 84219 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 717141.8215549329, "max": 718694.8810631792, "mean": 718362.4915315885, "std": 256.55104521907936 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 5326524.610453336, "max": 5328248.222104982, "mean": 5327447.36344113, "std": 570.3905606002697 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 14 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 2.54, "max": 68.58, "mean": 10.289408233296527, "std": 8.934550039294564 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 1.8287999999999998, "max": 41.452799999999996, "mean": 7.8492867310226915, "std": 5.590348307986632 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5967854047186502, "std": 0.229256428932921 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 2.434300095648623, "std": 3.404960960972311 } } ], "forestry_metrics": { "type": "tree", "tree_count": 84219, "basal_area_per_area": 19.98481248532281, "tree_density": 127.30189357490512, "quadratic_mean_diameter": 5.364989945129504, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.4595254802374243 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.19961829809176604 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.14800798226022852 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.11189217455520768 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.04363607512266874 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}The 200 comes back pending with a freshly rotated checksum. The
modifications array is still empty here. The submitted rule lands there once
the job completes (see Poll to completion). The rule
removes ≈32,500 trees (≈84,200 → ≈51,800).
Remove by expression
Section titled “Remove by expression”An expression condition tests several attributes at once — something a single
attribute condition can’t do, and something only inventories support. Here,
trees that are both thin and short: dbh < 5 and height < 2.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/your-inventory-id/modifications' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "modifications": [ { "conditions": [ { "expression": "dbh < 5 and height < 2" } ], "actions": [ { "modifier": "remove" } ] } ]}'from fastfuels_sdk.v2.client_library.models import InventoryExpressionCondition
# Remove trees that are both thin and short.inventory.apply_modifications( [ff.remove_trees(InventoryExpressionCondition(expression="dbh < 5 and height < 2"))])inventory.wait(){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-05T17:24:19.850475Z", "modified_on": "2026-11-05T17:25:12.913423", "checksum": "315abfbc697147d6a23965b6880205a4", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 84219 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 717141.8215549329, "max": 718694.8810631792, "mean": 718362.4915315885, "std": 256.55104521907936 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 5326524.610453336, "max": 5328248.222104982, "mean": 5327447.36344113, "std": 570.3905606002697 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 14 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 2.54, "max": 68.58, "mean": 10.289408233296527, "std": 8.934550039294564 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 1.8287999999999998, "max": 41.452799999999996, "mean": 7.8492867310226915, "std": 5.590348307986632 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5967854047186502, "std": 0.229256428932921 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 2.434300095648623, "std": 3.404960960972311 } } ], "forestry_metrics": { "type": "tree", "tree_count": 84219, "basal_area_per_area": 19.98481248532281, "tree_density": 127.30189357490512, "quadratic_mean_diameter": 5.364989945129504, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.4595254802374243 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.19961829809176604 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.14800798226022852 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.11189217455520768 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.04363607512266874 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}The and inside the expression is the same ANDing as stacking conditions — it
narrows. Where the dbh < 5 rule above removed ≈32,500 trees, adding
height < 2 cuts that to 2: almost every thin stem is still taller
than 2 m. Expressions accept dbh, height, and
crown_base_height, always in native units (cm for dbh, m for the heights).
Remove trees under roads or water
Section titled “Remove trees under roads or water”To drop trees wherever they fall near a road or near water, use two
rules — one per feature. Each is a within test against the feature,
widened by a buffer_m, with a remove action.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/your-inventory-id/modifications' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "modifications": [ { "conditions": [ { "source": "feature", "operator": "within", "feature_id": "your-road-feature-id", "buffer_m": 5 } ], "actions": [ { "modifier": "remove" } ] }, { "conditions": [ { "source": "feature", "operator": "within", "feature_id": "your-water-feature-id", "buffer_m": 5 } ], "actions": [ { "modifier": "remove" } ] } ]}'# Remove trees within 5 m of roads or water: one rule per feature.inventory.apply_modifications( [ ff.remove_trees(ff.tree_within("your-road-feature-id", buffer_m=5)), ff.remove_trees(ff.tree_within("your-water-feature-id", buffer_m=5)), ])inventory.wait(){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-05T17:24:20.047686Z", "modified_on": "2026-11-05T17:25:24.857197", "checksum": "85efc746038e4e7793dd3628fb865add", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 84219 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 717141.8215549329, "max": 718694.8810631792, "mean": 718362.4915315885, "std": 256.55104521907936 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 5326524.610453336, "max": 5328248.222104982, "mean": 5327447.36344113, "std": 570.3905606002697 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 14 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 2.54, "max": 68.58, "mean": 10.289408233296527, "std": 8.934550039294564 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 1.8287999999999998, "max": 41.452799999999996, "mean": 7.8492867310226915, "std": 5.590348307986632 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5967854047186502, "std": 0.229256428932921 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 2.434300095648623, "std": 3.404960960972311 } } ], "forestry_metrics": { "type": "tree", "tree_count": 84219, "basal_area_per_area": 19.98481248532281, "tree_density": 127.30189357490512, "quadratic_mean_diameter": 5.364989945129504, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.4595254802374243 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.19961829809176604 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.14800798226022852 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.11189217455520768 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.04363607512266874 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}Together the two rules remove ≈3,800 trees (≈84,200 → ≈80,400) — those in the road and water corridors plus the 5 m tolerance.
Scale an attribute
Section titled “Scale an attribute”Not every edit removes trees. A non-remove action edits an attribute on the
matching trees and leaves the tree count unchanged. Here, tall trees
(height > 25 m) have their dbh scaled to 90% — a multiply action gated by
a condition.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/your-inventory-id/modifications' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "modifications": [ { "conditions": [ { "attribute": "height", "operator": "gt", "value": 25 } ], "actions": [ { "attribute": "dbh", "modifier": "multiply", "value": 0.9 } ] } ]}'# Scale DBH of trees taller than 25 m to 90%.inventory.apply_modifications( [ff.modify_trees("dbh", "multiply", 0.9, ff.tree_attribute("height", "gt", 25))])inventory.wait(){ "id": "your-inventory-id", "domain_id": "your-domain-id", "type": "tree", "name": "TreeMap tree inventory", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-05T17:24:20.238242Z", "modified_on": "2026-11-05T17:25:37.021593", "checksum": "5836d65b75284c7f8b593b34914c361b", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 84219 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 717141.8215549329, "max": 718694.8810631792, "mean": 718362.4915315885, "std": 256.55104521907936 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 5326524.610453336, "max": 5328248.222104982, "mean": 5327447.36344113, "std": 570.3905606002697 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 14 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 84219, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 2.54, "max": 68.58, "mean": 10.289408233296527, "std": 8.934550039294564 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 1.8287999999999998, "max": 41.452799999999996, "mean": 7.8492867310226915, "std": 5.590348307986632 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5967854047186502, "std": 0.229256428932921 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 84219, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 2.434300095648623, "std": 3.404960960972311 } } ], "forestry_metrics": { "type": "tree", "tree_count": 84219, "basal_area_per_area": 19.98481248532281, "tree_density": 127.30189357490512, "quadratic_mean_diameter": 5.364989945129504, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.4595254802374243 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.19961829809176604 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.14800798226022852 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.11189217455520768 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.04363607512266874 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}The tree count is unchanged — this rewrites dbh on the
matching trees rather than deleting anything. multiply, divide, add,
subtract, and replace all edit in place. Only remove deletes.
Poll to completion
Section titled “Poll to completion”The checksum rotates the instant you POST, but the trees are rewritten and
the modifications list is updated only when the job completes. Poll the
inventory:
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-11-05T17:24:19.539430Z", "modified_on": "2026-11-05T17:25:02.725530Z", "checksum": "4d540892068e4e91965fdbdb10f11fa9", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [ { "conditions": [ { "attribute": "dbh", "operator": "lt", "value": 5, "unit": null } ], "actions": [ { "modifier": "remove" } ] } ], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 51764 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 717141.8215549329, "max": 718694.8690963736, "mean": 718360.6439660847, "std": 261.3078451785031 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 5326524.621068024, "max": 5328248.222104982, "mean": 5327468.591239328, "std": 564.7229712936826 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 13 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 5.08, "max": 68.58, "mean": 14.502917162506764, "std": 9.139496863407176 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 2.7432, "max": 41.452799999999996, "mean": 10.53559653813461, "std": 5.620575380652449 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5813434046827911, "std": 0.2199135128307488 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 3.433269677985666, "std": 3.957485287856709 } } ], "forestry_metrics": { "type": "tree", "tree_count": 51764, "basal_area_per_area": 19.438290141463913, "tree_density": 78.24428239484425, "quadratic_mean_diameter": 6.748993806066806, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.46367048428010355 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.20150203018570545 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.1521513226582935 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.1058341114900378 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.03892400853177107 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": []}Status walks pending → running → completed. When it lands, the submitted
rule appears in modifications.
The rotated checksum is the staleness signal for anything derived from this
inventory — a voxelization, an export. To keep the pre-edit inventory around,
branch it first.
Branch a scenario instead of overwriting
Section titled “Branch a scenario instead of overwriting”In-place modification edits the inventory under its own id — the pre-edit trees are gone. When you’d rather keep the original and explore a variant stand, duplicate first, then modify the copy.
POST .../duplicate makes a byte-for-byte clone: it copies the stored parquet
(it does not re-run the point process), carrying the inventory’s source,
modifications, treatments, and checksum over verbatim.
curl -X 'POST' \ 'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/your-inventory-id/duplicate' \ -H 'accept: application/json' \ -H 'api-key: my-api-key' \ -H 'Content-Type: application/json' \ -d '{ "name": "Inventory with small trees removed (scenario B)", "tags": ["scenario-b"]}'# Duplicate first, then modify the copy, so the original stays untouched.copy = inventory.duplicate( name="Inventory with small trees removed (scenario B)", tags=["scenario-b"])copy.wait(){ "id": "id-of-the-new-inventory", "domain_id": "your-domain-id", "type": "tree", "name": "Inventory with small trees removed (scenario B)", "description": "", "status": "pending", "progress": null, "created_on": "2026-11-05T17:25:49.215224", "modified_on": "2026-11-05T17:25:49.215224", "checksum": "4d540892068e4e91965fdbdb10f11fa9", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [ { "conditions": [ { "attribute": "dbh", "operator": "lt", "value": 5, "unit": null } ], "actions": [ { "modifier": "remove" } ] } ], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 51764 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 717141.8215549329, "max": 718694.8690963736, "mean": 718360.6439660847, "std": 261.3078451785031 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 5326524.621068024, "max": 5328248.222104982, "mean": 5327468.591239328, "std": 564.7229712936826 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 13 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 5.08, "max": 68.58, "mean": 14.502917162506764, "std": 9.139496863407176 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 2.7432, "max": 41.452799999999996, "mean": 10.53559653813461, "std": 5.620575380652449 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5813434046827911, "std": 0.2199135128307488 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 3.433269677985666, "std": 3.957485287856709 } } ], "forestry_metrics": { "type": "tree", "tree_count": 51764, "basal_area_per_area": 19.438290141463913, "tree_density": 78.24428239484425, "quadratic_mean_diameter": 6.748993806066806, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.46367048428010355 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.20150203018570545 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.1521513226582935 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.1058341114900378 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.03892400853177107 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": ["scenario-b"]}{ "id": "id-of-the-new-inventory", "domain_id": "your-domain-id", "type": "tree", "name": "Inventory with small trees removed (scenario B)", "description": "", "status": "completed", "progress": null, "created_on": "2026-11-05T17:25:49.215224Z", "modified_on": "2026-11-05T17:25:49.551879Z", "checksum": "4d540892068e4e91965fdbdb10f11fa9", "source": { "point_process": "inhomogeneous_poisson", "source_pim_grid_checksum": "998788156f274f149bc4cac1413c95e8", "name": "pim", "crown_base_height_model": { "name": "fia_national_logit_2026" }, "seed": 42, "source_pim_grid_id": "your-pim-grid-id" }, "modifications": [ { "conditions": [ { "attribute": "dbh", "operator": "lt", "value": 5, "unit": null } ], "actions": [ { "modifier": "remove" } ] } ], "treatments": [], "columns": [ { "key": "tree_id", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 51764 } }, { "key": "x", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 717141.8215549329, "max": 718694.8690963736, "mean": 718360.6439660847, "std": 261.3078451785031 } }, { "key": "y", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 5326524.621068024, "max": 5328248.222104982, "mean": 5327468.591239328, "std": 564.7229712936826 } }, { "key": "fia_species_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 13 } }, { "key": "fia_status_code", "type": "categorical", "unit": null, "summary": { "type": "categorical", "count": 51764, "null_count": 0, "unique_count": 2 } }, { "key": "dbh", "type": "continuous", "unit": "cm", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 5.08, "max": 68.58, "mean": 14.502917162506764, "std": 9.139496863407176 } }, { "key": "height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 2.7432, "max": 41.452799999999996, "mean": 10.53559653813461, "std": 5.620575380652449 } }, { "key": "crown_ratio", "type": "continuous", "unit": null, "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 0.0, "max": 0.97, "mean": 0.5813434046827911, "std": 0.2199135128307488 } }, { "key": "crown_base_height", "type": "continuous", "unit": "m", "summary": { "type": "continuous", "count": 51764, "null_count": 0, "min": 0.1835851292650901, "max": 36.57599999999999, "mean": 3.433269677985666, "std": 3.957485287856709 } } ], "forestry_metrics": { "type": "tree", "tree_count": 51764, "basal_area_per_area": 19.438290141463913, "tree_density": 78.24428239484425, "quadratic_mean_diameter": 6.748993806066806, "dominant_species_groups": [ { "spgrpcd": 2, "name": "Douglas-fir", "basal_area_share": 0.46367048428010355 }, { "spgrpcd": 4, "name": "Pine", "basal_area_share": 0.20150203018570545 }, { "spgrpcd": 1, "name": "Cedar/larch", "basal_area_share": 0.1521513226582935 }, { "spgrpcd": 3, "name": "True fir/hemlock", "basal_area_share": 0.1058341114900378 }, { "spgrpcd": 5, "name": "Spruce", "basal_area_share": 0.03892400853177107 } ] }, "georeference": { "crs": "EPSG:32611", "bounds": [ 717141.6556112946, 5326524.549818624, 718694.8955395881, 5328248.228078655 ] }, "error": null, "tags": ["scenario-b"]}The 201 mints a new inventory id — record it: id-of-the-new-inventory.
The copy starts pending while the background copy runs, but its checksum
already equals the source’s and its modifications are carried over intact.
Poll it to completed.
Same checksum, same source, same modifications — only the id, name,
and tags differ. Now apply any recipe above to id-of-the-new-inventory
and only the copy changes. The original keeps the checksum shown here.
Two things to watch:
-
Using the copy before it’s
completed. The clone ispendinguntil the background copy finishes. Its/dataendpoints422until then. Poll first.{"detail": "inventories/id-of-the-new-inventory status is 'pending', expected 'completed'."} -
Duplicating a non-
completedinventory. The source must becompleted— there’s nothing stable to copy until it finishes building.{"detail": "inventories/your-inventory-id status is 'running', expected 'completed'."}
If it fails
Section titled “If it fails”If processing fails, the inventory lands in status: failed with an error
message, and its stored trees are left unchanged — a failed in-place edit
never partially rewrites the inventory. The rules you submitted stay queued.
To retry, POST at least one rule: the next run applies the new rules together
with the queued ones. Sending the same rule again queues it twice, which
applies an arithmetic modifier twice. A queued rule cannot be removed, so a
corrected rule does not replace a faulty one.
Common pitfalls
Section titled “Common pitfalls”-
One rule for two features (AND vs OR). A road condition and a water condition in one rule match only trees inside both — almost none. Use one rule per feature, as in Remove trees under roads or water.
-
removecombined with another action.removemust be the sole action in its rule. Pairing it with an attribute edit is a422. To edit some trees and remove others, use two separate rules.{"detail": [{"type": "value_error","loc": ["body", "modifications", 0],"msg": "Value error, RemoveAction must be the sole action if present","input": {"conditions": [{"attribute": "dbh","operator": "lt","value": 5}],"actions": [{"modifier": "remove"},{"attribute": "height","modifier": "multiply","value": 0.9}]},"ctx": {"error": {}}}]} -
A road feature with no
buffer_m. Road features are thin. Trees are points, and a point rarely lands inside a bare road polygon, so awithintest with no buffer removes almost nothing.buffer_mgives the feature the width to catch trees — set it to the corridor you mean.
Next steps
Section titled “Next steps”- Inspect the result — fetch and stream the inventory data.
- Do the same to grids — modify a grid.