7. π Spatial analysis
Number of APIs: 113
Spatial analysis
Spatial analysis is the process of using analytical techniques to find relationships, discover patterns, and solve probelms with geographic data. The goal of every analysis is to turn data into information.
You perform feature analysis 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.
This collection demonstrates how to perform different types of feature analyses with the spatial analysis service. Each analysis requires you to get the service URL, submit a job request, check the job status, and then get the results.
NOTE: It is important to understand that most spatial analysis service operations require input data in the form of a hosted feature layer or feature collection (JSON). The input data for this collection has been provided for you, but to learn how to find, create, and enrich data for your own analyses, go to the feature analysis tutorials.
Steps to run a request in the spatial analysis collection
βNOTE: To perform feature analysis you need an ArcGIS Online account and you use ArcGIS Identity (OAuth 2.0) to authenticate requests to the service. ArcGIS Developer accounts and API keys are not supported. However, if you have an ArcGIS Developer account and would like to access the service, please contact Esri.
- Fork the Security and authentication and Spatial analysis collections. Ensure that you also have the Enhanced endpoints and Global environments. To learn more, go to the workspace [Overview] page.
- Get an [access token]
- Get the analysis URL to access the spatial analysis service.
- Select the type of analysis and the operation you want to run.
- Run the operation.
To learn more, go to How to perform feature analysis in the Mapping APIs and location services guide.
π Guide and API reference
- Mapping APIs and location services guide: Spatial analysis
- ArcGIS REST API reference: Spatial analysis service
π οΈ Integration
You can access the spatial analysis service and perform feature analyses using: ArcGIS API for Python, ArcGIS REST JS, and ArcGIS Maps SDK for JavaScript.
The ArcGIS Runtime APIs do not have direct support for accessing the spatial analysis service to perform feature analysis.
Spatial analysis service
The spatial analysis service is a ready-to-use service that performs complex geometric and data analyses on feature collections or hosted feature layers to discover relationships and patterns. All operations from the service are executed as job requests, which support long transactions.
To learn more, go to the service page in the Mapping APIs and location services guide.
Troubleshooting
If you have an issue running the requests, or have any other questions, post in the REST API Questions board in Esri Community with the tag spatial-analysis
. Or, you can make a comment within a request.
- If you receive an
Invalid token
error, check your role type in your ArcGIS Online organization. You need to have a user type of: Creator or GIS Analyst and a role type of: Publisher, Facilitator, or Administrator.
-
Combine data-π‘ Examples-Merge layers-Merge point layers - 2. Check status POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/MergeLayers/jobs/{{job_id}}
-
Combine data - DissolveBoundaries-spec POST https://{{analysis-service}}/arcgis/rest/services/tasks/GPServer/DissolveBoundaries/submitJob
-
Combine data-π‘ Examples-Join features-Join features from a feature layer - 1. Submit job POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/JoinFeatures/submitJob
-
Combine data-π‘ Examples-Merge layers-Merge polyline layers - 3. Get results POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/MergeLayers/jobs/{{job_id}}/results/mergedLayer
-
Combine data-π‘ Examples-Overlay layers-Overlay parks with bike routes - 1. Submit job POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/OverlayLayers/submitJob
-
Combine data-π‘ Examples-Overlay layers-Overlay parks with bike routes - 2. Check status POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/OverlayLayers/jobs/{{job_id}}
-
Combine data-π‘ Examples-Overlay layers-Overlay parks with bike routes - 3. Get results POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/OverlayLayers/jobs/{{job_id}}/results/outputLayer
-
Combine data - JoinFeatures-spec POST https://{{analysis-service}}/arcgis/rest/services/tasks/GPServer/JoinFeatures/submitJob
-
Summarize data-π‘ Examples-Aggregate points-Find the number of breweries in counties - 1. Submit job POST https://{{analysis-service}}/arcgis/rest/services/tasks/GPServer/AggregatePoints/submitJob
-
Summarize data-π‘ Examples-Aggregate points-Find the number of breweries in counties - 3. Get results POST {{analysis-service}}/arcgis/rest/services/tasks/GPServer/AggregatePoints/jobs/{{job_id}}/results/aggregatedLayer