Home / Market / geoparquet metadata validation

geoparquet metadata validation

Audit local GeoParquet 1.1.0 files offline with PyArrow for valid geo JSON metadata, primary_column, physical Arrow column types, geometry types, CRS semantics, and bbox.

skill★ 508760 dlgithubCC-BY-4.0 content; MIT code; upstream exceptions applyInstall in CosmosUpstream Source

Documentation & Preview

--- name: geoparquet-metadata-validation description: "Audit local GeoParquet 1.1.0 files offline with PyArrow for valid geo JSON metadata, primary_column, physical Arrow column types, geometry types, CRS semantics, and bbox." category: data risk: safe source: self source_type: self date_added: "2026-12-01" author: Koushik-Katkam tags: [geoparquet, parquet, pyarrow, geospatial, metadata, validation]

---

GeoParquet Metadata Validation

Overview

Audit local GeoParquet 1.1.0 .parquet files read-only using PyArrow schema metadata (pyarrow.parquet.read_schema) without scanning remote object stores, loading full row groups into memory, or mutating source files. Verifies geo JSON schema metadata, supported GeoParquet version, primary_column existence, compatibility between declared column encoding and physical Arrow/Parquet types, geometry_types, missing vs. explicit-null crs semantics, bounding-box shape, and 1.1.0 optional fields (edges, orientation, covering).

Distinction from existing geospatial and Parquet skills:

When to Use

Prerequisites

How It Works

1. Read Parquet schema metadata read-only

  1. Open only the Parquet footer/schema with pyarrow.parquet.read_schema(path) so malformed/non-Parquet files raise ArrowInvalid -> INVALID_INPUT cleanly without reading data pages.
  2. Require the b"geo" metadata key and parse it strictly with RFC 8259 JSON (NaN/Infinity rejected, INVALID_INPUT on invalid UTF-8/JSON).
  3. Restrict supported geo.version to "1.1.0" and validate metadata structure against the bundled GeoParquet 1.1.0 JSON Schema (jsonschema); return UNSUPPORTED for other versions such as "1.0.0" or "2.0.0".

2. Validate GeoParquet 1.1.0 column metadata vs. physical schema

Run the local verification suite in GeoParquet metadata harness:

  1. primary_column consistency: Assert primary_column is a non-empty string present in both geo["columns"] and the physical PyArrow Schema.names. Every declared key in geo["columns"] must also exist in the physical schema.
  2. Physical schema compatibility by encoding:
  1. geometry_types: Per GeoParquet 1.1.0, require a JSON array of unique recognized types restricted to the 7 base types (Point, LineString, Polygon, MultiPoint, MultiLineString, MultiPolygon, GeometryCollection) and their " Z" suffix variants (Point Z, etc.; [] allowed for unknown mixed types). Duplicate entries and unsupported M/ZM suffixes fail validation.
  2. Missing vs. explicit-null crs semantics:
  1. bbox and optional 1.1.0 metadata: Require 4-element or 6-element finite numeric arrays (ymin <= ymax, zmin <= zmax), valid edges ("planar" or "spherical"), valid orientation ("counterclockwise"), and complete covering.bbox validation (all four keys xmin, ymin, xmax, ymax mapped to exact two-part paths [group_name, coordinate_name] under the same root group, with child order xmin, ymin, xmax, ymax (or xmin, ymin, zmin, xmax, ymax, zmax) and a uniform FLOAT or DOUBLE type).

3. Keep metadata vs. geometry-content validation separate

Every report explicitly classifies itself as schema/footer metadata validation only (scope="metadata_only"). Passing metadata validation never implies row-level WKB decoding, geometry topological validity, or actual coordinate CRS conformance.

Examples

Run the self-contained verification suite in GeoParquet metadata harness:

User request: "Audit our exported buildings.parquet file against GeoParquet 1.1.0 metadata rules."
Inputs: Local Parquet file written with PyArrow containing geo 1.1.0 metadata.
Expected result: PASS with scope="metadata_only" and explicit CRS status (DEFAULT_OGC_CRS84 vs. UNKNOWN_NULL_CRS)
  when schema and metadata match; FAIL on missing primary_column, WKB-on-string encoding mismatch, or invalid bbox;
  UNSUPPORTED on geo version 2.0.0.

Limitations

Safety and Side Effects

Sources and related skills