Open Geospatial Consortium

Submission Date: 2021-07-06

Approval Date:   2021-11-24

Publication Date:   2022-05-02

External identifier of this OGC® document: http://www.opengis.net/doc/IS/geopackage-gr/1.1

Internal reference number of this OGC® document:    17-066r2

Version: 1.1

Category: OGC® Implementation

Editor:   Carl Reed

OGC GeoPackage Extension for Tiled Gridded Coverage Data

Copyright notice

Copyright © 2022 Open Geospatial Consortium

To obtain additional rights of use, visit http://www.opengeospatial.org/legal/

Warning

This document is an OGC Member endorsed international standard. This document is available on a royalty free, non-discriminatory basis. Recipients of this document are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.

Document type:    OGC® Standard

Document subtype:    Extension

Document stage:    Approved

Document language:  English

License Agreement

Permission is hereby granted by the Open Geospatial Consortium, ("Licensor"), free of charge and subject to the terms set forth below, to any person obtaining a copy of this Intellectual Property and any associated documentation, to deal in the Intellectual Property without restriction (except as set forth below), including without limitation the rights to implement, use, copy, modify, merge, publish, distribute, and/or sublicense copies of the Intellectual Property, and to permit persons to whom the Intellectual Property is furnished to do so, provided that all copyright notices on the intellectual property are retained intact and that each person to whom the Intellectual Property is furnished agrees to the terms of this Agreement.

If you modify the Intellectual Property, all copies of the modified Intellectual Property must include, in addition to the above copyright notice, a notice that the Intellectual Property includes modifications that have not been approved or adopted by LICENSOR.

THIS LICENSE IS A COPYRIGHT LICENSE ONLY, AND DOES NOT CONVEY ANY RIGHTS UNDER ANY PATENTS THAT MAY BE IN FORCE ANYWHERE IN THE WORLD.

THE INTELLECTUAL PROPERTY IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS NOTICE DO NOT WARRANT THAT THE FUNCTIONS CONTAINED IN THE INTELLECTUAL PROPERTY WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION OF THE INTELLECTUAL PROPERTY WILL BE UNINTERRUPTED OR ERROR FREE. ANY USE OF THE INTELLECTUAL PROPERTY SHALL BE MADE ENTIRELY AT THE USER’S OWN RISK. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ANY CONTRIBUTOR OF INTELLECTUAL PROPERTY RIGHTS TO THE INTELLECTUAL PROPERTY BE LIABLE FOR ANY CLAIM, OR ANY DIRECT, SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM ANY ALLEGED INFRINGEMENT OR ANY LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR UNDER ANY OTHER LEGAL THEORY, ARISING OUT OF OR IN CONNECTION WITH THE IMPLEMENTATION, USE, COMMERCIALIZATION OR PERFORMANCE OF THIS INTELLECTUAL PROPERTY.

This license is effective until terminated. You may terminate it at any time by destroying the Intellectual Property together with all copies in any form. The license will also terminate if you fail to comply with any term or condition of this Agreement. Except as provided in the following sentence, no such termination of this license shall require the termination of any third party end-user sublicense to the Intellectual Property which is in force as of the date of notice of such termination. In addition, should the Intellectual Property, or the operation of the Intellectual Property, infringe, or in LICENSOR’s sole opinion be likely to infringe, any patent, copyright, trademark or other right of a third party, you agree that LICENSOR, in its sole discretion, may terminate this license without any compensation or liability to you, your licensees or any other party. You agree upon termination of any kind to destroy or cause to be destroyed the Intellectual Property together with all copies in any form, whether held by you or by any third party.

Except as contained in this notice, the name of LICENSOR or of any other holder of a copyright in all or part of the Intellectual Property shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Intellectual Property without prior written authorization of LICENSOR or such copyright holder. LICENSOR is and shall at all times be the sole entity that may authorize you or any third party to use certification marks, trademarks or other special designations to indicate compliance with any LICENSOR standards or specifications. This Agreement is governed by the laws of the Commonwealth of Massachusetts. The application to this Agreement of the United Nations Convention on Contracts for the International Sale of Goods is hereby expressly excluded. In the event any provision of this Agreement shall be deemed unenforceable, void or invalid, such provision shall be modified so as to make it valid and enforceable, and as so modified the entire Agreement shall remain in full force and effect. No decision, action or inaction by LICENSOR shall be construed to be a waiver of any rights or remedies available to it.

i. Abstract

The "GeoPackage Extension for Tiled Gridded Coverage Data” (TGCE) extension (previously titled Elevation Extension) defines how to encode and store tiled regular gridded data, such as a digital elevation model, in a GeoPackage. The tiles contain values, such as elevation, temperature or pressure, and the extension defines two encodings. The PNG encoding uses PNG files to store 16-bit integer values and a scale and offset may be applied to fine-tune the coverage range. To support 32-bit floating point data or binary data, the extension also defines a TIFF encoding. In this encoding, TIFF files are used to store IEEE floating point or a binary data type where the SampleFormat has a value of either 1 (unsigned integer) or 2 (signed integer) AND the BitsPerSample is either 8, 16, or 32. To simplify development, this encoding constrains many of the TIFF options to the minimal set needed to meet the floating-point requirement. The extension also defines two ancillary data tables: one for regular gridded coverages and one for tiles.

ii. Keywords

The following are keywords to be used by search engines and document catalogues.

ogcdoc, OGC document, geopackage, cis, coverage, grid, tgce

iii. Preface

"GeoPackage Extension for Tiled Gridded Coverage Data” was initially documented in the GeoPackage 1.2 draft standard as Annex F.11 Tiled Gridded Elevation Data. In 2016, the GeoPackage Elevation Extension was tested and refined as part of the OGC GeoPackage Elevation Extension Interoperability Experiment [1]. Based on the results of the Interoperability Experiment, the candidate extension was edited and submitted to the OGC Architecture Board for review and consideration. The OGC Architecture Board recommended that the Elevation extension not be an Annex of the core GeoPackage standard but instead should be a separate document that aligns to other parts of the OGC Standards Baseline. In the ISO 19123 Schema for Coverage Geometry standard and in the OGC Coverage Implementation Schema, this type of regular gridded data is classed as grid-regular [2]. This document is the result of implementing that recommendation. As part of the work, the scope of the extension was expanded from just elevation data to any regular gridded coverage data.

NOTE and WARNING: Any implementations of the candidate standard prior to August 2017 may need to be revised to comply with changes to Table 1: Coverage Ancillary Table Definitions. Specifically, “pixel_encoding” has been changed to “grid_cell_encoding” and additional columns have been added to the Table.

