Skip to content

Remove trees with road, water and building features

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

Remove trees that fall within a road, water or building Feature by testing

To remove trees near a road or water feature, or inside a building footprint, pass a modification rule on the inventory create call: a feature condition and a remove action. This is the inventory counterpart to removing surface fuel under the same features. For how conditions and actions work, see About modifications.

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

  2. A domain: your-domain-id. See Create a domain.

  3. A completed road feature and water feature in that domain. See Create road and water features from OpenStreetMap and record your-road-feature-id and your-water-feature-id.

  4. A completed PIM source grid. A TreeMap inventory is generated from a pim grid. Create one, poll it to completed, and record your-pim-grid-id:

    Create 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"
    }'
  5. To remove rooftop detections, a completed building feature and CHM grid in that domain. See Create building features and record your-building-feature-id. Build a NAIP CHM grid (canopy/naip) as in Generate a tree inventory from a CHM and record your-chm-grid-id.

To remove every tree within a distance of water, add one rule with a within condition on the water feature, a buffer_m for the distance, and a remove action. remove must be the only action in its rule.

Create inventory — trees near water removed
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": "Trees with 5 m water buffer removed",
"source_pim_grid_id": "your-pim-grid-id",
"seed": 42,
"modifications": [
{
"conditions": [
{"source": "feature", "operator": "within", "feature_id": "your-water-feature-id", "buffer_m": 5}
],
"actions": [
{"modifier": "remove"}
]
}
]
}'

The 201 returns your rule and mints an inventory id. Record it: your-inventory-id. The removal runs while the inventory is built. seed: 42 fixes the tree population, so a run with the rule and a run without it can be compared tree for tree.

Poll the inventory, or wait() on it:

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

On the Pattee Canyon domain the rule removes 1,347 of 59,844 trees, 1.7% of the domain’s basal area: the trees inside Pattee Creek and within 5 m of it. The map shows those trees and the trees the rule kept just outside the buffer.

Domain 5 m buffer Water Kept trees Removed trees
Pattee Creek (blue) and its 5 m buffer (light blue) on the Pattee Canyon domain (white outline), with the trees the rule removed (pink) and the trees it kept within 10 m of the buffer (yellow). Click a tree to see its DBH and height.

To remove only some of the trees near a feature, add a second condition to the same rule. Conditions in a rule are ANDed, so a tree is removed only if it is inside the buffered road and above the DBH threshold. This rule removes trees over 10 in DBH within 5 m of a road. unit: "in" converts the threshold to the native cm before the comparison.

Create inventory — large trees near roads removed
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": "Large trees within 5 m of roads removed",
"source_pim_grid_id": "your-pim-grid-id",
"seed": 42,
"modifications": [
{
"conditions": [
{"source": "feature", "operator": "within", "feature_id": "your-road-feature-id", "buffer_m": 5},
{"attribute": "dbh", "operator": "gt", "value": 10, "unit": "in"}
],
"actions": [
{"modifier": "remove"}
]
}
]
}'

On the Pattee Canyon domain the rule removes 465 of 59,844 trees, with a median DBH of 13.5 in. They hold 3.0% of the domain’s basal area. The 1,817 trees of 10 in DBH or less inside the same buffer stay, with a median DBH of 4.4 in. Without the DBH condition, the rule removes every tree in the buffer.

Domain 5 m buffer Roads Kept trees Removed trees
OSM roads (red) and their 5 m buffer (orange) on the Pattee Canyon domain (white outline), with the trees over 10 in DBH the rule removed (pink) and the smaller trees it kept inside the buffer (yellow). Click a tree to see its DBH and height.

Remove CHM detections inside building footprints

Section titled “Remove CHM detections inside building footprints”

The NAIP CHM records rooftops as height, so a tree inventory detected from it places trees on roofs. To remove them, create the CHM inventory with one rule: a within condition on the building feature and a remove action.

Create CHM inventory — rooftop detections removed
curl -X 'POST' \
'https://api.fastfuels.silvxlabs.com/v2/domains/your-domain-id/inventories/tree/chm' \
-H 'accept: application/json' \
-H 'api-key: my-api-key' \
-H 'Content-Type: application/json' \
-d '{
"name": "CHM trees with rooftop detections removed",
"source_chm_grid_id": "your-chm-grid-id",
"algorithm": {
"name": "lmf",
"min_height": 2,
"footprint_size": 3
},
"modifications": [
{
"conditions": [
{"source": "feature", "operator": "within", "feature_id": "your-building-feature-id"}
],
"actions": [
{"modifier": "remove"}
]
}
]
}'

Record the inventory id, your-inventory-id, and poll it to completed.

On the Pattee Canyon domain the rule removes 58 of 11,858 detections, in 19 of the 25 footprints. The removed detections have a median height of 5.0 m. The 139 detections kept within 10 m of a building have a median height of 10.8 m, and all detections 15.0 m.

Domain Buildings Kept detections Removed detections
Overture building footprints (white) on the Pattee Canyon domain, with the CHM detections the rule removed (pink) and the detections it kept within 10 m of a building (yellow). Click a detection to see its height.

A tree whose crown overhangs a roof can have its top detected inside the footprint, and the rule removes it too. To also remove detections along the roof edges, add buffer_m to the condition.

  • remove combined with another action. remove must be the only action in its rule, and the API rejects any other combination. To edit some trees and remove others, use two rules.
  • Expecting no buffer_m to catch trees beside water. It catches only the trees inside water polygons. Set a buffer to reach the trees beside them.
  • Wrong DBH units. DBH is stored in cm, so a bare "value": 10 means 10 cm. Add "unit": "in" when you mean inches.
  • A feature from another domain. The feature must belong to the same domain as the inventory, or the request is rejected.