Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
f985421
hex-start
dblodgett-usgs May 23, 2026
5103ab0
Merge branch 'main' into hydrogeofetch
dblodgett-usgs May 25, 2026
3171f7f
finish hydrogeofetch hex
dblodgett-usgs May 25, 2026
03ac778
add high level plan
dblodgett-usgs May 25, 2026
0a06db0
flesh out hydrogeofetch plan
dblodgett-usgs May 25, 2026
4e16a53
remove build script that's not going to be needed
dblodgett-usgs May 26, 2026
32d4b83
Merge branch 'main' into hydrogeofetch
dblodgett-usgs May 26, 2026
903268e
update build strategy
dblodgett-usgs May 26, 2026
a300de8
hydrogeofetch migration step 1 complete
dblodgett-usgs May 26, 2026
36402e6
core nhdplusTools renaming
dblodgett-usgs May 26, 2026
830c0d5
environment and data dir rename
dblodgett-usgs May 26, 2026
5273fa0
memoise cache
dblodgett-usgs May 26, 2026
49f662e
package name change throughout
dblodgett-usgs May 26, 2026
8385e50
renames
dblodgett-usgs May 26, 2026
71a60a4
document
dblodgett-usgs May 26, 2026
c270168
strip byte order mark
dblodgett-usgs May 26, 2026
d5bf635
TODOs
dblodgett-usgs May 26, 2026
0ed4fba
skip failing tests
dblodgett-usgs May 26, 2026
5631c37
step 2 complete
dblodgett-usgs May 26, 2026
1a43313
remove fst
dblodgett-usgs May 27, 2026
3123243
httr not R download.file
dblodgett-usgs May 27, 2026
a1e3775
test cleanup
dblodgett-usgs May 27, 2026
03ec6d9
migrate to httr2
dblodgett-usgs May 27, 2026
49c1e7a
initial test mocking
dblodgett-usgs May 27, 2026
35059e7
mock more tests
dblodgett-usgs May 27, 2026
96b3447
integration tests that need network
dblodgett-usgs May 28, 2026
bd499e6
coverage
dblodgett-usgs May 28, 2026
0359433
dependency cleanup
dblodgett-usgs May 29, 2026
d594e6d
no more %>%
dblodgett-usgs May 29, 2026
da15b04
parallel tests back on
dblodgett-usgs Jun 1, 2026
f1af744
allow override of nldi sourced reachcode/measure in get_drrainage_are…
dblodgett-usgs Jun 1, 2026
d9aed96
handle NULL / error conditions in oafeat client
dblodgett-usgs Jun 1, 2026
4880569
http requests more robust
dblodgett-usgs Jun 1, 2026
d4f0ada
phase 3 plan complete
dblodgett-usgs Jun 1, 2026
31227fa
clean up more web service issues
dblodgett-usgs Jun 1, 2026
2db4f3e
clean up fixtures with long paths
dblodgett-usgs Jun 2, 2026
234a6c6
build performance
dblodgett-usgs Jun 2, 2026
7020d84
qa tier improvement
dblodgett-usgs Jun 8, 2026
eb8e9f6
improve 7zip for usgs install
dblodgett-usgs Jun 10, 2026
342a6c1
remove functionality duplicated from hydroloom
dblodgett-usgs Jun 11, 2026
6f2bcdb
complete documentation updates for hydroloom function removal
dblodgett-usgs Jun 11, 2026
8b82aa0
Merge branch 'main' into hydrogeofetch
dblodgett-usgs Jun 12, 2026
98932ea
fix test fixtures
dblodgett-usgs Jun 13, 2026
2c8c28f
clean up pkgdown and update citation
dblodgett-usgs Jun 14, 2026
ce7eb36
rebuild pkgdown
dblodgett-usgs Jun 15, 2026
89767f6
fixes #469 fixes #470 mainstem id support
dblodgett-usgs Jun 22, 2026
79e2ae7
catchup plan
dblodgett-usgs Jun 22, 2026
19dffbd
make arc rest more tolerant of failures
dblodgett-usgs Jun 22, 2026
4587c4f
clean up doco
dblodgett-usgs Jun 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ CLAUDE.md
dev
.claude
inst/build
vignettes/drainage_area_figures
PLAN.md
^tests/testthat/fixtures$
^vignettes/articles$
^\.kiro$
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ CLAUDE.md
dev
vignettes/*.html
vignettes/*_figures/
vignettes/articles/*.html
vignettes/articles/*_figures/
vignettes/articles/*_files/
.kiro/
64 changes: 48 additions & 16 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,60 @@ variables:
_R_CHECK_CRAN_INCOMING_: "false"
_R_CHECK_FORCE_SUGGESTS_: "true"
_R_CHECK_DONTTEST_EXAMPLES_: "false"
APT_PKGS: "p7zip-full"
_R_CHECK_RD_XREFS_: "false"

before_script:
- wget --no-check-certificate -O /usr/local/share/ca-certificates/DOIRootCA2.crt https://raw.githubusercontent.com/dblodgett-usgs/hydrogeoenv/master/linux/DOIRootCA2.cer
- chmod 644 /usr/local/share/ca-certificates/DOIRootCA2.crt && update-ca-certificates
- apt-get update
- apt-get install -y --no-install-recommends ${APT_PKGS}
- apt-get install -y --no-install-recommends qpdf pandoc
- export PATH="/usr/local/lib/R/site-library/littler/examples/:${PATH}"
- echo "options(Ncpus = $(nproc --all))" >> /usr/local/lib/R/etc/Rprofile.site
- install2.r devtools
- r -e 'devtools::install_dev_deps()'
stages:
- check
- build
- verify

test:
stage: test
workflow:
rules:
- if: $CI_COMMIT_BRANCH =~ /^rc\//

.r-base:
tags:
- chs-shared
image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/rocker/geospatial:latest
before_script:
- wget --no-check-certificate -O /usr/local/share/ca-certificates/DOIRootCA2.crt https://raw.githubusercontent.com/dblodgett-usgs/hydrogeoenv/master/linux/DOIRootCA2.cer
- chmod 644 /usr/local/share/ca-certificates/DOIRootCA2.crt && update-ca-certificates
- apt-get update
- apt-get install -y --no-install-recommends p7zip-full qpdf pandoc curl
- export PATH="/usr/local/lib/R/site-library/littler/examples/:${PATH}"
- echo "options(Ncpus = $(nproc --all))" >> /usr/local/lib/R/etc/Rprofile.site
- r -e 'pak::local_install_dev_deps()'

check:
extends: .r-base
stage: check
script:
- R CMD build --no-build-vignettes --no-manual .
- R CMD check --no-tests --no-examples --no-vignettes --no-manual *.tar.gz
artifacts:
paths:
- "*.Rcheck"
when: always

build:
extends: .r-base
stage: build
script:
- R CMD build .
- PKG_FILE=$(ls *.tar.gz)
- PKG_NAME=$(echo "$PKG_FILE" | sed 's/_.*//')
- PKG_VERSION=$(echo "$PKG_FILE" | sed 's/.*_\(.*\)\.tar\.gz/\1/')
- 'curl --silent --show-error --write-out "\nHTTP status: %{http_code}\n" --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "$PKG_FILE" "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PKG_NAME}/${PKG_VERSION}/${PKG_FILE}"'
artifacts:
paths:
- "*.tar.gz"

