Movatterモバイル変換


[0]ホーム

URL:


Skip to content
Esri Developer

Parse Esri JSON

Source:R/util-parse-esri-json.R
parse_esri_json.Rd

Parses an Esri FeatureSet JSON object into an R object. If there is nogeometry 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 toRcppSimdJson::fparse

call

The execution environment of a currently runningfunction, e.g.call = caller_env(). The corresponding functioncall is retrieved and mentioned in error messages as the sourceof the error.

You only need to supplycall when throwing a condition from ahelper function which wouldn't be relevant to mention in themessage.

Can also beNULL or adefused function call torespectively not display any call or hard-code a code to display.

For more information about error calls, seeIncluding 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)#> Simple feature collection with 1 feature and 1 field#> Geometry type: MULTIPOLYGON#> Dimension:     XY#> Bounding box:  xmin: 0 ymin: 0 xmax: 1 ymax: 1#> Geodetic CRS:  WGS 84#>   id                       geometry#> 1  1 MULTIPOLYGON (((0 0, 1 0, 1...

Was this page helpful?

Your browser is no longer supported. Please upgrade your browser for the best experience. See ourbrowser deprecation post for more details.


[8]ページ先頭

©2009-2025 Movatter.jp