kvos / CoastSat

Global shoreline mapping tool from satellite imagery
http://coastsat.space
GNU General Public License v3.0
696 stars 252 forks source link

shoreline segment with a prefer sorting #549

Open ChengJungHsu opened 6 days ago

ChengJungHsu commented 6 days ago

Hi there, thanks for all your work on this awesome tool. I want to extract shoreline via coastsat to Qgis for further analysis. I found the geojson output might have undesired sorting for points or line's vertices. The sorting of points cause crossover or fake segment. In my case as attached figure, the shoreline should be two segments. North beach is short and curved , while south one is longer and straighter. I plot curve line for line geojson and its point index number. In default sorting, the first point is located the south end of the north beach, and the 118th point is at its north end. Then the next point (119th) is at the south end of the south beach, and its last one at north end. I wonder if we can switch the sorting along points in order from north to south. So that the connected shoreline might looks more reasonable. Or is there trick of post-processing to fix it. I appreciate any suggestion and comments.

output_question_marked

kvos commented 5 days ago

when you create the .geojson you can select 'points' instead of lines, then it will not connect the dots randomly as in your example.