The following information is provided in compliance with the GeoPackage Extension template as defined in Annex E: GeoPackage Extension Template of the GeoPackage Standard. These additional introductory clauses are not elements in the standard OGC document template.

  • Extension Author: GeoPackage SWG, author_name of gpkg will be assigned if this extension is adopted by OGC.

  • Extension Name or Template: 2d_gridded_coverage, alias of gpkg_2d_gridded_coverage will be assigned if this extension is adopted by OGC.

  • Extension Type: This extension has a dependency on Clause 2.2[3] of the core GeoPackage standard.

  • Applicability: This GeoPackage Gridded Coverages extension can be used to store any gridded coverage in a GeoPackage data store. This extension specifies requirements and optional clauses for additional GeoPackage tables as well as requirements for extensions to tile pyramid user data tables (Clause 2.2.8 of the GeoPackage core) that can be used to hold tiled, gridded coverage data.

  • Scope: read-write

Attention is drawn to the possibility that some of the elements of this document may be the subject of patent rights. The Open Geospatial Consortium shall not be held responsible for identifying any or all such patent rights.

Recipients of this document are requested to submit, with their comments, notification of any relevant patent claims or other intellectual property rights of which they may be aware that might be infringed by any implementation of the standard set forth in this document, and to provide supporting documentation.

iv. Submitting organizations

The following organizations submitted this Document to the Open Geospatial Consortium (OGC):

Organization name(s)

The OGC GeoPackage Standards Working Group:

v. Submitters

All questions regarding this submission should be directed to the editor or the submitters:

Name

Affiliation

Chris Clarke

Compusult

Carl Reed

Carl Reed and Associates

Jeff Yutzler

Image Matters

vi. Future Work

A single channel coverage can cover a lot of data types, but not all data types. In particular, there are data coverages that are comprised of multiple data values per grid cell, and designed that you need all the data elements to make use of this type of data. For example, a layer that describes current wind conditions would be both wind direction and speed. In this case, it would be difficult to use either coverage without the other. More details are provided in GeoPackage Git Issue 553.

1. Scope

This extension defines the rules for encoding and storing 16-bit and 32-bit tiled regular grid coverages composed of regular gridded data, such as elevation and temperature, in a GeoPackage. This capability may be used to support use cases such as the following:

  • Visualization

    • 2D and 3D Draping and Texture mapping

    • 2D (hill shade, color relief, slope, aspect)

    • 3D (supporting changing view angles and level of detail)

  • Analysis

    • Contouring of any continuous coverage

    • Volume computations

    • Slicing for 3D printers and other applications

    • Viewshed and line-of-sight

    • Cross-country mobility (off-road routing)

    • Site suitability and planning (slope analysis such as helicopter landing zones)

    • 3D geometry representations of features (ground-based, airspace)

    • Terrain association (associating images to mapped locations)

    • Augmented reality training

    • Mesh generation

    • Ancillary data for classification tools

    • Trend Analysis

    • “Heat” maps

    • Drainage calculations

    • Profiling

This extension was designed to be relatively easy to implement and to be suitable for a wide variety of computing environments, including the mobile/handheld computing environment[4].

2. Conformance

This standard defines requirements for a Regular Grid Coverage, such as an elevation matrix, to be stored in a GeoPackage.

Conformance with this standard shall be checked using all the relevant tests specified in Annex A (normative) of this document. The framework, concepts, and methodology for testing, and the criteria to be achieved to claim conformance are specified in the OGC Compliance Testing Policies and Procedures and the OGC Compliance Testing web site[5].

3. References

The following normative documents contain provisions that, through reference in this text, constitute provisions of this document. For dated references, subsequent amendments to, or revisions of, any of these publications do not apply. For undated references, the latest edition of the normative document referred to applies.

ISO: ISO 12639, TIFF™ Revision 6.0 Final, June 3, 1992 Adobe® Systems Incorporated, 2004

ISO / OGC: ISO 19162:2015 Geographic information — Well-known text representation of coordinate reference systems. Also OGC 12-063r5. http://docs.opengeospatial.org/is/12-063r5/12-063r5.html, 2015

OGC: OGC 01-009 Implementation Specification: Coordinate Transformation Services Revision 1.0 http://portal.opengeospatial.org/files/?artifact_id=999, 2001

OGC: GC 08-015r2, Abstract Specification Topic 2 – Spatial Referencing by Coordinates, (ISO 19111), 2010

OGC: OGC 07-011, Abstract Specification Topic 6: Schema for coverage geometry and functions, (ISO 19123), 2006

OGC: OGC 15-115r3 CDB Core Standard: Model and Physical Data Store Structure https://portal.opengeospatial.org/files/?artifact_id=72712, 2016

OGC: OGC 09-146r6 Coverage Implementation Schema 1.1 http://docs.opengeospatial.org/is/09-146r6/09-146r6.html, 2017

OGC: OGC 12-128r12, GeoPackage Encoding Standard 1.1 http://www.geopackage.org/spec110/, 2015

OGC: OGC 06-121r9 Web Services Common Standard, version 2.0.0, 2010

OGC: OGC 08-094r1, OGC® SWE Common Data Model Encoding Standard, version 2.0, 2011

Adobe Systems Incorporated: Adobe TIFF ™ Revision 6.0 Final, ftp://download.osgeo.org/libtiff/doc/TIFF6.pdf, 1992

4. Terms and Definitions

This document uses the terms defined in OGC Policy Directive 49, which is based on the ISO/IEC Directives, Part 2, Rules for the structure and drafting of International Standards. In particular, the word “shall” (not “must”) is the verb form used to indicate a requirement to be strictly followed to conform to this standard and OGC documents do not use the equivalent phrases in the ISO/IEC Directives, Part 2.

This document also uses terms defined in the OGC Standard for Modular specifications [OGC 08-131r3], also known as the ‘ModSpec’. The definitions of terms such as standard, specification, requirement, and conformance test are provided in the ModSpec.

For the purposes of this document, the following additional terms and definitions apply [6].

Continuous coverage

coverage that returns different values for the same feature attribute at different direct positions within a single spatial object, temporal object or spatiotemporal object in its domain. [ISO 19123]

Note

A continuous (grid) coverage has values not only at the direct positions themselves, but also at any location between the direct positions. In other words, an application can apply interpolation methods to obtain values between direct positions.

Coordinate Reference System (CRS)

A coordinate system that is related to the real world by a datum. [ISO 19111]

Coverage

A coverage is a function that describe characteristics of real-world phenomena that vary over space and/or time. Typical examples are temperature, elevation and precipitation. A coverage is typically represented as a data structure containing a set of such values, each associated with one of the elements in a spatial, temporal or spatiotemporal domain. Typical spatial domains are point sets (e.g. sensor locations), curve sets (e.g. contour lines), grids (e.g. orthoimages, elevation models), etc. A property whose value varies as a function of time may be represented as a temporal coverage or time-series [ISO-19109].

Note

A feature that acts as a function to return values from its range for any direct position within its spatiotemporal domain, as defined in OGC Abstract Topic 6 [ISO 19123].

Discrete Coverage

Coverage that returns the same feature attribute values for every direct position within any single spatial object, temporal object, or spatiotemporal object in its domain [ISO 19123/OGC Topic 6]

Depth

Distance of a point from a chosen reference surface measured upward along a line perpendicular to that surface. [ISO 19111]

