Spatial analysis is the process of using analytical techniques to find relationships, discover patterns, and solve problems with geographic data. This section covers how to use ArcGIS REST JS to perform feature analysis with the spatial analysis service and then show the results in an OpenLayers map.
Feature analysis is the process of using the spatial analysis service to perform server-side geometric and analytic operations on feature data. To perform a feature analysis, you input feature data (typically a feature layer), execute one or more operations with ArcGIS REST JS, then display the output in a map to visualize and evaluate the results.
Feature analysis can help solve many different types of problems. For example, you can perform feature analysis in order to:
- Understand where features are or where multiple features exist.
- Measure sizes, shapes, and distributions of features.
- Discover and quantify relationships between features.
- Make predictions based on existing or theoretical patterns and relationships.
The operation you use depends on the type of problem you are trying to solve. Each operation reveals information about the input layers, and can return results as a new hosted feature layer. Operations are job requests performed server-side that are designed to process large amounts of feature data in the ArcGIS cloud infrastructure.
You can perform many different types of feature analyses with the spatial analysis service. The operations are grouped into the following categories:
- Find data: Find and export feature data using SQL or spatial queries.
- Combine data: Create new feature data by combining multiple data sources.
- Summarize data: Calculate statistics on feature data.
- Analyze patterns: Identify spatial patterns and relationships in feature data.
- Calculate geometries: Create new feature data and perform calculations on existing data.
To perform a feature analysis, you need to provide feature data as input, then use ArcGIS REST JS to access the spatial analysis service and execute an operation. You must authenticate requests to the spatial analysis service using ArcGIS identity in order to perform spatial analysis operations.
The steps to access the service using OpenLayers and ArcGIS REST JS are:
- Prepare feature data to be used in the analysis.
- Select an operation based on the problem you want to solve.
- Get the spatial analysis service URL from your organization.
- Submit a job request to the service using ArcGIS REST JS with your chosen operation and parameters.
- Check the status to see when the job is complete.
- Get the results.
- Display the results on a map using OpenLayers.
This example performs a hot spot analysis to identify hot and cold areas in point data for parking violations. The application allows you to sign in with your ArcGIS identity and uses oAuth 2.0 to get an access token. The token is used to access the basemap styles service as well as the spatial analysis service. ArcGIS REST JS is used to get the URL for the spatial analysis service and then make a call to the service to perform a hotspot analysis. The resulting feature layer is displayed in the map.
Learn how to build this application in the Perform a feature analysis tutorial.
Go to these tutorials to find, create, and enrich data for spatial analysis.
Find data sources
Discover data in ArcGIS that you can use for feature analysis.
Create data sources
Import, create, and generate data for feature analysis.
Enrich data sources
Enrich data with demographics and local facts for feature analysis.
Go to these tutorials to learn how to perform analyses interactively with the Map Viewer and programmatically with ArcGIS REST JS, ArcGIS API for Python, and ArcGIS REST API.
Find and extract data
Find data with attribute and spatial queries using find analysis operations.
Overlay, join, and dissolve features using combine analysis operations.
Aggregate and summarize features using summarize analysis operations.
Discover patterns in data
Find patterns and trends in data using spatial analysis operations.