Skip to content

GPQ validation vs draft OGC requirements

Chris Holmes edited this page Jun 17, 2024 · 4 revisions

This page is made to make it easier to compare what's in the OGC official recommendations and requirements, and what's in GPQ, which seems to have the most validation tests to date. It is made with the june 10th state of the ogc-template branch.

GPQ rule OGC rule OGC Text
✓ geometry columns must be stored using the BYTE_ARRAY parquet type requirement 1 part 1 Geometry columns SHALL be stored using the BYTE_ARRAY parquet type.
none requirement 1 part 2 Geometries SHALL be encoded as Well Known Binary (WKB).
✓ all geometry values match the "encoding" metadata none none
none requirement 2 part 1 Geometry columns SHALL be at the root of the schema.
✓ geometry columns must not be grouped requirement 2 part 2 A geometry SHALL NOT be a group field or nested in a group.
✓ geometry columns must be required or optional, not repeated requirement 3 part 1 The repetition for all geometry columns SHALL be “required” (exactly one) or “optional” (zero or one).
✓ geometry columns must be required or optional, not repeated requirement 3 part 2 A geometry column SHALL NOT be repeated.
✓ file must include a "geo" metadata key requirement 4 part 1 A GeoParquet file SHALL include a geo key in the Parquet metadata (see FileMetaData::key_value_metadata).
✓ metadata must be a JSON object requirement 4 part 2 The value of this key SHALL be a JSON-encoded UTF-8 string representing the file and column metadata that validates against the GeoParquet metadata schema.
✓ metadata must include a "columns" object requirement 4 part 3 Each geometry column in the dataset SHALL be included in the columns field (specified in [tbl_file_and_column_metadata_fields]) with the following content (specified in [tbl_column_metadata]), keyed by the column name
✓ optional "crs" must be null or a PROJJSON object requirement 5 part 1 If CRS is provided, the CRS SHALL be provided in PROJJSON format.
none requirement 5 part 2 If CRS is not provided, all coordinates in the geometries MUST use longitude, latitude based on the WGS84 datum, and the default value is OGC:CRS84 for CRS-aware implementations.
none requirement 6 If the crs field defines a dynamic CRS, the coordinates SHALL always be qualified with the epoch at which they are valid.
✓ optional "epoch" must be a number none (though the above is related) none
✓ all polygon geometries must follow the "orientation" metadata (if present) requirement 7 part 1 All vertices of exterior polygon rings SHALL be ordered in the counterclockwise direction (TODO: Fix this, its not right)
none requirement 7 part 2 All interior rings SHALL be ordered in the clockwise direction.
✓ optional "bbox" must be an array of 4 or 6 numbers requirement 8 The bbox, if specified, SHALL be encoded with an array representing the range of values for each dimension in the geometry coordinates.
✓ all geometries must fall within the "bbox" metadata (if present) requirement 8 The bbox, if specified, SHALL be encoded with an array representing the range of values for each dimension in the geometry coordinates.
none recommendation 1 The geometry encoding SHOULD be the OpenGIS® Implementation Specification for Geographic information — Simple feature access — Part 1: Common architecture WKB representation (using codes for 3D geometry types in the [1001,1007] range).
✓ optional "edges" must be a valid string recommendation 2 If edges is “spherical”, the orientation SHOULD always be set to counterclockwise. (TODO: Doesn't quite match)
none recommendation 3 If you are using GeoParquet to serialize geospatial data with feature identifiers, you SHOULD create your own file key/value metadata to indicate the column that represents this identifier.
✓ metadata must include a "version" string none none
✓ metadata must include a "primary_column" string none none
✓ column metadata must include the "primary_column" name none none
✓ column metadata must include a valid "encoding" string none none
✓ column metadata must include a "geometry_types" list none none
✓ optional "orientation" must be a valid string none none
✓ all geometry types must be included in the "geometry_types" metadata (if not empty) none none
Clone this wiki locally