[gdal-dev] Schema of gpkg_metadata in Geopackage

Even Rouault even.rouault at spatialys.com
Wed Aug 23 06:55:48 PDT 2017


On mercredi 23 août 2017 13:33:07 CEST Rahkonen Jukka (MML) wrote:
> Hi,
> 
> GDAL 2.3-dev creates gpkg_metadata table as
> 
> CREATE TABLE gpkg_metadata (id INTEGER CONSTRAINT m_pk PRIMARY KEY ASC NOT
> NULL UNIQUE,md_scope TEXT NOT NULL DEFAULT 'dataset',md_standard_uri TEXT
> NOT NULL,mime_type TEXT NOT NULL DEFAULT 'text/xml',metadata TEXT NOT NULL
> DEFAULT '');
> 
> In GPKG standard v. 1.0.1 and 1.2 the SQL is
> 
> 
> CREATE TABLE gpkg_metadata (
> 
> id INTEGER CONSTRAINT m_pk PRIMARY KEY ASC NOT NULL,
> 
> md_scope TEXT NOT NULL DEFAULT 'dataset',
> 
> md_standard_uri TEXT NOT NULL,
> 
> mime_type TEXT NOT NULL DEFAULT 'text/xml',
> 
> metadata TEXT NOT NULL
> )
> 
> It seems that UNIQUE was removed in 1.0.1 corrigendum.

You've good eyes ;-) I've just removed UNIQUE in trunk to align with latest specs, but I guess 
that doesn't make a difference in practice (and validation checks are fine with or without 
UNIQUE). A primary key is necessarily unique.

> I am not sure about
> what to think about having "metadata TEXT NOT NULL DEFAULT ''". In table 14
> in standard version 1.0.1 and also in table 32 in standard v. 1.2 there is
> an empty string as a default value but it does not reflect to the CREATE
> TABLE example.

In the live spec at http://www.geopackage.org/spec/#gpkg_metadata_sql , the example is 
metadata TEXT NOT NULL DEFAULT '' . Spec was fixed per
https://github.com/opengeospatial/geopackage/issues/243


But I see the http://www.geopackage.org/spec/#metadata_example_appendix is wrong...
Filed as https://github.com/opengeospatial/geopackage/issues/382


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/20170823/7d89eeb8/attachment-0001.html>


More information about the gdal-dev mailing list