How to perform geometry analysis

The most common approach to perform a geometry analysis is to use a client-side API to create a geometry (point, multipoint, polyline, polygon and others) and then execute one or more geometry operations to solve a problem. When you use two or more operations for geometry analysis, this is known as chaining. For example, you can buffer a point, then calculate the area of the result, and then determine if a line intersects the buffer.

Geometry data is typically created through user interaction or by accessing features in a hosted feature layer. When the operations are complete, the results are typically displayed in a map or used as input for other analyses.

Steps

The general steps to perform a geometry analysis are:

  1. Determine the geometry operation(s) required to solve the problem.
  2. Create one or more geometries with the same spatial reference.
  3. Execute the geometry operations.
  4. Display the results in a map or use as input for another analysis.

Example

Buffer, calculate area, and intersect

This example shows how to chain together a number of geometry operations to perform a geometry analysis. It creates a point and then buffers the point, calculates the area, and then determines if the area (polygon) intersects a line.

A real-world example of this might be to determine the potential flood area (buffer) that will affect a road and if the road will intersect the flood area.

ArcGIS JS APIArcGIS JS APIPython
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
const point = Geometry.fromJSON({
  type: "point",
  x: -3.83565819758263,
  y: 40.408142411681396,
  spatialReference: SpatialReference.WGS84,
});

const buffer = geometryEngine.geodesicBuffer(point, 1000, "meters");

const area = geometryEngine.geodesicArea(buffer);

console.log("The area is:" + area);

const line = Geometry.fromJSON({
  type: "polyline",
  paths: [
    [
      [-3.7611339616121, 40.39446064625446],
      [-3.6992634462656, 40.42167509407656],
      [-3.65292023890635, 40.39553309352415],
    ],
  ],
  spatialReference: SpatialReference.WGS84,
});

const intersects = geometryEngine.intersects(buffer, line);

console.log("The geometries intersect: " + intersects);

Tutorials

Services

Spatial analysis service

Process spatial datasets to discover relationships and patterns.

API support

Full supportPartial supportNo support

    Tools

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