Note

Note 1: The line direction may be straight, or be dependent on the Earth’s gravity field or other physical phenomena.
Note 2: A depth above the vertical reference surface will have a negative value.

Direct Position

The position described by a single set of coordinates within a coordinate reference system. [ISO 19123]

Elevation

Synonym for “height”

Grid

Grid network composed of two or more sets of curves in which the members of each set intersect the members of the other sets in an algorithmic way. NOTE: The curves partition a space into grid cells. [ISO 19123]

Grid point

Point located at the intersection of two or more curves in a grid. [ISO 19123:2005]

Height

Distance of a point from a chosen reference surface measured upward along a line perpendicular to that surface. [ISO 19111] Note 1 to entry: A height below the reference surface will have a negative value, which would embrace both gravity-related heights and ellipsoidal heights.

Regular grid

Grid whose grid lines have a constant distance along each grid axis

5. Conventions

This section provides details and examples for any conventions used in the document. Examples of conventions are symbols, abbreviations, use of XML schema, or special notes regarding how to read the document.

5.1. Identifiers

The normative provisions in this standard are denoted by the URI

All requirements and conformance tests that appear in this document are denoted by partial URIs which are relative to this base. The three letter acronym “Req” is equivalent to the above URI. NOTE: The abbreviation “gr” stands for grid-regular.

6. Short introduction to coverages and CIS

This section is extracted from the OGC Coverage Implementation Schema (CIS) standard. [7]. Please note that This GeoPackage extension references CIS 1.1 and not CIS 1.0.]

The GeoPackage tile grid extension is conceptually grounded in the OGC Coverage Implementation Schema (CIS). CIS specifies the OGC coverage model by establishing a concrete, interoperable, conformance-testable coverage structure. CIS is based on the abstract concepts of OGC Abstract Topic 6 (which is identical to ISO 19123:2005). ISO 19123 specifies an abstract model for coverages which is not per se interoperable. In other words, many different and incompatible implementations of the abstract model are possible. CIS, on the other hand, is interoperable in the sense that coverages can be conformance tested, regardless of their data format encoding, down to the level of single grid cell.

Coverages can be encoded in any suitable format (such as GML, JSON, GeoTIFF, TIFF, PNG or Net­CDF) and can be partitioned, e.g., for a time-interleaved representation. Coverages are independent from service definitions and, therefore, can be accessed through a variety of OGC services types, such as the Web Coverage Service (WCS) Standard. The coverage structure can serve a wide range of coverage application domains, thereby contributing to harmonization and interoperability between and across these domains.

Within the GeoPackage, a grid of elevations is a type of a regular gridded coverage (CIS::GeneralGridCoverage, class grid-regular) that has a grid as their domain set describing the direct positions in multi-dimensional coordinate space, depending on the type of grid. In the class grid-regular, simple equidistant grids are established. [8] This is illustrated in Figure 1.

Illustration of a regular gridded coverage

image

6.1. A note on “elevation”

Work on this extension originally focused on requirements for encoding a regular grid of elevations in a GeoPackage. The original (draft) version of this extension did not provide a definition of “elevation”. This version does include a very general definition of the term “elevation” as specified in ISO 19111:Spatial Referencing by Coordinates. This definition is almost identical to those found in a number of other documents, such as definitions for elevation (height) found in the Journal of Photogrammetry, standards documents from the International Civil Aviation Organization, American Society for Photogrammetry and Remote Sensing (ASPRS), the World Meteorological Organization, and the Federal Geographic Data Committee (FGDC). However, many of the definitions provided by those organizations take an earth centric view. OGC standards are being used for other planetary bodies. As such, this document uses a more general definition.

Variations of the definition used in this document are often provided to meet domain specific requirements. As an example, ICAO uses, “The vertical distance of a point or a level, on or affixed to the surface of the earth, measured from mean sea level. Official ICAO publications sometimes use the term "gravity-related height" as a synonym of elevation.” This is the same as the definition used in this standard with the caveat that “elevation” is measured from mean sea level.

The definition used in this standard accommodates any reference surface, including “elevation” as used in the building industry. Therefore, provision of proper coordinate reference system metadata is critical to determining the reference surface used for a specific elevation data set stored in a GeoPackage.

6.2. Storage formats and grid cell values

This extension to the OGC GeoPackage Encoding Standard leverages the existing structure for raster tiles as defined in GeoPackage Clause 2.2 using PNG (16-bit, unsigned integer) and TIFF (32-bit, float) files as the container for the grid values, such as elevation. The data producer has the responsibility to ensure that the intended recipient is able to read GeoPackages that contain a grid-regular coverage encoding (PNG or TIFF). Please note that using multiple zoom levels for a grid-regular coverage is purely optional. There is no requirement that grid-regular tiles have to be in a full pyramid. Clause 2.2 specifies how each zoom level is encoded. There may be only one zoom level.

Clause 7.1.1.2 and Table 1 Ancillary Coverage Data Definition define how the application to specify how the value of a grid cell is assigned. Obviously, if we are dealing with a continuous gridded coverage, values between grid cell center points can be interpolated, such as for contouring.

6.3. Cross Walk of GeoPackage Column Names and OGC/ISO Baseline

The following is a basic “crosswalk” between column names used in GeoPackage Clause 2.2 Tiles and semantics (tags) used in the OGC/ISO standards baseline, including Geography Markup Language (GML) and ISO 19123 Coverages. Please reference Annex B for an example of a GML encoding using domainSet, rangeType and rangeSet.

6.3.1. GML GridEnvelope

This GML element (Clause 19.2.2) defines the “limits” in pixel space of the grid matrix. The equivalent in the core GeoPackage standard is defined in Clause 2.2.7 Table 9. Tile Matrix Metadata Table Definition:

tile_width: Tile width in pixels (>= 1) for this zoom level

tile_height: Tile height in pixels (>= 1) for this zoom level

6.3.2. CIS/SWE rangeType

In the baseline, rangeType provides the ability to specify the characteristics of the coverage values contained in the rangeSet. As defined in ISO 19123, “The attribute rangeType: RecordType shall describe the range of the coverage”. More specifically, the rangeType component adds a structure description and technical metadata required for an appropriate (however, application independent) understanding of a coverage. Units of measure (UoM), allowed values (such as for radiance), and precision are rangeType metadata elements. Table 1 Coverage Ancillary Table Definitions provides columns for several key rangeType metadata elements.

6.3.3. CIS/SWE rangeSet

The rangeSet is comprised of the coverage range values, each one being associated with a direct position. In the case of the GeoPackage Grid Coverage extension, the rangeSet are the data values contained in the TIFF file. The requirements for using TIFF are defined in Clause 8 of this document.

6.3.4. GML/CIS/SWE domainSet

