Skip to content

Commit

Permalink
Merge pull request #430 from jyutzler/i426
Browse files Browse the repository at this point in the history
Adding required gpkg_extensions columns
  • Loading branch information
jyutzler authored May 13, 2018
2 parents 95025b7 + ebdd183 commit f9658aa
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 11 deletions.
1 change: 1 addition & 0 deletions spec/annexes/background.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ All questions regarding this document should be directed to the editor or the co
|2018-03-29| R15| Jeff Yutzler| Annex F.11| Updating references to adopted tiled gridded coverage data extension https://github.com/opengeospatial/geopackage/pull/421, https://github.com/opengeospatial/geopackage/pull/422
|2018-04-09| R15| Jeff Yutzler| Annex F.3| Removing erroneous part of trigger https://github.com/opengeospatial/geopackage/issues/414
|2018-04-19| R15| Jeff Yutzler| Annex F.8| Updating Table 19 to fix typos and improve clarity https://github.com/opengeospatial/geopackage/pull/427
|2018-05-01| R15| Jeff Yutzler| Annexes F.8, F.9, F.10| Updating R140, R141, and R145 to indicate required rows and column values https://github.com/opengeospatial/geopackage/issue/426

|=======================================================================

Expand Down
40 changes: 39 additions & 1 deletion spec/annexes/extension_crs_wkt.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,31 @@ For GeoPackages conforming to this extension, the `gpkg_spatial_ref_sys` table S
[caption=""]
.Requirement 145
====
GeoPackages with a row in the `gpkg_extensions` table with an `extension_name` of "gpkg_crs_wkt" SHALL comply with this extension. The row SHALL have a `scope` of "read-write".
GeoPackages with a row in the `gpkg_extensions` table with an `extension_name` of "gpkg_crs_wkt" SHALL comply with this extension.
GeoPackages complying with this extension SHALL have a row in the `gpkg_extensions` table as described in <<CRSWKTExtensionTableRecord>> (below).
====

[WARNING]
=====
Requirement 145 has been updated as part of GeoPackage 1.2.1.
In 1.1.0 and 1.2.0, the `table_name` and `column_name` column values of the required `gpkg_extensions` row were inadvertently left unspecified.
While the executable test suite running on an older GeoPackage version will not generate a failure due to missing `gpkg_extensions` column values, it is recommended to update these values to comply with the updated requirement on older versions as well.
=====

