get_mainstem_flowlines() returns the flowlines of geoconnex mainstems from NHDPlusV2, NHDPlusHR or 3DHP in the shape hydroloom’s aggregate flowpath functions take, with mainstemid set to the mainstem uri. With include_confluences = TRUE it adds the outlet flowline of each identified tributary so that hydroloom::get_confluences() can find where tributaries join. hydrogeofetch now requires hydroloom 1.3.0.

translate_hydrolocations() places points indexed to one of those networks on another, keeping each point on the mainstem its source identifier refers to. It indexes to the target mainstem’s flowlines directly, or records the point as a distance from a confluence both networks carry and lays that distance out on the target.

translate_flowlines() returns the pieces of target flowlines that cover each source flowline on its own mainstem.

OGC API Features requests no longer fetch the queryables of every collection on the server before each query; only the collection list is read.

  • Failed web service requests now report the service’s error message and whether retrying can help.
  • get_characteristics_metadata() falls back to ScienceBase when the S3 copy is unavailable (#487).
  • get_drainage_area_estimates() no longer copies catchment_data on every call.
  • Removed use of %||%, which requires R 4.4 (#483).
  • Added a 3DHP flowline sample for the New Hope basin.
  • The 3DHP service no longer carries reach code hydrolocations. The 3DHP article no longer shows relating NHD reachcodes to 3DHP, and the get_3dhp() docs no longer describe universalreferenceid as reachcodes; the service now fills it only on sink, spring and waterbody outlet hydrolocations.
  • The sample data scripts in inst/extdata no longer stop with an error when the download fails; they leave their objects undefined so callers can check with exists().

The GitHub repository was renamed from nhdplusTools to hydrogeofetch, which retired the old GitHub Pages site. The sample data files that examples and tests download were still requested from the old address and returned 404. All package URLs now point at doi-usgs.github.io/hydrogeofetch and github.com/DOI-USGS/hydrogeofetch.

get_drainage_area_estimates() now warns and returns NULL, rather than stopping, when the NHDPlusV2 OGC API returns no flowline attributes for the upstream network.

Improve coordinate precision test file matching to be more robust.

Bug fixes

  • Bounding box coordinates in OGC API Features requests are now rounded to six decimal places (about 0.1 m) instead of being sent at full floating point precision. Those coordinates come out of a projection round trip, and their last digits differ between PROJ builds, which made the request URL – and the recorded test fixtures keyed on it – platform dependent. Rounding is outward, so the queried area never shrinks.
  • Point coordinates that reach a request the same way – through discover_nhdplus_id() and the processing-service calls behind get_raindrop_trace(), get_split_catchment(), get_xs_point(), and get_xs_points() – are rounded to seven decimal places (about a centimeter) for the same reason.

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 get_3dhp_index() addresses (snaps) point features to the 3DHP network using the HydroAdd3D web service, returning the snapped location and elevation, the matched mainstem (as a geoconnex uri), the measure along the mainstem, and associated GNIS attributes.
  • 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 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 have been removed. Users should call hydroloom directly. See the hydroloom reference for full documentation, especially the indexing and navigation sections.

Removed re-exports

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

Caching changes

  • The memoise response cache now defaults to memory rather than filesystem. Cached web service responses live only as long as the R session unless you opt back in with hydrogeofetch_cache_settings(mode = "filesystem") or HYDROGEOFETCH_MEMOISE_CACHE=filesystem. The filesystem cache had no expiry and grew without bound in the user data directory.
  • New hydrogeofetch_cache_clear() removes data hydrogeofetch has cached in hydrogeofetch_data_dir(), either all of it or by category (responses, tiles, vaa, mainstems).

Bug fixes

  • get_3dhp() queries by universalreferenceid are now chunked, avoiding the service gateway timeouts (HTTP 504) that previously caused large reachcode lookups to return NULL. #475
  • get_catchment_characteristics() no longer surfaces the benign arrow “discarded from R metadata” warnings from the parquet metadata roundtrip. #475
  • Five stop() calls passed .call = FALSE instead of call. = FALSE, which appended FALSE to the error message the user saw. In get_nhdplus() and the query parameter checks.
  • Web requests now carry a 30 second connect timeout and a 300 second request timeout, so an unresponsive service can no longer hang a call indefinitely. Bulk downloads keep the connect timeout but are not capped on total duration.
  • check7z() no longer appends to PATH with Sys.setenv(); it returns the path to the 7z executable instead, leaving the user’s environment alone.

Other changes

Dependency changes

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

Function Updates

  • get_drainage_area_estimates() now returns drainage_basin, the upstream NHDPlusV2 catchments dissolved into a single boundary with the portion below the submitted point trimmed off the outlet catchment, along with its area as basin_da_sqkm. No HUC boundaries are involved. Both are available when catchments = TRUE or catchment_data is supplied, and always for headwater starts. For a headwater the basin is the whole answer, so the drainage area estimates are taken from its geometry rather than from an NHDPlus areasqkm attribute with a geometric difference subtracted from it.
  • get_drainage_area_estimates() no longer reports a drainage_basin carrying area below the submitted point when a split of the outlet catchment was due but the processing service returned none. A failed split was previously indistinguishable from a start that needed no split, and the full outlet catchment was kept in both cases. drainage_basin is now NULL and basin_da_sqkm NA when the split is missing.
  • get_drainage_area_estimates() no longer drops catchments from drainage_basin when a start resolves to several outlet COMIDs and a split catchment is available. A split covers one outlet catchment, so substituting it while removing several lost the catchments of the outlets that were not split.