Skip to content

Branch identification based on the area of coverage

Pre-release
Pre-release
Compare
Choose a tag to compare
@trundev trundev released this 25 Apr 19:21
· 24 commits to master since this release

This version includes fully rewritten second and third processing stage. Both stages use same technique to identify major vs. minor branches. There is no changes in the first stage.

It is tested on the complete SRTM N39E021, just like 2021-01. See GitHub action 2428150017. The performance is significantly degraded due to unfinished optimizations and quite more detailed result.

Branch identification technique by area of coverage:

  1. The area of coverage of all the pixels is pre-calculated, by taking into account the terrain slope
  2. A branch is created at each graph-leaf pixel, where no other pixels point to
  3. Each branch continues forward by accumulating the area of the pixel from the tree-graph
  4. When graph-node is reached, where multiple branches are connected, the one with largest area of coverage is selected as the major one. It continues further alone, by using the accumulated area of the others
  5. The major branch that reaches the graph-seed is referred as trunk (just one trunk per seed, even if it is also a graph-node)
  6. The branches that do not include a graph-node are referred as leaf-branches, or leaf-trunks when they end at seed

Summary of the major changes:

  • The second and third stages use a new common function arrange_lines, to distinguish major from minor branches. It uses the area of coverage, instead of the total length
  • The trunk branches are the only needed by the second stage of processing, where they are flipped to generate the largest ones, similar to the trick from 2020-11
  • The third stage, repeats the same process, but keeps all the non-leaf branches. Smallest ones are discarded at the end
  • An area verification function calc_branch_area is called during the geometry generation to double-check the previously calculated branch areas (this does some extra slowdown)
  • Some changes in CI process including update of GDAL version and change of the SRTM download link

Work in progress:

  • Additional parallelization in arrange_lines
  • The area of coverage can be used as map zoom-level filter
  • The ridge volume is considered to replace the area of coverage. It could improve the filtering-out of the ridges in flat areas