[#CRSWKTExtensionTableRecord,reftext='{table-caption} {counter:table-num}']
.Extension Table Records
[cols=",,,,",options="header",]
|=============================================================================================================================================================================================================================================================================================================================================================================================
|*table_name* |*column_name* |*extension_name* |*definition* |*scope*
|`gpkg_spatial_ref_sys` |`definition_12_063` |`gpkg_crs_wkt` |_see note below_|`read-write`
|=============================================================================================================================================================================================================================================================================================================================================================================================

[NOTE]
=====
For the `definition` column, use a hyperlink that describes the current implementation of this extension.
While a URL like http://www.geopackage.org/spec/#extension_crs_wkt is acceptable, permalinks to specific versions are provided upon publication using the URL pattern http://www.geopackage.org/specMmP/#extension_crs_wkt where `M` is the major version, `m` is the minor version, and `P` is the patch. For example http://www.geopackage.org/spec121/#extension_crs_wkt is the permalink for this extension for GeoPackage 1.2.1.
=====

[float]
====== gpkg_spatial_ref_sys
[[r116]]
Expand Down Expand Up @@ -110,6 +132,22 @@ If, for a particular row, both the `definition` and `definition_12_063` columns
[float]
===== Table Data Values

[cols="1,5a"]
|========================================
|*Test Case ID* |+/extensions/crs_wkt/extensions/data_values+
|*Test Purpose* |Verify that the gpkg_extensions table has the required row.
|*Test Method* |
. SELECT table_name, column_name, scope FROM gpkg_extensions WHERE extension_name = 'gpkg_schema';
. Not testable if returns an empty result set
. Fail if there is not exactly one row
. Fail if scope is not "read-write"
. Fail if column_name is not "definition_12_063"
. Fail if table_name is not "gpkg_spatial_ref_sys"
. Pass if no fails
|*Reference* |Annex F.10 Req 145
|*Test Type:* |Capabilities
|========================================

[cols="1,5a"]
|========================================
|*Test Case ID* |+/extension_crs_wkt/data_values_default+
Expand Down
36 changes: 31 additions & 5 deletions spec/annexes/extension_metadata.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,32 @@ See <<table_definition_sql>> clause <<gpkg_metadata_reference_sql>>.
[caption=""]
.Requirement 140
====
GeoPackages with a row in the `gpkg_extensions` table with an `extension_name` of "gpkg_metadata" SHALL comply with this extension. The row SHALL have a `scope` of "read-write".
GeoPackages with rows in the `gpkg_extensions` table with an `extension_name` of "gpkg_metadata" SHALL comply with this extension.
GeoPackages complying with this extension SHALL have rows in the `gpkg_extensions` table as described in <<MetadataExtensionTableRecord>> (below).
====

[WARNING]
=====
Requirement 140 was updated as part of GeoPackage 1.2.1.
In 1.1.0 and 1.2.0, the details of required `gpkg_extensions` rows were inadvertently left unspecified.
While the executable test suite running on an older GeoPackage version will not generate a failure due to missing `gpkg_extensions` rows, it is recommended to update these rows to comply with the updated requirement on older versions as well.
=====

[#MetadataExtensionTableRecord,reftext='{table-caption} {counter:table-num}']
.Extension Table Records
[cols=",,,,",options="header",]
|=============================================================================================================================================================================================================================================================================================================================================================================================
|*table_name* |*column_name* |*extension_name* |*definition* |*scope*
|`gpkg_metadata` |null |`gpkg_metadata` |_see note below_|`read-write`
|`gpkg_metadata_reference` |null |`gpkg_metadata` |_see note below_|`read-write`
|=============================================================================================================================================================================================================================================================================================================================================================================================

[NOTE]
=====
For the `definition` column, use a hyperlink that describes the current implementation of this extension.
While a URL like http://www.geopackage.org/spec/#extension_metadata is acceptable, permalinks to specific versions are provided upon publication using the URL pattern http://www.geopackage.org/specMmP/#extension_metadata where `M` is the major version, `m` is the minor version, and `P` is the patch. For example http://www.geopackage.org/spec121/#extension_metadata is the permalink for this extension for GeoPackage 1.2.1.
=====

[float]
====== gpkg_metadata
The `md_scope` column in the `gpkg_metadata` table is the name of the applicable scope for the contents of the metadata column for a given row.
Expand Down Expand Up @@ -256,13 +279,16 @@ Every `gpkg_metadata_reference` table row `md_parent_id` column value that is NO

[cols="1,5a"]
|========================================
|*Test Case ID* |+/extensions/metadata/extensions/data_values_scope+
|*Test Purpose* |Verify that the gpkg_extensions table has the required row.
|*Test Case ID* |+/extensions/metadata/extensions/data_values+
|*Test Purpose* |Verify that the gpkg_extensions table has the required rows.
|*Test Method* |
. SELECT scope FROM gpkg_extensions WHERE extension_name = 'gpkg_metadata';
. SELECT table_name, column_name, scope FROM gpkg_extensions WHERE extension_name = 'gpkg_metadata';
. Not testable if returns an empty result set
. Fail if there are not exactly two rows
. For each row returned from step 1
.. Fail if scope is not "read-write".
.. Fail if scope is not "read-write"
.. Fail if column_name is not NULL
. Fail if either table_name entry is not present
. Pass if no fails
|*Reference* |Annex F.8 Req 140
|*Test Type:* |Capabilities
Expand Down
36 changes: 31 additions & 5 deletions spec/annexes/extension_schema.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,32 @@ See <<gpkg_data_column_constraints_sql>>.
[caption=""]
.Requirement 141
====
GeoPackages with a row in the `gpkg_extensions` table with an `extension_name` of "gpkg_schema" SHALL comply with this extension. The row SHALL have a `scope` of "read-write".
GeoPackages with rows in the `gpkg_extensions` table with an `extension_name` of "gpkg_schema" SHALL comply with this extension.
GeoPackages complying with this extension SHALL have rows in the `gpkg_extensions` table as described in <<SchemaExtensionTableRecord>> (below).
====

[WARNING]
=====
Requirement 141 was updated as part of GeoPackage 1.2.1.
In 1.1.0 and 1.2.0, the details of required `gpkg_extensions` rows were inadvertently left unspecified.
While the executable test suite running on an older GeoPackage version will not generate a failure due to missing `gpkg_extensions` rows, it is recommended to update these rows to comply with the updated requirement on older versions as well.
=====

[#SchemaExtensionTableRecord,reftext='{table-caption} {counter:table-num}']
.Extension Table Records
[cols=",,,,",options="header",]
|=============================================================================================================================================================================================================================================================================================================================================================================================
|*table_name* |*column_name* |*extension_name* |*definition* |*scope*
|`gpkg_data_columns` |null |`gpkg_schema` |_see note below_|`read-write`
|`gpkg_data_column_constraints` |null |`gpkg_schema` |_see note below_|`read-write`
|=============================================================================================================================================================================================================================================================================================================================================================================================

[NOTE]
=====
For the `definition` column, use a hyperlink that describes the current implementation of this extension.
While a URL like http://www.geopackage.org/spec/#extension_schema is acceptable, permalinks to specific versions are provided upon publication using the URL pattern http://www.geopackage.org/specMmP/#extension_schema where `M` is the major version, `m` is the minor version, and `P` is the patch. For example http://www.geopackage.org/spec121/#extension_schema is the permalink for this extension for GeoPackage 1.2.1.
=====

[float]
====== Data Columns

Expand Down Expand Up @@ -257,13 +280,16 @@ If the `gpkg_data_column_constraints` table contains rows with `constraint_type`

[cols="1,5a"]
|========================================
|*Test Case ID* |+/extensions/schema/extensions/data_values_scope+
|*Test Purpose* |Verify that the gpkg_extensions table has the required row.
|*Test Case ID* |+/extensions/schema/extensions/data_values+
|*Test Purpose* |Verify that the gpkg_extensions table has the required rows.
|*Test Method* |
. SELECT scope FROM gpkg_extensions WHERE extension_name = 'gpkg_schema';
. SELECT table_name, column_name, scope FROM gpkg_extensions WHERE extension_name = 'gpkg_schema';
. Not testable if returns an empty result set
. Fail if there are not exactly two rows
. For each row returned from step 1
.. Fail if scope is not "read-write".
.. Fail if scope is not "read-write"
.. Fail if column_name is not NULL
. Fail if either table_name entry is not present
. Pass if no fails
|*Reference* |Annex F.9 Req 141
|*Test Type:* |Capabilities
Expand Down
7 changes: 7 additions & 0 deletions spec/annexes/extension_spatialindex.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,13 @@ END;

where <t> and <c> are replaced with the names of the feature table and geometry column being indexed and <i> is replaced with the name of the feature table integer primary key column.

[WARNING]
=====
GeoPackage Versions 1.2.0 and prior have an incorrect update3 trigger that will fail in certain circumstances.
It is strongly recommended to update older GeoPackages with the correct trigger presented here.
The GeoPackage Executable Test Suite has been updated to accept either version of the trigger in older versions and to mandate the corrected version in versions after 1.2.0.
=====

[float]
===== GeoPackage SQLite Configuration

Expand Down

0 comments on commit f9658aa

Please sign in to comment.