Use MATLAB stats and new GS attributes in /arctic_hydrology/stats/ endpoint#723
Open
Joshdpaul wants to merge 10 commits into
Open
Use MATLAB stats and new GS attributes in /arctic_hydrology/stats/ endpoint#723Joshdpaul wants to merge 10 commits into
/arctic_hydrology/stats/ endpoint#723Joshdpaul wants to merge 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Arctic hydrology API to use the new Rasdaman MHIT statistics coverage and updated GeoServer attributes, and to populate a summary block from a dedicated WFS stats layer for frontend “data sentences”.
Changes:
- Switch
/arctic_hydrology/stats/<stream_id>to the newak_hydro_segments_mhit_stats_combinedRasdaman coverage to expose the full MHIT statistics suite. - Add a new WFS URL generator + request path to fetch precomputed “summary” statistics from
hydrology:arctic_rivers_segments_stats_simplified, and include additional segment metadata (e.g., gauge/watershed attributes). - Expand Arctic hydrology documentation and CSV header metadata to reflect the broader stats set and new
?source=options.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
templates/documentation/arctic_hydrology.html |
Updates endpoint docs, query params (?source=), and example responses to reflect the new stats/summary/metadata. |
routes/arctic_hydrology.py |
Switches the stats coverage, adds WFS summary fetch + response population, and adds new segment metadata fields. |
generate_urls.py |
Updates Arctic hydrology WFS layer name/attributes and adds a new WFS URL builder for summary stats. |
csv_functions.py |
Updates Arctic stats CSV header comments to enumerate the expanded MHIT statistic set. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This branch upgrades the Arctic hydrology endpoints to use updated GeoServer layer attributes and the new Rasdaman coverage that expose the full MHIT statistics suite. This branch also populates the
summaryblock of pre-computed key statistics for use by the front end data sentences.Summary of changes
All MHIT statistics: The stats endpoint (
/arctic_hydrology/stats/<stream_id>) now returns all 50+ MHIT hydrologic statistics via the newak_hydro_segments_mhit_stats_combinedRasdaman coverage. Previously only ma12–ma23 and ma99 were returned.summaryblock on stats and hydroviz endpoints: The top-levelsummarykey is populated from thearctic_rivers_segments_stats_simplifiedGeoServer layer which provides pre-computed statistics for the data sentences section of the app. Previously, there was a placeholder stub dictionary here populated with null values.Additional segment metadata: Stats and climatology responses now include
gauge_id(USGS or Canadian gauge ID if available, empty string otherwise),watershed(HUC8 or Yukon watershed ID), andwatershed_outlet(boolean). Note that the dictionary keys here vary from the CONUS return because we aren't dealing exclusively with HUC8s in the transboundary dataset.GeoServer layer updates
generate_wfs_arctic_hydrology_url: Updated WFS layer name fromhydrology:arctic_segmentstohydrology:arctic_rivers_segments_joined_3338_simplifiedand expandedpropertyNameto includeGauge_ID,ID_1,ID_2,Name, andoutlet.generate_wfs_arctic_hydrology_stats_url(new): Fetches pre-computed summary statistics fromhydrology:arctic_rivers_segments_stats_simplified.Documentation (
arctic_hydrology.html)?source=parameter documentation to both endpoint tables (stats: three accepted values; modeled climatology: two accepted values), matching the CONUS hydrology docs.summary,watershed,watershed_outlet, andgauge_idfields.CSV output (
csv_functions.py)arctic_hydrology_csv()to document all 50 statistics with descriptions matching the format used by the CONUS hydrology CSV.