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.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: geoparquet-metadata-validationdescription: "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: datarisk: safesource: selfsource_type: selfdate_added: "2026-12-01"author: Koushik-Katkamtags: [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:
geospatial-python: validates CRS transforms,shapely.make_valid, and Rasterio raster clipping in memory rather than auditing GeoParquetgeoParquet file schema metadata.duckdb-analytics: verifies Hive partition pruning, filter pushdown, and DuckDB cursor isolation without validating GeoParquet 1.1.0 metadata contracts.
When to Use
- Validating exported GeoParquet
1.1.0datasets in CI or ETL pipelines before publishing or cataloging. - Catching broken GeoParquet writers that omit the
"geo"metadata key, name a missingprimary_column, store text WKT in a column declared as"WKB", or collapsecrs: nullinto default WGS84. - Do not use this skill for row-by-row WKB/GeoArrow geometry validity auditing, coordinate reprojection, or remote S3/cloud dataset scans.
Prerequisites
- Python
3.10+with pinned PyArrow, jsonschema, and pytest dependencies (tested with Python3.12.10,pyarrow==25.0.1,jsonschema==4.26.0,pytest==9.1.1). - Local or synthetic
.parquetfile paths (read_schemaonly — no cloud storage credentials or remote reads).
How It Works
1. Read Parquet schema metadata read-only
- Open only the Parquet footer/schema with
pyarrow.parquet.read_schema(path)so malformed/non-Parquet files raiseArrowInvalid->INVALID_INPUTcleanly without reading data pages. - Require the
b"geo"metadata key and parse it strictly with RFC 8259 JSON (NaN/Infinityrejected,INVALID_INPUTon invalid UTF-8/JSON). - Restrict supported
geo.versionto"1.1.0"and validate metadata structure against the bundled GeoParquet1.1.0JSON Schema (jsonschema); returnUNSUPPORTEDfor 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:
primary_columnconsistency: Assertprimary_columnis a non-empty string present in bothgeo["columns"]and the physical PyArrowSchema.names. Every declared key ingeo["columns"]must also exist in the physical schema.- Physical schema compatibility by
encoding:"WKB"requires physical Arrowbinary/large_binary(rejectsstring,int64, etc. asINCOMPATIBLE_PHYSICAL_SCHEMA). Reject non-stringencodingvalues (e.g., JSON arrays/objects) cleanly as schema errors rather than raisingTypeError.- Strict GeoParquet
1.1.0native encodings verify separated coordinateStructcolumns stored as ParquetDOUBLE(Struct<x: float64, y: float64[, z: float64, m: float64]>withpa.float64) at the required nesting depth (point: depth0,linestring/multipoint: depth1,polygon/multilinestring: depth2,multipolygon: depth3). InterleavedFixedSizeListlayouts and lower-precision floats (float32/float16) fail strict1.1.0checks unless the non-standard compatibility mode (strict_native_layout=False) is explicitly opted into (which flags such layouts with aWARNfinding).
geometry_types: Per GeoParquet1.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 unsupportedM/ZMsuffixes fail validation.- Missing vs. explicit-
nullcrssemantics:- Missing
"crs"key ->crs_status="DEFAULT_OGC_CRS84". - Explicit
"crs": null->crs_status="UNKNOWN_NULL_CRS"(never infer OGC:CRS84 from explicitnull). - Object
"crs"-> must be a non-empty PROJJSON mapping.
- Missing
bboxand optional1.1.0metadata: Require 4-element or 6-element finite numeric arrays (ymin <= ymax,zmin <= zmax), validedges("planar"or"spherical"), validorientation("counterclockwise"), and completecovering.bboxvalidation (all four keysxmin,ymin,xmax,ymaxmapped to exact two-part paths[group_name, coordinate_name]under the same root group, with child orderxmin, ymin, xmax, ymax(orxmin, 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
- Inspects Parquet footer schema metadata only (
read_schema); does not scan row groups, decode WKB/GeoArrow coordinates, verifybboxtightness against actual rows, or validate full PROJJSON against the official EPSG registry. - Strictly targets GeoParquet
1.1.0; earlier versions such as"1.0.0"returnUNSUPPORTEDso1.1.0encoding andcoveringassumptions are never misapplied to1.0.0.
Safety and Side Effects
- Strictly offline and read-only over local
.parquetfiles (pyarrow.parquet.read_schemaonly). - Never accesses remote S3/GCS/HTTPS URLs, mutates source Parquet files, or sends data off-machine.
Sources and related skills
- GeoParquet 1.1.0 Specification
- Related skills: geospatial-python, duckdb-analytics.