From 7f7123c39e53fb457ad344df3bd9affe4f085b24 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Thu, 9 May 2024 08:21:15 -0500 Subject: [PATCH 1/3] rename license --- LICENSE => LICENSE.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE => LICENSE.md (100%) diff --git a/LICENSE b/LICENSE.md similarity index 100% rename from LICENSE rename to LICENSE.md From ebcb50c90b738298c89c8cab005e22c9044ab7a4 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Thu, 9 May 2024 08:22:49 -0500 Subject: [PATCH 2/3] v1.0.0 code.json --- code.json | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/code.json b/code.json index 43109bbf..ae798bf2 100644 --- a/code.json +++ b/code.json @@ -1,4 +1,43 @@ [ + { + "name": "nhdplusTools", + "organization": "U.S. Geological Survey", + "description": "Tools for Using NHDPlus Data", + "version": "v1.0.0", + "status": "Production", + "permissions": { + "usageType": "openSource", + "licenses": [ + { + "name": "Public Domain, CC0-1.0", + "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v1.0.0/LICENSE" + } + ] + }, + "homepageURL": "https://code.usgs.gov/water/nhdplusTools/", + "downloadURL": "https://code.usgs.gov/water/nhdplusTools/-/archive/v1.0.0/nhdplustools-v1.0.0.zip", + "disclaimerURL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v1.0.0/DISCLAIMER.md", + "repositoryURL": "https://code.usgs.gov/water/nhdplusTools.git", + "vcs": "git", + "laborHours": 1500, + "tags": [ + "R", + "nhdplus", + "USGS", + "water", + "v0.6.2" + ], + "languages": [ + "R" + ], + "contact": { + "name": "David Blodgett", + "email": "dblodgett@usgs.gov" + }, + "date": { + "metadataLastUpdated": "2024-05-09" + } + }, { "name": "nhdplusTools", "organization": "U.S. Geological Survey", @@ -10,7 +49,7 @@ "licenses": [ { "name": "Public Domain, CC0-1.0", - "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v0.6.1/LICENSE.md" + "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v0.6.1/LICENSE" } ] }, @@ -49,7 +88,7 @@ "licenses": [ { "name": "Public Domain, CC0-1.0", - "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v0.6.1/LICENSE.md" + "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v0.6.1/LICENSE" } ] }, @@ -87,7 +126,7 @@ "licenses": [ { "name": "Public Domain, CC0-1.0", - "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v0.6.0/LICENSE.md" + "URL": "https://code.usgs.gov/water/nhdplusTools/-/raw/v0.6.0/LICENSE" } ] }, From eb1fd31ff15c7df4721786e45d0adb084f323520 Mon Sep 17 00:00:00 2001 From: David Blodgett Date: Thu, 9 May 2024 10:23:10 -0500 Subject: [PATCH 3/3] fixes #380 --- R/get_nhdplushr.R | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/R/get_nhdplushr.R b/R/get_nhdplushr.R index 97e84b68..2e413868 100644 --- a/R/get_nhdplushr.R +++ b/R/get_nhdplushr.R @@ -91,8 +91,19 @@ get_nhdplushr <- function(hr_dir, out_gpkg = NULL, try(out <- st_sf(out)) } - if(grepl("flowline", layer, ignore.case = TRUE) & check_terminals) - out <- make_standalone(out) + if(grepl("flowline", layer, ignore.case = TRUE) & check_terminals) { + expect_names <- get(paste0("make_standalone_tonode_attributes"), + envir = nhdplusTools_env) + if(!all(expect_names %in% names(out))) { + warning("check_terminals is true but attributes selected do not support the checks.") + } else { + tryCatch(out <- make_standalone(out), + error = function(e) { + warning("Failed to execute 'make_standalone' on output.\n", + "Error was:\n", e) + }) + } + } if(!is.null(out_gpkg) && (!layer %in% layer_names | overwrite)) { write_sf(out, layer = layer, dsn = out_gpkg)