[GRASS-user] Fwd: Re: remove small islands from vector areas

Robert Nuske rsn.mailinglists at gmail.com
Fri Jun 21 12:40:10 PDT 2019



Am 21.06.19 um 21:27 schrieb Ken Mankoff:
> On 2019-06-21 at 21:10 +02, Robert Nuske <rsn.mailinglists at gmail.com> wrote...
>> If there is no way to only treat the islands/holes (which i don't know
>> about), it will change the outer boundary as well. Fjord like
>> structures will vanish. Neighboring areas might even merge if close
>> enough. And since one can not control the buffer style of sharp edges
>> (like in postgis, geos), everything will become "rounder".
> Can you work in raster space or do you have to remain with resolution-agnostic vectors? I've solved this issue with maintaining coastlines in raster space by finding and saving the largest (or several largest) clumps (e.g. the ocean surrounding my domain), filling all holes which may involve filling the sea or growing the coastline, and then re-applying the saved clumps, thereby removing any artificially rounded coast.
>
> r.clump input=raster output=clumps
> clump_ID_largest=$(r.stats -c clumps sort=desc | head -n1 | cut -d" " -f1)
> r.mapcalc "mask_ocean = if(clumps == ${clump_ID_largest}, null(), 1)"
> r.mfilter -z input=raster output=raster_overfilled filter=filter.txt
> r.mapcalc "raster_filled = raster_overfilled * mask_ocean" --o
>
>    -k.
Interesting idea. Using the ocean like a stencil. Will think about it. 
Could work similarly in vector world.

Will have to test first if Markus Metz is right and v.clean rmarea does 
what I want. Maybe i haven't studied carefully enough my tests.

Thanks Ken

regards
   robert
   robert


More information about the grass-user mailing list