FRAMES | NO FRAMES

 

B U S I N E S S   A N A L Y S T   10.1   R E S T    A N A L Y S I S    T A S K

Spatial Overlay Endpoint

Aggregates data from a geographic layer with another layer.

 

Availability: Business Analyst Server.

 

URL Example

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/SpatialOverlay/execute

Specific Parameters

Parameter

Description

Boundaries (required)

The polygon layer whose features represent trade areas. Type DataLayer.

Summarizations (required)

Fields of the geography layer to be aggregated to the output feature layer. Type array of string.

AnalysisExtent (optional)

Data extent to restrict the analysis. Type ExtentData.

AreaIDField (optional)

Name of area ID field in the Boundaries layer. Type string.

Default: AREA_ID.

DataHierarchy (optional)

Name of a hierarchy of data layers used for summarization. Type string. Use the Get Data Hierarchies lookup operation to query available geography hierarchies.

Default: Standard Business Analyst Data.

SingleAreaID (optional)

ID of a single area of the Boundaries layer to calculate market penetration. Type string.

Other Parameters

Parameter

Description

OutputType (required)

Array of task output options. Options for this endpoint include rendering an output image (GetMapImage) and/or creating a feature layer for subsequent analysis (GetFeatureClass). Type array of TaskOutputType.

ActiveDatasetID (optional)

ID of the active dataset. Type string.

Default: ID of the first available dataset.

f (optional)

Response format. Type string. Available formats: HTML, JSON, PJSON, XML.

Default: HTML.

IsFullErrorMessage (optional)

Mode for composing error messages. Type boolean.

Default: false.

OutputAnalysisItem (optional)

Configuration options for storing the output feature layer in the repository. This will enable viewing and working with the output result in subsequent tasks. Type esriFolderItem.

OutputSpatialReference (optional)

An option specifying the spatial reference to return the output feature layer. Type SpatialReference. If this parameter is missing, the output record set will be returned in the default spatial reference. See Get Default Spatial Reference lookup operation to query the default spatial reference.

RenderingParameters (optional)

Configuration options for rendering output when GetMapImage option is specified in the OutputType parameter. Type RenderingParameters.

ReturnGeometry (optional)

An option specifying the presence of the shape attribute in the returned record set. Type boolean.

Default: true.

token

Authentication token. This parameter is required if your Business Analyst Server is secured. Type string.

Returns

Variable of type TaskResultOutput

Remarks

The Spatial Overlay endpoint allows you to summarize demographic data for a set of custom trade areas and add summarized values as attribute fields to the output feature layer.

 

The analysis can be restricted to an analysis extent if the AnalysisExtent parameter is specified. The optional SingleAreaID parameter restricts the analysis to a single area of the Boundaries layer.

 

The Summarizations parameter specifies names of variables from the geography hierarchy to be aggregated on areas of the Boundaries layer and appended to the output feature layer as attributes.

 

The ReturnGeometry option specifies how to return the analysis result in the TaskResultOutput. RecordSet property—with or without the shape attribute.

 

NOTE: Since Business Analyst Server 10.0, the DataLayerID parameter is replaced with an optional DataHierarchy parameter.

Usage Tips

• The input data layer is usually a Business Analyst trade area layer.

• The input data layer contains the data you want to extract.

• The output overlay layer contains data extracted from the input data layer and summarizations aggregated from the geography layer.

Example Usage

The example below demonstrates execution of an overlay analysis on a trade area.  Selected attribute variables are summarized over the overlaid areas.

 

NOTE: The example uses the "Drive Time Polygons 1" polygon layer already created in the Trade Areas folder of the San Francisco Tutorial Project of the Default Workspace.

 

Request

http://localhost:6080/arcgis/rest/services/DefaultMap/MapServer/exts/BAServer/SpatialOverlay/execute?boundaries= {"Recordset":{"geometryType":"esriGeometryPolygon","spatialReference":{"wkid":4269},"features":[{"geometry":{"rings":[[[-122.4346,37.8566476371076],[-122.360655858915,37.826739954428],[-122.347749703146,37.761714833162],[-122.406398364369,37.7151967133423],[-122.488250155425,37.7254855017619],[-122.525947479981,37.784114591287],[-122.488335196333,37.8427896412311],[-122.4346,37.8566476371076]]],"spatialReference":{"wkid":4269}},"attributes":{"OID":1,"AREA_ID":"1_1","STORE_ID":"1","RING":1,"RING_DEFN":"5","AREA_DESC":"0 - 5 Miles"}},{"geometry":{"rings":[[[-122.4329,37.8057482650651],[-122.35900658434,37.775840365754],[-122.346109142864,37.7108146974946],[-122.404717633044,37.6642961225184],[-122.48651348554,37.6745850161913],[-122.524184911958,37.7332146557964],[-122.486598312884,37.791890171551],[-122.4329,37.8057482650651]]],"spatialReference":{"wkid":4269}},"attributes":{"OID":2,"AREA_ID":"2_1","STORE_ID":"2","RING":1,"RING_DEFN":"5","AREA_DESC":"0 - 5 Miles"}}]}}&summarizations=["TOTPOP_CY","HHPOP_CY"]&outputtype=[GetFeatureClass]&f=pjson

 

