[gdal-dev] How to recognize FDO style SQLite db?
even.rouault at spatialys.com
Fri May 27 05:40:28 PDT 2016
On Friday 27 May 2016 12:09:42 Jukka Rahkonen wrote:
> User in gis.stackoverflow tried to use SQL "select ST_Union(geometry)" for
> the Natural Earth SQLite db file from
> The query yields an empty geometry because the NE database is written with
> FDO geometries instead of SpatiaLite geometries. What I wonder is that does
> GDAL user have any simple mean for getting informed if SQLite db is FDO or
This probably doesn't completely fullfil the requirement of "simple mean" ;-),
but if you enable the debug messages from GDAL with "--debug on", you should
"OGR style SQLite DB found !"
whereas a Spatialite one will trigger :
"SpatiaLite v4 DB found !" (or "Spatialite DB found" for spatialite 2 or 3)
> If SpatiaLite is present a clever enough user can use ogrinfo
> and check from
> https://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html#p16fdo that
> value 2 is returned in case when "both tables exist, and their layout is the
> one used by FDO/OGR"
> ogrinfo -sql "select CheckSpatialMetaData()"
> INFO: Open of `natural_earth_vector.sqlite'
> using driver `SQLite' successful.
> Layer name: SELECT
> Geometry: None
> Feature Count: 1
> Layer SRS WKT:
> CheckSpatialMetaData(): Integer (0.0)
> CheckSpatialMetaData() (Integer) = 2
> However, the one who knows to do that must be somewhat advanced GDAL and
> Spatialite user.
> -Jukka Rahkonen-
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
Spatialys - Geospatial professional services
More information about the gdal-dev