knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "40%", eval = TRUE ) library(AOI) library(sf)
AOI helps create reproducible, programmatic boundaries for analysis and mapping workflows. The package targets five main use cases:
AOI uses tidygeocoder
as a backend for term-based geooding and Wikipedia APIs. If you have more ridgid addresses tidygeocoder
is great!
geocode(c('Colorado State University', "University of Colorado", 'NOAA'))
# Address with POINT representation geocode('500 Linden St, Fort Collins, CO 80524', pt = TRUE)
# Single events geocode(event = 'D-day') # Multi-location events with BBOX (harvey = geocode(event = 'Hurricane Harvey', bb = TRUE)) mapview::mapview(harvey)
geocode_rev(c(37, -119))
aoi_get(state = c("CO", "UT"))
aoi_get(state = "TX", county = "Harris")
aoi_get(country = "Ukraine")
World_asia = aoi_get(country = "Asia") aoi_describe(World_asia) USA_south = aoi_get(state = "south") aoi_describe(USA_south)
# 100 square mile region around Longs Peaks aoi_ext("Long Peaks", wh = 10)
# 200 square mile region around 37,-119 aoi_ext(xy = c(x = 119, y = 37), wh = c(20, 10))
# 10,000 square meter region around Normandy Landings aoi_ext(geo = "white house", wh = 10000, bbox = TRUE) |> st_as_sf() |> aoi_map(returnMap = T)
NOTE: The following functions require leaflet, shiny and leaflelt.extras. Since these are Suggested Dependencies you will need to install them yourself in warnings appear.
Sometimes it is useful to view the created AOIs. aoi_map
offers a quickly formatted leaflet
map (not all that dissimilar from mapview
so this may retire).
AOI = geocode(geo = c("Paris", "Amsterdam", "Prague", "England"), pt = TRUE) aoi_map(AOI, returnMap = TRUE)
Alternatively sometimes users need very specific AOIs that are not POINTs, bounding boxes, or fiat boundaries. For this AOI provides aoi_draw()
which allows users to interactively draw an Area of Interest (AOI) using a shiny app.
Once an object is drawn and the "Save AOI" button pressed, a new sf
object called 'aoi' will appear in your environment.
aoi_draw()
knitr::include_graphics('man/figures/shiny-app.png')
The need for AOI's is rampant in the r-spatial community. AOI plays nicely with the following non-exhaustive list helping users be to the meat of their utilities without getting hung up on boundary definition.
| package |
|---|
| ggmap |
| nhdplusTools |
| elevatr |
| terrainr |
| climateR |
| dataRetrivial |
| soilDB |
| nwmTools |
| FedData |
| hereR |
Please add more!
remotes::install_github("mikejohnson51/AOI")
AOI has been supported with funds from the UCAR COMET program (2018-2019) and the NSF Convergence Accelerator Project (2020).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.