The gml:domainSet property describes the domain of the coverage. The metadata defining the domain is provided in both the core GeoPackage tables and coverage ancillary tables and associated requirements for the grid coverage GeoPackage extension. Key elements of the domain metadata are defined in the core GeoPackage standard:

  • Clause 1.1.2 Table 2 Spatial Ref Sys Table Definition;

  • Clause 2.2.7 Table 9 Tile Matrix Metadata Table Definition in the core GeoPackage standard; and

  • Clause 1.1.3 Table 4 Contents Table Definition.

Additional metadata elements describing the domain of a continuous regular grid coverage are provided in the coverage ancillary table (Table 1) and include units of measure (UoM), precision, and pixel sample encoding method.

7. Grid-Regular Coverage Extension Requirement Clauses

Clause 7 defines the requirements for encoding and storing regular, grid coverages in a GeoPackage. These requirements are in addition or complement the requirements for raster tiles as defined in the core GeoPackage standard Clause 2.2.

The following requirements class incorporates all the requirements that define the core of the TGCE. These 13 requirements are defined in the sub-clauses to the TIFF Encoding requirements clause.

Requirements Class : Table Definitions

http://www.opengis.net/spec/geopackage-gr/1.1/core

Target type

Token

Dependency

http://www.geopackage.org/spec/#tiles

Requirement 1

Req/coverage-ancillary

Requirement 2

Req/tile-ancillary

Requirement 3

Req/gpkg-spatial-ref-sys-row

Requirement 4

Req/gpkg-spatial-ref-sys-record

Requirement 5

Req/gpkg-contents

Requirement 6

Req/gpkg-extensions

Requirement 7

Req/gpkg-2d-gridded-coverage-ancillary

Requirement 8

Req/gpkg-2d-gridded-coverage-ancillary-set-name

Requirement 9

Req/gpkg-2d-gridded-coverage-ancillary-datatype

Requirement 10

Req/gpkg-2d-gridded-tile-ancillary

Requirement 11

Req/gpkg-2d-gridded-tile-ancillary-values

Requirement 12

Req/gpkg-2d-gridded-tile-ancillary-dvalues-id

Requirement 13

Req/gpkg-pyramid-user-data-datatype-integer

7.1. Table Definitions

Clauses 7.1.1 and 7.1.2 define the requirements and elements of Tiled Grid Extension ancillary (additional) tables required for storing a regular grid of values such as elevation in a GeoPackage.

7.1.1. Coverage Ancillary

Requirement 1

Req/table-defs/coverage-ancillary

A GeoPackage that contains tiled gridded data SHALL contain a gpkg_2d_gridded_coverage_ancillary table or view as per the Coverage Ancillary Table Definition below. Subsequent extensions or custom implementations MAY add additional columns to this table. Clients SHALL ignore additional columns that are unrecognized.

Table 1 provides definitions for columns in the Coverage Ancillary Table.

Table 1. Coverage Ancillary Table Definition
Column Name Column Type Column Description Null Default Key Constraint

id

INTEGER

Autoincrement primary key

no

PK

tile_matrix_set_name

TEXT

Foreign key to table_name in gpkg_tile_matrix_set

no

FK

UNIQUE

datatype

TEXT

integer or float

no

integer

scale

REAL

Scale as a multiple relative to the unit of measure

no

1

offset

REAL

The offset to the 0 value

no

0

precision

REAL [9]

The smallest value that has meaning for this dataset

yes

1

data_null

REAL [10]

The value that indicates NULL

yes

grid_cell_encoding

TEXT

Specifies how a value is assigned to a grid cell (pixel)

yes

grid-value-is-center

uom

TEXT

Units of Measure for values in the grid coverage

yes

field_name

TEXT

Type of Gridded Coverage Data (default is Height).

yes

Height

quantity_definition

TEXT

Description of the values contained in the Gridded Coverage.

yes

Height

Using the Scale and Offset Values

Integer values MAY be scaled and offset in order to make more efficient use of 16-bit integer space available in PNG files. The scale and offset MAY be applied to the entire coverage and/or the individual tile. The scale and offset do not apply to the data_null value as defined in the Coverage Ancillary Table Definitions (above).

Actual cell values are be calculated by:

  • first multiplying the stored value by the gpkg_2d_gridded_tile_ancillary_table.scale value and then adding the gpkg_2d_gridded_tile_ancillary_table.offset,

  • followed by multiplying that value by the gpkg_2d_gridded_coverage_ancillary.scale value and then adding the gpkg_2d_gridded_coverage_ancillary.offset.

In pseudo-code, this conversion would look like:

elevationInUnitOfMeasure = (SomeGrid_RegularCoverage.tile_data→pngpixels[i] * gpkg_2d_gridded_tile_ancillary.scale + gpkg_2d_gridded_tile_ancillary.offset) * gpkg_2d_gridded_coverage_ancillary.scale + gpkg_2d_gridded_coverage_ancillary.offset;

Note: integer and float refer to the values stored in the tiles. If integer values have a real scale or offset applied to them, then the resulting values will be real. The scale and offset do not apply to tiles of datatype float.

grid cell encoding

There is a small set of possible ways in how a value is actually assigned to a given grid cell. For example, a value could be assigned to the center of a cell, a corner of a cell, and so forth. Additionally, a value can be assigned to the entire cell. The OGC standards baseline currently states the use of pixel-is-point: GMLJP2 follows the definition of grids in GML 3.2.1 [OGC 07-036] clause 19.2.2: “When a grid point is used to represent a sample space (e.g. image pixel), the grid point represents the center of the sample space (see ISO 19123:2005, 8.2.2)”. In this extension, we use “grid-value-is-area” rather than “pixel-is-area” for discrete coverages such as classified satellite imagery and specifies that the value for an entire grid cell is the same value.

For the purposes of grid coverage GeoPackage extension, the following values are allowed.

  • grid-value-is-center: This is the default. Assume the value is center of grid cell.

  • grid-value-is-area – Assume the entire grid cell has the same value.

  • grid-value-is-corner – A typical use case is for a mesh of elevation values as specified in the OGC CDB standard Clause 5.6.1.

As other sampling methods are identified, the list of enumeration types can be expanded.

uom

The default is the units of measure as defined in the vertical CRS metadata, such as for heights (elevations). However, for many types of grid coverage data there will not be a vertical CRS defined in EPSG or other registries. Examples of such phenomenon are temperature, pressure, and wind speed. The formal (normative) definition for these phenomenon should be specified based on some well know accepted registry, ontology, or other community accepted units of measurement definitions. Currently, UCUM is used as the normative UoM reference in the OGC standards baseline. Some examples from UCUM are:

  • Cel - Celsius, degree – temperature

  • [degF] – degree Fahrenheit – temperature

  • mbar - millibar – pressure

  • B[uV] - microvolt, bel – electric potential level

There are other normative sources for UoM definitions, such as the World Meteorological codes registry[11] and the NASA QUDT semantic definitions[12].

An additional consideration is that a GeoPackage may be used in a disconnected environment. Therefore, the UoM specification should not be a URN or URI to some external resource. Consequently, the UoM code used should also have a specific field name and quantity definition.

