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"
}
}
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
- Use feature data and specify features of interest using SQL expressions.
- Find or extract data using spatial and attribute queries.
- Combine datasets using overlay or merge operations.
- Summarize data by aggregating, joining, or finding features near other features.
- Discover patterns with hot spot, cluster, or interpolation analysis.
- Perform tessellation, buffer, centroid, and other geometric calculations.
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:
- An ArcGIS Developer account or an ArcGIS Online account.
- An access token (OAuth 2.0).
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.
{
"jobId":"jf67a9772bc9447b5a32d18d95cc296d5",
"jobStatus":"esriJobSucceeded",
"results":{}
},
"inputs":{},
"messages":[]
}
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>
{
"jobId":"jf67a9772bc9447b5a32d18d95cc296d5",
"jobStatus":"esriJobSucceeded",
"results":{
"hotSpotsResultLayer":{
"paramUrl":"results/hotSpotsResultLayer"
},
"processInfo":{
"paramUrl":"results/processInfo"
}
},
"inputs":{},
"messages":[]
}
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"
{
"paramName":"hotSpotsResultLayer",
"dataType":"GPString",
"value":{
"url":"https://services3.arcgis.com/gpy4De51GXcwFEZo/arcgis/rest/services/AutoTheftHotSpots/FeatureServer/0",
"itemId":"e0852eef19094a71be2d04399b6c5509"
}
}
Tip:
To learn how to access the service with the ArcGIS API for Python, go to the arcgis.features.analysis API reference.