Forest scanning
Measure logs in the forest, at the roadside, before haulage, with the tract they came from recorded as the group's origin.
Used in steps 1–3: Create, Scan, Sync. For forest owners, harvesting contractors and timber buyers who measure stacks in the forest, at the roadside. By the end, each stack is measured, tied to the tract it was cut from, and reported to your backend, ready to haul.
A stack is a group. Origin is set on the group, not on each log: origin_place_id points at a place, the tract, with its boundary. Create the tract once and give it to every stack cut from it.
1. Create#
Create the tract once, with its boundary (GeoJSON, longitude first), while you still have signal:
const timbereye = new Timbereye() // reads TIMBEREYE_SECRET_KEY
const tract = await timbereye.places.create({
type: "tract",
name: "Tract 14",
externalRef: "T-14",
point: { lat: 0.40045, lon: 9.40045 },
geometry: {
type: "Polygon",
coordinates: [
[
[9.4, 0.4],
[9.4009, 0.4],
[9.4009, 0.4009],
[9.4, 0.4009],
[9.4, 0.4],
],
],
},
})curl https://api.timbereye.com/v1/places \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "type": "tract", "name": "Tract 14", "external_ref": "T-14", "point": { "lat": 0.40045, "lon": 9.40045 },
"geometry": { "type": "Polygon",
"coordinates": [[[9.4, 0.4], [9.4009, 0.4], [9.4009, 0.4009], [9.4, 0.4009], [9.4, 0.4]]] } }'timbereye places create --type tract --name "Tract 14" --external-ref T-14 \
--lat 0.40045 --lon 9.40045 --geometry @tract14.geojson --json{
"id": "plc_4Hk2pT",
"object": "place",
"type": "tract",
"name": "Tract 14",
"area_ha": 1.0,
"eudr": { "valid": true, "issues": [] }
}Then a group per stack, with the tract as its origin:
const stack = await timbereye.groups.create({
kind: "stack",
externalRef: "stk_0207",
name: "Roadside 3, stack 2",
originPlaceId: "plc_4Hk2pT",
defaults: { species: "PINE_TAEDA", length: { valueM: 5.8 } },
})curl https://api.timbereye.com/v1/groups \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "kind": "stack", "external_ref": "stk_0207", "name": "Roadside 3, stack 2", "origin_place_id": "plc_4Hk2pT",
"defaults": { "species": "PINE_TAEDA", "length": { "value_m": 5.8 } } }'timbereye groups create --kind stack --external-ref stk_0207 --name "Roadside 3, stack 2" \
--origin-place plc_4Hk2pT --species PINE_TAEDA --length 5.8m --json{
"id": "grp_3Kd7Mf",
"object": "group",
"kind": "stack",
"external_ref": "stk_0207",
"origin_place_id": "plc_4Hk2pT"
}Keep grp_3Kd7Mf on stack stk_0207. The boundary is checked against the EUDR geolocation rules when the place is created; eudr.issues lists what fails. See Origin.
2. Scan#
The crew scans each stack with the Timbereye app or your own app. With no signal, the phone keeps every log and uploads later (Working offline). Each sitting is refined when it uploads.
A crew that names stacks on the spot can open them by your stack id from the phone instead (POST /groups/open), passing the tract's place id as origin_place_id, which your app got from your backend (a phone cannot list places). A place id it may not use is refused with 404, the same for any such id.
3. Sync#
Each sitting's logs, once refined, send group.measured with the stack's tally, and a later sitting sends it again with the next revision. In your webhook handler (behind express.raw, see Stay in sync):
const event = await timbereye.webhooks.verify(req)
if (event.type === "group.measured") {
const tally = event.data.object
await db.stacks.update(tally.externalRef, {
pieces: tally.pieces,
m3: tally.volume?.m3,
revision: tally.revision,
})
}Your stack record afterwards:
{ "id": "stk_0207", "timbereyeGroupId": "grp_3Kd7Mf", "pieces": 88, "m3": 27.4, "revision": 1 }Example figures. See Stay in sync.
Hauling#
Load the stack's logs onto a truckload group, which then reports them under its own group.measured. Logs moved out leave the stack's tally, and the stack sends a new revision without them (reason log_removed); keep the revision you stored before the haul as the stack's count. Every log keeps the list of groups it has been in (timbereye items find --tag). Create the truckload, with the tract as its origin (moved logs keep the tract of the stack they were measured into; see Trace origin):
const truck = await timbereye.groups.create({
kind: "truck_load",
externalRef: "haul_5520",
originPlaceId: "plc_4Hk2pT",
})curl https://api.timbereye.com/v1/groups \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "kind": "truck_load", "external_ref": "haul_5520", "origin_place_id": "plc_4Hk2pT" }'timbereye groups create --kind truck_load --external-ref haul_5520 --origin-place plc_4Hk2pT --json{ "id": "grp_8Tr2Lp", "object": "group", "kind": "truck_load", "external_ref": "haul_5520" }Then move the stack's logs onto it (at most 500 per call; for part of a stack, pass only those ids):
const itemIds: string[] = []
for await (const log of timbereye.groups.items.list("grp_3Kd7Mf")) itemIds.push(log.id)
await timbereye.groups.items.add("grp_8Tr2Lp", { itemIds })curl "https://api.timbereye.com/v1/groups/grp_3Kd7Mf/items?limit=100" \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" # every page; collect each data[].id
curl https://api.timbereye.com/v1/groups/grp_8Tr2Lp/items/add \
-H "Authorization: Bearer $TIMBEREYE_SECRET_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{ "item_ids": ["itm_5Lw2Nc", "itm_7Qp3Xd"] }'timbereye groups items move --from grp_3Kd7Mf --to grp_8Tr2Lp --all --yes --json{ "id": "grp_8Tr2Lp", "object": "group", "summary": { "items": 88 } }Moving the logs in sends the truckload's group.measured (reason correction).
What you get back#
- Pieces and volume (JAS) per stack and per truckload.
- The origin export,
timbereye.groups.origin("grp_3Kd7Mf"): GeoJSON with each tract's count and volume, and logs with no origin inunattributed. See Origin. - Every log with its measurements and photos. The API calls a log an
item. See Read logs, volume and photos.
Not supported#
- Origin per log. A stack from two tracts needs two groups.
- KML or shapefile boundaries. Send GeoJSON.
- Timbereye checks origin data against the EUDR geolocation rules. It does not screen for deforestation or file due-diligence statements.
- No harvest plans, permits or haulage dispatch. Volume under JAS only.