Skip to content
climbage edited this page Mar 6, 2013 · 9 revisions

JSON Formats

The Features to JSON geoprocessing tool generates JavaScript Object Notation (JSON) from Esri features in ArcGIS. This JSON is easily readable and processed by Hadoop systems. It is generated in two flavors:

  • Enclosed JSON
  • Unenclosed JSON

Both are provided to support different application requirements and user workflows.

Enclosed JSON

An enclosed JSON document is a valid document in its entirety based on standard JSON specifications. It has header information including the features spatial reference if applicable. It can not be appended to without making it an invalid JSON document.

{
  "displayFieldName" : "",
  "fieldAliases" : { ... },
  "geometryType" : "esriGeometryPolygon",
  "spatialReference" : { "wkid" : 4326 },
  "fields" : [ ... ],
  "features" : [
    {
      "attributes" : {
        "OBJECTID" : 1,
        "NAME" : "Redlands"
	...
      },
      "geometry" : {
        "rings" : [
	...
        ]
      }
    }
,
    {
      "attributes" : {
        "OBJECTID" : 2,
        "NAME" : "Riverside"
	...
      },
      "geometry" : {
        "rings" : [
        ...
	]
      }
    }
  ]
}

Unenclosed JSON

The unenclosed JSON is a simplified version of the enclosed JSON. There is no header information and it can be appended to. While this JSON is not valid as an entire document, when read into Hadoop with the help of the Hadoop Utilities, it is broken up into individual records which are valid and can be parsed with a JSON paresr.

{
  "attributes" : {
    "OBJECTID" : 1,
    "NAME" : "Redlands"
     ...
  },
  "geometry" : {
    "rings" : [
     ...
    ]
  }
}

{
  "attributes" : {
    "OBJECTID" : 2,
    "NAME" : "Riverside"
     ...
  },
  "geometry" : {
    "rings" : [
     ...
    ]
  }
}