On vendredi 27 décembre 2019 19:22:01 CET Jakob Miksch wrote: > Dear list, > > I found a unexpected behavior of the SQLITE dialect. See this example > where I access ten features of a remote GeoJSON: > > ogr2ogr \ > -dialect SQLITE \ > -sql "SELECT * FROM chapters LIMIT 10" \ > -f GPKG output.gpkg \ > https://raw.githubusercontent.com/maptime/maptime.github.io/master/_data/cha > pters.json > > The resulting layername with SQLITE dialect is "SELECT". In contrast, > with OGRSQL dialect, the resulting layername is "chapters" - which is > more logical to me. > > Any ideas why this behavior is different between SQLITE and OGRSQL dialect?
OGRSQL parses the SQL, so it knows the SQL is about selecting in a given layer. In the SQLite case, the SQL is mostly forwarded to SQLite and we don't really try if we select from a single layer, or do something more complicated like a join etc Adding "-nln chapers" will make it work as you expect. Even -- Spatialys - Geospatial professional services http://www.spatialys.com _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
