Skip to content
Back to skills

Geoparquet Metadata Validation

ASecurity

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.

  • 50,717 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added December 2, 2026
ai-agentspythongogit

Works with

  • cursor
  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned December 2, 2026

npx -y skills add sickn33/agentic-awesome-skills --skill geoparquet-metadata-validation --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Geoparquet Metadata Validation?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Geoparquet Metadata Validation
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sickn33-geoparquet-metadata-validation/badge)](https://www.skillsdirectory.com/skills/sickn33-geoparquet-metadata-validation)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
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:
- `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](references/geoparquet-metadata-harness.md):

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](references/geoparquet-metadata-harness.md):

```text
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

- [GeoParquet 1.1.0 Specification](https://geoparquet.org/releases/v1.1.0/)
- Related skills: [geospatial-python](https://github.com/sickn33/agentic-awesome-skills/blob/e4dcf3977b6d1e18a2539f630bd82c2433d283e2/skills/geospatial-python/SKILL.md), [duckdb-analytics](https://github.com/sickn33/agentic-awesome-skills/blob/e4dcf3977b6d1e18a2539f630bd82c2433d283e2/skills/duckdb-analytics/SKILL.md).

Files in this skill

  • SKILL.md7.2 KB
  • references/geoparquet-metadata-harness.md27.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.