This field is mandatory.

field_name

field_name is an element of rangeType. Specifically, each “field” attribute in a given GeoPackage gridded coverage instance is identified by a name that is unique to the coverage instance. For example, if the field_name is “temperature”, then the entire coverage instance is “temperature”. Therefore, for this GeoPackage extension, there is only one field attribute and one instance. In the example below, consider a grid coverage comprised of temperatures and using SWE Data Common (08-094r1) to specify the field name.

<swe:field name="temperature">
<swe:Quantity definition="http://mmisw.org/ont/cf/parameter/air_temperature">
<swe:label>Air Temperature</swe:label>
<swe:uom code="Cel"/>
</swe:Quantity>
</swe:field>

For a disconnected environment, the field_name should not be a URN or a URI. Instead use the label from the normative resource being referenced. In the above example, the field_name would be “air_temperature”. The quantity definition would also need to be specified.

quantity definition

Associated with the field name is a definition of that field/attribute. In SWE Common this is defined in the Quantity class. In the above example, navigating to http://mmisw.org/ont/cf/parameter/air_temperature provides a very specific definition of what is meant by “temperature.”

Please note that in a disconnected environment, the use of URNs and URIs is discouraged. Instead, use the text field to provide the quantity definition for the UoM being used. For example, for the above example the Marine Metadata registry provides the following: “Air temperature is the bulk temperature of the air, not the surface (skin) temperature.”

This metadata element/column is required if the values contained in a grid coverage are anything other than height (elevation). This is a text string that describes the field (type). This could be an http uri to an ontology or enumeration, such as “http://sweet.jpl.nasa.gov/2.0/spaceExtent.owl#Height."

7.1.2. Tile Ancillary

Requirement 2

Req/table-defs/tile-ancillary

A GeoPackage that contains tiled gridded data SHALL contain a gpkg_2d_gridded_tile_ancillary table or view as per Tile Ancillary Table Definition. Subsequent extensions or custom implementations MAY add additional columns to this table. Clients SHALL ignore additional columns that are unrecognized.

Table 2. Tile Ancillary Table Definition
Column Name Column Type Column Description Null Default Key

id

INTEGER

Autoincrement primary key

no

PK

tpudt_name

TEXT

Name of tile pyramid user data table

no

UNIQUE[13]

tpudt_id

INTEGER

Foreign key to id in tile pyramid user data table

no

UNIQUE[14]

scale

REAL

Scale as a multiple relative to the unit of measure

no

1

offset

REAL

The offset to the 0 value

no

0

min

REAL [15]

Minimum value of this tile

yes

max

REAL [16]

Maximum value of this tile

yes

mean

REAL

The arithmetic mean of values in this tile

yes

std_dev

REAL

The standard deviation of values in this tile

yes

The min, max, and mean values are natural, i.e., not scaled or offset. Similarly, the std_dev is calculated based on the natural values. The scale and offset do not apply to tiles of datatype float.

7.2. Table Values

The following requirements specify required and optional table values.

7.2.1. gpkg_spatial_ref_sys

Requirement 3

Req/gpkg-spatial-ref-sys-row

GeoPackages complying with this extension SHALL have a row in the gpkg_spatial_ref_sys table as described in Spatial Ref Sys Table Record:

Due to limitations in expressing 3D coordinate reference systems in the original OGC (circa 2001) Well-known Text, it is recommended that GeoPackages complying with the grid-regular extension also comply with ISO 19162 WKT for Coordinate Reference Systems as described in the GeoPackage CRS extension http://www.geopackage.org/spec/#extension_crs_wkt. Please refer to clause F.10 WKT for Coordinate Reference Systems in the core GeoPackage standard version 1.1 and later.

Table 3. Spatial Ref Sys Table Record
srs_name srs_id organization organization_coordsys_id definition description

any

4979

EPSG or epsg

4979

any

any

Requirement 4

Req/gpkg-spatial-ref-sys-record

The gpkg_spatial_ref_sys table in a GeoPackage SHALL contain records to define all spatial reference systems used by tiled gridded data in a GeoPackage. The spatial reference system SHALL be used to define the vertical datum, reference geoid, and units of measure for the tiled gridded elevation data.

7.2.2. gpkg_contents

Requirement 5

Req/gpkg-contents

The gpkg_contents table _SHALL_ contain a row with a data_type column value of 2d-gridded-coverage for each tile pyramid containing tiled gridded data. When relevant, such as for elevation, the srs_id column value for that row SHOULD reference an SRS that has a vertical datum. This requirement extends core requirement GPKG-34). NOTE: Ideally for elevation data the vertical datum for each pyramid of elevation will be specified. However, it is impractical to mandate this for a number of reasons, including the difficulty in testing whether a specific SRS has a valid vertical datum.

7.2.3. gpkg_extensions

Requirement 6

Req/gpkg-extensions

GeoPackages complying with this extension SHALL have rows in the gpkg_extensions table as described in Table 4 Extensions Table Record (below).

Table 4. Extension Table Record
table_name column_name extension_name definition scope

gpkg_2d_gridded_coverage_ancillary

null

gpkg_2d_gridded_coverage

http://docs.opengeospatial.org/is/17-066r1/17-066r1.html

read-write

gpkg_2d_gridded_tile_ancillary

null

gpkg_2d_gridded_coverage

http://docs.opengeospatial.org/is/17-066r1/17-066r1.html

read-write

name of actual tile pyramid user data table containing grid-regular data

tile_data

gpkg_2d_gridded_coverage

http://docs.opengeospatial.org/is/17-066r1/17-066r1.html

read-write

7.3. gpkg_2d_gridded_coverage_ancillary

The following requirements defines mandatory and optional elements for the coverage ancillary table definition.

The following requirements refer to the gpkg_2d_gridded_coverage_ancillary table as per Coverage Ancillary Table Definition.

Requirement 7

Req/gpkg-2d-gridded

For each row in gpkg_contents with a data_type column value of 2d-gridded-coverage, there SHALL be a row in gpkg_2d_gridded_coverage_ancillary. Values of the tile_matrix_set_name column SHALL reference values in the gpkg_contents table_name column.

Requirement 8

Req/gpkg-2d-gridded-coverage-ancillary-set-name

Values of the gpkg_2d_gridded_coverage_ancillary tile_matrix_set_name column SHALL reference values in the gpkg_tile_matrix_set table_name column.

Requirement 9

Req/gpkg-2d-gridded-coverage-ancillary-datatype

Values of the gpkg_2d_gridded_coverage_ancillary datatype column MAY be integer or float. When the datatype is float, the scale and offset values SHALL be set to the defaults.

7.4. gpkg_2d_gridded_tile_ancillary

The following requirements refer to the gpkg_2d_gridded_tile_ancillary table as per Tile Ancillary Table Definition.

Requirement 10

Req/gpkg-2d-gridded-tile-ancillary-row

For each row in a tile pyramid user data table corresponding to tiled gridded data such as elevation data, there SHALL be a row in gpkg_2d_gridded_tile_ancillary.

