diff --git a/examples/example.parquet b/examples/example.parquet index eda6d8f..cb12ef3 100644 Binary files a/examples/example.parquet and b/examples/example.parquet differ diff --git a/examples/example.py b/examples/example.py index 7b5cec3..45122ec 100644 --- a/examples/example.py +++ b/examples/example.py @@ -23,12 +23,12 @@ metadata = { - "version": "0.4.0", + "version": "0.5.0-dev", "primary_column": "geometry", "columns": { "geometry": { "encoding": "WKB", - "geometry_type": ["Polygon", "MultiPolygon"], + "geometry_types": ["Polygon", "MultiPolygon"], "crs": json.loads(df.crs.to_json()), "edges": "planar", "bbox": [round(x, 4) for x in df.total_bounds], diff --git a/examples/example_metadata.json b/examples/example_metadata.json index 2cf11ac..7400721 100644 --- a/examples/example_metadata.json +++ b/examples/example_metadata.json @@ -9,7 +9,7 @@ 83.6451 ], "crs": { - "$schema": "https://proj.org/schemas/v0.4/projjson.schema.json", + "$schema": "https://proj.org/schemas/v0.5/projjson.schema.json", "area": "World.", "bbox": { "east_longitude": 180, @@ -108,13 +108,13 @@ }, "edges": "planar", "encoding": "WKB", - "geometry_type": [ + "geometry_types": [ "Polygon", "MultiPolygon" ] } }, "primary_column": "geometry", - "version": "0.4.0" + "version": "0.5.0-dev" } } \ No newline at end of file diff --git a/format-specs/geoparquet.md b/format-specs/geoparquet.md index c23ed9a..55190b4 100644 --- a/format-specs/geoparquet.md +++ b/format-specs/geoparquet.md @@ -53,7 +53,7 @@ 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. | +| geometry_types | \[string] | **REQUIRED** The geometry types of all geometries, or an empty array 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'. | @@ -110,9 +110,9 @@ The axis order of the coordinates in WKB stored in a geoparquet follows the de f (x, y) where x is easting or longitude and y is northing or latitude. This ordering explicitly overrides the axis order as specified in the CRS. This follows the precedent of [GeoPackage](https://geopackage.org), see the [note in their spec](https://www.geopackage.org/spec130/#gpb_spec). -#### geometry_type +#### geometry_types -This field captures the geometry type(s) of the geometries in the +This field captures the geometry types of the geometries in the column, when known. Accepted geometry types are: "Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection". @@ -120,16 +120,14 @@ column, when known. Accepted geometry types are: "Point", "LineString", In addition, the following rules are used: - In case of 3D geometries, a " Z" suffix gets added (e.g. "Point Z"). -- The value can be a single string or an array of strings in case multiple - geometry types are present (e.g. ["Polygon", "MultiPolygon"]). -- Additionally the value "Unknown" is accepted to explicitly signal that the - geometry type is not known. +- A list of values indicates that multiple geometry types are present (e.g. ["Polygon", "MultiPolygon"]). +- An empty array explicitly signals that the geometry types are not known. It is expected that this field is strictly correct. For example, if having both polygons and multipolygons, it is not sufficient to specify "MultiPolygon", but it is expected to specify ["Polygon", "MultiPolygon"]. Or if having 3D points, it is not sufficient to -specify "Point", but it is expected to list "Point Z". +specify ["Point"], but it is expected to list ["Point Z"]. #### orientation diff --git a/format-specs/schema.json b/format-specs/schema.json index 70ee64a..8e7ee67 100644 --- a/format-specs/schema.json +++ b/format-specs/schema.json @@ -6,7 +6,7 @@ "properties": { "version": { "type": "string", - "const": "0.4.0", + "const": "0.5.0-dev", "description": "The version of the geoparquet metadata standard used when writing." }, "primary_column": { @@ -25,20 +25,13 @@ "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." + "geometry_types": { + "description": "The geometry types of all geometries, or an empty array if they are not known.", + "type": "array", + "items": { + "type": "string", + "pattern": "^(GeometryCollection|(Multi)?(Point|LineString|Polygon))( Z)?$" + } }, "crs": { "oneOf": [ @@ -95,11 +88,5 @@ } }, "additionalProperties": true, - "required": ["version", "primary_column", "columns"], - "$defs": { - "geometry_type": { - "type": "string", - "enum": ["Point", "LineString", "Polygon", "MultiPoint", "MultiLineString", "MultiPolygon", "GeometryCollection", "Unknown"] - } - } + "required": ["version", "primary_column", "columns"] }