Skip to content

Commit

Permalink
check
Browse files Browse the repository at this point in the history
  • Loading branch information
dblodgett-usgs committed Oct 21, 2023
1 parent 0481fa6 commit 3d56153
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
7 changes: 6 additions & 1 deletion R/arcrest_tools.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ query_usgs_arcrest <- function(AOI = NULL, ids = NULL,

length_ids <- length(ids)

chunk_size <- 1000
if(is.null(ids) | length(ids) == 0) {
"nothing found for filter or web service failed"
return(NULL)
}

chunk_size <- 2000
ids <- split(ids, ceiling(seq_along(ids)/chunk_size))

out <- rep(list(list()), length(ids))
Expand Down
9 changes: 6 additions & 3 deletions R/get_hydro.R
Original file line number Diff line number Diff line change
Expand Up @@ -200,22 +200,25 @@ get_nwis <- function(AOI = NULL, t_srs = NULL, buffer = 20000){
#' hydrolocation <- get_3dhp(AOI = AOI, type = "hydrolocation")
#' waterbody <- get_3dhp(AOI = AOI, type = "waterbody")
#'
#' if(!is.null(waterbody) & !is.null(flowlines) & !is.null(hydrolocation)) {
#' plot(sf::st_geometry(waterbody), col = "lightblue", border = "lightgrey")
#' plot(sf::st_geometry(flowlines), col = "blue", add = TRUE)
#' plot(sf::st_geometry(hydrolocation), col = "grey", pch = "+", add = TRUE)
#' plot(sf::st_geometry(hydrolocation), col = "grey", pch = "+", add = TRUE) }
#'
#' # given mainstem ids from any source, can query for them in ids.
#'
#' CO <- get_3dhp(ids = "https://geoconnex.us/ref/mainstems/29559",
#' type = "flowline")
#'
#' plot(sf::st_geometry(CO), col = "blue")
#' if(!is.null(CO))
#' plot(sf::st_geometry(CO), col = "blue")
#'
#' # get all the waterbodies along the CO river
#' CO_wb <- get_3dhp(ids = unique(CO$waterbodyid3dhp), type = "waterbody")
#'
#' if(!is.null(CO_wb)) {
#' plot(sf::st_geometry(CO_wb[grepl("Powell", CO_wb$gnisidlabel),]),
#' col = "blue", border = "NA")
#' col = "blue", border = "NA") }
#'
#' # given universamreferenceid (reachcodes), can query for them but only
#' # for hydrolocations. This is useful for looking up mainstem ids.
Expand Down
9 changes: 6 additions & 3 deletions man/get_3dhp.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d56153

Please sign in to comment.