Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from labs.waterdata to api.water #244

Merged
merged 3 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions demo/index.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,9 @@ geom_site <- sf::read_sf("https://geoconnex.us/nmwdi/nmbgmr/wells/NM0028827")
point <- sf::st_sfc(geom_site$geometry)
geom_site <- geom_site$geometry[[1]]
nldi_point<-nhdplusTools::discover_nhdplus_id(point)
# nldiURL<-"DM = "https://labs.waterdata.usgs.gov/api/nldi/linked-data/nwissite/USGS-08279500/navigate/DM?distance=100"
# nldiURL<-"DM = "https://api.water.usgs.gov/nldi/linked-data/nwissite/USGS-08279500/navigate/DM?distance=100"

nldi_query <- URLencode(paste0('https://labs.waterdata.usgs.gov/api/nldi/linked-data/comid/position?f=json&coords=POINT(',geom_site[1],' ',geom_site[2],')'))
nldi_query <- URLencode(paste0('https://api.water.usgs.gov/nldi/linked-data/comid/position?f=json&coords=POINT(',geom_site[1],' ',geom_site[2],')'))
start <- sf::read_sf(nldi_query)
mainstem <- sf::read_sf(paste0(start$navigation,"/DM/flowlines?distance=250"))

Expand All @@ -412,7 +412,7 @@ mapview::mapview(list("Downstream Mainstem"=sf::st_as_sf(sf::st_geometry(mainste
The above code constructs the URLs to call the NLDI service directly, however there are convenience tools in [R](https://usgs-r.github.io/nhdplusTools/index.html) and [Python](https://github.com/cheginit/pynhd) to interact with the NLDI. Below we use the R package `nhdplusTools` to discover data indexed to our downstream mainstem in the NLDI. What features are available from the NLDI?

```{r, message=FALSE, warning=FALSE}
knitr::kable(fromJSON("https://labs.waterdata.usgs.gov/api/nldi/linked-data"))
knitr::kable(fromJSON("https://api.water.usgs.gov/nldi/linked-data/"))

```

Expand Down
20 changes: 10 additions & 10 deletions demo/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion namespaces/iow/links.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ https://geoconnex.us/iow/homepage, https://internetofwater.org, konda@lincolnins
https://geoconnex.us/iow/aboutus, https://internetofwater.org/who-we-are/, [email protected], About us
https://geoconnex.us/demo, https://geoconnex.internetofwater.dev/demo, [email protected], geconnex demo
https://geoconnex.us/iow/sitemap, https://reference.geoconnex.us/stac/sitemap, [email protected], geoconnex sitemap
https://geoconnex.us/iow/nldi, https://labs.waterdata.usgs.gov/about-nldi/index.html, [email protected], nldi shortlink
https://geoconnex.us/iow/nldi, https://waterdata.usgs.gov/blog/nldi-intro/, [email protected], nldi shortlink
https://geoconnex.us/iow/nldi/demo, https://storymaps.arcgis.com/stories/0ecb1aaf143b4e1981dbe30f38fceec5, [email protected], nldi demo shortlink
https://geoconnex.us/iow/map, https://gis.cgs.earth/portal/apps/webappviewer/index.html?id=41e8676b373344dfab9733b4d8f32837, [email protected], geoconnex content map
https://geoconnex.us/iow/cr-demo, https://lincolninstitute.maps.arcgis.com/apps/mapviewer/index.html?webmap=87f4a26d8af24e758b39ec4d137661ac, [email protected], geoconnex demo map
Expand Down
2 changes: 1 addition & 1 deletion namespaces/nhdplusv2/comid.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,target,creator,description
https://geoconnex.us//nhdplusv2/comid/([0-9]+).*$, https://labs.waterdata.usgs.gov/api/nldi/linked-data/comid/$1, iow, NHDPlusV2 NLDI comids
https://geoconnex.us//nhdplusv2/comid/([0-9]+).*$, https://api.water.usgs.gov/nldi/linked-data/comid/$1, iow, NHDPlusV2 NLDI comids
2 changes: 1 addition & 1 deletion namespaces/nhdplusv2/huc12pp/huc12pourpoints.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,target,creator,description
https://geoconnex.us//nhdplusv2/huc12/([0-9]+)$, https://labs.waterdata.usgs.gov/api/nldi/linked-data/huc12pp/$1, iow, NHDPlusV2 NLDI HUC12
https://geoconnex.us//nhdplusv2/huc12/([0-9]+)$, https://api.water.usgs.gov/nldi/linked-data/huc12pp/$1, iow, NHDPlusV2 NLDI HUC12
2 changes: 1 addition & 1 deletion namespaces/nhdplusv2/reachcode.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,target,creator,description
https://geoconnex.us//nhdplusv2/reachcode/([0-9]+).*$, https://labs.waterdata.usgs.gov/geoserver/wmadata/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=wmadata%3Anhdflowline_network&outputFormat=application%2Fjson&cql_filter=reachcode%20=%20%27$1%27, iow, NHDPlusV2 reachcode
https://geoconnex.us//nhdplusv2/reachcode/([0-9]+).*$, https://api.water.usgs.gov/geoserver/wmadata/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=wmadata%3Anhdflowline_network&outputFormat=application%2Fjson&cql_filter=reachcode%20=%20%27$1%27, iow, NHDPlusV2 reachcode
2 changes: 1 addition & 1 deletion namespaces/nhdplusv2/wb_comid.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
id,target,creator,description
https://geoconnex.us//nhdplusv2/nhdwaterbody_comid/([0-9]+).*$, https://labs.waterdata.usgs.gov/geoserver/wmadata/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=wmadata%3Anhdwaterbody&outputFormat=application%2Fjson&cql_filter=comid%20=%20%27$1%27, iow, NHDPlusV2 nhdwaterbody
https://geoconnex.us//nhdplusv2/nhdwaterbody_comid/([0-9]+).*$, https://api.water.usgs.gov/geoserver/wmadata/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=wmadata%3Anhdwaterbody&outputFormat=application%2Fjson&cql_filter=comid%20=%20%27$1%27, iow, NHDPlusV2 nhdwaterbody
Loading