[gdal-dev] ogr2ogr sqlite to spatialite (retain views as views)

lucvanlinden luc.vanlinden at gmail.com
Fri Jun 30 08:51:19 PDT 2017


I was testing the ogr2ogr from sqlite to spatialite.

The sqlite source file is an FDO type (with geometry_columns &
spatial_ref_sys tables). 
Also the encoding is FGF, but we know ogr can deal with this.

Our sqlite file has spatial tables and non spatial tables.
We have the config options SQLITE_LIST_ALL_TABLES set in the windows

The sqlitefile contains views (spatial and non spatial view).

The spatial views have an entry in geometry_columns metadata table.

Running the OGR2OGR -f sqlite targetfile sourcefile -dsco SPATIALITE=YES we

- the views become populated tables (and not views anymore)
- the ex-spatial-view tables (source spatial view now table) are properly
created as spatial tables
- the ex spatial tables re converted as ordanary tables with "fdo_' prefix,
no entry in the geometry columns, although the geomtry is correctly encoded.

- a side effect it seems to have difficulties with FID columns in the views
(used -unsetFID to bypass but are still wondered)

My question short is how to use ogr2ogr to properly change an (fdo) sqlite
file to spatial lite?
How to do this when having spatial and non-spatial tables?
How to do this when having spatial views and non-spatial views?

should this not be possible straightforward, it would be helpfull to know
the limitations, constraints and possible workarounds or post process steps,
would they be required.

Thanks and regards


View this message in context: http://osgeo-org.1560.x6.nabble.com/ogr2ogr-sqlite-to-spatialite-retain-views-as-views-tp5326273.html
Sent from the GDAL - Dev mailing list archive at Nabble.com.

More information about the gdal-dev mailing list