Chapter 2 of the capture journey

The journey of a capture

The capture on the public web map

  1. 1The pin
  2. 2The clusters
  3. 3The approval
  4. 4The tree page

This chapter starts at stage 4 of chapter 1: The record. Chapters 2 to 4 follow the same capture on different paths. Their numbers give only the reading order.

This chapter follows one capture onto the public web map, map.treetracker.org. Anyone can open the map and see the trees that growers captured.

The web map shows a capture in two ways. Close up, it is a pin. From further away, it is a part of the number on a cluster. A click on a pin opens the tree page.

Best guess No public source confirms this. A Greenstand maintainer will review it.

A drawing of the map close up: a pin for each active capture, and one new pin with the label “New: not verified yet”
A drawing of the map close up

Stage 1 of 4

The pin: the capture is on the map before verification

When the field data service stores the capture (chapter 1, stage 4), the database also keeps an older tree record of it. This record is “active” at once. It is not “approved” yet.

The map is a set of small square images, the tiles. The browser asks the tile server for each tile. The mark “active” shows a capture on the map. So close up, the new capture is a pin at once, before an admin verifies it.

Greenstand’s product page says that the web map shows verified trees. Today, the map shows each active capture, also before verification.

For developers

The repo, the file, and the lines at the commit that this page describes.

A drawing of the map from further away: three clusters with their counts, and one count that goes up by 1 at the next run of the job
A drawing of the map further away

Stage 2 of 4

The clusters: a job adds the capture to the counts

From further away, the map groups the captures into round clusters. A cluster shows a number: the count of its captures.

An automatic job is set to run every 2 hours. It finds the active captures that are not in a cluster yet. Then it builds the clusters again. Until the next run, the new capture is a pin close up. It is not in the counts yet.

Best guess The job runs every 2 hours in production today.

For developers

The repo, the file, and the lines at the commit that this page describes.

A drawing of the two badges of the web map tree page
Only the badge of the tree page changes

Stage 3 of 4

The approval: only the tree page changes

An admin approves the capture (chapter 1, stage 5). The admin panel saves “approved” in the record. It also saves the age of the tree, the type of planting, and the species if the admin knows it. Nothing sends a message to the map. The pin and the counts stay the same.

Only the tree page changes. Its badge “Waiting for verification” becomes “Verified”. If the admin rejects the capture, the record is not active any more. Then the map hides it.

For developers

The repo, the file, and the lines at the commit that this page describes.

A drawing of the tree page with made-up data: a tree photo, Tree #1234, the badges, the date, the country, the species, and a clock with “Kept for some hours”
A drawing of the tree page

Stage 4 of 4

The tree page: what a visitor sees

A visitor clicks a pin. The web map opens the tree page beside the map. The page shows the photo, the tree number, the badges, the date of the capture, the country, and the species. The photo comes straight from cloud storage.

The web map keeps each tree page for a time before it builds the page again. So “Verified” can show hours after the approval.

Best guess The web map keeps a tree page for some hours in production, on purpose.

The web map reads only the older tree records. The job of chapter 1 that copies the decision into the newer tables is not on this path.

For developers

The repo, the file, and the lines at the commit that this page describes.