← LeaderboardThe Skill Leaderboard

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.

Published by sickn33 ↗sickn33/agentic-awesome-skills

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 GeoParquet geo Parquet 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.0 datasets in CI or ETL pipelines before publishing or cataloging.
  • Catching broken GeoParquet writers that omit the "geo" metadata key, name a missing primary_column, store text WKT in a column declared as "WKB", or collapse crs: null into 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 Python 3.12.10, pyarrow==25.0.1, jsonschema==4.26.0, pytest==9.1.1).
  • Local or synthetic .parquet file paths (read_schema only — no cloud storage credentials or remote reads).

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:
    • "WKB" requires physical Arrow binary / large_binary (rejects string, int64, etc. as INCOMPATIBLE_PHYSICAL_SCHEMA). Reject non-string encoding values (e.g., JSON arrays/objects) cleanly as schema errors rather than raising TypeError.
    • Strict GeoParquet 1.1.0 native encodings verify separated coordinate Struct columns stored as Parquet DOUBLE (Struct<x: float64, y: float64[, z: float64, m: float64]> with pa.float64) at the required nesting depth (point: depth 0, linestring/multipoint: depth 1, polygon/multilinestring: depth 2, multipolygon: depth 3). Interleaved FixedSizeList layouts and lower-precision floats (float32/float16) fail strict 1.1.0 checks unless the non-standard compatibility mode (strict_native_layout=False) is explicitly opted into (which flags such layouts with a WARN finding).
  3. 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.
  4. Missing vs. explicit-null crs semantics:
    • Missing "crs" key -> crs_status="DEFAULT_OGC_CRS84".
    • Explicit "crs": null -> crs_status="UNKNOWN_NULL_CRS" (never infer OGC:CRS84 from explicit null).
    • Object "crs" -> must be a non-empty PROJJSON mapping.
  5. 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

  • Inspects Parquet footer schema metadata only (read_schema); does not scan row groups, decode WKB/GeoArrow coordinates, verify bbox tightness 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" return UNSUPPORTED so 1.1.0 encoding and covering assumptions are never misapplied to 1.0.0.

Safety and Side Effects

  • Strictly offline and read-only over local .parquet files (pyarrow.parquet.read_schema only).
  • Never accesses remote S3/GCS/HTTPS URLs, mutates source Parquet files, or sends data off-machine.

Sources and related skills