Requirement 11

Req/gpkg-2d-gridded-tile-ancillary-values

Values of the gpkg_2d_gridded_tile_ancillary tpudt_name column SHALL reference existing tile pyramid user data tables and rows in gpkg_2d_gridded_coverage_ancillary. When the datatype of the corresponding gpkg_2d_gridded_coverage_ancillary row is float, the scale and offset values SHALL be set to the defaults.

Requirement 12

Req/gpkg-2d-gridded-tile-ancillary-values-id

Values of the gpkg_2d_gridded_tile_ancillary tpudt_id column SHALL reference values in id column of the table referenced in tpudt_name.

Requirement 13

Req/gpkg-pyramid-user-data-datatype-integer

For data where the datatype column of the corresponding row in the gpkg_2d_gridded_coverage_ancillary table is integer, the tile_data BLOB in the tile pyramid user data table containing tiled, gridded data SHALL be of MIME type image/png or image/tiff. If type png is being used, the data SHALL be 16-bit unsigned integer (single channel - "greyscale").

NOTE: For additional requirements related to the use of TIFF, please see the TIFF Requirements Class.

8. TIFF Encoding

Due to the wide range of possible TIFF encodings, the TIFF encoding for a GeneralGridCoverage, class grid-regular (such as for elevation data) tile has been constrained for the sake of interoperability and best practice. Further, these constraints are provided as a basis for enhanced interoperability with using GeoPackages in an OGC compliant CDB data store. CDB, used in the modeling and simulation industry, has a major requirement for using GeneralGridCoverage, class grid-regular such as terrain (a grid of elevations). CDB defines a strict set of requirements for encoding terrain as a tiled TIFF coverage in a CDB data store.

Each TIFF encoded tile is a baseline TIFF as defined in the Part 1 of the TIFF standard. The only allowed encoding extensions are:

  • IEEE floating point or a binary data type where the SampleFormat has a value of either 1 (unsigned integer) or 2 (signed integer) AND the BitsPerSample is either 8, 16, or 32 (see Requirement 17 below)

  • LZW compression (see Requirement 18 below)

Tiles are encoded as a single-band image using either one 32-bit floating point component or binary data type per pixel. This implies a number of constraints which are listed below.

  • There is only one band per TIFF tile. In other words, for any pixel in the TIFF tile, there SHALL be only one component (see Requirement 16 below).

  • All pixels in the tile SHALL be set with a valid component value (see Requirement 21 below).

  • Other TIFF tags are derived from the other constraints in this extension.

  • No multi-image/tiling extensions defined in TIFF shall be used (see Requirement 19 and Requirement 20 below).

The following requirements class specifies requirements that restrict a TIFF encoding of gridded coverage data.

Requirements Class : Tiff Encoding

http://www.opengis.net/spec/geopackage-gr/1.0/tiff

Target type

Token

Dependency

http://www.geopackage.org/spec/#tiles

Requirement 14

Req/gpkg- pyramid-user-data-datatype-float

Requirement 15

Req/gpkg-gr-tiff

Requirement 16

Req/gpkg-gr-tiff-samplesperpixel

Requirement 17

Req/gpkg-gr-tiff-datatype

Requirement 18

Req/gpkg-gr-tiff-lzw

Requirement 19

Req/gpkg-gr-tiff-single-image

Requirement 20

Req/gpkg-gr-tiff-internal-tiles

Requirement 21

Req/gpkg-tiff-valid-component-value

The following requirement clarifies what the default encoding behavior is

Requirement 14

Req/gpkg- pyramid-user-data-datatype-float

(extends GPKG-36 and GPKG-37) For data where the datatype column of the corresponding row in the gpkg_2d_gridded_coverage_ancillary table is float, the tile_data BLOB in the tile pyramid user data table containing tiled, gridded data SHALL be of MIME type image/tiff and the default data encoding SHALL be 32-bit floating point as described in the TIFF Encoding.

Requirement 15

Req/gpkg-tiff

A TIFF file used for storing tiled GeneralGridCoverage, class grid-regular (such as elevation data), SHALL conform to the TIFF specification[17].

Requirement 16

Req/gpkg-tiff-samplesperpixel

A TIFF file storing tiled GeneralGridCoverage, class grid-regular, such as elevation data, SHALL have one sample per grid cell[18]. This requirement constrains TIFF Section 2.

By setting TIFF TAG 277 (SamplesPerPixel) to be 1, the GeoPackage producer indicates that there is a single sample per grid cell.

Note
Tag 277 is described in Section 6: RGB Full Color Images, sub-clause Differences from Palette Color Images and in Section 8: Baseline Field Reference Guide sub-clause The Fields. The Type is SHORT and defines the number of components per pixel. SamplesPerPixel is usually 1 for bilevel, grayscale, and palette-color images. See the TIFF ExtraSamples field for further information.

Requirement 17

Req/gpkg-tiff-datatype

A TIFF file storing tiled GeneralGridCoverage, class grid-regular (such as elevation data) SHALL have 32-bit floating (FLOAT - 11) data type or have a binary data type where the SampleFormat has a value of either 1 (unsigned integer) or 2 (signed integer) AND the BitsPerSample is either 8, 16, or 32.

This requirement constrains TIFF Section 19.

By setting TAG 339 (SampleFormat, Type SHORT), the producer indicates that the Sample Value is one of the following as defined in Part 2 (TIFF Extensions) Section 19: Data Sample Format TIFF:

1 = unsigned integer data
2 = two’s complement signed integer data
3 = IEEE floating point data [IEEE]

The value specifies how to interpret each data sample in a pixel

Note
A general description of TAG 258 is in Section 8: Baseline Field Reference Guide of the TIFF Standard. See also Section 4: Grayscale Images. By setting TAG 258 to be 8 is typically for a Baseline TIFF grayscale image allowing specifying 16 for distinct shades of gray. By setting TAG 258 (BitsPerSample) to be 32, the producer indicates that there are 32 bits per sample.

Requirement 18

Req/gpkg-tiff-lzw

A TIFF file storing tiled regular gridded coverages MAY use the LZW compression option as per TIFF Section 13 - LZW Compression.

NOTE: TIFF section 13 describes TIFF compression scheme 5, an adaptive compression scheme for raster images.

NOTE to developers: Client applications that support the TIFF encoding are expected to support this LZW compression. This is due to the fact that GeoPackages containing gridded coverages delivered to a client may or may not use LZW compression.

Requirement 19

Req/gpkg-tiff-single-image

A TIFF file storing tiled regular gridded coverages SHALL only contain single images per TIFF file. This requirement constrains TIFF Section 2. Multiple image files are not allowed.

Requirement 20

Req/gpkg-tiff-internal-tiles

A TIFF file storing tiled GeneralGridCoverage, class grid-regular, such as elevation data, SHALL NOT contain internal tiles as per TIFF Section 15. This requirement constrains TIFF Section 15.

Requirement 21

