Skip to content

Latest commit

 

History

History
153 lines (128 loc) · 5.87 KB

extension_crs_wkt.adoc

File metadata and controls

153 lines (128 loc) · 5.87 KB

WKT for Coordinate Reference Systems

Introduction

The OGC GeoPackage standard was adopted prior to the adoption of "OGC Well known text representation of Coordinate Reference Systems" [34], in 13 August, 2014. As a result, the OGC GeoPackage standard references an older document [32] which has known ambiguities that are being encountered in the field. This extension establishes a new column to contain values that conform to the new standard.

Extension Author

GeoPackage SWG, author_name gpkg.

Extension Name or Template

gpkg_crs_wkt

Extension Type

Extension of Existing Requirement in clause [spatial_ref_sys_data_table_definition].

Applicability

Applies to the gpkg_spatial_ref_sys table.

Scope

Read-write

Requirements

Table
Table Definition
Requirement 115

For GeoPackages conforming to this extension, the gpkg_spatial_ref_sys table SHALL have an additional column called definition_12_063 as per Spatial Ref Sys Table Definition and gpkg_spatial_ref_sys Table Definition SQL (CRS WKT Extension).

Table 1. Spatial Ref Sys Table Definition
Column Name Column Type Column Description Not Null Default Key

srs_name

TEXT

Human readable name of this SRS

yes

srs_id

INTEGER

Unique identifier for each Spatial Reference System within a GeoPackage

yes

PK

organization

TEXT

Case-insensitive name of the defining organization e.g. EPSG or epsg

yes

organization_coordsys_id

INTEGER

Numeric ID of the Spatial Reference System assigned by the organization

yes

definition

TEXT

Well-known Text [32] Representation of the Spatial Reference System

yes

'undefined'

description

TEXT

Human readable description of this SRS

no

definition_12_063

TEXT

Well-known Text [34] Representation of the Spatial Reference System

yes

'undefined'

Table Data Values
Requirement 116

Values of the definition_12_063 column SHALL be constructed per the WKT syntax in [34].

Requirement 117

At least one definition column SHALL be defined with a valid definition unless the value of the srs_id column is 0 or -1. Both columns SHOULD be defined. If it is not possible to produce a valid [32] definition then the value of the definition column MAY be undefined. If it is not possible to produce a valid [34] definition then the value of the definition_12_063 column MAY be undefined.

If, for a particular row, both the definition and definition_12_063 columns are populated, the value in the definition_12_063 column takes priority.

Abstract Test Suite

Table Definition

Table Definition

Test Case ID

/extension_crs_wkt/table_def

Test Purpose

Verify that the gpkg_spatial_ref_sys table exists and has the correct definition. Extends /base/core/gpkg_spatial_ref_sys/data/table_def.

Test Method

  1. PRAGMA table_info('gpkg_spatial_ref_sys')

  2. Fail if returns an empty result set

  3. Fail if result set does not include a column named 'definition_12_063' or if the column is not of type 'TEXT', notnull 1, and dflt_value 'undefined'.

  4. Pass if no failures.

Reference

Annex F.10 Req 115

Test Type

Basic

Table Data Values

Test Case ID

/extension_crs_wkt/data_values_default

Test Purpose

Verify that the gpkg_spatial_ref_sys table contains the required default contents. Extends /base/core/gpkg_spatial_ref_sys/data_values_default.

Test Method

  1. SELECT organization, organization_coordsys_id, definition, definition_12_063 FROM gpkg_spatial_ref_sys WHERE srs_id = -1

    1. Confirm that this returns "NONE" -1 "undefined" "undefined"

  2. SELECT srs_id, organization, organization_coordsys_id, definition, definition_12_063 FROM gpkg_spatial_ref_sys WHERE srs_id = 0

    1. Confirm that this returns "NONE" 0 "undefined" "undefined"

  3. SELECT definition FROM gpkg_spatial_ref_sys WHERE organization IN ("epsg","EPSG") AND organization_coordsys_id 4326

    1. Confirm that this is a valid CRS

  4. SELECT definition_12_063 FROM gpkg_spatial_ref_sys WHERE organization IN ("epsg","EPSG") AND organization_coordsys_id 4326

    1. Confirm that this is a valid 12-063 CRS

  5. Pass if tests 1-4 are met

  6. Fail otherwise

Reference

Annex F.10 Req 116

Test Type

Capability

Test Case ID

/extension_crs_wkt/data_values_required

Test Purpose

Verify that the spatial_ref_sys table contains rows to define all srs_id values used by features and tiles in a GeoPackage. Extends /base/core/gpkg_spatial_ref_sys/data_values_required.

Test Method

  1. SELECT definition, definition_12_063 FROM gpkg_spatial_ref_sys WHERE srs_id NOT IN (0, -1)

  2. For each result

    1. Fail if both definition values are 'undefined'

  3. Pass if no failures

Reference

Annex F.10 Req 117

Test Type

Capability

Table Definition SQL

gpkg_spatial_ref_sys
gpkg_spatial_ref_sys Table Definition SQL (CRS WKT Extension)
CREATE TABLE gpkg_spatial_ref_sys (
  srs_name TEXT NOT NULL,
  srs_id INTEGER NOT NULL PRIMARY KEY,
  organization TEXT NOT NULL,
  organization_coordsys_id INTEGER NOT NULL,
  definition  TEXT NOT NULL DEFAULT 'undefined',
  description TEXT,
  definition_12_063 TEXT NOT NULL DEFAULT 'undefined'
);