Skip to content

Commit

Permalink
Merge pull request opengeospatial#447 from jyutzler/i444
Browse files Browse the repository at this point in the history
opengeospatial#444 enforce match between srs_ids
  • Loading branch information
jyutzler authored Jun 18, 2018
2 parents b6fa351 + f0b8248 commit 29b1c11
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/1_base.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ A GeoPackage file SHALL include a `gpkg_contents` table per table <<gpkg_content
|`min_y` |DOUBLE |Bounding box minimum northing or latitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates. |yes | |
|`max_x` |DOUBLE |Bounding box maximum easting or longitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates.|yes | |
|`max_y` |DOUBLE |Bounding box maximum northing or latitude for all content in table_name. If tiles, this is informational and the tile matrix set should be used for calculating tile coordinates.|yes | |
|`srs_id` |INTEGER |Spatial Reference System ID: `gpkg_spatial_ref_sys.srs_id`; when `data_type` is features, SHALL also match `gpkg_geometry_columns.srs_id`; When data_type is tiles, SHALL also match `gpkg_tile_matrix_set.srs_id` |yes | |FK
|`srs_id` |INTEGER |Spatial Reference System ID: `gpkg_spatial_ref_sys.srs_id`|yes | |FK
|=======================================================================

See <<gpkg_contents_sql>>.
Expand Down Expand Up @@ -261,3 +261,8 @@ The bounding box (`min_x`, `min_y`, `max_x`, `max_y`) provides an informative bo
====
Values of the `gpkg_contents` table `srs_id` column SHALL reference values in the `gpkg_spatial_ref_sys` table `srs_id` column.
====

[NOTE]
===========
When `data_type` is "features", the `srs_id` also matches `gpkg_geometry_columns.srs_id` (see <<r146>>). When `data_type` is "tiles", the `srs_id` also matches `gpkg_tile_matrix_set.srs_id` (see <<r147>>).
===========
7 changes: 7 additions & 0 deletions spec/2a_features.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ The `geometry_type_name` value in a `gpkg_geometry_columns` row SHALL be one of
The `srs_id` value in a `gpkg_geometry_columns` table row SHALL be an `srs_id` column value from the `gpkg_spatial_ref_sys` table.
====

[[r146]]
[caption=""]
.Requirement 146
====
The `srs_id` value in a `gpkg_geometry_columns` table row SHALL match the `srs_id` column value from the corresponding row in the `gpkg_contents` table.
====

[[r27]]
[caption=""]
.Requirement 27
Expand Down
7 changes: 7 additions & 0 deletions spec/2b_tiles.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ The gpkg_tile_matrix_set table SHALL contain one row record for each tile pyrami
Values of the `gpkg_tile_matrix_set` `srs_id` column SHALL reference values in the `gpkg_spatial_ref_sys` `srs_id` column.
====

[[r147]]
[caption=""]
.Requirement 147
====
The `srs_id` value in a `gpkg_tile_matrix_set` table row SHALL match the `srs_id` column value from the corresponding row in the `gpkg_contents` table.
====

[[tile_matrix]]
==== Tile Matrix

Expand Down
22 changes: 22 additions & 0 deletions spec/annexes/ats.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,17 @@ Note: Some of these tests require a spatial engine or custom code beyond simple
|*Test Type* |Capability
|========================================

[cols="1,5a"]
|========================================
|*Test Case ID* |+/opt/features/geometry_columns/data/data_values_srs_id_match+
|*Test Purpose* |Verify that the `srs_id` column values are consistent between `gpkg_geometry_columns` and `gpkg_contents`.
|*Test Method* |
. SELECT a.srs_id, b.srs_id FROM gpkg_geometry_columns a, gpkg_contents b WHERE a.table_name = b.table_name
. Fail if returns any rows have non-matching SRS IDs
|*Reference* |Clause 2.1.5.1.2 Req 146:
|*Test Type* |Capability
|========================================

[cols="1,5a"]
|========================================
|*Test Case ID* |+/opt/features/geometry_columns/data/data_values_z+
Expand Down Expand Up @@ -661,6 +672,17 @@ END;
|*Test Type* |Capability
|========================================

[cols="1,5a"]
|========================================
|*Test Case ID* |+/opt/tiles/gpkg_tile_matrix_set/data/data_values_srs_id_match+
|*Test Purpose* |Verify that the `srs_id` column values are consistent between `gpkg_tile_matrix_set` and `gpkg_contents` tables.
|*Test Method* |
. SELECT a.srs_id, b.srs_id FROM gpkg_tile_matrix_set a, gpkg_contents b WHERE a.table_name = b.table_name
. Fail if returns any rows have non-matching SRS IDs
|*Reference* |Clause 2.2.6.1.2 Req 147:
|*Test Type* |Capability
|========================================

===== Tile Matrix
====== Data
*Table Definition*
Expand Down

0 comments on commit 29b1c11

Please sign in to comment.