Skip to content

Spatial analysis is the process of using analytical techniques to find relationships, discover patterns, and solve problems with geographic data.

You can use the arcgis-rest-request package to make a job request to the spatial analysis service.

Steps
  1. Import your data from a CSV, XLS, GeoJSON, or Shapefile file to create a feature service and feature layer.
  2. Get your ArcGIS portal's analysis URL.
  3. Install and reference the arcgis-rest-request package.
  4. Perform a spatial analysis operation.

Feature analysis

You can use feature analysis to find where features overlap, measure their size and shape, or detect patterns and relationships in your data.

Perform a feature analysis

Learn how to perform a hot spot analysis on parking violations data using the Job request in ArcGIS 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
async function runHotSpotAnalysis(session) {
  const portalSelf = await getSelf({ authentication: session });
  const analysisUrl = portalSelf.helperServices.analysis.url;

  const params = {
    analysisLayer: {
      url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/sf_traffic_parking_violations_sa_osapi/FeatureServer/0"
    },
    shapeType: "Hexagon",
    outputName: {
      serviceProperties: {
        name: `RestJS_find_hot_spots_${Date.now()}`
      }
    }
  };

  const jobReq = await Job.submitJob({
    url: `${analysisUrl}/FindHotSpots/submitJob`,
    params,
    authentication: session
  });

  jobReq.on(JOB_STATUSES.Status, (info) => {
    console.log("Job Status:", info.status);
  });

  const jobResults = await jobReq.getAllResults();
  return jobResults;
}
Go to tutorial

More resources

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