From c4d194444d250b2b008ca56afb7060f7a38cc7fd Mon Sep 17 00:00:00 2001 From: Daniel Schep Date: Sat, 6 Jun 2026 10:53:25 -0400 Subject: [PATCH 1/2] NOAA stream guage locations --- data/gauges.geojson | 1 + gauges.ultra | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 data/gauges.geojson create mode 100644 gauges.ultra diff --git a/data/gauges.geojson b/data/gauges.geojson new file mode 100644 index 0000000..c69e215 --- /dev/null +++ b/data/gauges.geojson @@ -0,0 +1 @@ +{"type":"FeatureCollection","features":[{"type":"Feature","properties":{"lid":"FCTV2","name":"Falling Creek at Turner Road near Ampt Hill","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.45011,"longitude":-77.5111,"pedts":{"observed":"HGIRR","forecast":""},"status":{"observed":{"primary":5.62,"primaryUnit":"ft","secondary":-999,"secondaryUnit":"kcfs","floodCategory":"not_defined","validTime":"2026-06-06T14:15:00Z"},"forecast":{"primary":-999,"primaryUnit":"","secondary":-999,"secondaryUnit":"","floodCategory":"fcst_not_current","validTime":"0001-01-01T00:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.5111,37.45011]}},{"type":"Feature","properties":{"lid":"FHRV2","name":"Falling Creek at Hopkins Rd near Ampt Hill","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.461048,"longitude":-77.466148,"pedts":{"observed":"HGIRR","forecast":""},"status":{"observed":{"primary":6.58,"primaryUnit":"ft","secondary":-999,"secondaryUnit":"kcfs","floodCategory":"not_defined","validTime":"2026-06-06T14:15:00Z"},"forecast":{"primary":-999,"primaryUnit":"","secondary":-999,"secondaryUnit":"","floodCategory":"fcst_not_current","validTime":"0001-01-01T00:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.466148,37.461048]}},{"type":"Feature","properties":{"lid":"JRKV2","name":"James River (VA) at KANAWHA CANAL near Richmond","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.564444444444,"longitude":-77.574444444444,"pedts":{"observed":"HGIRG","forecast":"HGIFE"},"status":{"observed":{"primary":6.65,"primaryUnit":"ft","secondary":0.137,"secondaryUnit":"kcfs","floodCategory":"not_defined","validTime":"2026-06-06T13:30:00Z"},"forecast":{"primary":-999,"primaryUnit":"","secondary":-999,"secondaryUnit":"","floodCategory":"fcst_not_current","validTime":"0001-01-01T00:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.574444444444,37.564444444444]}},{"type":"Feature","properties":{"lid":"PCFV2","name":"Pocoshock Creek at Rt 360 near Falling Creek Farms","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.46444,"longitude":-77.53854,"pedts":{"observed":"HGIRR","forecast":""},"status":{"observed":{"primary":6.29,"primaryUnit":"ft","secondary":-999,"secondaryUnit":"kcfs","floodCategory":"not_defined","validTime":"2026-06-06T14:15:00Z"},"forecast":{"primary":-999,"primaryUnit":"","secondary":-999,"secondaryUnit":"","floodCategory":"fcst_not_current","validTime":"0001-01-01T00:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.53854,37.46444]}},{"type":"Feature","properties":{"lid":"RCBV2","name":"Broad Rock Creek at Rt 1 at Richmond","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.487246,"longitude":-77.444991,"pedts":{"observed":"HGIRR","forecast":""},"status":{"observed":{"primary":3.55,"primaryUnit":"ft","secondary":-999,"secondaryUnit":"kcfs","floodCategory":"not_defined","validTime":"2026-06-06T14:30:00Z"},"forecast":{"primary":-999,"primaryUnit":"","secondary":-999,"secondaryUnit":"","floodCategory":"fcst_not_current","validTime":"0001-01-01T00:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.444991,37.487246]}},{"type":"Feature","properties":{"lid":"RICV2","name":"James River (VA) at Richmond Locks","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.525,"longitude":-77.421111111111,"pedts":{"observed":"HGIRG","forecast":"HGIFF"},"status":{"observed":{"primary":1.5,"primaryUnit":"ft","secondary":-999,"secondaryUnit":"kcfs","floodCategory":"no_flooding","validTime":"2026-06-06T13:54:00Z"},"forecast":{"primary":2.5,"primaryUnit":"ft","secondary":-999,"secondaryUnit":"kcfs","floodCategory":"no_flooding","validTime":"2026-06-09T03:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.421111111111,37.525]}},{"type":"Feature","properties":{"lid":"RMDV2","name":"James River (VA) at Richmond-Westham","rfc":{"abbreviation":"MARFC","name":"Middle Atlantic River Forecast Center"},"wfo":{"abbreviation":"AKQ","name":"Wakefield"},"state":{"abbreviation":"VA","name":"Virginia"},"latitude":37.563055555556,"longitude":-77.547222222222,"pedts":{"observed":"HGIRG","forecast":"HGIFF"},"status":{"observed":{"primary":4.03,"primaryUnit":"ft","secondary":1.91,"secondaryUnit":"kcfs","floodCategory":"no_flooding","validTime":"2026-06-06T13:30:00Z"},"forecast":{"primary":4,"primaryUnit":"ft","secondary":1.85,"secondaryUnit":"kcfs","floodCategory":"no_flooding","validTime":"2026-06-06T18:00:00Z"}}},"geometry":{"type":"Point","coordinates":[-77.547222222222,37.563055555556]}}]} diff --git a/gauges.ultra b/gauges.ultra new file mode 100644 index 0000000..acda6b7 --- /dev/null +++ b/gauges.ultra @@ -0,0 +1,16 @@ +--- +type: geojson +transform: | + export default (data) => ({ + type: "FeatureCollection", + features: data.gauges.map(g => ({ + type: "Feature", + properties: g, + geometry: { + type: "Point", + coordinates: [g.longitude, g.latitude], + }, + })), + }) +--- +https://api.water.noaa.gov/nwps/v1/gauges?bbox.xmin=-77.60205967932723&bbox.ymin=37.441871701544855&bbox.xmax=-77.31705491509821&bbox.ymax=37.62441381867703&srid=EPSG_4326 From 4cbe76757bc6f47b15f2ffc05047939814311579 Mon Sep 17 00:00:00 2001 From: Daniel Schep Date: Sat, 6 Jun 2026 15:14:41 -0400 Subject: [PATCH 2/2] map --- map.ultra | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/map.ultra b/map.ultra index f165cd6..56dbb21 100644 --- a/map.ultra +++ b/map.ultra @@ -17,6 +17,19 @@ style: fill-color: gray fill-opacity: 0.5 beforeLayerId: building + - type: symbol + filter: [==, [get, type], streamgauge] + icon-image: pinhead:circle_outline_with_top_left_quarter_and_bottom_right_quarter + icon-overlap: always + #icon-color: + # - case + # - [ ==, [ get, cso_now ], true ] + # - darkred + # - [ ==, [ get, cso_active ], true ] + # - red + # - [ ==, [ get, cso_recent ], true ] + # - orange + # - green - type: symbol filter: [==, [get, type], test] icon-image: pinhead:circle @@ -100,8 +113,9 @@ export const source = async () => { fetch("https://poop.maprva.org/data/cso_overflow.geojson"), fetch("https://poop.maprva.org/data/james_river_watch.geojson"), fetch("https://poop.maprva.org/data/water.geojson"), + fetch("https://api.water.noaa.gov/nwps/v1/gauges?bbox.xmin=-77.60205967932723&bbox.ymin=37.51971667627613&bbox.xmax=-77.31705491509821&bbox.ymax=37.62441381867703&srid=EPSG_4326"), ]); - const [cso, testResults, water] = await Promise.all(resps.map(r => r.json())); + const [cso, testResults, water, gauges] = await Promise.all(resps.map(r => r.json())); // get just the latest test results and compute their age const latestTestResults = testResults.features.reduce((acc, cur) => { @@ -120,7 +134,16 @@ export const source = async () => { ...Object.values(latestTestResults), ...cso.features, ...water.features, + ...gauges.gauges.map(g => ({ + type: "Feature", + properties: {...g, type: "streamgauge"}, + geometry: { + type: "Point", + coordinates: [g.longitude, g.latitude], + }, + })), ], }; return { type: "geojson", data }; } +