[gdal-dev] GPKG: CREATE TABLE AS not working as expected

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Thu Dec 28 14:50:39 PST 2017


Tobias Wendorff wrote
> I just tried it, but the target table has the same order as the
> original table:
> 
> ogr2ogr -update test.gpkg test.gpkg -sql "SELECT * FROM mytable ORDER BY
> ST_GeoHash(ST_Transform(ST_Envelope(geom), 4326), 10)" -nln sorted
> 
> This gives me the correct sorting:
> ogrinfo -ro test.gpkg -sql "SELECT * FROM mytable ORDER BY
> ST_GeoHash(ST_Transform(ST_Envelope(geom), 4326), 10)"

Hi, 

I would try with SQL that does not select the FID instead of "select *". See
preserve_fid in http://www.gdal.org/ogr2ogr.html. Not guaranteed to work.

-Jukka Rahkonen-





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list