Feature Output

All the spatial analysis tasks create new data. This new data is typically features but in some cases, such as with the Aggregate Points task, the output may include tables. There are two values that can be returned to you:

  1. A URL to a feature service layer, or
  2. a feature collection.

URL to a feature service

One of the optional input parameters to a task is OutputName. If OutputName is specified, the output will be a feature service is hosted at your organization. You set the OutputName parameter to a feature service name of your choosing. The layer name or names within the feature service are determined by the task. The output URL will be the URL to a layer within the service.

Feature collection output

If OutputName is not specified, results will be returned as a feature collection. For more information on feature collections and feature sets, see the Javascript documentation:

Example feature collection

{
    "layerDefinition": {
        "geometryType": "esriGeometryPoint",
        "fields": [
            {
                "name": "Id",
                "type": "esriFieldTypeOID",
                "alias": "Id"
            },
            {
                "name": "Name",
                "type": "esriFieldTypeString",
                "alias": "Name"
            }
        ]
    },
    "featureSet": {
        "geometryType": "esriGeometryPoint",
        "spatialReference": {
            "wkid": 4326
        },
        "features": [
            {
                "geometry": {
                    "x": -104.44,
                    "y": 34.83
                },
                "attributes": {
                    "Id": 43,
                    "Name": "Feature 1"
                }
            },
            {
                "geometry": {
                    "x": -100.65,
                    "y": 33.69
                },
                "attributes": {
                    "Id": 67,
                    "Name": "Feature 2"
                }
            }
        ]
    }
}

In addition to output features, some tasks may output a table of statistics (such as the Aggregate Points task). Tables are simply a subset of features; that is, they contain attributes but no geometry. Their syntax is the same as a feature collection, but with no spatial components.

Example table output.

{
    "layerDefinition": {
        "fields": [
            {
                "name": "Id",
                "type": "esriFieldTypeString",
                "alias": "Id"
            },
            {
                "name": "State_Name",
                "type": "esriFieldTypeString",
                "alias": "State Name"
            },
            {
                "name": "State_Abbr",
                "type": "esriFieldTypeString",
                "alias": "State Abbr"
            }
        ]
    },
    "featureSet": {
        "features": [
            {
                "attributes": {
                    "Id": 43,
                    "State_Name": "California",
                    "State_Abbr": "CA"
                }
            },
            {
                "attributes": {
                    "Id": 67,
                    "State_Name": "Colorado",
                    "State_Abbr": "CO"
                }
            }
        ]
    }
}