get_shp_zip | R Documentation |
This function takes a path to a given shapefile from online or local directory, and returns a sf based data.frame to the R environment.
get_shp_zip(shp_url, web = TRUE)
shp_url |
A character path to a zipped shapefile, locally or online. |
web |
TRUE/FALSE, is the path a web URL or a local directory path |
Returns an sf data.frame.
# set up the parameters to use in function: library(sf) library(utils) library(mapview) # get a shapefile of all USGS gages in North America shp_url <- "https://water.usgs.gov/GIS/dsdl/gagesII_9322_point_shapefile.zip" gages2 <- get_shp_zip(shp_url) # now plot mapview::mapview(gages2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.