Req/gpkg-tiff-valid-component-value

All pixels in a tile of coverage data SHALL be set with a valid component value. The mechanisms defined in this extension SHALL be used to indicate a missing value for a pixel. Use the data_null value defined in Coverage Ancillary. Special Note: Special floating point values such as NaN and Inf SHALL NOT be used.

Annex A: Conformance Class Abstract Test Suite (Normative)

A.1. Tiled Gridded Coverage Core Conformance Class

Test Case ID /extensions/coverage/table_def/gpkg_2d_gridded_coverage_ancillary

Test Purpose:

Verify that the "gpkg_2d_gridded_coverage_ancillary" table has the proper definition.

Test Method:

  1. PRAGMA table_info(gpkg_2d_gridded_coverage_ancillary)

  2. Fail if table does not have all of the columns specified in Table 27

  3. Pass if logged pass and no fails

Reference

Req 1

Test Type

Basic

Test Case ID /extensions/coverage/table_def/gpkg_2d_gridded_tile_ancillary

Test Purpose:

Verify that the "gpkg_2d_gridded_tile_ancillary" table has the proper definition.

Test Method:

  1. PRAGMA table_info(gpkg_2d_gridded_tile_ancillary)

  2. Fail if table does not have all of the columns specified in Table 1

  3. Pass if logged pass and no fails

Reference

Req 2

Test Type

Basic

Test Case ID /extensions/coverage/table_val/gpkg_spatial_ref_sys/rows

Test Purpose:

Verify that the "gpkg_spatial_ref_sys" table has the required rows.

Test Method:

  1. SELECT COUNT(*) FROM gpkg_spatial_ref_sys WHERE organization_coordsys_id = 4979 AND (organization = EPSG OR organization = epsg)

  2. Fail if count is zero

  3. Pass if logged pass and no fails

Reference

Annex F.11 Req 3

Test Type

Basic

Test Case ID /extensions/coverage/table_val/gpkg_spatial_ref_sys/refs

Test Purpose:

Verify that all elevation data uses an SRS that is defined in gpkg_spatial_ref_sys

Test Method:

  1. SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage;

  2. For each table_name

    1. SELECT COUNT(*) FROM gpkg_tile_matrix_set WHERE table_name = {table_name}

    2. Fail if count is not 1

  3. Pass if no fails

Reference:

Annex F.11 Req 4

Test Type

Capability

Test Case ID /extensions/coverage/table_val/gpkg_spatial_ref_sys

Test Purpose:

Verify that all elevation data uses an SRS that is defined in gpkg_spatial_ref_sys

Test Method:

  1. SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage;

  2. Not testable if result set is empty

  3. Manually inspect that all elevation data is accounted for in the result set

Reference:

Annex F.11 Req 5

Test Type

Capability

Test Case ID /extensions/coverage/table_val/gpkg_extensions

Test Purpose:

Verify that all required rows are present in gpkg_extensions

Test Method:

  1. SELECT table_name, column_name, extension_name, definition, scope from gpkg_extensions";

  2. Verify that the required rows in Table 3 for table_name gpkg_2d_gridded_coverage_ancillary and gpkg_2d_gridded_tile_ancillary are present.

  3. SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage;

  4. For each table_name

    1. SELECT column_name, definition, scope from gpkg_extensions WHERE extension_name = gpkg_2d_gridded_coverage AND table_name = {table_name}

    2. Fail if no rows found

    3. Fail if the results do not match the entry in Table 30 for a user defined table

  5. Pass if no fails

Reference:

Annex F.11 Req 6

Test Type

Capability

Test Case ID /extensions/coverage/table_ref/gpkg_contents/gpkg_2d_gridded_coverage_ancillary

Test Purpose:

Verify that all required rows are present in gpkg_2d_gridded_coverage_ancillary

Test Method:

  1. SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage;

  2. For each table_name

    1. SELECT COUNT(*) FROM gpkg_2d_gridded_coverage_ancillary WHERE tile_matrix_set_name = {table_name}

    2. Fail if count is not 1

  3. Pass if no fails

Reference:

Annex F.11 Req 7

Test Type

Capability

Test Case ID /extensions/coverage/table_ref/gpkg_2d_gridded_coverage_ancillary/gpkg_tile_matrix_set

Test Purpose:

Verify that gpkg_2d_gridded_coverage_ancillary references gpkg_tile_matrix_set

Test Method:

  1. SELECT tile_matrix_set_name FROM gpkg_2d_gridded_coverage_ancillary;

  2. For each tile_matrix_set_name

    1. SELECT count(*) FROM gpkg_tile_matrix_set WHERE table_name = {tile_matrix_set_name}

    2. Fail if count is not 1

  3. Pass if no fails

Reference:

Annex F.11 Req 8

Test Type

Capability

Test Case ID /extensions/coverage/table_val/gpkg_2d_gridded_coverage_ancillary

Test Purpose:

Verify that gpkg_2d_gridded_coverage_ancillary contains valid column values

Test Method:

  1. SELECT datatype, scale, offset FROM gpkg_2d_gridded_coverage_ancillary WHERE tile_matrix_set_name IN (SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage);

  2. For each result in 1

    1. Fail if datatype is not "integer" or "float"

    2. Fail if datatype is "float" and scale is not 1.0

    3. Fail if datatype is "float" and offset is not 0.0

  3. Pass if no fails

Reference:

Annex F.11 Req 9

Test Type

Capability

Test Case ID /extensions/coverage/table_ref/tpudt/gpkg_2d_gridded_tile_ancillary

Test Purpose:

Verify that all required rows are present in gpkg_2d_gridded_tile_ancillary

Test Method:

  1. SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage;

  2. For each table_name

    1. SELECT {table_name}.id as tid, gpkg_2d_gridded_tile_ancillary.tpudt_id as taid from elev_png LEFT OUTER JOIN gpkg_2d_gridded_tile_ancillary ON {table_name}.id = gpkg_2d_gridded_tile_ancillary.tpudt_id AND gpkg_2d_gridded_tile_ancillary.tpudt_name = {table_name}

    2. For each row

    3. Fail if taid is null

  3. Pass if no fails

Reference:

Annex F.11 Req 10, 12

Test Type

Capability

Test Case ID /extensions/coverage/table_val/gpkg_2d_gridded_tile_ancillary

Test Purpose:

Verify that all required rows in gpkg_2d_gridded_tile_ancillary have valid values

Test Method:

  1. SELECT tpudt_name, scale, offset FROM gpkg_2d_gridded_tile_ancillary;

  2. For each row

    1. PRAGMA table_info({tpudt_name})

    2. Fail if tpudt_name is not a table or view

    3. SELECT datatype from gpkg_2d_gridded_coverage_ancillary WHERE tile_matrix_set_name = {tpudt_name}

    4. Fail if no rows found

    5. Fail if datatype is "float" and scale is not 1.0

    6. Fail if datatype is "float" and offset is not 0.0

  3. Pass if no fails

Reference:

