You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add CQL filter passthrough to OGC waterdata getters
Every `get_*` function that targets an OGC collection (`continuous`,
`daily`, `field_measurements`, `monitoring_locations`,
`time_series_metadata`, `latest_continuous`, `latest_daily`,
`channel`) now accepts `filter` and `filter_lang` kwargs that are
forwarded as the OGC `filter` / `filter-lang` query parameters.
This unlocks server-side expressions that aren't expressible via the
other kwargs. The motivating use case is pulling one-shot windows of
continuous data around many field-measurement timestamps in a single
request via OR'd BETWEEN clauses, instead of N round-trips.
Caveats documented in each docstring and NEWS.md:
- The server currently accepts `cql-text` (default) and `cql-json`;
`cql2-text` / `cql2-json` are not yet supported.
- Long filters can exceed the URI length limit. A `UserWarning` is
emitted above 5000 characters and the practical cap is around 75
OR-clauses before the server returns HTTP 414.
Includes unit tests covering the filter / filter-lang URL
construction for all OGC services and the long-filter warning.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: NEWS.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,5 @@
1
+
**04/22/2026:** The OGC `waterdata` getters (`get_continuous`, `get_daily`, `get_field_measurements`, and others) now accept `filter` and `filter_lang` kwargs that are passed through to the service's CQL filter parameter. This enables advanced server-side filtering that isn't expressible via the other kwargs — most commonly, OR'ing multiple time ranges into a single request. The server currently accepts `cql-text` (default) and `cql-json`; long filters can exceed the URI length limit, so `dataretrieval` warns above 5000 characters and the practical cap is around 75 OR-clauses before the server returns HTTP 414.
2
+
1
3
**12/04/2025:** The `get_continuous()` function was added to the `waterdata` module, which provides access to measurements collected via automated sensors at a high frequency (often 15 minute intervals) at a monitoring location. This is an early version of the continuous endpoint and should be used with caution as the API team improves its performance. In the future, we anticipate the addition of an endpoint(s) specifically for handling large data requests, so it may make sense for power users to hold off on heavy development using the new continuous endpoint.
2
4
3
5
**11/24/2025:**`dataretrieval` is pleased to offer a new module, `waterdata`, which gives users access USGS's modernized [Water Data APIs](https://api.waterdata.usgs.gov/). The Water Data API endpoints include daily values, instantaneous values, field measurements (modernized groundwater levels service), time series metadata, and discrete water quality data from the Samples database. Though there will be a period of overlap, the functions within `waterdata` will eventually replace the `nwis` module, which currently provides access to the legacy [NWIS Water Services](https://waterservices.usgs.gov/). More example workflows and functions coming soon. Check `help(waterdata)` for more information.
0 commit comments