[GRASS-user] v.generalize threshold change in Python does not affect output
Clement Poirier
Clement.Poirier at unima.fr
Fri Oct 9 06:36:38 PDT 2020
Dear GRASS users,
I'm trying to simplify a watercourse polygon with v.generalize in a Python script running on a x64 Windows 10 machine. The script points to the GRASS 7.8.3 distribution shipped with QGIS 3.14.
Previously in QGIS, the v.generalize tool on the watercourse polygon with 'threshold' set to 100 produced the desired output, with 'Number of vertices for selected features reduced from 2323 to 30 (1% remaining)'.
In the Python script, using the same arguments, v.generalize gives:
grass.run_command('v.generalize', input='watercourse', output='vgen _lothresh', type='area', method='douglas', threshold=100)
> 'Number of vertices for selected features reduced from 3249 to 1854 (57% remaining)'
which is not the same output. And changing the 'threshold' argument from 100 to 10000 has no effect on the output:
grass.run_command('v.generalize', input='watercourse', output='vgen_hithresh', type='area', method='douglas', threshold=10000)
> 'Number of vertices for selected features reduced from 3249 to 1854 (57% remaining)'
In the Python script again, pointing to a standalone GRASS 7.8.3 or old stable 7.6.1 does not solve the problem, nor using other simplification methods.
What am I doing wrong here? I would appreciate your support on this.
Thank you, best wishes
Clement Poirier
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20201009/cb390093/attachment.html>
More information about the grass-user
mailing list