Expose the Water Data STAC protocol surface - #386
Draft
thodson-usgs wants to merge 1 commit into
Draft
Conversation
Add raw access to the public USGS Water Data STAC operations through the `waterdata.stac` namespace: catalog and conformance discovery, collection and item resources, queryables, and GET/POST item search. Preserve upstream Catalog, Collection, GeoJSON, and JSON Schema documents alongside `BaseMetadata`, and forward every parameter advertised for those routes. The live catalog currently publishes one collection, `ratings`, containing base, correction, and expanded stage-discharge RDB assets. Keep `waterdata.get_ratings()` as the flat analysis-ready workflow that downloads and parses those files; the namespaced helpers serve raw discovery and can see future collections without another public-interface redesign. Use Water Data's configured base URL, host-scoped API key, typed HTTP failures, and bounded retries. Expose the upstream pagination `token` as `page_token` to avoid the package's credential guard, and omit internal management health routes because they are not STAC capabilities. Document the raw `(dict, BaseMetadata)` contract, namespace rationale, and ratings-only current inventory in the reference, architecture guide, README, NEWS, and an executable example notebook.
thodson-usgs
force-pushed
the
feat/waterdata-stac-api
branch
from
August 21, 2026 20:39
f1d289b to
417f9e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the public USGS Water Data STAC protocol surface through the
waterdata.stacnamespace while keeping the existing analysis-ready ratings workflow on the mainwaterdatafacade.Current upstream inventory
As verified against the live USGS catalog on 2026-08-21,
/stac/v0/collections?limit=100reportsnumberMatched: 1andnumberReturned: 1. The sole collection isratings, containing stage-discharge rating files in three RDB variants:base,corr, andexsa.This PR therefore does not claim that daily values, continuous values, peaks, field measurements, or other Water Data products are available through STAC. Those products currently belong to the separate
/ogcapi/v0API family. The official STAC documentation says the catalog will provide a wider array of native-format data, but it publishes no additional collection or timetable today.The generic interface is useful now for raw ratings catalog/item metadata and is deliberately data-driven so newly published collections can be discovered without another public-interface redesign.
waterdata.get_ratings()remains the only analysis-ready STAC workflow and continues to download and parse rating assets.Public interface
Raw STAC documents are grouped under
waterdata.stac:get_catalog()andget_conformance()get_collections()andget_collection()get_items()andget_item()get_queryables()search()using the advertised GET or POST representationEach helper returns
(document, BaseMetadata). Catalog, Collection, GeoJSON Item/ItemCollection, and JSON Schema documents remain unchanged so callers retain standard links, extensions, collection-specific properties, and asset metadata.The implementation forwards every parameter advertised for these public routes. The upstream pagination field
tokenis exposed aspage_tokenand translated back on the wire, avoiding ambiguity with the package's credential-parameter guard. Internal/_mgmt/pingand/_mgmt/healthroutes are excluded because they are service operations, not STAC capabilities.No compatibility aliases are added for the earlier draft names (
get_stac_*andsearch_stac) because that surface has never been released.Service integration
STAC calls share the Water Data adapter's existing:
ADR 0012 records why raw protocol-shaped operations use a
waterdata.stacnamespace while the parsedwaterdata.get_ratings()getter remains flat.Documentation
get_ratings()Validation
1005 passed, 12 deselected; coverage report:98%108 passedruff check,ruff format, strictmypy,lint-imports(8 contracts),xenon,complexipy, notebook stripping, and repository hygiene checksgit diff --checkf200027eidentical to the former five-commit tipPrimary upstream sources