[GRASS-user] v.in.ogr where-clause not working

gisfisch at t-online.de gisfisch at t-online.de
Sun Jan 22 04:42:38 PST 2023


Hello list,

I have problems with v.in.ogr in a python script; I use:

grass.run_command('v.in.ogr',input='d:/my_input',output='my_output',type='bo
undary,centroid',where='LENGTH !=
1',snap=0.01,min_area=0.01,flags="o",overwrite=True)

This has been working fine for years in GRASS 7.0.3 with Python 2.

 

Now, I tried in GRASS 7.8 on Python 3 and I get the following error:

ERROR 1: "LENGTH" not recognised as an available field.

FEHLER: Error setting attribute filter 'LENGTH != 1'

The field called LENGTH is present and there is no typing error. What I
absolutely not understand is that the command is working fine inside GRASS
itself! Just the Python script does not.

"LENGTH" is not a Python reserved keyword, and no SQL reserved keyword. I
also tried it with another name for that column. That also did not work.

Any ideas what could be wrong? Thank you very much.

Uwe

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20230122/ca50186d/attachment.htm>


More information about the grass-user mailing list