R/download_well_meta.R

Defines functions download_well_meta

Documented in download_well_meta

#' Download "TWDB" Well Metadata
#'
#' @param opts list of curl options passed to crul::HttpClient()
#' @return sf
#' @export
#'
download_well_meta <- function(opts = list()) {
  ## downloads geojson and returns a sf tibble
  url <- "https://www.waterdatafortexas.org"
  path <- paste0("groundwater/wells.geojson")

  content <- get_download(url,
                          path,
                          accept = "json",
                          opts = opts)
  attr.url <- attr(content, 'url')

  content <- sf::read_sf(content)
  attr(content, 'url') <- attr.url

  return(content)
}
mps9506/wd4tx documentation built on Feb. 11, 2022, 11:33 p.m.