Annex F.11 Req 11

Test Type

Capability

Test Case ID /extensions/coverage/table_val/tpudt

Test Purpose:

Verify that all rows in tile pyramid user data tables have valid values

Test Method:

  1. SELECT table_name FROM gpkg_contents WHERE data_type = 2d-gridded-coverage;

  2. For each table_name

    1. SELECT t.datatype AS datatype, u.id AS id, u.tile_data AS tile_data FROM gpkg_2d_gridded_coverage_ancillary t, {table_name} u WHERE t.tile_matrix_set_name = table_name;

    2. For each row

    3. If datatype is float, fail if tile_data is not a valid TIFF image as per requirements 115-121

    4. If datatype is integer, fail if tile_data is not a valid PNG image

  3. Pass if no fails

Reference:

Annex F.11 Req 13, 14, 115-121

Test Type

Capability

Annex B: Informative - GML example showing domainSet, rangeType, and rangetSet

<?xml version="1.0" encoding="UTF-8"?>

<gmlcov:RectifiedGridCoverage gml:id="DTM001" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlcov="http://www.opengis.net/gmlcov/1.0" xmlns:swe="http://www.opengis.net/swe/2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/gmlcov/1.0 file:///D:/Documents/OGC/Coverage/GMLCOV/Schemas/gmlcov/1.0.2/coverage.xsd">

<gml:domainSet>

<gml:RectifiedGrid gml:id="rg0001_C0002" dimension="2" srsName="http://www.opengis.net/def/crs/EPSG/0/32633">

<gml:limits>

<gml:GridEnvelope>

<gml:low>0 0</gml:low>

<gml:high>3327 2946</gml:high>

</gml:GridEnvelope>

</gml:limits>

<gml:axisName>x</gml:axisName>

<gml:axisName>y</gml:axisName>

<gml:origin>

<gml:Point gml:id="P0001" srsName="http://www.opengis.net/def/crs/EPSG/0/32633">

<gml:pos>291355.903287358 4640962.87782889</gml:pos>

</gml:Point>

</gml:origin>

<gml:offsetVector srsName="http://www.opengis.net/def/crs/EPSG/0/32633">0.298582141738734 0</gml:offsetVector>

<gml:offsetVector  srsName="http://www.opengis.net/def/crs/EPSG/0/32633">0 -0.298582141738591</gml:offsetVector>

</gml:RectifiedGrid>

</gml:domainSet>

<gml:rangeSet>

<gml:File>

<gml:rangeParameters/>

<gml:fileName>D:\Documents\Data\DTM001.tiff</gml:fileName>

<gml:fileStructure>Not interleaved</gml:fileStructure>

</gml:File>

</gml:rangeSet>

<gmlcov:rangeType>

<swe:DataRecord>

<swe:field name="Height">

<swe:Quantity definition="http://sweet.jpl.nasa.gov/2.0/spaceExtent.owl#Height" referenceFrame="http://www.opengis.net/def/crs/EPSG/0/9001">

<swe:description>Height above mean sea level</swe:description>

<swe:uom code="m"/>

</swe:Quantity>

</swe:field>

</swe:DataRecord>

</gmlcov:rangeType>

</gmlcov:RectifiedGridCoverage>

Annex C: Table Definition SQL for Grid-Regular Extension (Normative)

C.1. Coverage Ancillary Table Definition SQL

CREATE TABLE 'gpkg_2d_gridded_coverage_ancillary' (
  id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  tile_matrix_set_name TEXT NOT NULL UNIQUE,
  datatype TEXT NOT NULL DEFAULT 'integer',
  scale REAL NOT NULL DEFAULT 1.0,
  offset REAL NOT NULL DEFAULT 0.0,
  precision REAL DEFAULT 1.0,
  data_null REAL,
  grid_cell_encoding TEXT DEFAULT 'grid-value-is-center',
  uom TEXT,
  field_name TEXT DEFAULT 'Height',
  quantity_definition TEXT DEFAULT 'Height',
  CONSTRAINT fk_g2dgtct_name FOREIGN KEY('tile_matrix_set_name') REFERENCES gpkg_tile_matrix_set (table_name),
  CHECK (datatype in ('integer','float'))
);

C.2. Tile Ancillary Table Definition SQL

CREATE TABLE gpkg_2d_gridded_tile_ancillary (
  id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  tpudt_name TEXT NOT NULL,
  tpudt_id INTEGER NOT NULL,
  scale REAL NOT NULL DEFAULT 1.0,
  offset REAL NOT NULL DEFAULT 0.0,
  min REAL DEFAULT NULL,
  max REAL DEFAULT NULL,
  mean REAL DEFAULT NULL,
  std_dev REAL DEFAULT NULL,
  CONSTRAINT fk_g2dgtat_name FOREIGN KEY (tpudt_name) REFERENCES gpkg_contents(table_name),
  UNIQUE (tpudt_name, tpudt_id)
);

Annex D: Revision History

Date Release Editor Primary clauses modified Description

2017-07-25

0.1

C. Reed

all

initial version

2018-02-26

R1

C. Reed

all

Address comments from TC vote

2021-04-01

1.1

C. Reed

all

Changes for minor revision. See revision notes


1. https://portal.opengeospatial.org/files/?artifact_id=70051&version=1
2. Grid-regular in OGC Coverage Implementation Schema (CIS). More specifically, for a continuous grid-regular coverage, see CV_ContinuousQuadrilateralGridCoverage in ISO 19123 and OGC Topic Volume 6.
3. The GeoPackage (Clause 2.2) Tiles option specifies a mechanism for storing raster data in tile pyramids in a GeoPackage data store.
4. We acknowledge that this approach will not support certain applications that require a high degree of precision and/or accuracy (e.g., targeting). This is due to the encoding mechanism (PNG or TIFF).
5. www.opengeospatial.org/cite
6. The definitions for “height” and “depth” are meant to be general and are derived from ISO 19111. However, the reader should note that there are domain specific variations or enhancements of the definitions used in this standard.
7. The text in this section is extracted/summarized from the OGC Coverage Implementation Schema 1.1 (CIS) standard [OGC 09-146r6
8. This GeoPackage extension uses the CIS 1.1. CIS 1.1 provides a definition for Rectified Grid Coverage for backwards compatibility with CIS 1.0. Please see CIS 1.1 sections 7.1 and 7.2 for discussion of compatibility.
9. This is a REAL to support extensions that use non-integer data.
10. This is a REAL to support extensions that use non-integer data.
11. https://codes.wmo.int/def/common/Unit
12. http://www.qudt.org/
13. These two values are designed to be jointly unique so that they refer to a single row in a single table.
14. These two values are designed to be jointly unique so that they refer to a single row in a single table.
15. This is a REAL to support extensions that use non-integer data.
16. This is a REAL to support extensions that use non-integer data.
17. https://www.loc.gov/preservation/digital/formats/fdd/fdd000022.shtml
18. Note: In this document, pixel and grid cell may be considered as equivalent terms.