parse_esri_json {arcgisutils} | R Documentation |
Parse Esri JSON
Description
Parses an Esri FeatureSet JSON object into an R object. If there is no geometry present, a data.frame is returned. If there is geometry, an sf object is returned.
Usage
parse_esri_json(string, ..., call = rlang::caller_env())
Arguments
string |
the raw Esri JSON string. |
... |
additional arguments passed to |
call |
The execution environment of a currently running
function, e.g. You only need to supply Can also be For more information about error calls, see Including function calls in error messages. |
Value
A data.frame. If geometry is found, returns an sf object.
Examples
esri_json <- '{
"geometryType": "esriGeometryPolygon",
"spatialReference": {
"wkid": 4326
},
"hasZ": false,
"hasM": false,
"features": [
{
"attributes": {
"id": 1
},
"geometry": {
"rings": [
[
[0.0, 0.0],
[1.0, 0.0],
[1.0, 1.0],
[0.0, 1.0],
[0.0, 0.0]
]
]
}
}
]
}'
parse_esri_json(esri_json)