Release Notes
This release introduces a dedicated ogcapi module that consolidates all OGC API-based web service clients under a single, extensible framework. The module exposes a new OGCAPIBase base class that handles pagination, CQL filtering, geometry queries, feature ID lookups, bounding-box queries, User-Agent identification, optional API-key injection, and automatic cache eviction for error responses. The existing GeoConnex and FabricData classes have been refactored to inherit from OGCAPIBase, and a new NWIS class has been added to access the USGS Water Data OGC API (https://api.waterdata.usgs.gov/ogcapi/v0) as USGS migrates its services to the OGC API standard.
New Features
- Add
NWISclass for accessing the new USGS Water Data OGC API (https://api.waterdata.usgs.gov/ogcapi/v0). USGS is migrating its web services to the OGC API standard; this class provides access to monitoring locations, daily/continuous observations, field/channel measurements, and reference code tables. The class reads theUSGS_API_KEYenvironment variable automatically for higher rate limits. - Add
NLDI.get_characteristics_byidmethod for retrieving local, total, or divergence-routed catchment characteristics for a specific feature directly from the NLDI API. - Add
trim_toleranceparameter toNLDI.navigate_byidandNLDI.navigate_byboxfor controlling how aggressively the first flowline is trimmed whentrim_start=True. - Add
StreamCat.changelog,StreamCat.data_dictionary, andStreamCat.all_metrics_bycomidmethods to expose additional StreamCat API endpoints.
Internal Changes
- Move
GeoConnexandFabricDatafromcoreto the new dedicatedogcapimodule alongside the newNWISclass. - Introduce
OGCAPIBaseas a reusable base class for all OGC API services.GeoConnex,FabricData, andNWISnow inherit from it, making it straightforward to add further OGC API-based services. OGCAPIBasenow sends aUser-Agentheader (pynhd/<version>) on every request so API providers can identify traffic from HyRiver.FabricDataandNWISread theUSGS_API_KEYenvironment variable when no explicitapi_keyis passed.- Error responses (e.g., rate-limit or server errors) are automatically evicted from the HTTP cache so they do not persist across retries.
- Fix type annotations across
core,network_tools,nhdplus_derived,ogcapi,pygeoapi, andpynhdmodules to pass strict Pyright type-checking.