[gdal-dev] ogr2ogr Too many recursion levels in expression

Even Rouault even.rouault at spatialys.com
Fri Mar 27 05:17:20 PDT 2020


Luca,

> I need to extract several features (around 190) from a geojson file. I
> build the where condition string but when I run it I get this error
> 
> ERROR 1: Too many recursion levels in expression
> ERROR 1: SetAttributeFilter(NUTS_NAME='Nordburgenland' OR
> NUTS_NAME='Waldviertel' OR NUTS_NAME='Wien city'.....OR
> NUTS_NAME='Zala') on layer 'NUTS_RG_01M_2016_3035_LEVL_3' failed.

As a workaround, try:

NUTS_NAME IN ('Nordburgenland', 'Waldviertel', ... )

I've also submitted a fix so that those many OR can be supported:
https://github.com/OSGeo/gdal/pull/2355

The issue was naturally the parser would construct a deeply unbalanced expression tree, and 
sanity checks triggered to avoid potential call stack overflows when evaluating it.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200327/4f8d4ab0/attachment-0001.html>


More information about the gdal-dev mailing list