ArcGIS APIs and SDKs make use of a dedicated JSON specification to define geographic data for use on the map. These JSON objects include:

  • Points define a single location on the map, such as a user's location.
  • Polylines define a series of points representing a line, such as a road or a river.
  • Polygons define closed shapes, such as the outline of a lake.
  • Extents define closed rectangular shapes, such as the outline of a building.
  • Features consist of a geometry (point, line or polygon) and additional attributes (like a name) and a symbol that represents how the feature is rendered on the map.
  • Feature Sets define a series of features of the same geometry, such as polygons representing US states.
  • Feature Collections can define a series of feature sets as well as common rendering rules and information about the attributes each feature contains.

Points

Points are used to represent a single specific location, such as an address, users location, or asset. Points are required to have at least three properties:

  • x - The location of the point along the x axis.
  • y - The location of the point along the y axis.
  • spatialReference - Defines the measurement system used to locate the polygon on a model of the Earth. See introduction the Introduction to Spatial Reference Systems.

Points may also optionally contain z and m properties. z refers to elevation while m represents an arbitrary linear measurement that is independent of point's location. You can also refer to the ArcGIS REST API point documentation and the web map specification point documentation.

{
  "x": -118.24354,
  "y": 34.05389,
  "spatialReference": {
    "wkid": 4326
  }
}

Note: A wkid (or Well Known ID) identifies the spatial reference used to articulate the point's location. 4326 is the standard system commonly used by GPS. The `x` axis represents longitude and the y axis represents latitude. This may be the reverse of what you are accustomed to.

Polylines

Polylines are used to represent unclosed lines between two or more points. A line might represent a wall or barrier, a trail or road or a route between two locations. Polylines can include individual segments that do not touch and have two key top level properties:

  • paths - An array of paths, each path is an array of coordinates pairs in [x, y] format.
  • spatialReference - Defines the measurement system used to locate the polygon on a model of the Earth. See Introduction to Spatial Reference Systems.

Each coordinate pair can also have a z and/or m as the third or fourth item in the coordinate array. If a polyline has z and/or m in it's coordinates the hasZ and/or hasM properties will be present and set to true refer to the ArcGIS REST API polyline documentation and the webmap specification polyline documentation.

{
  "paths": [
    [
      [ -118.24354, 34.05389 ],
      [ -118.24446, 34.05294 ],
      [ -118.24554, 34.05364 ],
      [ -118.24358, 34.05576 ],
      [ -118.24448, 34.05649 ],
      [ -118.24643, 34.05814 ],
      [ -118.24454, 34.06001 ]
    ]
  ],
  "spatialReference": {
    "wkid": 4326
  }
}

Note: A wkid (or Well Known ID) identifies the spatial reference used to articulate the point's location. 4326 is the standard system commonly used by GPS. The `x` axis represents longitude and the y axis represents latitude. This may be the reverse of what you are accustomed to.

Polygons

Polygons are used to represent closed and filled shapes such as state or country boundaries, parks or building footprints. They can include both holes and non-overlapping geometries. Polygons have two key top level properties:

  • rings - An array of rings, clockwise rings are filled and counterclockwise rings are considered holes. Each ring is an array of [x, y] coordinate pairs.
  • spatialReference - Defines the measurement system used to locate the polygon on a model of the Earth. See introduction the Introduction to Spatial Reference Systems.

Each coordinate pair can also have a z and/or m as the third or fourth item in the coordinate array. If a polyline has z and/or m in it's coordinates the hasZ and/or hasM properties will be present and set to true refer to the ArcGIS REST API polygon documentation and the webmap specification polygon documentation.

{
  "rings":[
    [
      [ -118.38516, 34.01270 ],
      [ -118.38827, 34.01489 ],
      [ -118.38813, 34.01602 ],
      [ -118.38797, 34.01648 ],
      [ -118.38760, 34.01712 ],
      [ -118.38733, 34.01696 ],
      [ -118.38696, 34.01749 ],
      [ -118.38662, 34.01789 ],
      [ -118.38689, 34.01805 ],
      [ -118.38683, 34.01812 ],
      [ -118.38295, 34.01592 ],
      [ -118.38516, 34.01270 ]
    ],
    [
      [ -118.38661, 34.01486 ],
      [ -118.38634, 34.01498 ],
      [ -118.38652, 34.01563 ],
      [ -118.38670, 34.01559 ],
      [ -118.38679, 34.01595 ],
      [ -118.38699, 34.01591 ],
      [ -118.38707, 34.01507 ],
      [ -118.38661, 34.01486 ]
    ]
  ],
  "spatialReference": {
    "wkid": 4326
  }
}

