[gdal-dev] OGR Spatialite to geopackage

Even Rouault even.rouault at spatialys.com
Wed Jun 13 01:49:46 PDT 2018


On mercredi 13 juin 2018 01:36:18 CEST jratike80 wrote:
> Even Rouault-2 wrote
> 
> > There isn't a concept of view in the OGR model, so they are presented as
> > tables and converted as such. In that case this is a technical Spatialite
> > table that makes no sense in GPKG, so you should exclude it from the
> > conversion by explicitly listing the tables/views you want to convert.
> 
> Hi,
> 
> Sorry, but this time your answer does not make sense. I can convert with
> success a full featured SpatiaLite database (created by GDAL) with two
> tables and a spatial view (that gets converted into a normal spatial table)
> into GPKG with a simple command

What I meant is that in OGR, on the read side, views and tables are presented 
as OGR layers, and on the write side, they are written as tables. So the 
concept of view is lost in the translation. And anyway in the GPKG case, the 
concept of spatial view isn't really well supported by the standard currently.
> 
> ogr2ogr -f gpkg output.gpkg input.sqlite.
> 
> My source SpatiaLite db does include the "geom_cols_ref_sys" view, with this
> DLL
> 
> CREATE VIEW geom_cols_ref_sys AS
> SELECT f_table_name, f_geometry_column, geometry_type,
> coord_dimension, spatial_ref_sys.srid AS srid,
> auth_name, auth_srid, ref_sys_name, proj4text, srtext
> FROM geometry_columns, spatial_ref_sys
> WHERE geometry_columns.srid = spatial_ref_sys.srid
> 
> So my GDAL can handle the system view  "geom_cols_ref_sys" while the GDAL
> that Luc has obviously can't. I suppose we have somehow different builds,
> mine comes from the gisinternals developer builds.

I presumed that Luc had specified -oo LIST_ALL_TABLES=YES (which actually list 
views as well), but apprently he didn't, so yes that's a bit mysterious


-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list