Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean-up spec and JSON Schema #131

Merged
merged 7 commits into from
Dec 5, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions format-specs/geoparquet.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ All file-level metadata should be included under the "geo" key in the parquet me
| ------------------ | ------ | -------------------------------------------------------------------- |
| version | string | **REQUIRED** The version of the geoparquet metadata standard used when writing. |
| primary_column | string | **REQUIRED** The name of the "primary" geometry column. |
| columns | Map<key, [Column Metadata](#column-metadata)> | **REQUIRED** Metadata about geometry columns, with each key is the name of a geometry column in the table. |
| columns | Map\<str, [Column Metadata](#column-metadata)> | **REQUIRED** Metadata about geometry columns. Each key is the name of a geometry column in the table. |

At this level, additional implementation-specific fields (e.g. library name) are allowed, and thus readers should be robust in ignoring those.

Expand All @@ -52,13 +52,13 @@ Each geometry column in the dataset must be included in the columns field above

| Field Name | Type | Description |
| --- | --- | --- |
| encoding | string | **REQUIRED** Name of the geometry encoding format. Currently only 'WKB' is supported. |
| geometry_type | string or \[string] | **REQUIRED** The geometry type(s) of all geometries, or 'Unknown' if they are not known. |
| crs | JSON object | **OPTIONAL** [PROJJSON](https://proj.org/specifications/projjson.html) JSON object representing the Coordinate Reference System (CRS) of the geometry. If the crs field is not included then the data in this column must be stored in longitude, latitude based on the WGS84 datum, and CRS-aware implementations should assume a default value of [OGC:CRS84](https://www.opengis.net/def/crs/OGC/1.3/CRS84). |
| orientation | string | **OPTIONAL** Winding order of exterior ring of polygons. If present must be 'counterclockwise'; interior rings are wound in opposite order. If absent, no assertions are made regarding the winding order. |
| edges | string | **OPTIONAL** Name of the coordinate system for the edges. Must be one of 'planar' or 'spherical'. The default value is 'planar'. |
| encoding | string | **REQUIRED** Name of the geometry encoding format. Currently only `WKB` is supported. |
| geometry_type | string or \[string] | **REQUIRED** The geometry type(s) of all geometries, or `Unknown` if they are not known. |
| crs | object\|null | **OPTIONAL** [PROJJSON](https://proj.org/specifications/projjson.html) JSON object representing the Coordinate Reference System (CRS) of the geometry. If the crs field is not included then the data in this column must be stored in longitude, latitude based on the WGS84 datum, and CRS-aware implementations should assume a default value of [OGC:CRS84](https://www.opengis.net/def/crs/OGC/1.3/CRS84). `null` indicates that there is no CRS assigned. |
| orientation | string | **OPTIONAL** Winding order of exterior ring of polygons. If present must be `counterclockwise`; interior rings are wound in opposite order. If absent, no assertions are made regarding the winding order. |
| edges | string | **OPTIONAL** Name of the coordinate system for the edges. Must be one of `planar` or `spherical`. The default value is 'planar'. |
| bbox | \[number] | **OPTIONAL** Bounding Box of the geometries in the file, formatted according to [RFC 7946, section 5](https://tools.ietf.org/html/rfc7946#section-5). |
| epoch | double | **OPTIONAL** Coordinate epoch in case of a dynamic CRS, expressed as a decimal year. |
| epoch | number | **OPTIONAL** Coordinate epoch in case of a dynamic CRS, expressed as a decimal year. |
m-mohr marked this conversation as resolved.
Show resolved Hide resolved

#### crs

Expand Down
152 changes: 75 additions & 77 deletions format-specs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"title": "GeoParquet",
"type": "object",
"description": "Parquet metadata included in the geo field.",
"required": ["version", "primary_column", "columns"],
"properties": {
"version": {
"type": "string",
Expand All @@ -11,95 +12,92 @@
},
"primary_column": {
"type": "string",
"description": "The name of the 'primary' geometry column."
"description": "The name of the 'primary' geometry column.",
"minLength": 1
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
},
"columns": {
"type": "object",
"description": "Metadata about geometry columns, with each key is the name of a geometry column in the table.",
"patternProperties": {
".*": {
"type": "object",
"properties": {
"encoding": {
"type": "string",
"enum": ["WKB"],
"description": "Name of the geometry encoding format. Currently only 'WKB' is supported."
},
"geometry_type": {
"oneOf": [
{
"$ref": "#/$defs/geometry_type"
},
{
"type": "array",
"items": {
"$ref": "#/$defs/geometry_type"
},
"uniqueItems": true
}
],
"description": "The geometry type(s) of all geometries, or 'Unknown' if they are not known."
},
"crs": {
"oneOf": [
{
"$ref": "https://proj.org/schemas/v0.4/projjson.schema.json"
},
{
"type": "null"
}
],
"description": "JSON object representing the Coordinate Reference System (CRS) of the geometry. If the crs field is not included then the data in this column must be stored in longitude, latitude based on the WGS84 datum, and CRS-aware implementations should assume a default value of OGC:CRS84."
},
"edges": {
"type": "string",
"enum": ["planar", "spherical"],
"description": "Name of the coordinate system for the edges. Must be one of 'planar' or 'spherical'. The default value is 'planar'."
},
"orientation": {
"type": "string",
"enum": ["counterclockwise"],
"description": "Winding order of exterior ring of polygons; interior rings are wound in opposite order. If absent, no assertions are made regarding the winding order."
},
"bbox": {
"type": "array",
"description": "Bounding Box of the geometries in the file, formatted according to RFC 7946, section 5.",
"items": [
{
"type": "number",
"description": "The westmost constant longitude line that bounds the rectangle (xmin)."
},
{
"type": "number",
"description": "The minimum constant latitude line that bounds the rectangle (ymin)."
},
{
"type": "number",
"description": "The eastmost constant longitude line that bounds the rectangle (xmax)."
"description": "Metadata about geometry columns. Each key is the name of a geometry column in the table.",
"additionalProperties": {
"type": "object",
"required": ["encoding", "geometry_type"],
"properties": {
"encoding": {
"type": "string",
"const": "WKB",
"description": "Name of the geometry encoding format. Currently only 'WKB' is supported."
},
"geometry_type": {
"oneOf": [
{
"type": "string",
"const": "Unknown"
},
{
"$ref": "#/definitions/geometry_type"
},
{
"type": "array",
"items": {
"$ref": "#/definitions/geometry_type"
},
{
"type": "number",
"description": "The maximum constant latitude line that bounds the rectangle (ymax)."
}
]
"uniqueItems": true
}
],
"description": "The geometry type(s) of all geometries, or 'Unknown' if they are not known."
},
"crs": {
"oneOf": [
{
"$ref": "https://proj.org/schemas/v0.5/projjson.schema.json"
},
{
"type": "null"
}
],
"description": "JSON object representing the Coordinate Reference System (CRS) of the geometry. If the crs field is not included then the data in this column must be stored in longitude, latitude based on the WGS84 datum, and CRS-aware implementations should assume a default value of OGC:CRS84."
},
"edges": {
"type": "string",
"enum": ["planar", "spherical"],
"description": "Name of the coordinate system for the edges. Must be one of 'planar' or 'spherical'. The default value is 'planar'."
},
"orientation": {
"type": "string",
"const": "counterclockwise",
"description": "Winding order of exterior ring of polygons; interior rings are wound in opposite order. If absent, no assertions are made regarding the winding order."
},
"bbox": {
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
"type":"array",
"description": "Bounding Box of the geometries in the file, formatted according to RFC 7946, section 5.",
"items":{
"type":"number"
},
"epoch": {
"type": "number",
"description": "Coordinate epoch in case of a dynamic CRS, expressed as a decimal year."
}
"oneOf":[
{
"description": "2D bbox consisting of (xmin, ymin, xmax, ymax)",
"minItems":4,
"maxItems":4
},
{
"description": "3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)",
"minItems":6,
"maxItems":6
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
}
]
},
"additionalProperties": true,
"required": ["encoding", "geometry_type"]
"epoch": {
"type": "number",
"description": "Coordinate epoch in case of a dynamic CRS, expressed as a decimal year."
}
}
}
}
},
"additionalProperties": true,
"required": ["version", "primary_column", "columns"],
"$defs": {
"definitions": {
"geometry_type": {
"type": "string",
"enum": ["Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection", "Unknown"]
"pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
}
}
}