Spatial analysis service

The spatial analysis service is a ready-to-use service that performs complex geometric and data analyses on feature data to discover relationships and patterns.

Hot spot analysis revealing areas of high and low home values in San Francisco.

Key features

You can use the spatial analysis service to:

  • Understand where features are or where multiple features exist.
  • Measure sizes, shapes, and distributions of features.
  • Analyze relationships and interactions between features.
  • Detect and quantify patterns and relationships between features.
  • Make predictions based on existing or theoretical patterns and relationships.

How the spatial analysis service works

The spatial analysis service allows you to perform server-side operations on large collections of features. All operations are executed as job requests, which support long transactions.

The steps to access the service are:

  1. Get the spatial analysis service URL from your organization.
  2. Submit a job request to the service with the operation and parameters.
  3. Check the status to see when the job is complete.
  4. Get the results.

Learn more about executing job requests in How to perform feature analysis.

Get the spatial analysis service URL

In order to make a request to the spatial analysis service, you need to get the URL first. The analysis service URL is unique to your organization and will look something like this:

Use dark colors for code blocksCopy
 
1
https://analysis3.arcgis.com/arcgis/rest/services/tasks/GPServer

To find the URL specific to your organization you need to make a call to the portal service's /sharing/rest/portals/self endpoint.

Within the response, the helperServices object contains the list of service URLs that your organization can access. If your organization has permission to access the spatial analysis service, you will see the analysis URL.

To make a request to get the URL, see the example below:

Request
HTTPHTTPcURL
Use dark colors for code blocksCopy
     
1
2
3
4
5
POST arcgis.com/sharing/rest/portals/self HTTP/1.1
Content-Type: application/x-www-form-urlencoded

&f=json
&token=<ACCESS_TOKEN>
Response (JSON)
Use dark colors for code blocksCopy
           
1
2
3
4
5
6
7
8
9
10
11
{
  "helperServices": {
    // Other parameters
    "analysis": {
      "url": "https://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer"
    },
    "geoenrichment": {
      "url": "https://geoenrich.arcgis.com/arcgis/rest/services/World/GeoenrichmentServer"
    }
  }
}

Types of operations

Feature analysis operations for the spatial analysis service are grouped by the type of problems they solve and the type of feature data returned.

Below is an overview of the operations:

  • Find data: Construct SQL and spatial queries to find and extract features.
  • Combine data: Overlay and merge two feature datasets.
  • Summarize data: Aggregate, join, or find features near other features.
  • Analyze patterns: Perform hot spot, cluster, and interpolation operations from feature data.
  • Calculate geometries: Create buffers, centroids, or tessellations from feature data.

Find data

Find data operations allow you to find feature data with a SQL or spatial query, or to export feature data, to create new feature data.

Find existing locations

The FindExistingLocations operation selects features that satisfy one or more SQL and/or spatial expressions and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindExistingLocations/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayersThe point, polyline, or polygon feature data that will be used to construct the query.[{"url":"https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/OSM_POI/FeatureServer/0","name":"OpenStreetMap - Points of interest (bèta) - Punten"}]
expressionsThe SQL or spatial query.[{"operator":"","layer":0,"where":"service = 'Eten en Drinken'"}]

Key parameters

NameDescriptionExamples
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Derive new locations

The DeriveNewLocations operation selects and can modify features to satisfy one or more SQL and/or spatial expressions and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DeriveNewLocations/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayersThe layer(s) that will be used to construct the query.[{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Find_Locations_in_SF_Neighborhoods/FeatureServer/0"},{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Police_Stations/FeatureServer/0"}]
expressionsThe SQL or spatial query.[{"operator":"","layer":0,"selectingLayer":1,"spatialRel":"withinDistance","distance":0.25,"units":"Miles"}]

Key parameters

NameDescriptionExamples
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Extract data

