Skip to content

Geometry operator - geodesic buffers

This sample uses the geodesicBufferOperator to create geodesic buffers around the pointer (mouse/touch) location as a user moves the pointer across the view.

Geodesic buffers account for the earth’s curvature, resulting in more accurate representations, especially when viewed in 3D and over large areas. On a 2D Web Mercator map, the geodesic buffers appear increasingly distorted as they are drawn farther from the equator. This happens because the shortest path on a globe is not a straight line when represented on a flat map. This distortion is unavoidable when projecting a sphere onto a flat surface, leading to stretching and shearing.

In comparison. planar buffers are best for viewing smaller geographic areas. The shape of planar buffers won't distort on 2D Web Mercator map, but their size and areas will be increasingly inaccurate as they move away from the equator. In the 3D view, the size of planar buffers will be largest at the equator and smaller the closer they get to the poles.

How it works

The sample listens to arcgisViewPointerMove and arcgisViewKeyDown events both on the Map and Scene instances. If the b key is tapped, a user can click on or move the pointer around both views to create a geodesic buffer around the pointer location.

Use dark colors for code blocksCopy
1
2
3
4
5
viewElementMap.addEventListener("arcgisViewPointerMove", (event) => {
  if (bufferEnabled) {
    createBuffer(event.detail, viewElementMap.view);
  }
});
Image preview of related sample Geometry operator - proximity analysis

Geometry operator - proximity analysis

Image preview of related sample Geometry operator - offset analysis

Geometry operator - offset analysis

Image preview of related sample Geometry operator - centroid analysis

Geometry operator - centroid analysis

Image preview of related sample Geometry operator - using a worker for analysis

Geometry operator - using a worker for analysis

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