Queries the geoconnex reference feature server for features of interest.
get_geoconnex_reference(
AOI,
type = NULL,
t_srs = NULL,
buffer = 0.5,
status = TRUE
)
bbox, sf polygon or point, or a URL that will return an sf object when passed to read_sf
character the feature type chosen from discover_geoconnex_reference
character (PROJ string or EPSG code) or numeric (EPSG code). A user specified - target -Spatial Reference System (SRS/CRS) for returned objects. Will default to the CRS of the input AOI if provided, and to 4326 for ID requests.
numeric. The amount (in meters) to buffer a POINT AOI by for an extended search. Default = 0.5
boolean print status or not
sf data.frame containing requested reference features
# \donttest{
dplyr::distinct(discover_geoconnex_reference()[c("id", "title")])
#> # A tibble: 18 × 2
#> id title
#> <chr> <chr>
#> 1 hu02 HU02
#> 2 hu04 HU04
#> 3 hu06 HU06
#> 4 hu08 HU08
#> 5 hu10 HU10
#> 6 nat_aq USGS National Aquifers
#> 7 principal_aq USGS Principal Aquifers
#> 8 sec_hydrg_reg USGS Secondary Hydrogeologic Regions
#> 9 gages Reference Gages
#> 10 mainstems Reference Mainstems
#> 11 dams Reference Dams
#> 12 pws Public Water Systems
#> 13 states States
#> 14 counties Counties
#> 15 aiannh American Indian/Alaska Native Areas/Hawaiian Home Lands (AIANN…
#> 16 cbsa Core-based statistical areas (CBSA)
#> 17 ua10 Urban Areas
#> 18 places Places
AOI <- sf::st_as_sfc(sf::st_bbox(c(xmin = -89.56684, ymin = 42.99816,
xmax = -89.24681, ymax = 43.17192),
crs = "+proj=longlat +datum=WGS84 +no_defs"))
get_geoconnex_reference(AOI, type = "hu04")
#> Starting download of first set of features.
#> Simple feature collection with 2 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -91.15213 ymin: 41.22784 xmax: -88.18307 ymax: 46.21648
#> Geodetic CRS: WGS 84
#> # A tibble: 2 × 8
#> id loaddate gnis_id gnis_url uri fid name
#> * <chr> <dttm> <chr> <chr> <chr> <int> <chr>
#> 1 0707 2017-02-01 00:53:08 NA "" https://geoconnex.us/r… 189 Wisc…
#> 2 0709 2012-06-11 07:54:59 NA "" https://geoconnex.us/r… 65 Rock
#> # ℹ 1 more variable: geometry <MULTIPOLYGON [°]>
get_geoconnex_reference("https://geoconnex.us/ref/mainstems/315626", type = "hu04", )
#> Starting download of first set of features.
#> Simple feature collection with 15 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -106.7484 ymin: 30.05369 xmax: -91.8491 ymax: 39.38306
#> Geodetic CRS: WGS 84
#> # A tibble: 15 × 8
#> id loaddate gnis_id gnis_url uri fid name
#> * <chr> <dttm> <chr> <chr> <chr> <int> <chr>
#> 1 1102 2017-04-17 09:39:52 NA "" https://geoconnex.us/… 29 Uppe…
#> 2 1103 2012-06-11 07:54:59 NA "" https://geoconnex.us/… 70 Midd…
#> 3 1104 2012-06-11 07:54:59 NA "" https://geoconnex.us/… 133 Uppe…
#> 4 1105 2012-06-11 07:54:59 NA "" https://geoconnex.us/… 143 Lowe…
#> 5 1106 2017-04-21 13:34:18 NA "" https://geoconnex.us/… 144 Arka…
#> 6 1107 2017-04-21 13:34:23 NA "" https://geoconnex.us/… 145 Neos…
#> 7 1108 2017-09-20 20:59:45 NA "" https://geoconnex.us/… 126 Uppe…
#> 8 1109 2017-04-24 11:26:44 NA "" https://geoconnex.us/… 148 Lowe…
#> 9 1110 2017-04-21 13:15:51 NA "" https://geoconnex.us/… 146 Nort…
#> 10 1111 2017-04-21 13:15:55 NA "" https://geoconnex.us/… 7 Lowe…
#> 11 1112 2017-04-24 08:53:22 NA "" https://geoconnex.us/… 147 Red …
#> 12 1113 2017-04-24 08:53:22 NA "" https://geoconnex.us/… 179 Red-…
#> 13 1114 2017-10-15 23:35:54 NA "" https://geoconnex.us/… 175 Red-…
#> 14 1305 2017-11-05 19:43:51 NA "" https://geoconnex.us/… 178 Rio …
#> 15 1306 2017-09-20 20:59:52 NA "" https://geoconnex.us/… 129 Uppe…
#> # ℹ 1 more variable: geometry <MULTIPOLYGON [°]>
AOI <- sf::st_sfc(sf::st_point(c(-89.56684, 42.99816)),
crs = "+proj=longlat +datum=WGS84 +no_defs")
get_geoconnex_reference(AOI, type = "hu04", buffer = 100000)
#> Starting download of first set of features.
#> Simple feature collection with 2 features and 7 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: -91.15213 ymin: 41.22784 xmax: -88.18307 ymax: 46.21648
#> Geodetic CRS: WGS 84
#> # A tibble: 2 × 8
#> id loaddate gnis_id gnis_url uri fid name
#> * <chr> <dttm> <chr> <chr> <chr> <int> <chr>
#> 1 0707 2017-02-01 00:53:08 NA "" https://geoconnex.us/r… 189 Wisc…
#> 2 0709 2012-06-11 07:54:59 NA "" https://geoconnex.us/r… 65 Rock
#> # ℹ 1 more variable: geometry <MULTIPOLYGON [°]>
# }