getFeatureLayer | R Documentation |
Retrieve feature layer from ArcGIS REST service getFeatureLayer is used by writeLayer to write feature layers to local files
getFeatureLayer(url, bbox = NULL)
url |
URL of the layer REST service, ending with "/query". Example: https://geopub.epa.gov/arcgis/rest/services/EMEF/Tribal/MapServer/2/query (American Indian Reservations) |
bbox |
A bounding box from the sf function st_bbox; used to filter the query results. Optional; defaults to NULL. |
ArcGIS feature layer
## Not run:
# Load example dataset
data(Data_Nutrients_UT)
# Get the bounding box of the data
bbox <- sf::st_bbox(
c(
xmin = min(Data_Nutrients_UT$TADA.LongitudeMeasure),
ymin = min(Data_Nutrients_UT$TADA.LatitudeMeasure),
xmax = max(Data_Nutrients_UT$TADA.LongitudeMeasure),
ymax = max(Data_Nutrients_UT$TADA.LatitudeMeasure)
),
crs = sf::st_crs(Data_Nutrients_UT)
)
# Get the American Indian Reservations feature layer,
# filtered by the bounding box for the Data_Nutrients_UT example dataset
getFeatureLayer("https://geopub.epa.gov/arcgis/rest/services/EMEF/Tribal/MapServer/2/query", bbox)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.