Riverscapes / riverscapes-tools

Open-source Python 3.0 tools for the Riverscapes organization
https://tools.riverscapes.net/
GNU General Public License v3.0
11 stars 11 forks source link

Decide and Implement new Centerline Strategy #382

Closed joewheaton closed 1 year ago

joewheaton commented 3 years ago

In #381 we tried to bring back centerlines, but with decisions to leave rasterized edges, we have way more vertices and this was blowing up the centerline tool. Six steps forward one step back ;). @philipbaileynar, @KellyMWhitehead and @joewheaton need a new strategy.

Once we have it, let's spell it out up here by editing this post. I will put my thoughts below.

joewheaton commented 3 years ago

A few ideas... Assuming that what is breaking our centerline method right now is the number of vertices and using Theisen polygons, I'm wondering if we try something staying in Raster first. Feel free to shoot this down... what if:

  1. We produced a binary raster where 1 is outside the 0.68 thresholded valley bottom and 0 (false) is inside.
  2. We calculated a Euclidian distance from 1's (outside), and then similar to @philipbaileynar old RBT thalweg tool, we do a least cost-path tracing down trying to connect dots to the next highest (i.e. furthest away from edge) cells?
  3. We could then attempt to smooth and simplify the resulting line so it doesn't have so many vertices?

Or... I don't know how the "smoothing" works, but I know it is computationally expensive. What if we are only doing it temporarily for purposes of getting a centerline on the 0.68? What parameters on that operation are there, what seems to cost the most?

joewheaton commented 3 years ago

@lauren-herbine and @shelbysawyer feel free to make suggestions if you have them. Otherwise mentioning you for FYI

joewheaton commented 3 years ago

Just found this old post from Duncan, that is quite helpful for our CL strategy discussions: https://github.com/Riverscapes/ConfinementTool/issues/39

joewheaton commented 3 years ago

@philipbaileynar can you ask @KellyMWhitehead to try the Euclidian Distance thing and see where that gets us? I believe that because step 1 will be to produce a binary raster that is outside all valley bottoms, it should overcome some of the lateral partitioning of valley bottoms that are getting split apart in bigger valley bottoms when they should be lumped together.

philipbaileynar commented 3 years ago

Someone should experiment with Euclidean distance by hand before we write any code. Could even be model builder.

joewheaton commented 1 year ago

This is now complete with 0.7 onwards.