How to perform feature analysis
This section outlines the high-level steps required to perform a feature analysis. It shows how to use the Map Viewer and ArcGIS Pro as part of your development workflow and code examples are provided for ArcGIS API for Python, ArcGIS REST JS, and ArcGIS REST API.
ArcGIS tools and APIs for analysis
To perform feature analysis, you can use different ArcGIS software and tools and APIs. In many cases, it is helpful to start by using tools to perform analyses interactively. Using tools will help you learn about the different types of operations, the required parameters, and how changing the parameters affects the analysis and results.
Below is a list of the different tools and APIs you can use:
ArcGIS software and tools: These are applications such as Map Viewer or ArcGIS Pro that you can use to perform analysis interactively, to experiment with different analyses and parameters, and to visualize the results. If you are new to ArcGIS, it is recommended to start with these tools. For documentation and tutorials, go to ArcGIS Online analysis and ArcGIS Pro Analytics.
ArcGIS APIs: These are programming APIs such as ArcGIS API for Python or ArcGIS REST JS that you can use to access the spatial analysis service. Use these APIs to build custom applications.
ArcGIS REST API: This is the API you use to directly access the spatial analysis service. Use the REST API to build custom applications that access the service with HTTP requests.
Steps
The high-level steps for feature analysis include the following:
- Prepare feature data
- Select an operation
- Perform the analysis
- Visualize the results
- Evaluate the results
1. Prepare feature data
The preliminary step for most feature analyses is to prepare input feature data. The input data is the data that is analyzed during the operation. In most cases, you will want to perform an analysis with your own data, but you can also use existing data hosted in ArcGIS.
There are a number of ways you can prepare data for analysis, but the easiest way is to use ArcGIS software and tools such as ArcGIS Online, Map Viewer, and ArcGIS Pro. These tools provide an interactive way to find, import, and prepare data.
Regardless of the tools or APIs you use, the spatial analysis service requires input data in the form of feature data. The feature data must be a collection of features where each feature has a geometry and a set of attributes. The geometry type and attribute fields must be the same for all features. The format of the feature data can be a hosted feature layer (URL) or a feature collection (JSON).
The input data for a feature analysis is not changed by the spatial analysis service and is treated as read-only. The output data contains changes that were applied during the analysis.
How to prepare data
The different ways to find or create input data for feature analyses are listed below:
Find existing data: You can use existing data sources hosted in ArcGIS as input for analyses. The data sources need to be in the format of a hosted feature layer or table. For example, you can use hosted feature layers such as USA census block groups or World Demographics.
Below is a list of resources that you can use to search for input data for analyses:
To learn how to find data with these tools, go to the Find data sources tutorial.
Import data as a feature layer: If you have existing point, line, or polygon data with attributes, you can use ArcGIS Online or the developer dashboard to import the data and create your own hosted feature layers for analyses. You can import different formats such as CSV, XLS, shapefile, or GeoJSON. Once your data is hosted, the feature layer can be used as input for feature analysis using ArcGIS tools or APIs.
To learn how to import data, go to the Create data sources tutorial.
Feature collection (JSON): If you are programmatically accessing the spatial analysis service, you can also create a feature collection as a JSON structure and use it as input for the analysis.
To learn how to format a feature collection, go to FeatureSet in Common data types.
Enrich data: If you want to add demographic or local facts data attributes to an existing hosted feature layer such as USA census tracks, you can use the GeoEnrichment analysis.
To learn how to enrich data, go to the Enrich data sources tutorial.
2. Select an operation
You can perform many different types of feature analyses with the spatial analysis service. The operation you use depends on the type of data you have and the problem you want to solve. Use the table of categories below to help choose the correct operation. For more details about each, go to Types of feature analysis.
Category | Description | Operations | Result | Example |
---|---|---|---|---|
Find data | Selects a subset of features using a SQL or spatial query. | Find , Derive , Extract | A new feature collection or hosted feature layer. |
![]() Finds existing polygons that match a SQL query. |
Combine data | Combines or joins features from two or more feature datasets. | Merge , Overlay , Join , Dissolve | A new feature collection or hosted feature layer. |
![]() Dissolves polygons from two input feature datasets. |
Summarize data | Aggregates or summarizes feature data and creates statistics. | Aggregate points , Summarize nearby , Summarize within , Summarize center and dispersion | A new feature collection or hosted feature layer. |
![]() Aggregate points into polygons. |
Analyze patterns | Identifies spatial patterns and relationships in feature data. | Find hot spots , Find outliers , Find point clusters , Find similar locations , Calculate density , Interpolate points | A new feature collection or hosted feature layer. |
![]() Find hot spots based on attribute values |
Calculate geometries | Performs geometric calculations on existing features or can create new feature data. | Create buffers , Create centroids , Generate tessellations , | A new feature collection or hosted feature layer. |
![]() Generate and merge buffers around features. |
3. Perform the analysis
You can use different ArcGIS tools and APIs to perform a feature analysis. Regardless of the mechanism you use, they all require user authentication to make requests to the spatial analysis service and the transactions need to managed as job requests (long transactions).
Security and authentication
To access to the spatial analysis service, you need an ArcGIS Online account and you need to implement user authentication. If you are using applications such as the Map Viewer and ArcGIS Pro, they authenticate users when they sign in, and then make requests to service with the user credentials when spatial analysis tools are used. If you are accessing the service programmatically, you need to implement a user authentication workflow. This typically involves using account credentials to get an access token and then making requests to the service. Learn more about user authentication and tokens in Security and authentication.
Job processing
All feature analysis requests to the spatial analysis service are job requests. Regardless of the tool or API you use, each analysis is a long transaction that needs to be executed, checked, and the results need to be retrieved by the application. Tools such as Map Viewer and ArcGIS Pro manage most of the transactions for you, but when using APIs you have to manage the transaction yourself. Learn about the steps required in the code examples below.
ArcGIS software and tools
You can use the Map Viewer and ArcGIS Pro to perform feature analysis interactively. The Map Viewer is a web application that allows you to perform mapping operations and execute different types of analyses. ArcGIS Pro is a desktop application that runs on Windows devices that you can also use to execute different types of analyses. Both applications store the results of an analysis in ArcGIS as a hosted feature layer and display the results after an analysis. They also make it easy to visually analyze and inspect the results of the analysis interactively.
The general steps to perform a feature analysis with the Map Viewer are:
- Go to the Map Viewer and login in with your ArcGIS Online account.
- Identify one or more hosted feature layers to be used as input data and add them to the map.
- Go to Analysis tools.
- Select a tool, set the parameters (with the input hosted feature layer), and execute the analysis.
- View the results on the map.
Learn more about how to perform spatial analysis with the Map Viewer in the Tutorials.
The general steps to perform a feature analysis with ArcGIS Pro are:
- Go to ArcGIS Pro and login in with your ArcGIS account.
- Create or open a project.
- Identify one or more hosted feature layers to be used as input data and add them to the map.
- Go to the analysis tools in the Analysis ribbon.
- Select a tool, set the parameters, and execute the analysis.
- View the results on the map.
Learn more about how about perform spatial analysis with ArcGIS Pro ArcGIS Pro Analytics.
ArcGIS APIs
The easiest way to programmatically execute an analysis request to the spatial analysis service is to use the ArcGIS API for Python or the ArcGIS REST JS API. These APIs provide security and authentication classes and also simplify the process of executing and managing job requests.
The steps to use the Python API are:
- Import an operation from the
arcgis.features.analysis
library. - Provide your username and password.
- Identify the input feature layer(s) and URL(s) for the analysis.
- Set the parameters and execute the analysis.
- Get the results and add them to a map.
Example
This example executes a hot spot analysis.
The steps to use the ArcGIS REST API are:
- Import
Job
,JOB_
, andSTATUSES ArcGISIdentity
from theManager @esri/arcgis-rest-request
library andget
from theSelf @esri/arcgis-rest-portal
. - Get a token with your username and password from the
ArcGISIdentity
.Manager - Get the spatial analysis service base URL.
- Identify the input feature layer(s) and URL(s) for the analysis.
- Set the parameters and execute the analysis with
submit
.Job - Check the job status.
- Get the results.
Example
This example executes a hot spot analysis.
ArcGIS REST API
To access the spatial analysis service directly, you need to get the URL from your organization and then execute a job request. You get the service URL by making a self
request and then extracting the URL from helper
. Once you have the URL you can execute a job request to perform the analysis.
The steps to access the service are:
- Get the spatial analysis service URL from your organization.
- Submit a job request to the service with the operation and parameters.
- Check the status to see when the job is complete.
- Get the results.
Example
This example shows how to execute a job request to perform a hot spot analysis.
Request
Response (JSON)
Request
Response (JSON)
4. Display the results
After you perform an analysis, the most common step is to display the results in a map. The spatial analysis service returns styling information with the resulting hosted feature layer and feature collection (JSON), so client applications and APIs can easily display the results in a map.
Visualize the layer
If you are using the Map Viewer or ArcGIS Pro, the resulting hosted feature layer is automatically added to the map when an analysis is complete. A renderer is also automatically applied from the styling information so you can visualize the results.
If you are using ArcGIS APIs, most APIs will access the styling information automatically in the resulting hosted feature layer to draw the feature layer in a map. The APIs access the styling information stored in the Drawing Info
field of the feature layer.
If you own the resulting feature layer from analyses, you can use the item page, Map Viewer, or ArcGIS Pro to override drawing information by saving new colors and symbols in the layer. Alternatively, you can override the colors and symbols on the client-side using an ArcGIS API.
To learn more about visualizing data, go to Visualization.
Access the hosted feature layer
The easiest way to display the results of an analysis is to get the URL for the hosted feature layer that is returned and then use the URL to add the layer to the map. ArcGIS applications and APIs will use the URL to access the feature data and drawing information to render the layer in the map.
To learn more about accessing feature layers, go to Data hosting.
The steps to display the layer are:
- Log in to your developer dashboard or ArcGIS Online.
- Find the resulting hosted feature layer that was created from your analysis.
- Get the URL.
- Add the layer to an application using an API.
Example
This example displays the results of a hot spot analysis on traffic data by accessing the hosted feature layer URL. The feature colors and symbols are rendered using the information stored in the Drawing Info
field in the layer. To get the hosted feature layer URL and drawing information, go to the item page.
This example uses the following:
- Item page:
- Title: Traffic_Crashes_Resulting_in_Injury_Hot_Spots
- URL:
https:
//www.arcgis.com/home/item.html?id=40935975462a410ca0ae20b9ee35f053
- Feature layer URL and drawing info:
- URL:
https:
//services3.arcgis.com/GVgb Jbqm8h XASVYi/arcgis/rest/services/Traffic_ Crashes_ Resulting_ i n_ Injury_ Hot_ Spots/Feature Server/0
- URL:
5. Evaluate the results
The final step for most feature analyses is to evaluate the results. The process typically involves visualizing and evaluating the results. The type of evaluation you perform depends on the type of analysis undertaken and the problem you are trying to solve. Sometimes it is necessary to undertake additional analyses to further refine the results or to look for different patterns in the data.
Tutorials

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 demographic information and local business facts using the spatial analysis service.

