How to perform raster analysis with raster operations

1. Prepare data

The preliminary step for most raster analyses is to prepare input raster 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 raster analysis service requires input data in the form of raster data. The format of the raster data can be in the form of one of the following layer types: Map tile layer, Imagery layer, Tiled imagery layer, and Elevation layer.

The input data for a raster analysis is not changed by the raster analysis service and is treated as read-only. The output data contains changes that were applied during the analysis.

2. Select an operation

The operation you choose to run depends on the type of data you have available and the problem you are wanting to solve. In general, raster analysis operations require existing raster data to use as input parameters. Data can be data you currently have or can be downloaded from various agencies and companies. To learn about data available to you in the ArcGIS system, go to Finding datasources.

Raster operations are categorized into groups based on the type of analysis they perform. To find an appropriate operation for your use case, go to Types of raster operations page.

CategoryDescriptionOperationsExample
Analyze patternsExamine and extract information from raster datasets to identify and understand spatial patterns or trends.CalculateDensity, ComputeChangeRaster, InterpolatePoints Compute Change
Evaluate the difference between two input rasters with ComputeChangeRaster.
Analyze terrainDetermine topographic characteristics and features of a land surface using elevation or digital elevation model (DEM) raster datasets.CreateViewShed, SurfaceParameters Create Viewshed
Identify locations on a raster surface that are visible to the input observer locations with CreateViewShed.
Deep learningApply deep learning techniques and neural networks to analyze and extract information from raster datasets.ClassifyObjectsUsingDeepLearning, ClassifyPixelsUsingDeepLearning, DetectObjectsUsingDeepLearning Classify DL
Run a deep learning model on an imagery layer in which each input object is classified with ClassifyObjectsUsingDeepLearning.
Manage dataCreate, Organize, and convert raster datasets.ConvertFetaureToRaster, ConvertRasterToFeature, Sample Convert feature to raster
Convert a point, line, or polygon feature layer to a raster with ConvertFeatureToRaster.
Multidimensional analysisExamine and extract information from raster datasets that contain multiple dimensions or variables. Multidimensional raster datasets can store multiple attributes or variables for a location, such as temperature, precipitation, air quality or vegetation indices, collected over time or different spectral bands.AggregateMultidimensionalRaster, FindArgumentStatistics, GenerateMultidimensionalAnomaly, GenerateTrendRaster,PredictUsingTrendRaster Aggregate multidimensional
Aggregate existing multidimensional dataset variables along a dimension with AggregateMultidimensionalRaster.
Summarize dataAggregate or condense raster data to provide a concise representation of its properties using summary statistics, such as mean, minimum, maximum, standard deviation, or count within specific spatial units or zones.SummarizeRasterWithin, ZonalStatisticsAsTable Summarize raster within
Summarize the cells of a raster within the boundaries of zones defined by another dataset with SummarizeRasterWithin.
Proximity analysisUse distance to determine accumulation, allocation, or find paths between the cells of a raster dataset.DistanceAccumulation, DistanceAllocation, OptimalPathAsLine, OptimalPathAsRaster, OptimalRegionConnections Distance accumulation
Calculate accumulated distance for each cell to sources with DistanceAccumulation.

3. Perform the analysis

You can use different developer tools and APIs to perform an analysis. Regardless of the mechanism you use, they all require user authentication to make requests to the raster analysis service and the transactions need to managed as job requests (long transactions).

The easiest way to programmatically perform an analysis operation is to use client APIs. These APIs provide authentication classes and also simplify the process of executing and managing job requests.

The general steps to perform an analysis include:

  1. Import the appropriate modules.
  2. Implement authentication to obtain an access token.
  3. Identify the input parameters for the analysis.
  4. Make the request.
  5. Handle the results
ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for PythonArcGIS REST JS
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
            const jobParams = {
              inputZoneLayer: {
                url:
                  "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Census_Counties/FeatureServer/0",
                filter: "STATE_NAME = 'Alabama'",
              },
              inputRasterLayerToSummarize: {
                url:
                  "https://tiledimageservices3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/US_Annual_Temperature/ImageServer",
              },
              zoneField: "COUNTY_FIPS",
              shapeUnits: "Miles",
              // Output a hosted tiled imagery layer
              outputName: {
                serviceProperties: {
                  name: "JSAPI - Alabama average temperature",
                  capabilities: "Image, TilesOnly",
                },
                itemProperties: {
                  description:
                    "output generated from the summarizeRasterWithin operation",
                  title: "Alabama average temperature[JSAPI]",
                },
              },
            }

            const job = await EsriGeoprocessor.submitJob(analysisURL, jobParams)

            const res = await job.waitForJobCompletion({interval:5000, statusCallback: (j)=>{
                console.log(`Job status: ${j.jobStatus}`)
            }})

            if (res.jobStatus === "job-succeeded"){
                const r = await res.fetchResultData("aggregatedLayer")
                const resultLayer = new FeatureLayer({portalItem: {id: r.value.itemId}})
                map.add(resultLayer)
            }
Expand

4. Display the results

The final step is to display the results on a map. Depending on the client-side mapping library you are using, you can use a view to display the data in 2D as a map or 3D as a scene. You also need to set the location and zoom level or scale of the view.

The steps to display the map are:

  1. Reference the mapping library.
  2. Create a map.
  3. Set the service URL or item ID for the result layer.
  4. Add the layer to the map.
  5. Set the map location.
  6. Set the zoom level or scale.
  7. Display the result.
ArcGIS Maps SDK for JavaScriptArcGIS Maps SDK for JavaScriptArcGIS API for Python
Expand
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
        const resultLayer = new EsriImageryTileLayer({
          portalItem: { id: "c5331694510447f08ffbcf37451301d1" },
        })

        const view = new EsriMapView({
          center: [-87.0045, 32.6719],
          zoom: 6,
          container: "viewDiv",
          map: new EsriMap({
            basemap: "arcgis/light-gray",
            layers: [resultLayer],
          }),
        })
Expand

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