Branch identification based on the area of coverage
Pre-release
Pre-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:
- The area of coverage of all the pixels is pre-calculated, by taking into account the terrain slope
- A branch is created at each
graph-leaf
pixel, where no other pixels point to - Each branch continues forward by accumulating the area of the pixel from the
tree-graph
- 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 - The major branch that reaches the
graph-seed
is referred astrunk
(just onetrunk
perseed
, even if it is also agraph-node
) - The branches that do not include a
graph-node
are referred asleaf-branches
, orleaf-trunks
when they end atseed
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