grass
grass copied to clipboard
v.fill.holes: Remove isles, keep outer boundary
Example
Input

Output

I would like for this to go to core rather than the grass-addons repo because it seems like basic functionality, but I have seen some topology issues with complex data (will post on that later).
What I'm missing here? I have an issue with the current implementation. If there are touching areas, it does not create a valid topology: some of the areas are not build. The same happens to be me with real-word large data and small hand-drawn data. Any comments or questions welcome.
Failing example
Input

Output

Output: boundaries and centroids

Output: vector digitizer rendering

v.build output
Number of centroids exceeds number of areas: 4 > 2
Number of incorrect boundaries: 2
Number of centroids outside area: 2
Data
GitHub does not take the GRASS pack format even with other file extensions I tried, so it is a zipped .pack file: test2.zip
Does @metzm have a suggestion here on the topology issue?
The new version works! Thanks @metzm for the pointers!
The updated version contains documentation including images and notebook to generate them. I included some notes on topology because it was not what I expected. It as pytest-based tests.
Some features this could have, but I do not plan to implement:
- maximum (or minimum) size to remove
- keep features of other vector types (e.g. keep points)
- keep boundaries with categories (may represent lines which are at the same time boundaries)
- copy all attribute tables with layer=-1 (Now it copies only relevant rows of the attribute table for the selected layer. This usually should be the whole table because all areas with centroids are kept, so wanting to simply preserve everything makes sense.)
From my perspective, this is ready to merged. Reviews welcome.
Perhaps change the PR name to make it clear it's a completely new tool.