Find and extract data
Find data with attribute and spatial queries using find analysis operations.

Combine data
Overlay, join, and dissolve features using combine analysis operations.

Summarize data
Aggregate and summarize features using summarize analysis operations.

Discover patterns in data
Find patterns and trends in data using spatial analysis operations.

Perform a feature analysis
Perform a feature analysis using ArcGIS REST JS.

Find and extract data
Find data with attribute and spatial queries using find analysis operations.

Combine data
Overlay, join, and dissolve features using combine analysis operations.

Summarize data
Aggregate and summarize features using summarize analysis operations.

Discover patterns in data
Find patterns and trends in data using spatial analysis operations.
Services
Spatial analysis service
Process spatial datasets to discover relationships and patterns.
API support
Find data | Combine data | Summarize data | Analyze patterns | Calculate geometries | |
---|---|---|---|---|---|
ArcGIS Maps SDK for JavaScript | 1 | 1 | 1 | 1 | 1 |
ArcGIS Maps SDK for .NET | |||||
ArcGIS Maps SDK for Kotlin | |||||
ArcGIS Maps SDK for Swift | |||||
ArcGIS Maps SDK for Java | |||||
ArcGIS Maps SDK for Qt | |||||
ArcGIS API for Python | |||||
ArcGIS REST JS | 1 | 1 | 1 | 1 | 1 |
Esri Leaflet | 2 | 2 | 2 | 2 | 1 |
MapBox GL JS | 2 | 2 | 2 | 2 | 1 |
OpenLayers | 2 | 2 | 2 | 2 | 1 |
- 1. Access with geoprocessing task
- 2. Access via ArcGIS REST JS