The ArcGIS Maps SDK for JavaScript provides a variety of capabilities for performing client-side geometric operations on points, multipoints, lines, polygons and extents.
Categories
The geometry operators are grouped into nine functional categories: bounding, densify and generalize, feature to point, linear referencing, linear transformations, measurements, projection, spatial relationships, and topological operations.
Bounding
Bounding operators are used to determine an enclosing shape around a more complex geometric object. This is used to quickly test for potential collisions or overlaps with other objects without needing to check every detail of the original geometry. The result geometry can be used to significantly improve the performance of spatial analysis.
alphaShapeOperator, boundaryOperator, convexHullOperator, minimumBoundingCircleOperator
Densify and generalize
Densifying a multipart geometry adds more vertices at regular intervals. Generalizing a multipart geometry simplifies it by removing vertices while preserving its general shape.
densifyOperator, generalizeOperator, geodeticDensifyOperator
Feature to point
Feature to point operations are used to locate a specific interior point in a polygon or extent.
centroidOperator, labelPointOperator
Linear referencing
Linear referencing is a method for determining geographic locations as relative positions between or along a measured line feature.
Linear transformations
Linear transformations involve altering the spatial location, shape, or orientation of geographic data by manipulating the coordinates and include flipX, flipY, scale and more.
Measurements
Measurement operations are for determining the dimensions of geometric shapes.
areaOperator, distanceOperator, geodeticAreaOperator, geodeticDistanceOperator, geodeticLengthOperator, lengthOperator
Projection
Projection operations involve transforming the vertices of geometries from one spatial reference to another.
projectOperator, shapePreservingProjectOperator
Spatial relationships
Spatial relationships are about understanding where geometries are in relation to each other to define their arrangement and interactions.
containsOperator, crossesOperator, disjointOperator, equalsOperator, geodesicProximityOperator, intersectsOperator, intersectionOperator, isNearOperator, overlapsOperator, proximityOperator, relateOperator, touchesOperator, and withinOperator
Topological
Topological operations are about changing the shape of an object while maintaining its fundamental structure in terms of how parts are connected to each other. The result is the creation of a new geometry.
autoCompleteOperator, bufferOperator, clipOperator, cutOperator, differenceOperator, geodesicBufferOperator, graphicBufferOperator, extendOperator, integrateOperator, multiPartToSinglePartOperator, offsetOperator, polygonOverlayOperator, reshapeOperator, linesToPolygonsOperator, polygonSlicerOperator, simplifyOperator, symmetricDifferenceOperator, unionOperator
Working with spatial relationship operators
Dimensionality
The concept of dimensions is important in determining the spatial relationship of two features. The dimensions of the features are examined to determine how they should be compared. The dimension of the resulting feature or features determines whether or not the operation was successful.
The dimensions of a geometry are the minimum coordinates (none, x, y) required to define the spatial extent of the geometry. A geometry can have a dimension of 0, 1, or 2. The dimensions are as follows:
- 0 — Has neither length nor area
- 1 — Has a length (x or y)
- 2 — Contains area (x and y)
Point and multipoint features have a dimension of 0, polylines a dimension of 1, and extents and polygons a dimension of 2. The presence of z-coordinates or m-coordinates does not affect the dimensionality of the geometry.
Acceleration
Relational operators can benefit from acceleration. Acceleration is the process of constructing data structures used during relational operations, such as a spatial index, and saving them to be reused. This process can have performance benefits when applying the same relational operation against a geometry numerous times.
Accelerating a geometry can be time consuming and should be weighed when determining when to use it. The time to accelerate versus the performance gain depends on the number of vertices in the geometry. If the geometry has a large number of vertices, for example more than 10,000, then you can see a performance gain from acceleration even if you are using it only ten times. If the geometry has a small number of vertices, for example less than 200, you may not see a performance gain from acceleration unless you are using it more than 100 to 200 times.
Working with geodetic operators
Geodetic curve types
A curve type is how the connection between vertices is interpreted. A geodetic curve is a curve defined on the surface of a spheroid. To represent a geodetic curve on a flat map, the output is densified. The start and end vertices are not affected by densification, only the intermediate vertices are affected.
The SDK supports five geodetic curve types when working with the following: geodesicBufferOperator, geodeticAreaOperator, geodeticDensifyOperator, geodeticDistanceOperator and geodeticLengthOperator. Except for the shape-preserving
type, the other four types replace the connection between two vertices, that were connected by some segment, with a given geodetic curve. Shape preserving typically means a new geometry is created that approximates the given geodetic path using a densified representation.
-
geodesic
- Defines the shortest distance between any two points. -
great-elliptic
- Defined by the intersection of a plane that contains the center of the spheroid and the spheroid surface and passes through two points. This is also known as a great circle when a sphere is used. It is not necessarily the shortest path between two points. -
loxodrome
- Defined by the line of constant bearing, or azimuth, between two points. It represents a rhumb-line path on the earth that crosses each meridian at the same acute angle, thus forming a spiral that converges on the north or south pole. The Mercator projection shows loxodromes as straight lines. -
normal-section
- Defined by the intersection of a plane that passes through two points on the surface of the spheroid and is perpendicular to the surface at the first point. It is not necessarily the shortest path between two points. -
shape-preserving
- The segment shape is preserved in the projection where it is defined. This is often used in situations where maintaining the visual representation of a feature is crucial, like when working with boundaries or coastlines.