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 4 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
24 changes: 12 additions & 12 deletions format-specs/geoparquet.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ All file-level metadata should be included under the "geo" key in the parquet me

| Field Name | Type | Description |
| ------------------ | ------ | -------------------------------------------------------------------- |
| 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 | object<key, [Column Metadata](#column-metadata)> | **REQUIRED** Metadata about geometry columns, with each key is the name of a geometry column in the table. |
| 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 | object\<string, [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 @@ -58,15 +58,15 @@ Version of the GeoParquet spec used, currently 0.4.0

Each geometry column in the dataset must be included in the columns field above with the following content, keyed by the column name:

| Field Name | Type | Description |
| --- | --- | --- |
| encoding | string | **REQUIRED** Name of the geometry encoding format. Currently only `"WKB"` is supported. |
| geometry_types | \[string] | **REQUIRED** The geometry types of all geometries, or an empty array if they are not known. |
| crs | object | **OPTIONAL** [PROJJSON](https://proj.org/specifications/projjson.html) 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"`. |
| 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 | number | **OPTIONAL** Coordinate epoch in case of a dynamic CRS, expressed as a decimal year. |
| Field Name | Type | Description |
| -------------- | ------------ | ----------- |
| encoding | string | **REQUIRED** Name of the geometry encoding format. Currently only `"WKB"` is supported. |
| geometry_types | \[string] | **REQUIRED** The geometry types of all geometries, or an empty array if they are not known. |
| crs | object\|null | **OPTIONAL** [PROJJSON](https://proj.org/specifications/projjson.html) 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). |
tschaub marked this conversation as resolved.
Show resolved Hide resolved
| 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 | number | **OPTIONAL** Coordinate epoch in case of a dynamic CRS, expressed as a decimal year. |

#### crs

Expand Down
124 changes: 55 additions & 69 deletions format-specs/schema.json
Original file line number Diff line number Diff line change
@@ -1,90 +1,76 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "GeoParquet",
"type": "object",
"description": "Parquet metadata included in the geo field.",
"type": "object",
"required": ["version", "primary_column", "columns"],
"properties": {
"version": {
"type": "string",
"const": "0.5.0-dev",
"description": "The version of the GeoParquet metadata standard used when writing."
"const": "0.5.0-dev"
},
"primary_column": {
"type": "string",
"description": "The name of the 'primary' geometry column."
"type": "string"
},
"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": {
"additionalProperties": {
"type": "object",
"required": ["encoding", "geometry_types"],
"properties": {
"encoding": {
"type": "string",
"const": "WKB"
},
"geometry_types": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"enum": ["WKB"],
"description": "Name of the geometry encoding format. Currently only 'WKB' is supported."
},
"geometry_types": {
"description": "The geometry types of all geometries, or an empty array if they are not known.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"
"pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$"
}
},
"crs": {
"oneOf": [
{
"$ref": "https://proj.org/schemas/v0.4/projjson.schema.json"
},
{
"type": "null"
}
]
},
"edges": {
"type": "string",
"enum": ["planar", "spherical"]
},
"orientation": {
"type": "string",
"const": "counterclockwise"
},
"bbox": {
m-mohr marked this conversation as resolved.
Show resolved Hide resolved
"type": "array",
"items": {
"type": "number"
},
"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"
"oneOf": [
{
"description": "2D bbox consisting of (xmin, ymin, xmax, ymax)",
"minItems": 4,
"maxItems": 4
},
"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
}
]
},
"epoch": {
"type": "number",
"description": "Coordinate epoch in case of a dynamic CRS, expressed as a decimal year."
}
{
"description": "3D bbox consisting of (xmin, ymin, zmin, xmax, ymax, zmax)",
"minItems": 6,
"maxItems": 6
}
]
},
"additionalProperties": true,
"required": ["encoding", "geometry_types"]
"epoch": {
"type": "number"
}
}
}
}
},
"additionalProperties": true,
"required": ["version", "primary_column", "columns"]
}
}