Spatial analysis service

The spatial analysis service solves complex location-oriented problems using spatial data. It provides different types of analysis to summarize data, find locations, complete data enrichment, analyze patterns, use proximity, and manage data. The spatial analysis service works with hosted feature layers or feature collections. To perform spatial analysis with raster data, use the Raster Analysis service.

Key features

Tip:

To learn more about the spatial analysis service features and capabilities, go to the Job requests overview.

Access the service

To access the spatial analysis service, you need the following:

Tip:

To learn more about API keys and OAuth 2.0, go to Security and authentication in the Mapping APIs and location services guide.

Example

This example shows how to find locations with statistically significant clustering of points using the FindHotSpots request.

1. Send a job request to find hot spots.


POST https://<analysis service>.arcgis.com/arcgis/rest/services/tasks/GPServer/FindHotSpots/submitJob HTTP/1.1
content-type: application/x-www-form-urlencoded

f=json
&token=<ACCESS_TOKEN>
&analysisLayer={"url":"https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/Auto_Theft/FeatureServer/0"}
&shapeType=fishnet
&returnDirections=true
&context={
  "extent":{
    "xmin":-13645650.815000549,
    "ymin":4538996.0112298895,
    "xmax":-13617426.442306284,
    "ymax":4555563.73711068,
    "spatialReference":{
      "wkid":102100,
      "latestWkid":3857
    }
  }
}
&outputName={
  "serviceProperties": {
    "name": "AutoTheftHotSpots"
  }
}

2. Check the job status using the provided jobID until the job has succeeded or failed. Learn more about submitting GP Jobs.


POST https://<analysis service>.arcgis.com/arcgis/rest/services/tasks/GPServer/FindHotSpots/jobs/jf67a9772bc9447b5a32d18d95cc296d5 HTTP/1.1
content-type: application/x-www-form-urlencoded

f=json
&token=<ACCESS_TOKEN>

3. Once the job has succeeded, get the results.


POST https://<analysis service>.arcgis.com/arcgis/rest/services/tasks/GPServer/FindHotSpots/<jobID>/results/hotSpotsResultLayer HTTP/1.1
content-type: application/x-www-form-urlencoded

f=json
&token=<ACCESS_TOKEN>
&returnType="data"

Hot spots of automobile thefts

Tip:

To learn how to access the service with the ArcGIS API for Python, go to the arcgis.features.analysis API reference.

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