verify:
extends: .r-base
stage: verify
script:
- r -e 'devtools::check(check_dir = ".")'
- r -e 'capture.output(print(covr::coverage_to_list(covr::package_coverage(type = "all")), width = 20), file = "covr.txt", split = TRUE)'
- R CMD check --as-cran --no-manual *.tar.gz
artifacts:
paths:
- "*.Rcheck"
- "covr.txt"
when: always
17 changes: 9 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
Package: nhdplusTools
Package: hydrogeofetch
Type: Package
Title: NHDPlus Tools
Version: 1.5.0
Title: Hydrologic Geospatial Fabric Extraction Tool Chain
Version: 2.0.0
Authors@R: c(person(given = "David",
family = "Blodgett",
role = c("aut", "cre"),
email = "dblodgett@usgs.gov",
comment = c(ORCID = "0000-0001-9489-1710")),
person(given = "Mike",
family = "Johnson",
role = "aut",
role = "ctb",
comment = c(ORCID = "0000-0002-5288-8350")),
person(given = "Marc",
family = "Weber",
Expand All @@ -23,18 +23,19 @@ Authors@R: c(person(given = "David",
family = "Koenig",
role = "ctb",
comment = c(ORCID = "0000-0002-7790-330X")))
Description: Tools for traversing and working with National Hydrography Dataset Plus (NHDPlus) data. All methods implemented in 'nhdplusTools' are available in the NHDPlus documentation available from the US Environmental Protection Agency <https://www.epa.gov/waterdata/basic-information>.
Description: Tools for traversing and working with National Hydrography Dataset Plus (NHDPlus) data. All methods implemented in 'hydrogeofetch' are available in the NHDPlus documentation available from the US Environmental Protection Agency <https://www.epa.gov/waterdata/basic-information>. Previously published as 'nhdplusTools'.
URL: https://doi-usgs.github.io/nhdplusTools/ https://github.com/doi-usgs/nhdplusTools/
BugReports: https://github.com/doi-usgs/nhdplusTools/issues/
Depends:
R (>= 4.1)
Imports: hydroloom, dataRetrieval, dplyr, sf, units, magrittr, jsonlite, httr, xml2, R.utils, utils, tidyr, methods, maptiles, mapsf, fst, arrow, tools, zip, pbapply, memoise, digest
Suggests: testthat, knitr, rmarkdown, ggmap, ggplot2, lwgeom, gifski, leaflet, httptest, future, future.apply, StreamCatTools, terra
Imports: hydroloom, dataRetrieval, dplyr, sf, units, jsonlite, httr2, xml2, utils, data.table, methods, arrow, tools, zip, memoise, digest
Suggests: testthat, knitr, rmarkdown, ggmap, ggplot2, lwgeom, gifski, leaflet, httptest2, StreamCatTools, terra, maptiles, mapsf
License: CC0
Encoding: UTF-8
RoxygenNote: 7.3.3
VignetteBuilder: knitr
Config/testthat/parallel: true
Config/testthat/edition: 3
LazyData: true
LazyDataCompression: xz
Language: en-US
Config/roxygen2/version: 8.0.0
71 changes: 12 additions & 59 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Generated by roxygen2: do not edit by hand

export(add_plus_network_attributes)
export(add_mainstems)
export(align_nhdplus_names)
export(calculate_arbolate_sum)
export(calculate_total_drainage_area)
export(disambiguate_flowline_indexes)
export(check_mainstems)
export(discover_geoconnex_reference)
export(discover_nhdplus_id)
export(download_nhd)
Expand All @@ -13,72 +11,53 @@ export(download_nhdplusv2)
export(download_rf1)
export(download_vaa)
export(download_wbd)
export(fix_flowdir)
export(get_3dhp)
export(get_DD)
export(get_DM)
export(get_UM)
export(get_UT)
export(get_boundaries)
export(get_catchment_characteristics)
export(get_characteristics_metadata)
export(get_drainage_area_estimates)
export(get_elev_along_path)
export(get_flowline_index)
export(get_gagesII)
export(get_geoconnex_reference)
export(get_hr_data)
export(get_huc)
export(get_hydro_location)
export(get_levelpaths)
export(get_nhdarea)
export(get_nhdphr)
export(get_nhdplus)
export(get_nhdplushr)
export(get_nldi_basin)
export(get_nldi_feature)
export(get_nldi_index)
export(get_node)
export(get_nwis)
export(get_partial_length)
export(get_path_lengths)
export(get_path_members)
export(get_pathlength)
export(get_pfaf)
export(get_raindrop_trace)
export(get_sorted)
export(get_split_catchment)
export(get_streamlevel)
export(get_streamorder)
export(get_terminal)
export(get_tocomid)
export(get_vaa)
export(get_vaa_names)
export(get_vaa_path)
export(get_waterbodies)
export(get_waterbody_index)
export(get_wb_outlet)
export(get_xs_point)
export(get_xs_points)
export(make_node_topology)
export(hydrogeofetch_cache_settings)
export(hydrogeofetch_data_dir)
export(make_standalone)
export(map_nhdplus)
export(navigate_network)
export(navigate_nldi)
export(nhdplusTools_cache_settings)
export(nhdplusTools_data_dir)
export(nhdplus_path)
export(plot_nhdplus)
export(prepare_nhdplus)
export(rename_geometry)
export(rescale_catchment_characteristics)
export(rescale_measures)
export(st_compatibalize)
export(subset_nhdplus)
export(subset_rpu)
export(subset_vpu)
export(update_mainstems)
importFrom(arrow,open_dataset)
importFrom(arrow,read_csv_arrow)
importFrom(arrow,s3_bucket)
importFrom(arrow,write_parquet)
importFrom(data.table,as.data.table)
importFrom(data.table,dcast)
importFrom(dataRetrieval,findNLDI)
importFrom(digest,digest)
importFrom(dplyr,across)
Expand All @@ -87,6 +66,7 @@ importFrom(dplyr,any_of)
importFrom(dplyr,arrange)
importFrom(dplyr,bind_rows)
importFrom(dplyr,collect)
importFrom(dplyr,contains)
importFrom(dplyr,desc)
importFrom(dplyr,distinct)
importFrom(dplyr,everything)
Expand All @@ -102,48 +82,25 @@ importFrom(dplyr,select)
importFrom(dplyr,starts_with)
importFrom(dplyr,summarize)
importFrom(dplyr,ungroup)
importFrom(fst,metadata_fst)
importFrom(fst,read.fst)
importFrom(graphics,par)
importFrom(httr,GET)
importFrom(httr,RETRY)
importFrom(httr,content)
importFrom(httr,progress)
importFrom(httr,write_disk)
importFrom(hydroloom,accumulate_downstream)
importFrom(hydroloom,add_levelpaths)
importFrom(hydroloom,add_pathlength)
importFrom(hydroloom,add_pfafstetter)
importFrom(hydroloom,add_streamlevel)
importFrom(hydroloom,add_streamorder)
importFrom(httr2,req_perform)
importFrom(httr2,request)
importFrom(hydroloom,add_toids)
importFrom(hydroloom,disambiguate_indexes)
importFrom(hydroloom,fix_flowdir)
importFrom(hydroloom,get_hydro_location)
importFrom(hydroloom,get_node)
importFrom(hydroloom,get_partial_length)
importFrom(hydroloom,hy)
importFrom(hydroloom,index_points_to_lines)
importFrom(hydroloom,index_points_to_waterbodies)
importFrom(hydroloom,make_fromids)
importFrom(hydroloom,make_index_ids)
importFrom(hydroloom,navigate_connected_paths)
importFrom(hydroloom,navigate_hydro_network)
importFrom(hydroloom,navigate_network_dfs)
importFrom(hydroloom,rename_geometry)
importFrom(hydroloom,rescale_measures)
importFrom(hydroloom,sort_network)
importFrom(hydroloom,st_compatibalize)
importFrom(jsonlite,fromJSON)
importFrom(magrittr,`%>%`)
importFrom(memoise,cache_filesystem)
importFrom(memoise,cache_memory)
importFrom(memoise,memoise)
importFrom(methods,as)
importFrom(methods,is)
importFrom(pbapply,pbapply)
importFrom(pbapply,pblapply)
importFrom(pbapply,pboptions)
importFrom(sf,"st_geometry<-")
importFrom(sf,read_sf)
importFrom(sf,st_area)
Expand Down Expand Up @@ -171,12 +128,8 @@ importFrom(sf,st_union)
importFrom(sf,st_zm)
importFrom(sf,write_sf)
importFrom(stats,weighted.mean)
importFrom(tidyr,contains)
importFrom(tidyr,pivot_wider)
importFrom(tidyr,replace_na)
importFrom(tools,R_user_dir)
importFrom(units,set_units)
importFrom(utils,combn)
importFrom(utils,download.file)
importFrom(utils,read.delim)
importFrom(utils,tail)
Expand Down
44 changes: 44 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,47 @@
hydrogeofetch 2.0.0
==========

`hydrogeofetch` is the renamed successor to `nhdplusTools`. The package scope has grown beyond NHDPlus, and the new name reflects its broader role as a hydrologic geospatial data access and network tool chain. `nhdplusTools` will remain on CRAN as a deprecation shim until October 2028.

## New features

- New `add_mainstems()` joins geoconnex mainstem identifiers onto a table containing NHDPlusV2 (comid/featureid) or NHDPlusHR (nhdplusid) identifiers, using a cached lookup table from the [ref_rivers](https://github.com/internetofwater/ref_rivers) release. #469
- New `check_mainstems()` checks whether mainstem identifiers have been superseded by a newer reference release; new `update_mainstems()` re-indexes points with a known mainstem id onto its replacement using `hydroloom::index_points_to_lines()`. #470

## Removed functions (moved to hydroloom)

Network analysis and spatial indexing functions that duplicated [hydroloom](https://doi-usgs.github.io/hydroloom/) have been removed. Users should call hydroloom directly. See the [hydroloom reference](https://doi-usgs.github.io/hydroloom/reference/) for full documentation, especially the [indexing](https://doi-usgs.github.io/hydroloom/reference/index.html#indexing-and-linear-referencing) and [navigation](https://doi-usgs.github.io/hydroloom/reference/index.html#network-navigation-and-accumulation) sections.

- `get_flowline_index()` → `hydroloom::index_points_to_lines()`
- `get_waterbody_index()` → `hydroloom::index_points_to_waterbodies()`
- `disambiguate_flowline_indexes()` → `hydroloom::disambiguate_indexes()`
- `get_UT()`, `get_DD()` → `hydroloom::navigate_hydro_network(x, start, "UT")` / `"DD"`
- `get_UM()`, `get_DM()` → `hydroloom::navigate_hydro_network(x, start, "UM")` / `"DM"` (note: the old wrappers also ran `align_nhdplus_names`, filtered, and supported `sort`/`include` arguments)
- `navigate_network()` — workflow glue; use `navigate_nldi()` + `subset_nhdplus()` or hydroloom navigation directly
- `get_sorted()` → `hydroloom::sort_network()`
- `get_pathlength()` → `hydroloom::add_pathlength()`
- `get_streamorder()` → `hydroloom::add_streamorder()`
- `get_streamlevel()` → `hydroloom::add_streamlevel()`
- `get_levelpaths()` → `hydroloom::add_levelpaths()`
- `get_pfaf()` → `hydroloom::add_pfafstetter()`
- `get_terminal()` → `hydroloom::sort_network(x, split = TRUE)`
- `calculate_total_drainage_area()` → `hydroloom::accumulate_downstream(x, "area")`
- `calculate_arbolate_sum()` → `hydroloom::accumulate_downstream(x, "length")`
- `get_path_members()`, `get_path_lengths()` → `hydroloom::navigate_connected_paths()`
- `make_node_topology()` → `hydroloom::make_node_topology()`
- `add_plus_network_attributes()` → use hydroloom's `add_levelpaths()`, `add_pathlength()`, `accumulate_downstream()` etc. directly

## Removed re-exports

These hydroloom functions are no longer re-exported; call `hydroloom::fn()` directly:

- `st_compatibalize()`, `rename_geometry()`, `get_node()`, `fix_flowdir()`, `rescale_measures()`, `get_hydro_location()`, `get_partial_length()`

## Dependency changes

- Removed `pbapply` from Imports (no longer needed)
- Removed `future`, `future.apply` from Suggests (no longer needed)

nhdplusTools 1.5.0
==========

Expand Down
Loading
Loading