[GRASS-user] v.extract fails for long strings in sql where or cat

Dear list,

is there a max length in the where statement for v.extract?

I want to extract many line features depending on the value of an id field and get:

"[Errno 7] Argument list too long: 'v.extract'" when I run v.extract with a long sql statement.

It works if I use id < 70000, hence the number of extracted items is not the problem. However, this does not help because I need a selection like "id in (1,5,7,...,70000)". Similarly, cat = 1-70000 works but cat = 1,2,3,....,70000 does not.

I found an old posting about this (https://lists.osgeo.org/pipermail/grass-user/2010-January/054361.html) and wonder if anything has changed since then and if there is any work around if not.

I am running GRASS 7.8.5 on Linux Mint 19.

Thanks a lot,

Mira

--
Dr. Mira Kattwinkel
Quantitative Landscape Ecology
iES Landau, Institute for Environmental Sciences
University of Koblenz-Landau
Fortstraße 7
76829 Landau
Germany
Phone: + 49 6341 280-31553
Office: Building I, Room 2.02

Le 11 août 2021 11:06:35 GMT+02:00, Mira Kattwinkel <kattwinkel-mira@uni-landau.de> a écrit :

Dear list,

is there a max length in the where statement for v.extract?

I want to extract many line features depending on the value of an id
field and get:

"[Errno 7] Argument list too long: 'v.extract'" when I run v.extract
with a long sql statement.

It works if I use id < 70000, hence the number of extracted items is not
the problem. However, this does not help because I need a selection like
"id in (1,5,7,...,70000)". Similarly, cat = 1-70000 works but cat =
1,2,3,....,70000 does not.

I found an old posting about this
(https://lists.osgeo.org/pipermail/grass-user/2010-January/054361.html)
and wonder if anything has changed since then and if there is any work
around if not.

If what you have is a long list of cat values, try the 'file' option of v.extract.

Moritz