[GRASS-user] patching vectors - some are not patched

Ken Mankoff mankoff at gmail.com
Mon Nov 19 07:52:09 PST 2018


Hi Martin,

On 2018-11-19 at 16:32 +0100, Markus Metz <markus.metz.giswork at gmail.com> wrote:
>> On 2018-11-19 at 08:26 +0100, Ken Mankoff <mankoff at gmail.com> wrote:
>>
>> r.mapcalc "basin = if(basin, ${count}, null())" --o
>> r.to.vect -v input=basin output=b type=area --o
>> v.patch -a input=b output=basin --o
>> v.clean in=basin out=basin_clean0 tool=break,rmdupl --o
>> v.clean in=basin_clean0 out=basin_clean1 tool=snap,break,rmdupl --o
>
> you can also clean the patched vector with
>
> v.clean tool=bpol,rmdupl,break,rmdupl -c
>
> it could be a bit faster

If found it faster and easier to not work in vector space. I now write out the raster with 'r.out.xyz raster=basin >> basin.txt" (I'm actually doing this with GNU parallel with one basin and one file per CPU core). Then I can read concat and read in everything as a raster. Finally, converting the single raster to a vector seems to work better than accumulating all the individual vectors.

Thanks,

  -k.


More information about the grass-user mailing list