[gdal-dev] shapefile field indexing on OGR 1.x vs 2.1

Even Rouault even.rouault at spatialys.com
Tue Jan 31 03:37:05 PST 2017


> Even,
> 
> I tried ogr2ogr -lco RESIZE=YES and indeed the Integer64 field becomes
> Integer, but that changes the original shapefile, I was hoping to use
> the existing shapefile without touching it.

If there are no holes in feature numbering, you could normally reuse the existing .shp and 
.shx files ( or just create a copy of the .dbf, resize it, and rename it to its original name)

> 
> Related to the attribute index: when using SQL WHERE clauses like
> WHERE myfield IN (1, 2, 3) on the integer field, it reports on the last
> one only, like if the query was
> WHERE myfield = 3
> (while there are rows with myfield = 1 and 2 as well...)
> 
> This is happening only if using the mapinfo attribute index on 2.1 (was
> working on 1.x). If I manually remove the index files the query executes
> correctly.
> 

Ah that's indeed a regression. I've just fixed it per
https://trac.osgeo.org/gdal/ticket/6798

You can workaround it by using = and OR : "WHERE myfield = 1 OR myfield = 2 OR myfield = 
3". That or IN (when working) have similar performance.

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/20170131/2eb15b83/attachment.html>


More information about the gdal-dev mailing list