rskelly / treetops

Tree Top and Crown Delineation from Canopy Height Rasters
0 stars 0 forks source link

Add Elevation Fields (ground z, top of tree, tree height) to database output. #105

Closed rskelly closed 4 years ago

rskelly commented 6 years ago

Python script attached which performs this fix.

TreetopUtils.txt

rskelly commented 6 years ago

The crowns phase already computes the tree top height and position from the original raster, however it does not create a new geometry for that point. It must wait until the crowns section because the top located in the treetops phase is deduced from the smoothed raster, whose maxima don't necessarily correspond to those in the original raster. The maximum is located in the region delineated by the crown associated with the top.

1) Should we create a new geometry to represent the top from the un-smoothed raster? This can be added to the tops database or the crowns database. Either entails less work than creating a new database. 2) It would perhaps be good to provide a structure for the tables that are required. The current fields are:

Tops: id | parentid | smoothcol | smoothrow | smoothx | smoothy | smoothz | origx | origy | origz | (geometry)

Crowns: id | (geometry)

lorendawe commented 6 years ago

We talked this over and decided that we would like a streamlined output that we can deliver to the client without revising the attributes. This would include the same attributes for both tops and crowns: TREE_ID, GROUND_Z, TOP_Z, TREE_HT Please use orig (non-smoothed) values only.

We would also require geometry to be 3D, Please use TOP_Z for the top's elevation and (GROUND_Z + (0.5 * TREE_HT)) for crown's elevation (this allows us to visualize the tops/crowns with the lidar in 3D).

We realize that the other fields are valuable for debugging/development so perhaps there could be a "debug" or "verbose" option that includes whatever fields you feel may be required for debugging and/or future development.

rskelly commented 5 years ago

Unresolved: The smoothed values will be removed from the output entirely, with only the heights extracted from the original raster remaining. Since the crowns phase is required for generating top heights from the original raster, if the tops phase is run alone, these columns will be empty. Our choices for handling this are:

  1. Leave the intermediate smoothed columns in.
  2. Leave them in unless the crowns phase is run, and then delete them.
  3. Join the tops and crowns phases and require both to run every time.
  4. Add a checkbox with a message to the effect of “Keep Smoothed Heights” and default to off. (This is my preferred option as other users have found this data useful.)
  5. Something else? The extra column would contribute to the size of the database, obviously.
lorendawe commented 5 years ago

Please use combination of 3) and 4). No problem to run tops and crowns every time and only output smoothed heights if user wants them (default to off)