stac-catalog-validation
Validate STAC Items, Catalogs, and Collections offline across 1.0.0 and 1.1.0 schemas, temporal rules, geometry/bbox bounds, collection links, local assets, and extensions.
Try your first task
A source-grounded starter task has not been verified for this skill yet.
SKILL.md
name: stac-catalog-validationdescription: "Validate STAC Items, Catalogs, and Collections offline across 1.0.0 and 1.1.0 schemas, temporal rules, geometry/bbox bounds, collection links, local assets, and extensions."category: datarisk: safesource: selfsource_type: selfdate_added: "2026-12-01"author: Koushik-Katkamtags: [stac, geospatial, metadata, json-schema, validation, earth-observation]STAC Catalog Validation
Overview
Run a version-aware, offline-capable validation workflow for SpatioTemporal Asset Catalog (STAC) Catalog, Collection, and Item JSON documents (1.0.0 and 1.1.0). The workflow separates specification violations, cross-entity consistency findings, partial extension checks, and unverified remote resources so static catalogs and metadata pipelines fail deterministically on broken temporal or spatial invariants without treating unprobed URLs, unpinned schemas, or unsupported versions as valid.
Distinction from related geospatial skills:
geospatial-python(merged via PR #2656) covers vector CRS reprojection (set_crsvsto_crs), geometry repair (shapely.make_valid), and raster sampling with GeoPandas/Shapely/Rasterio.noaa-radar-satellite-fetchingretrieves raw NOAA NEXRAD and GOES objects from AWS S3 buckets and filters scan timestamps.radar-satellite-analysisinterprets decoded meteorological radar/satellite observations (beam geometry, parallax, calibration, quality flags).xarray-coordinate-alignmentaligns multi-dimensional labeled scientific arrays (xr.align,xr.merge).
This skill validates the STAC metadata graph and contracts wrapping geospatial assets before downstream array loading or catalog indexing.
When to Use
- Publishing or auditing a static STAC
Catalog/Collection/Itemtree or STAC API item payload (versions1.0.0or1.1.0). - Catching common STAC defects before ingestion: malformed JSON,
properties: null, invalid GeoJSON geometry types or shapes,datetime: nullmissingstart_datetime/end_datetime,bboxsupplied withgeometry: null, Item bounds spilling outside declaredbboxor parent Collection spatial/temporal extents, or broken locallinksandassetspaths. - Verifying offline STAC trees while explicitly reporting remote assets, unknown URI schemes, and unpinned extension schemas as unverified.
- Do not use this skill for CRS coordinate transformations (
geospatial-python), array coordinate alignment (xarray-coordinate-alignment), or downloading satellite granules (noaa-radar-satellite-fetching).
Prerequisites
- Python 3.10+ with
jsonschema(tested with Python 3.12.10,jsonschema 4.26.0,pytest 9.1.1). - Local STAC JSON files (
Catalog,Collection,Item) and, for full schema conformance, official version-pinned local STAC + GeoJSON + extension JSON Schemas resolved via a localreferencing.Registry. Without external schema clones, the bundled harness runs partial offline subset validation and explicitly labels what external schemas were not verified. - Zero network / credential requirement: No paid services, satellite downloads, STAC API write calls, or cloud storage credentials are required. Remote asset
hrefs (https://,s3://,gs://), unknown URI schemes, and unpinned extension schemas are reported under unverified remote resources unless resolved in an authorized environment.
How It Works
1. Pin STAC version and distinguish full vs. subset schemas
- Parse JSON safely and verify the root document is a JSON object (
dict). Return structured specification findings on malformed JSON, non-object documents, ornullstructural fields (properties: null,links: null,assets: null) rather than crashing. - Inspect
stac_versionandtype("Catalog","Collection","Feature"). Treat unrecognizedstac_versionvalues as unverified rather than substituting a1.0.0or1.1.0schema. - Note version-specific rules documented in version and extension rules:
- In STAC
1.1.0,bboxis prohibited whengeometryisnull; in1.0.0, omittingbboxwhengeometryisnullis recommended. - Common Asset Metadata (
bands,data_type,nodata,statistics) moved into STAC1.1.0core, whereas1.0.0relies oneo/rasterextensions (eo:bands,raster:bands). - Projection extension
v2.0.0replaces deprecatedproj:epsgwithproj:code(e.g."EPSG:32610").
- In STAC
- Load official local JSON Schemas via
referencing.Registrywhen full schema compliance is required. If running only the self-contained subset rules from stac validation harness, record extension checks explicitly as partial checks (partial_checks) and unpinned schemas as unverified.
2. Run layered checks and classify findings cleanly
Evaluate every document and local catalog graph across four layers, keeping the output categories strictly separate:
- Specification violations (
spec_violations— core schema & invariant failures):- Malformed JSON, non-object roots, invalid field types (
properties: null,links: null,assets: null), or subset schema violations. - Unsupported or prohibited GeoJSON
geometry.type(Point,MultiPoint,LineString,MultiLineString,Polygon,MultiPolygononly;GeometryCollectionis prohibited by STAC1.0.0and1.1.0Item specs) or malformed coordinate arrays (unclosed polygon rings, wrong dimensionality,boolvalues). properties.datetimeisnullwhile eitherproperties.start_datetimeorproperties.end_datetimeis missing ornull; unparseable or calendar-invalid RFC 3339 timestamps (2026-02-30);start_datetime > end_datetime; or invalid/non-2-item/inverted Collection or linked parent Collectionextent.temporal.intervalendpoints (distinguishing invalid endpoints from legitimatenullopen bounds[null, end],[start, null],[null, null]).geometryis non-null whilebboxis missing;geometryisnullwhilebboxis present on a1.1.0Item;bboxhas invalid length (!= 4and!= 6),miny > maxy,minz > maxz(6D), or out-of-range WGS84 coordinates.
- Malformed JSON, non-object roots, invalid field types (
- Additional consistency findings (
consistency_findings— structural & cross-entity checks):- Item GeoJSON geometry bounds fall outside Item
bboxbeyond tolerance (1e-6). - Item
collectionproperty disagrees with parent Collectionid, or lacks a matchingrel: "collection"link. - Both Item temporal bounds (
start_datetime/end_datetimeordatetime) fail to fall inside parent Collectionextent.temporal.interval, or Itembboxfalls outside parent Collectionextent.spatial.bbox(or parent Collection extent is malformed). - Local relative or local
file://links(child,item,collection,parent,root) orassets.<key>.hreftargets (afterunquote()URI decoding) do not exist on disk.
- Item GeoJSON geometry bounds fall outside Item
- Partial checks & Unverified remote resources (
partial_checks,unverified_remote_resources):partial_checks: identifies checks verified only via bundled field rules (for example, Projectionv2.0.0proj:codeshape) when official extension JSON Schemas are not loaded locally.unverified_remote_resources: unsupportedstac_version, unpinnedstac_extensionsURIs, remotehttp:///https:///s3:///gs:///az://URIs, unknown schemes (ftp://), non-localfile://remotehost/...URIs, or top-level document paths / locallinks/assetsresolving outside the approvedcatalog_root.
3. Verify results without overstating coverage
Report exact counts for spec_violations, consistency_findings, partial_checks, and unverified_remote_resources per inspected document. Never report a partial-schema run or a run with unverified remote resources as full official specification compliance.
Examples
Run the self-contained offline STAC suite in stac validation harness:
User request: "Validate our static STAC 1.1.0 collection and items before publishing."
Inputs: Local catalog directory with collection.json, item.json files, and local asset files.
Expected result: Valid 1.1.0 items report 0 specification violations and 0 consistency findings while
explicitly flagging remote https:// assets under unverified_remote_resources and subset Projection checks
under partial_checks. Invalid fixtures catch malformed JSON, properties: null, geometry type "Bogus",
datetime: null with missing end_datetime, Item intervals ending outside Collection temporal extent,
Items outside Collection spatial extent, and paths escaping the catalog root.
Limitations
- The bundled harness uses offline subset schemas rather than full official STAC/GeoJSON/extension JSON Schemas (
$refnetwork resolution is deliberately disabled). Use official version-pinned local clones withreferencing.Registrywhen full$refschema coverage is required. - Antimeridian-crossing bboxes (
minx > maxx, where geometry-vs-bbox containment is skipped), 3D Z-range coordinate checks across vertices, full extension schemas beyond minimal field presence, and remote or recursive graph-level link traversal remain incomplete in the offline harness and are flagged underpartial_checks/unverified_remote_resourcesrather than treated as full conformance. - Remote COG/Parquet/Zarr header readability and GDAL pixel decoding require online authorization or
geospatial-python/ raster tooling. - Core Item
geometryandbboxsanity assumes WGS84 (EPSG:4326), per the STAC Item specification.
Safety and Side Effects
- Strictly read-only over local JSON files and local asset existence checks (
Path.is_file()). - Trusted catalog root & top-level document containment: Callers must pass a trusted
catalog_rootdirectory;validate_stac_documentenforces the samecatalog_rootcontainment (is_relative_to) and regular-file (is_file()) checks on the top-leveldoc_pathbefore reading it as it enforces on locallinksandassets. - Untrusted STAC & linked metadata hardening: Guard non-string/unhashable field types (
type: [],stac_extensions: [{}],link.rel: ["self"]), validate nested linked structures (parent_collection,extent,extent.temporal,extent.spatial) as JSON objects/arrays before indexing, distinguish invalid interval endpoints from legitimatenullopen bounds, catch malformed URI syntax (ValueErrorfromurlsplit) and invalid OS path characters (ValueError/OSError), decode URI paths carefully (unquote/url2pathname), reject unknown URI schemes and remotefile://hosts, and avoid fetching URLs discovered inside untrusted JSON.
Sources and related skills
- STAC Specification v1.1.0 (Items, Catalogs, Collections)
- STAC Specification v1.0.0
- Related skills: geospatial-python (CRS & raster alignment), noaa-radar-satellite-fetching (NOAA archive discovery), radar-satellite-analysis (remote-sensing interpretation), xarray-coordinate-alignment (coordinate alignment).