[gdal-dev] Question about GeoPackage and views
Even Rouault
even.rouault at spatialys.com
Wed Nov 1 06:05:43 PDT 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171101/6f20d878/attachment.html>
More information about the gdal-dev
mailing list