An overview of the JSON toolset

The JSON toolset contains tools to convert features between JSON (JavaScript Object Notation) or GeoJSON and feature classes. JSON and GeoJSON are text-based, lightweight interchange data formats that are used to share GIS data between ArcGIS and other systems. These formats are language-agnostic, and most programming languages—such as Python, C#, Java, JavaScript, and so on—provide libraries to read, manipulate, and write JSON and GeoJSON.

Tools

ToolDescription

Features To JSON

Converts features to Esri JSON or GeoJSON format. The fields, geometry, and spatial reference of features will be converted to their corresponding JSON representation and written to a file with a .json or .geojson extension.

JSON To Features

Converts feature collections in an Esri JSON formatted file (.json) or a GeoJSON formatted file (.geojson) to a feature class.

Featureset JSON

ArcGIS REST API specification defines featureset as a collection of features with a specific geometry type, fields, and a spatial reference. The JSON format of featureset is shown below. The geometryType, Spatial Reference, and Fields properties define the geometry type, spatial reference, and field definitions for the collection of features. The features property defines the collection of features. Each feature in the collection has a geometry and field values (known as attributes) . The hasZ and hasM properties specify whether the features geometry have z and m values, respectively.

JSON representation of Featureset

{ 
"displayFieldName" : "<displayFieldName>",
"fieldAliases" : {
  "<fieldName1>" : "<fieldAlias1>",
  "<fieldName2>" : "<fieldAlias2>"
},
"geometryType" : "<geometryType>",
"hasZ" : <true|false>,  //Added at 10.1
"hasM" : <true|false>,   //Added at 10.1
"spatialReference" : <spatialReference>,
"fields": [
            {
                "name": "<field1>",
                "type": "<field1Type>",
                "alias": "<field1Alias>"
            },
            {
                "name": "<field2>",
                "type": "<field2Type>",
                "alias": "<field2Alias>"
            }
        ],
 "features": [
            {
                "geometry": {
                    <geometry1>
                },
                "attributes": {
                    "<field1>": <value11>,
                    "<field2>": <value12> 
                } 
            },
            {
                "geometry": {
                    <geometry2>
                },
                "attributes": {
                    "<field1>": <value21>,
                    "<field2>": <value22> 
                } 
            }
        ]
}

Related topics


In this topic
  1. Tools
  2. Featureset JSON