Note: A wkid (or Well Known ID) identifies the spatial reference used to articulate the point's location. 4326 is the standard system commonly used by GPS. The `x` axis represents longitude and the y axis represents latitude. This may be the reverse of what you are accustomed to.

Extents

Extents represent rectangular shapes that are commonly used to center the map on a particular area of interest. Extents are also commonly referred to as envelopes or bounding boxes and have five key top level properties:

  • xmin - The lowest value of the extent along the x-axis.
  • ymin - The lowest value of the extent along the y-axis.
  • xmax - The highest value of the extent along the x-axis.
  • ymax - The highest value of the extent along the y-axis.
  • spatialReference - Defines the measurement system used to locate the extent on a model of the Earth. See Introduction to Spatial Reference Systems.

Extents can also contain z and m values in their zmin/zmax and mmin/max properties, refer to the ArcGIS REST API extent documentation and the webmap specification extent documentation.

{
  "xmin": -118.252655,
  "ymin": 34.048244,
  "xmax": -118.239434,
  "ymax": 34.057265,
  "spatialReference": {
    "wkid": 4326
  }
}

Note: A wkid (or Well Known ID) identifies the spatial reference used to articulate the point's location. 4326 is the standard system commonly used by GPS. The `x` axis represents longitude and the y axis represents latitude. This may be the reverse of what you are accustomed to.

Features

Features are used to associate tabular data with geographic information. This additional information can used to affect the rendering of the feature, provide additional metadata to services, be displayed in popups, or used to filter features on the map. Features have two important top level properties:

  • geometry - A point, polyline, polygon or extent object.
  • attributes - An object of key/value pairs in JSON format to associate with the geometry.

In the web map specification features can also accept a symbol property which represents how this feature will be visualized on the map, see the web map specification feature documentation for more information. You can also refer to this ArcGIS REST API feature documentation;

{
  "geometry": {
    "x": -118.24274,
    "y": 34.05369,
    "spatialReference": {
      "wkid": 4326
    }
  },
  "attributes": {
    "name": "LA City Hall",
    "address":"200 N Spring St, Los Angeles, CA 90012"
  }
}

Note: A wkid (or Well Known ID) identifies the spatial reference used to articulate the point's location. 4326 is the standard system commonly used by GPS. The `x` axis represents longitude and the y axis represents latitude. This may be the reverse of what you are accustomed to.

Feature Sets

Feature sets are groups of features that share a common geometry type, spatial reference and attribute information. Feature sets are commonly used to represent groups of similar features, especially as parameters to, or responses from API methods. Features have two important top level properties:

  • features - An array of features.
  • spatialReference - Defines the measurement system used to locate the features on a model of the Earth. See introduction the Introduction to Spatial Reference Systems.
  • fields - An array of objects with a name, alias and type. These fields define valid attributes of each feature.
  • objectIdField - Indicates which field holds the unique ID of the feature.
  • geometryType - Indicates the type of geometry of the features, esriGeometryPoint, esriGeometryPolyline or esriGeometryPolygon.
{
  "spatialReference": {
    "wkid": 4326
  },
  "fields": [
    {
      "alias": "OBJECTID",
      "name": "OBJECTID",
      "type": "esriFieldTypeOID",
      "editable": false
    },
    {
      "alias": "Name",
      "name": "name",
      "length": 255,
      "type": "esriFieldTypeString",
      "editable": true
    },
    {
      "alias": "Address",
      "name": "address",
      "length": 255,
      "type": "esriFieldTypeString",
      "editable": true
    }
  ],
  "objectIdField": "OBJECTID",
  "geometryType": "esriGeometryPoint",
  "features": [
    {
      "geometry": {
        "x": -118.24274,
        "y": 34.05369,
        "spatialReference": {
          "wkid": 4326
        }
      },
      "attributes": {
        "OBJECTID": 1,
        "name": "LA City Hall",
        "address": "200 N Spring St, Los Angeles, CA 90012"
      }
    },
    {
      "geometry": {
        "x": -118.24935,
        "y": 34.05501,
        "spatialReference": {
          "wkid": 4326
        }
      },
      "attributes": {
        "OBJECTID": 2,
        "name": "Walt Disney Concert Hall",
        "address": "111 S Grand Ave, Los Angeles, CA 90012"
      }
    },
    {
      "geometry": {
        "x": -118.24853,
        "y": 34.0505,
        "spatialReference": {
          "wkid": 4326
        }
      },
      "attributes": {
        "OBJECTID": 3,
        "name": "Grand Central Market",
        "address": "317 S Broadway, Los Angeles, CA 90013"
      }
    }
  ]
}

