From 27aa9ec66cd736d215937c91d6fc109f47044edf Mon Sep 17 00:00:00 2001 From: Jemma Stachelek Date: Fri, 11 Aug 2023 16:21:28 -0600 Subject: [PATCH] update aws endpoint, closes #92 --- NEWS.md | 4 ++++ R/utils.R | 4 ++-- data-raw/get-vpu-shp.R | 2 +- data-raw/get-vpu_key.R | 4 ++-- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/NEWS.md b/NEWS.md index ef9ebb1..891394a 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +## nhdR 0.6.1 + +* Update nhdplus download endpoint (#92) + ## nhdR 0.6.0 * Dropped use of the retiring `rgdal` package (#91) diff --git a/R/utils.R b/R/utils.R index 1860b25..55fe1f7 100644 --- a/R/utils.R +++ b/R/utils.R @@ -85,7 +85,7 @@ get_plus_remotepath <- function(vpu, component = "NHDSnapshot") { } baseurl <- paste0( - "https://edap-ow-data-commons.s3.amazonaws.com?delimiter=/&prefix=", + "https://dmap-data-commons-ow.s3.amazonaws.com?delimiter=/&prefix=", prefix) res <- read_xml(baseurl) res <- stringr::str_extract_all(as.character(res), @@ -100,7 +100,7 @@ get_plus_remotepath <- function(vpu, component = "NHDSnapshot") { res <- res[!(seq_len(length(res)) %in% c(grep("FGDB", res), grep(".pdf", res), grep("FileGDB", res)))] - paste0("https://edap-ow-data-commons.s3.amazonaws.com/", res[1]) + paste0("https://dmap-data-commons-ow.s3.amazonaws.com/", res[1]) } is_spatial <- function(filename) { diff --git a/data-raw/get-vpu-shp.R b/data-raw/get-vpu-shp.R index 874ba96..3ddbb9b 100644 --- a/data-raw/get-vpu-shp.R +++ b/data-raw/get-vpu-shp.R @@ -3,7 +3,7 @@ library(rgdal) library(nhdR) # https://www.epa.gov/waterdata/nhdplus-global-data -remote_path <- "https://https://edap-ow-data-commons.s3.amazonaws.com/NHDPlusV21/Data/GlobalData/NHDPlusV21_NHDPlusGlobalData_03.7z" +remote_path <- "https://https://dmap-data-commons-ow.s3.amazonaws.com/NHDPlusV21/Data/GlobalData/NHDPlusV21_NHDPlusGlobalData_03.7z" temp_dir <- tempdir() in_path <- file.path(temp_dir, "nhdglobal.7z") # in_path <- "/tmp/RtmpsyMbWy/nhdglobal.7z" diff --git a/data-raw/get-vpu_key.R b/data-raw/get-vpu_key.R index 866420a..0b37fb0 100644 --- a/data-raw/get-vpu_key.R +++ b/data-raw/get-vpu_key.R @@ -6,7 +6,7 @@ get_nhdplus_v21_links <- function(){ } directory_raw <- read_xml( - "https://edap-ow-data-commons.s3.amazonaws.com?delimiter=/&prefix=NHDPlusV21/Data/") + "https://dmap-data-commons-ow.s3.amazonaws.com?delimiter=/&prefix=NHDPlusV21/Data/") top_directories <- xml2::xml_text(directory_raw) top_directories <- strsplit(top_directories, "NHDPlusV21")[[1]] @@ -16,7 +16,7 @@ get_nhdplus_v21_links <- function(){ directories <- lapply(top_directories, function(x){ raw <- read_xml(paste0( - "https://edap-ow-data-commons.s3.amazonaws.com?delimiter=/&prefix=", x)) + "https://dmap-data-commons-ow.s3.amazonaws.com?delimiter=/&prefix=", x)) if(has_sub_dirs(raw)){ res <- data.frame(