The ExtractData operation selects and exports features that satisfy a SQL or spatial expression and creates new feature data stored as a file in a new item. The output features can be downloaded as a CSV, KML, FileGeoDatabase, or Shapefile. Multifile formats are stored in a zipfile.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/ExtractData/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayersThe point, polyline, or polygon features that will be extracted.[{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Find_Locations_in_SF_Neighborhoods/FeatureServer/0"}]

Key parameters

NameDescriptionExamples
dataFormatThe default file format is CSV.KML, FileGeoDatabase, CSV, Shapefile
clipDefine whether the data should be extracted from within the extent.true
extentThe area used to extract the input features.[{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Portland_boundary/FeatureServer/0"}]
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Combine data

Combine data operations allow you to merge, overlay, and join multiple sources of feature data to create new feature data.

Merge layers

The MergeLayers operation combines two feature datasets and returns new feature data. The input data must contain the same type of geometry (point, polyline, or polygon).

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/MergeLayers/submitJob?<parameters>

Required parameters

Name
DescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe point, polyline, or polygon features to merge with the mergeLayer.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}
mergeLayerThe point, polyline, or polygon features to merge with the inputLayer. The mergeLayer must contain the same feature type (point, polyline, or polygon) as the inputLayer.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

Key parameters

Name
DescriptionExamples
mergingAttributesAn array of values that describe how fields from the mergeLayer are to be modified. By default, all fields from both inputs will be carried across to the output mergedLayer.['Temp Remove', 'RiskRate Rename RiskRateJan', 'AirQualityIndex Match AQI']
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Overlay layers

The OverlayLayers operation combines two or more feature datasets using either intersect, union, or erase methods. The operation returns a new feature dataset that contains the feature attributes of the input layers.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/OverlayLayers/submitJob?<parameters>

Required parameters

Name
DescriptionExamples
fThe format of the data returnedf=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe point, line, or polygon features that will be overlayed with the overlayLayer parameter.{"url": <SERVICE_URL>, "filter": <where clause>}
overlayLayerThe features that will be overlaid with the inputLayer parameter features.{"url": <SERVICE_URL>, "filter": <where clause>}

Key parameters

Name
DescriptionExamples
overlayTypeThe type of overlay to be performed. [Intersect, Union, Erase]"overlayType": "Union"
outputTypeThe type of intersection to be found. This parameter is only valid when the overlayType parameter value is Intersect. [Input,Line,Point]"outputType":"Line"
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Join features

The JoinFeatures operation combines attributes from one feature datasets to another based on spatial and/or attribute relationships and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/JoinFeatures/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returnedf=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
targetLayerThe point, line, polygon, or table layer that will have attributes from the joinLayer parameter appended to its table.{"url": <SERVICE_URL>, "filter": <where clause>}
joinLayerThe point, line, polygon, or table layer that will be joined to the targetLayer parameter.{"url": <SERVICE_URL>, "filter": <where clause>}

Key parameters

NameDescriptionExamples
attributeRelationshipDefines an attribute relationship used to join features. Features are matched when the field values in the join layer are equal to field values in the target layer.[{"targetField":"county","operator":"equal","joinField":"Area_Name"}]
joinOperationA string representing the type of join (JoinOneToOne or JoinOneToMany) that will be applied."joinType":"inner"
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Dissolve boundaries

The DissolveBoundaries operation combines polygons from feature datasets that ovelap or share a common boundary and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/submitJob?<parameters>

Required parameters

Name
Description
Examples
fThe format of the data returnedf=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe layer containing polygon features that will be dissolved.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

Key parameters

NameDescriptionExamples
dissolveFieldsOne or more fields from the inputLayer that control which polygons are merged."dissolveFields": ["Class"]
summaryFieldsA list of field names and statistical summary type that you wish to calculate from the polygons that are dissolved together"summaryFields": ["Annual_Sales Sum", "Annual_Sales Min"]
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Summarize data

Summarize data operations allow you to calculate spatial and attribute statistics on feature data to create new feature data.

Aggregate points

The AggregatePoints operation determines which points fall inside polygons using a point-in-polygon spatial relationship and returns new feature data based on the analysis.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/AggregatePoints/submitJob?<parameters>

Required parameters

Name
Description
Examples
fThe format of the data returnedf=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
pointLayerThe point features aggregated into the polygons in the polygonLayer.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

Key parameters

NameDescriptionExamples
polygonLayerThe polygon features (areas) into which the input points will be aggregated.{"url": <feature service layer url>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}
keepBoundariesWithNoPointsA Boolean value that specifies whether the polygons that have no points within them should be returned in the output. The default is true.true | false
summaryFieldsA list of field names and statistical summary type that you want to calculate for all points within each polygon. Note that the count of points within each polygon is always returned."summaryFields": ["Annual_Sales Sum", "Annual_Sales Mean"]
groupByFieldA field name in the pointLayer. Points that have the same value for the group by field will have their own counts and summary field statistics. You can create statistical groups using an attribute in the analysis layer. For example, if you are aggregating crimes to neighborhood boundaries, you may have a Crime_type attribute with five crime types. Each unique crime type forms a group, and the statistics you choose will be calculated for each unique value of Crime_type."groupByField": "Crime_type"
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Summarize center and dispersion

The SummarizeCenterAndDispersion operation finds central features and directional distribution in feature data. It calculates the central, mean center, median center, and ellipse of features to determine the distribution.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/SummarizeCenterAndDispersion/submitJob?<parameters>

Required parameters

NameDescriptionExamples
analysisLayerThe point, line, or polygon features to be analyzed.{"url": <SERVICE_URL>}
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
fThe format of the data returnedf=json f=pjson

Key parameters

NameDescriptionExamples
summarizeTypeThe method with which to summarize the analysisLayer."summarizeType": ["CentralFeature","MeanCenter","MedianCenter","Ellipse"]
ellipseSizeThe size of the output ellipse in standard deviations. The default ellipse size is 1. Valid choices are 1, 2, or 3 standard deviations."ellipseSize": "3 standard deviations"
weightFieldA numeric field in the analysisLayer to be used to weight locations according to their relative importance.
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Summarize nearby

The SummarizeNearby operation find features within a specified distance of other feature data and returns new feature data from the analysis. The distnce measure can be a straight line or defined by travel mode.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/SummarizeNearby/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returnedf=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
sumNearbyLayerPoint, line, or polygon features from which distances will be measured to features in the summaryLayer.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}
summaryLayerPoint, line, or polygon features. Features in this layer that are within the specified distance to features in the sumNearbyLayer will be summarized.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

Key parameters

NameDescriptionExamples
nearTypeDefines what type of distance measurement you want to use: straight-line distance, or by measuring travel time or travel distance along a street network using various modes of transportation known as travel modes. The default is StraightLine. For details about supported travel modes see the GetTravelModes operation from the Utilities service."nearType": "StraightLine"
distancesA list of double values that defines the search distance (for StraightLine and distance-based travel modes) or time (for time-based travel modes). You can enter a single distance value or multiple values, separating each value with a space. Features that are within (or equal to) the distances you enter will be summarized. The units of the distance values are supplied by the units parameter."distances": [4.0]
unitsIf nearType is StraightLine or a distance-based travel mode, this is the linear unit to be used with the distance values specified in distances. If nearType is a time-based travel mode, then units are time based"units": "Miles"

"Units": "Minutes"
returnBoundariesIf true, the resultLayer will contain areas defined by the specified nearType. For example, if using a StraightLine value of 5 miles, the resultLayer will contain areas with a 5-mile radius around the input sumNearbyLayer features.`true
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Summarize within

The SummarizeWithin operation find areas (and portions of areas) that overlap between two feature datasets, calculates statistics about the overlap, and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/SummarizeWithin/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
sumWithinLayerThe polygon features. Features, or portions of features, in the summaryLayer that fall within the boundaries of these polygons will be summarized.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}
summaryLayerPoint, line, or polygon features that will be summarized for each polygon in the sumWithinLayer.{"url": <SERVICE_URL>, "filter": <where clause>}

{"layerDefinition": {}, "featureSet": {}, "filter": <where clause>}

Key parameters

NameDescriptionExamples
sumShapeA Boolean value that instructs the task to calculate statistics based on shape type of the summaryLayer, such as the count of points, the total length of lines, or the total area of polygons of the summaryLayer within each polygon in the sumWithinLayer. If the summaryLayer is lines or polygons, the count of features within each summary polygon is returned.true | false
shapeUnitsWhen summaryLayer contains polygons:
Acres | Hectares | SquareMeters | SquareKilometers | SquareMiles | SquareYards | SquareFeet

When summaryLayer contains lines:
Meters | Kilometers | Feet | Yards | Miles
"shapeUnits": "Miles"
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Analyze patterns

Analyze patterns operations allow you to perform complex geometry, attribute, and statistic calculations to identify spatial patterns and relationships in feature data.

Find hot spots

The FindHotSpots operation finds spatially and statistically signficant clusters of features with high and low values (point counts or field values) and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindHotSpots/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
analysisLayerThe point or polygon feature layer.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Average_PDX_home_values/FeatureServer/0"}
analysisFieldUse if the analysis layer contains polygons.counts, rates, averages

Key parameters

NameDescriptionExamples
shapeTypeUse if the analysis layer contains points.hexagon, fishnet
boundingPolygonLayerWhen the analysis layer contains points and no analysisField is specified, you can provide a boundary for the analysis.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Delaware_County_Municipal_Boundaries/FeatureServer/0"}
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Find outliers

The FindOutliers operation find spatial and statistical anomalies in clusters of feature dataand returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindOutliers/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
analysisLayerThe point or polygon feature layer.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Average_PDX_home_values/FeatureServer/0"}
analysisFieldUse if the analysis layer contains polygons.counts, rates, averages

Key parameters

NameDescriptionExamples
shapeTypeUse if the analysis layer contains points.hexagon, fishnet
boundingPolygonLayerWhen the analysis layer contains points and no analysisField is specified, you can provide a boundary for the analysis.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Delaware_County_Municipal_Boundaries/FeatureServer/0"}
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Find point clusters

The FindPointClusters operation finds clusters (defined by you) of point features at a specidied distance and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindPointClusters/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
analysisLayerThe point data.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Traffic_Crashes/FeatureServer/0"}
minFeaturesClusterDefine the minimum number of features to be considered a cluster.5

Key parameters

NameDescriptionExamples
searchDistanceA double value to use as the maximum distance to search for neighboring features.200
searchDistanceUnitMust be provided if searchDistance is specified.Miles, Feet, Meters, Kilometers
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Calculate density

The CalculateDensity operation spreads known quantities of point or line attributes to create polygon features that represent areas of high and low density and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/CalculateDensity/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe point or polyline features from the feature dataset.{"url":"https://services.arcgis.com/nSZVuSZjHpEZZbRo/arcgis/rest/services/OSM_POI/FeatureServer/0","name":"OpenStreetMap - Points of interest (bèta) - Punten"}

Key parameters

NameDescriptionExamples
areaUnitsThe units of the calculated density values.SquareMiles, SquareKilometers
boundingPolygonLayerThe polygon(s) from a hosted feature layer or feature collection in which you want densities to be calculated.{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Portland_boundary/FeatureServer/0"}
classificationTypeHow density values will be classified.NaturalBreaks
numClassesNumber used to divide the range of predicted values into distinct classes.10
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Interpolate points

The InterpolatePoints operation finds and predicts new features and attribute values in point feature data and returns new feature data.

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/InterpolatePoints/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe point feature collection or hosted feature layer.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Average_temperature_Oregon/FeatureServer/0"}
fieldThe numeric field containing the values to interpolate.Elevation

Key parameters

NameDescriptionExamples
interpolateOptionA value declaring the preference for speed versus accuracy. The default is 5.1, 5, 9
classificationTypeDetermines how the predicted values will be classified into areas. The default is GeometricInterval.EqualArea, EqualInterval, GeometricInterval, Manual
classBreaksIf the classificationType is Manual, then provide the class break values as a list.[1,3,5]
boundingPolygonLayerThe layer specifying the polygons in which you want values to be interpolated.{url:"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Delaware_County_Municipal_Boundaries/FeatureServer/0"}
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Calculate geometries

Calculate geometries operations allow you to perform different types of geometric calculations on feature data and to create new feature data such as grids, tessellations, and bins.

Create buffers

The CreateBuffers operation creates areas at a specified distances around a point, line, or polygon feature and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/CreateBuffers/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe point, line, or polygon features to be buffered.{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Police_Stations/FeatureServer/0","name":"Police Stations"}
distancesIf not using field. The value with which the buffer will be calculated.1
fieldIf not using distances. A field within the inputLayer containing a buffer distance.ATTRIBUTE_FIELD

Key parameters

NameDescriptionExamples
unitsThe unit to be used with the specified distance values.Meters, Kilometers, Miles
dissolveTypeDetermines whether overlapping buffers are split, dissolved, or kept.None, Dissolve, Split
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Find centroids

The FindCentroids operation allows you to find the representative center of each multipoint, polyline, or polygon feature and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/FindCentroids/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
inputLayerThe multipoint, line, or polygon features that will be used to generate centroid point features.{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Average_PDX_home_values/FeatureServer/0","name":"Average_PDX_home_values"}

Key parameters

NameDescriptionExamples
pointLocationOutput points are determined by the calculated geometric center of each input feature. If set to true the points will be contained by the bounds of the input feature.false (default)
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Generate tessellations

The GenerateTessellations operation allows you to create equally sized square, hexagon, triangle, or diamond geometry bins for an area or extent and returns new feature data.

URL

Use dark colors for code blocksCopy
 
1
http://<YOUR_ANALYSIS_SERVICE>/arcgis/rest/services/tasks/GPServer/GenerateTessellations/submitJob?<parameters>

Required parameters

NameDescriptionExamples
fThe format of the data returned.f=json f=pjson
tokenAn OAuth 2.0 access token. Learn how to get an access token in Security and authentication.token=<ACCESS_TOKEN>
binTypeThe tessellation shape.HEXAGON, SQUARE, DIAMOND, TRIANGLE, TRANSVERSEHEXAGON
binSizeThe size of each bin.500

Key parameters

NameDescriptionExamples
binSizeUnitThe unit to be used with the specified value in binSize.Feet,Miles,Kilometers
extentLayerThe extent that the tessellations will cover.{"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Portland_boundary/FeatureServer/0"}
outputNameA string representing the name of the hosted feature layer to return with the results. NOTE: If you do not include this parameter, the results are returned as a feature collection (JSON).{"serviceProperties": {"name": "<SERVICE_NAME>"}}
contextA bounding box or output spatial reference for the analysis."extent":{"xmin:", "ymin:", "xmax:", "ymax:"}

For a complete list of the request parameters and input values, go to the ArcGIS REST API reference.

Authentication

To make authenticated requests, you need to use ArcGIS Identity (formerly named user). It grants a short-lived token, generated via OAuth 2.0, giving your application permission to access the content and services authorized to an existing ArcGIS user's account.

Learn more about getting access tokens in Security and authentication.

API support

You cannot use ArcGIS Runtime APIs to access the spatial analysis service. Use ArcGIS API for Python, ArcGIS REST JS, or ArcGIS API for JavaScript.

Pricing

You can only access the spatial analysis service with an ArcGIS Online account. Each operation performed consumes credits. To learn more, go to Understand credits in the ArcGIS Online documentation.

Tutorials

Learn how to perform related analyses interactively with Map Viewer and programmatically with ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.

Tools

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.