Feature Collections

Feature collections are similar to feature sets with several important differences:

  • Feature collections can have multiple layers, each layer can have its own distinctive geometry types, fields and features.
  • Feature collections can be rendered as a part of the [web map] and [web scene] specifications.
  • Feature collections can be saved as items in ArcGIS Online or ArcGIS Enterprise and shared in multiple maps or applications.

Feature collections should be created according to the web map specification's featureCollection object.

{
  "layers": [
    {
      "layerDefinition": {
        "objectIdField": "OBJECTID",
        "templates": [],
        "type": "Feature Layer",
        "drawingInfo": {
          "renderer": {
            "type": "simple",
            "symbol": {
              "style": "esriSMSCircle",
              "type": "esriSMS",
              "xoffset": 0,
              "yoffset": 0,
              "angle": 0,
              "size": 20,
              "color": [4, 121, 193, 127],
              "outline": {
                "style": "esriSLSSolid",
                "type": "esriSLS",
                "width": 2,
                "color": [2, 94, 149, 255]
              }
            }
          }
        },
        "displayField": "name",
        "visibilityField": "",
        "name": "Places",
        "hasAttachments": false,
        "typeIdField": "",
        "capabilities": "Query,Editing",
        "types": [],
        "geometryType": "esriGeometryPoint",
        "fields": [
          {
            "alias": "OBJECTID",
            "name": "OBJECTID",
            "type": "esriFieldTypeOID",
            "editable": false
          },
          {
            "alias": "Name",
            "name": "name",
            "length": 255,
            "type": "esriFieldTypeString",
            "editable": true
          },
          {
            "alias": "Address",
            "name": "address",
            "length": 255,
            "type": "esriFieldTypeString",
            "editable": true
          }
        ],
        "extent": {
          "xmin": -118.24935,
          "ymin": 34.0505,
          "xmax": -118.24274,
          "ymax": 34.05501,
          "spatialReference": {
            "wkid": 4326
          }
        },
        "spatialReference": {
          "wkid": 4326
        }
      },
      "popupInfo": {
        "title": "{name}",
        "description": "{address}"
      },
      "featureSet": {
        "geometryType": "esriGeometryPoint",
        "features": [
          {
            "geometry": {
              "x": -118.24274,
              "y": 34.05369,
              "spatialReference": {
                "wkid": 4326
              }
            },
            "attributes": {
              "OBJECTID": 1,
              "name": "LA City Hall",
              "address": "200 N Spring St, Los Angeles, CA 90012"
            }
          },
          {
            "geometry": {
              "x": -118.24935,
              "y": 34.05501,
              "spatialReference": {
                "wkid": 4326
              }
            },
            "attributes": {
              "OBJECTID": 2,
              "name": "Walt Disney Concert Hall",
              "address": "111 S Grand Ave, Los Angeles, CA 90012"
            }
          },
          {
            "geometry": {
              "x": -118.24853,
              "y": 34.0505,
              "spatialReference": {
                "wkid": 4326
              }
            },
            "attributes": {
              "OBJECTID": 3,
              "name": "Grand Central Market",
              "address": "317 S Broadway, Los Angeles, CA 90013"
            }
          }
        ]
      }
    }
  ],
  "showLegend": false
  }