get_url_ply | R Documentation |
Given a sanctuary code or link (ie URL), download the zip, unzip it, and read first shapefile as a spatial feature. This function was originally designed to pull from one of the zip links found at NOAA Sanctuaries GIS.
get_url_ply(
sanctuary = NULL,
url = NULL,
dir_ply = here::here("data_ss/ply"),
verbose = F
)
sanctuary |
NOAA Sanctuary code with which to form |
url |
Link from which to fetch a polygon. Originally designed to pull from one of the zip links found at NOAA Sanctuaries GIS. |
dir_ply |
Directory to download locally into. This directory serves as a cache to skip operations if already performed. If zip file exists, skip downloading. If directory to unzip exists, skip unzipping. |
verbose |
Verbose messages describing operations and choices, such as skipping download or unzip and which shapefile used if more than one found. |
Returns a spatial feature sf polygon data frame.
# mbnms: Monterey Bay National Marine Sanctuary
ply_mbnms <- get_url_ply(sanctuary = "mbnms")
ply_mbnms
plot(ply_mbnms[1])
# fknms: Florida Keys National Marine Sanctuary
ply_fknms <- get_url_ply(sanctuary = "fknms")
ply_fknms
plot(ply_fknms[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.