[GRASS-user] v.generalize and external boundaries
Daniel McInerney
daniel.o.mcinerney at gmail.com
Fri Aug 24 08:43:19 PDT 2018
Hi List,
I'm using v.generalize in a script (excerpt included below) to smooth
the boundaries of a polygon vector dataset. In the attached example
(input_vector.png), I would like to *only* generalize the internal lines
(blue), and leave the external boundary (green line) unchanged. I
thought that the flag, '-l' might provide this functionality, but
unfortunately the resulting external boundary is changed significantly
(attached vgeneralize_output.png).
Is this functionality available in v.generalize or is there another way
that this could be achieved in GRASS?
Thanks in advance.
Best regards,
Daniel.
##run generalisation (step: 1 - douglas)
gscript.run_command('v.generalize', flags='l', overwrite=True,
input='segments', output='segments_douglas', method='douglas', threshold=1)
##run generalisation (step: 2 - sliding average)
gscript.run_command('v.generalize', flags='l', overwrite=True,
input='segments_douglas', output='segments_douglas_slide',
method='sliding_averaging', threshold='2', look_ahead='9', slide='0.1',
iterations='3')
##run generalisation (step: 3 - snake)
gscript.run_command('v.generalize', flags='l', overwrite=True,
input='segments_douglas_slide', output='segments_douglas_slide_snake',
method='snake', threshold='3', alpha='1', beta='1')
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vgeneralize_output.png
Type: image/png
Size: 25552 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180824/f834ec84/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: input_vector.png
Type: image/png
Size: 22381 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180824/f834ec84/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 2472 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20180824/f834ec84/attachment-0001.key>
More information about the grass-user
mailing list