Response

{
 "results": [
  {
   "paramName": "RecordSet",
   "dataType": "GPFeatureRecordSetLayer",
   "value": {
    "displayFieldName": "",
    "fieldAliases": {
     "OBJECTID": "Object ID",
     "OID_": "OID_",
     "AREA_ID": "AREA_ID",
     "STORE_ID": "STORE_ID",
     "RING": "RING",
     "RING_DEFN": "RING_DEFN",
     "AREA_DESC": "AREA_DESC",
     "HHPOP_CY": "2011 Population in Households",
     "TOTPOP_CY": "2011 Total Population"
    },
    "geometryType": "esriGeometryPolygon",
    "spatialReference": {
     "wkid": 4326,
     "latestWkid": 4326
    },
    "fields": [
     {
      "name": "OBJECTID",
      "type": "esriFieldTypeOID",
      "alias": "Object ID"
     },
     {
      "name": "OID_",
      "type": "esriFieldTypeInteger",
      "alias": "OID_"
     },
     {
      "name": "AREA_ID",
      "type": "esriFieldTypeString",
      "alias": "AREA_ID",
      "length": 256
     },
     {
      "name": "STORE_ID",
      "type": "esriFieldTypeString",
      "alias": "STORE_ID",
      "length": 256
     },
     {
      "name": "RING",
      "type": "esriFieldTypeInteger",
      "alias": "RING"
     },
     {
      "name": "RING_DEFN",
      "type": "esriFieldTypeString",
      "alias": "RING_DEFN",
      "length": 256
     },
     {
      "name": "AREA_DESC",
      "type": "esriFieldTypeString",
      "alias": "AREA_DESC",
      "length": 256
     },
     {
      "name": "HHPOP_CY",
      "type": "esriFieldTypeDouble",
      "alias": "2011 Population in Households"
     },
     {
      "name": "TOTPOP_CY",
      "type": "esriFieldTypeDouble",
      "alias": "2011 Total Population"
     }
    ],
    "features": [
     {
      "attributes": {
       "OBJECTID": 1,
       "OID_": 1,
       "AREA_ID": "1_1",
       "STORE_ID": "1",
       "RING": 1,
       "RING_DEFN": "5",
       "AREA_DESC": "0 - 5 Miles",
       "HHPOP_CY": 678231.56858499977,
       "TOTPOP_CY": 699983.26620199985
      },
      "geometry": {
       "rings": [
        [
         [
          -122.4346,
          37.856647637107599
         ],
         [
          -122.36065585891501,
          37.826739954428007
         ],
         [
          -122.34774970314601,
          37.761714833162003
         ],
         [
          -122.406398364369,
          37.715196713342294
         ],
         [
          -122.48825015542499,
          37.725485501761895
         ],
         [
          -122.525947479981,
          37.784114591286993
         ],
         [
          -122.488335196333,
          37.842789641231093
         ],
         [
          -122.4346,
          37.856647637107599
         ]
        ]
       ]
      }
     },
     {
      "attributes": {
       "OBJECTID": 2,
       "OID_": 2,
       "AREA_ID": "2_1",
       "STORE_ID": "2",
       "RING": 1,
       "RING_DEFN": "5",
       "AREA_DESC": "0 - 5 Miles",
       "HHPOP_CY": 825301.34949899989,
       "TOTPOP_CY": 849052.19248900015
      },
      "geometry": {
       "rings": [
        [
         [
          -122.43289999999999,
          37.805748265065105
         ],
         [
          -122.35900658433999,
          37.775840365753993
         ],
         [
          -122.34610914286401,
          37.710814697494598
         ],
         [
          -122.404717633044,
          37.664296122518394
         ],
         [
          -122.48651348554,
          37.674585016191301
         ],
         [
          -122.524184911958,
          37.733214655796402
         ],
         [
          -122.486598312884,
          37.791890171551003
         ],
         [
          -122.43289999999999,
          37.805748265065105
         ]
        ]
       ]
      }
     }
    ]
   }
  }
 ],
 "messages": [
  
 ]
}

JSON Response Example Rendered with the ArcGIS API for JavaScript

Example Usage Rendering

See Also

Business Analyst Server REST Reference