Skip to content

Tree replacement

Justin Forest edited this page Apr 26, 2025 · 6 revisions

Tree replacement is a feature that allows tracking multiple trees historically planted in the same place. It also simplifies the process of updating trees which were replaced in real life.

Feature status: planned.

User Experience

  • When the user is in the Tree Mapper mode, and they click the (...) button on the tree page, the menu contains an option named "Replace tree".
  • When that option is clicked, a form opens to add a new tree, with the following defaults:
    • coordinates are of the tree being replaced,
    • the planting year is set to current,
    • state is set to healthy.
  • When the form is submitted, the old tree status is automatically set to "gone".
  • On the tree page, there is a link to the tree which previously existed on this location.

Implementation details

  • The "trees" table has an additional numeric fields "replaces" and "replaced_by", which contain ids of the previous/successor trees.
  • When the form is submitted, there's an optional "replaces" field with the previous tree id.
  • When the tree is saved, the old tree status is set to "gone".

Progress

This feature was implemented on April 26, 2025. See this commit.

Clone this wiki locally