[gdal-dev] Schema of gpkg_metadata in Geopackage

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

[gdal-dev] Schema of gpkg_metadata in Geopackage

jratike80

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. 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.

 

-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: Schema of gpkg_metadata in Geopackage

Even Rouault-2

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


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

Re: Schema of gpkg_metadata in Geopackage

jratike80

Hi,


Our document

http://www.gdal.org/drv_geopackage.html says that gpkg driver targets standard version 1.0/1.0.1. For me it seems that starting from GDAL 2.2 the target is version 1.2, it that right?


-Jukka Rahkonen-


Lähettäjä: Even Rouault <[hidden email]>
Lähetetty: 23. elokuuta 2017 16:55
Vastaanottaja: [hidden email]
Kopio: Rahkonen Jukka (MML)
Aihe: Re: [gdal-dev] Schema of gpkg_metadata in Geopackage
 

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


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

Re: Schema of gpkg_metadata in Geopackage

Even Rouault-2

On jeudi 24 août 2017 06:19:19 CEST Rahkonen Jukka (MML) wrote:

> Hi,

>

>

> Our document

>

> http://www.gdal.org/drv_geopackage.html says that gpkg driver targets

> standard version 1.0/1.0.1. For me it seems that starting from GDAL 2.2 the

> target is version 1.2, it that right?

 

Not completely. Good point. I've adjusted the doc per:

https://trac.osgeo.org/gdal/changeset/39928

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


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