[gdal-dev] Question about GeoPackage and views

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[gdal-dev] Question about GeoPackage and views

jratike80

Hi,

 

I was reading the GeoPackage standard and only now read carefully the requirement 29

 

“A GeoPackage MAY contain tables or updateable views containing vector features. Every such

feature table or view in a GeoPackage SHALL have a column with column type INTEGER and

'PRIMARY KEY AUTOINCREMENT' column constraints”

 

Should I really read this so that GeoPackage MUST NOT contain non-updateable views, or at least they cannot be included in the standard  gpkg_contents and gpkg_geometry_columns tables but used only through some extension?

 

Writable views in SQLite are not too simple to create, see for example https://www.gaia-gis.it/fossil/libspatialite/wiki?name=writable-view

However, even read-only views could be very handy from the users and data providers point of view J.

 

-Jukka Rahkonen-

 


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|

Re: Question about GeoPackage and views

Even Rouault-2

On mercredi 1 novembre 2017 12:57:35 CET Rahkonen Jukka (MML) wrote:

> Hi,

>

> I was reading the GeoPackage standard and only now read carefully the

> requirement 29

>

> "A GeoPackage MAY contain tables or updateable views containing vector

> features. Every such feature table or view in a GeoPackage SHALL have a

> column with column type INTEGER and 'PRIMARY KEY AUTOINCREMENT' column

> constraints"

>

> Should I really read this so that GeoPackage MUST NOT contain non-updateable

> views, or at least they cannot be included in the standard gpkg_contents

> and gpkg_geometry_columns tables but used only through some extension?

 

Hi Jukka,

 

Good question. There's a related ticket in

https://github.com/opengeospatial/geopackage/issues/207

 

Anyway it is difficult currently to support updatable or non-updatable views since there's no reliable way to figure out the FID column for a view, as there's no equivalent of Spatialite's views_geometry_columns

 

GDAL's implementation:

"""Starting with GDAL 2.2, in the case of the columns in the SELECT clause of the view acts a integer primary key, then it can be recognized by OGR as the FID column of the view, provided it is renamed as OGC_FID. Selecting a feature id from a source table without renaming will not be sufficient, since due to joins this feature id could appear several times. Thus the user must explicitly acknowledge that the column is really a primary key."""

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/gdal-dev