esri2sf | R Documentation |
These functions are the interface to the user.
esri2sf( url, outFields = c("*"), where = "1=1", bbox = NULL, token = "", geomType = NULL, crs = 4326, progress = FALSE, replaceDomainInfo = TRUE, ... ) esri2df( url, outFields = c("*"), where = "1=1", token = "", progress = FALSE, replaceDomainInfo = TRUE, ... ) esrimeta(url, token = "", fields = FALSE)
url |
character string for service url, e.g. https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/. |
outFields |
vector of fields you want to include. default is '*' for all fields". |
where |
string for where condition. Default is |
bbox |
bbox class object from |
token |
string for authentication token (if needed). |
geomType |
string specifying the layer geometry ('esriGeometryPolygon' or 'esriGeometryPoint' or 'esriGeometryPolyline' - if |
crs |
coordinate reference system (see |
progress |
Show progress bar with |
replaceDomainInfo |
add domain information to the return dataframe? Default TRUE. |
... |
additional named parameters to pass to the query. ex) "resultRecordCount = 3" |
fields |
|
sf dataframe (esri2sf
) or tibble dataframe (esri2df
) or list or dataframe (esrimeta
).
esri2sf
: Retrieve spatial object
esri2df
: Retrieve table object (no spatial data).
esrimeta
: Retrieve layer metadata
When accessing services with multiple layers, the layer number must be specified at the end of the service url (e.g., https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/3). #' The list of layers and their respective id numbers can be found by viewing the service's url in a web browser and viewing the "Layers" heading (e.g., https://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/#mapLayerList).
baseURL <- "https://sampleserver1.arcgisonline.com/ArcGIS/rest/" url <- paste0(baseURL, "services/Demographics/ESRI_Census_USA/MapServer/3") outFields <- c("POP2007", "POP2000") where <- "STATE_NAME = 'Michigan'" df <- esri2sf(url, outFields = outFields, where = where) plot(df)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.