## Method Overview

Name | Return Type | Summary | |
---|---|---|---|

Promise | Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries. more details | more details | |

Promise | Calculates the clipped geometry from a target geometry by an envelope. more details | more details | |

Promise | Indicates if one geometry contains another geometry. more details | more details | |

Promise | Calculates the convex hull of the input geometry. more details | more details | |

Promise | Indicates if one geometry crosses another geometry. more details | more details | |

Promise | Split the input Polyline or Polygon where it crosses a cutting Polyline. more details | more details | |

Promise | Densify geometries by plotting points between existing vertices. more details | more details | |

Promise | Creates the difference of two geometries. more details | more details | |

Promise | Indicates if one geometry is disjoint (doesn't instersect in any way) with another geometry. more details | more details | |

Promise | Calculates the shortest planar distance between two geometries. more details | more details | |

Promise | Indicates if two geometries are equal. more details | more details | |

Promise | Returns an Object containing additional information about the input spatial reference. more details | more details | |

Promise | Flips a geometry on the horizontal axis. more details | more details | |

Promise | Flips a geometry on the vertical axis. more details | more details | |

Promise | Performs the generalize operation on the geometries in the cursor. more details | more details | |

Promise | Calculates the area of the input geometry. more details | more details | |

Promise | Creates geodesic buffer polygons at a specified distance around the input geometries. more details | more details | |

Promise | Returns a geodesically densified version of the input geometry. more details | more details | |

Promise | Calculates the length of the input geometry. more details | more details | |

Promise | Creates a new geometry through intersection between two geometries. more details | more details | |

Promise | Indicates if one geometry intersects another geometry. more details | more details | |

Promise | Indicates if the given geometry is topologically simple. more details | more details | |

Promise | Finds the coordinate of the geometry that is closest to the specified point. more details | more details | |

Promise | Finds vertex on the geometry nearest to the specified point. more details | more details | |

Promise | Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects. more details | more details | |

Promise | Creates offset version of the input geometry. more details | more details | |

Promise | Indicates if one geometry overlaps another geometry. more details | more details | |

Promise | Calculates the area of the input geometry. more details | more details | |

Promise | Calculates the length of the input geometry. more details | more details | |

Promise | Indicates if the given DE-9IM relation holds for the two geometries. more details | more details | |

Promise | Rotates a geometry counterclockwise by the specified number of degrees. more details | more details | |

Promise | Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type. more details | more details | |

Promise | Creates the symmetric difference of two geometries. more details | more details | |

Promise | Indicates if one geometry touches another geometry. more details | more details | |

Promise | All inputs must be of the same type of geometries and share one spatial reference. more details | more details | |

Promise | Indicates if one geometry is within another geometry. more details | more details |

### Method Details

#### buffer(geometry, distance, unit, unionResults){Promise}

Creates planar (or Euclidean) buffer polygons at a specified distance around the input geometries.

The GeometryEngine has two methods for buffering geometries client-side: buffer and geodesicBuffer. Use caution when deciding which method to use. As a general rule, use geodesicBuffer if the input geometries have a spatial reference of either WGS84 (wkid: 4326) or Web Mercator. Only use buffer (this method) when attempting to buffer geometries with a projected coordinate system other than Web Mercator. If you need to buffer geometries with a geographic coordinate system other than WGS84 (wkid: 4326), use GeometryService.buffer().

Parameters:geometry Geometry | Geometry[]The buffer input geometry. The

`geometry`

and`distance`

parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array.The specified distance(s) for buffering. The

`geometry`

and`distance`

parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array.

When using an array of geometries as input, the length of the geometry array does not have to equal the length of the`distance`

array. For example, if you pass an array of four geometries:`[g1, g2, g3, g4]`

and an array with one distance:`[d1]`

, all four geometries will be buffered by the single distance value. If instead you use an array of three distances:`[d1, d2, d3]`

,`g1`

will be buffered by`d1`

,`g2`

by`d2`

, and`g3`

and`g4`

will both be buffered by`d3`

. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries.Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsoptionalunionResults BooleanDetermines whether the output geometries should be unioned into a single polygon.

**Default Value:**falseReturns:Type Description Promise When resolved, the response is the resulting buffer(s). The result will be an array if an array of geometries is used as input. It will be a single polygon if a single geometry is input into the function. Example:`// point is a Point geometry geometryEngineAsync.buffer(point, 1000, "feet").then(function(response){ console.log(response); // response is a polygon geometry of a 1000ft buffer around the input point });`

#### clip(geometry, envelope){Promise}

Calculates the clipped geometry from a target geometry by an envelope.

Parameters:geometry GeometryThe geometry to be clipped.

envelope ExtentThe envelope used to clip.

Returns:Type Description Promise When resolved, response is the clipped geometry. - See also:

#### contains(geometry1, geometry2){Promise}

Indicates if one geometry contains another geometry.

Parameters:geometry1 GeometryThe geometry that is tested for the "contains" relationship to the other geometry.

geometry2 GeometryThe geometry that is tested for the "within" relationship to the other geometry.

Returns:Type Description Promise Response is `true`

if geometry1 contains geometry2 (or if geometry2 is within geometry1).- See also:

#### convexHull(geometry, merge){Promise}

Calculates the convex hull of the input geometry. A convex hull is the smallest convex polygon that encloses a group of Objects, such as points. The input geometry can be a point, multipoint, polyline or polygon. The hull is typically a polygon but can also be a polyline or point in degenerate cases.

Parameters:geometry GeometryThe input geometry.

optionalmerge BooleanDictates whether to merge output geometries.

Returns:Type Description Promise When resolved, response is usually a Polyon geometry. - See also:

#### crosses(geometry1, geometry2){Promise}

Indicates if one geometry crosses another geometry.

Parameters:geometry1 GeometryThe geometry to cross.

geometry2 GeometryThe geometry being crossed.

Returns:Type Description Promise Responds `true`

if geometry1 crosses geometry2.- See also:

#### cut(geometry, cutter){Promise}

Split the input Polyline or Polygon where it crosses a cutting Polyline. For Polylines, all left cuts are grouped together in the first Geometry. Right cuts and coincident cuts are grouped in the second Geometry and each undefined cut, along with any uncut parts, are output as separate Polylines. For Polygons, all left cuts are grouped in the first Polygon, all right cuts are grouped in the second Polygon, and each undefined cut, along with any left-over parts after cutting, are output as a separate Polygon. If no cuts are returned then the array will be empty. An undefined cut will only be produced if a left cut or right cut was produced and there was a part left over after cutting, or a cut is bounded to the left and right of the cutter.

Parameters:geometry GeometryThe geometry to be cut.

cutter PolylineThe polyline to cut the geometry.

Returns:Type Description Promise When resolved, response is an array of geometries created by cutting the input geometry with the cutter. - See also:

#### densify(geometry, maxSegmentLength, maxSegmentLengthUnit){Promise}

Densify geometries by plotting points between existing vertices.

Parameters:geometry GeometryThe geometry to be densified.

maxSegmentLength NumberThe maximum segment length allowed. Must be a positive value.

Measurement unit for maxSegmentLength. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsReturns:Type Description Promise When resolved, response is the densified geometry. #### difference(inputGeometry, subtractor){Promise}

Creates the difference of two geometries. The resultant geometry is the portion of inputGeometry not in the subtractor. The dimension of the subtractor has to be equal to or greater than that of the inputGeometry.

Parameters:inputGeometry Geometry | Geometry[]The input geometry to subtract from.

subtractor GeometryThe geometry being subtracted from inputGeometry.

Returns:Type Description Promise When resolved, response is the geometry of inputGeometry minus the subtractor geometry. - See also:

#### disjoint(geometry1, geometry2){Promise}

Indicates if one geometry is disjoint (doesn't instersect in any way) with another geometry.

Parameters:geometry1 GeometryThe base geometry that is tested for the "disjoint" relationship to the other geometry.

geometry2 GeometryThe comparison geometry that is tested for the "disjoint" relationship to the other geometry.

Returns:Type Description Promise When resolved, response is `true`

if geometry1 and geometry2 are disjoint (don't instersect in any way).- See also:

#### distance(geometry1, geometry2, distanceUnit){Promise}

Calculates the shortest planar distance between two geometries. Distance is reported in the linear units specified by

`distanceUnit`

or, if`distanceUnit`

is null, the units of the spatialReference of input geometry.To calculate the geodesic distance between two points, first construct a Polyline using the two points of interest as the beginning and ending points of a single path. Then use the polyline as input for the geodesicLength() method.

Parameters:geometry1 GeometryFirst input geometry.

geometry2 GeometrySecond input geometry.

Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsReturns:Type Description Promise When resolved, response is the distance between the two input geometries. - See also:

#### equals(geometry1, geometry2){Promise}

Indicates if two geometries are equal.

Parameters:geometry1 GeometryFirst input geometry.

geometry2 GeometrySecond input geometry.

Returns:Type Description Promise When resolved, responds with `true`

if the two input geometries are equal.- See also:

#### extendedSpatialReferenceInfo(spatialReference){Promise}

Returns an Object containing additional information about the input spatial reference.

Parameter:spatialReference SpatialReferenceThe input spatial reference.

Returns:Type Description Promise When resolved, response is an Object with the following properties: `{ tolerance: <Number>, unitBaseFactor: <Number>, unitID: <Number>, unitSquareDerivative: <Number>, unitType: <Number> }`

#### flipHorizontal(geometry, flipOrigin){Promise}

Flips a geometry on the horizontal axis. Can optionally be flipped around a point.

Parameters:geometry GeometryThe input geometry to be flipped.

optionalflipOrigin PointPoint to flip the geometry around. Defaults to the centroid of the geometry.

Returns:Type Description Promise When resolved, response is the flipped geometry. - See also:

#### flipVertical(geometry, flipOrigin){Promise}

Flips a geometry on the vertical axis. Can optionally be flipped around a point.

Parameters:geometry GeometryThe input geometry to be flipped.

optionalflipOrigin PointPoint to flip the geometry around. Defaults to the centroid of the geometry.

Returns:Type Description Promise When resolved, response is the flipped geometry. - See also:

#### generalize(geometry, maxDeviation, removeDegenerateParts, maxDeviationUnit){Promise}

Performs the generalize operation on the geometries in the cursor. Point and Multipoint geometries are left unchanged. Envelope is converted to a Polygon and then generalized.

Parameters:geometry GeometryThe input geometry to be generalized.

maxDeviation NumberThe maximum allowed deviation from the generalized geometry to the original geometry.

optionalremoveDegenerateParts BooleanWhen

`true`

the degenerate parts of the geometry will be removed from the output (may be undesired for drawing).optional Measurement unit for maxDeviation. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsReturns:Type Description Promise When resolved, response is the generalized geometry. - See also:

#### geodesicArea(geometry, unit){Promise}

Calculates the area of the input geometry. As opposed to planarArea(), geodesicArea takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or Web Mercator, it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead.

This method only works with WGS84 (wkid: 4326) and Web Mercator spatial references.

Parameters:geometry PolygonThe input polygon.

Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for area units.

**Possible Values:**acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-milesReturns:Type Description Promise When resolved, response is the area of the input geometry. - See also:

#### geodesicBuffer(geometry, distance, unit, unionResults){Promise}

Creates geodesic buffer polygons at a specified distance around the input geometries. When calculating distances, this method takes the curvature of the earth into account, which provides highly accurate results when dealing with very large geometries and/or geometries that spatially vary on a global scale where one projected coordinate system could not accurately plot coordinates and measure distances for all the geometries.

This method only works with WGS84 (wkid: 4326) and Web Mercator spatial references. In general, if your input geometries are assigned one of those two spatial references, you should always use geodesicBuffer() to obtain the most accurate results for those geometries. If needing to buffer points assigned a projected coordinate system other than Web Mercator, use buffer() instead. If the input geometries have a geographic coordinate system other than WGS84 (wkid: 4326), use GeometryService.buffer().

Parameters:geometry Geometry | Geometry[]The buffer input geometry. The

`geometry`

and`distance`

parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array.The specified distance(s) for buffering. The

`geometry`

and`distance`

parameters must be specified as either both arrays or both non-arrays. Never specify one as an array and the other a non-array.

When using an array of geometries as input, the length of the geometry array does not have to equal the length of the`distance`

array. For example, if you pass an array of four geometries:`[g1, g2, g3, g4]`

and an array with one distance:`[d1]`

, all four geometries will be buffered by the single distance value. If instead you use an array of three distances:`[d1, d2, d3]`

,`g1`

will be buffered by`d1`

,`g2`

by`d2`

, and`g3`

and`g4`

will both be buffered by`d3`

. The value of the geometry array will be matched one to one with those in the distance array until the final value of the distance array is reached, in which case that value will be applied to the remaining geometries.Measurement unit of the distance(s). Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsoptionalunionResults BooleanDetermines whether the output geometries should be unioned into a single polygon.

**Default Value:**falseReturns:Type Description Promise When resolved, the response is the resulting buffer(s). The result will be an array if an array of geometries is used as input. It will be a single polygon if a single geometry is input into the function. Example:`// point is a Point geometry geometryEngineAsync.geodesicBuffer(point, 1000, "kilometers").then(function(buffer){ // buffer is a polygon representing a 1000ft buffer around the input point console.log(buffer); });`

#### geodesicDensify(geometry, maxSegmentLength, maxSegmentLengthUnit){Promise}

Returns a geodesically densified version of the input geometry. Use this function to draw the line(s) of the geometry along great circles.

Parameters:A polyline or polygon to densify.

maxSegmentLength NumberThe maximum segment length allowed. This must be a positive value.

Measurement unit for

`maxSegmentLength`

. If a unit is not specified, the units are considered to be the same as the units of the`geometry`

. Use one of the possible values listed below or any of the numeric codes for linear units.**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsReturns:Type Description Promise Resolves to the densified geometry. - See also:

Example:`// lineGeom is a line geometry geometryEngineAsync.geodesicDensify(lineGeom, 10000).then(function(response){ // Response is the densified version of lineGeom });`

#### geodesicLength(geometry, unit){Promise}

Calculates the length of the input geometry. As opposed to planarLength(), geodesicLength() takes into account the curvature of the earth when performing this calculation. Therefore, when using input geometries with a spatial reference of either WGS84 (wkid: 4326) or Web Mercator, it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead.

This method only works with WGS84 (wkid: 4326) and Web Mercator spatial references.

Parameters:geometry GeometryThe input geometry.

Measurement unit of the return value. Defaults to the units of the input geometry. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsReturns:Type Description Promise When resolved, response is the length of the input geometry. - See also:

#### intersect(geometry, intersector){Promise}

Creates a new geometry through intersection between two geometries.

Parameters:geometry Geometry | Geometry[]The input geometry(ies).

intersector GeometryThe geometry being intersected.

Returns:Type Description Promise When resolved, response is the intersection of the geometries. - See also:

#### intersects(geometry1, geometry2){Promise}

Indicates if one geometry intersects another geometry.

Parameters:geometry1 GeometryThe geometry that is tested for the intersects relationship to the other geometry.

geometry2 GeometryThe geometry being intersected.

Returns:Type Description Promise When resolved, response is `true`

if the input geometries intersect each other.- See also:

#### isSimple(geometry){Promise}

Indicates if the given geometry is topologically simple.

Parameter:geometry GeometryThe input geometry.

Returns:Type Description Promise When resolved, response is `true`

if the geometry is topologically simple.- See also:

#### nearestCoordinate(geometry, inputPoint){Promise}

Finds the coordinate of the geometry that is closest to the specified point.

Parameters:geometry GeometryThe geometry to consider.

inputPoint PointThe point used to search the nearest coordinate in the geometry.

Returns:Type Description Promise Resolves to an instance of NearestPointResult, containing the nearest coordinate to the `inputPoint`

.- See also:

#### nearestVertex(geometry, inputPoint){Promise}

Finds vertex on the geometry nearest to the specified point.

Parameters:geometry GeometryThe geometry to consider.

inputPoint PointThe point used to search the nearest vertex in the geometry.

Returns:Type Description Promise Resolves to an instance of NearestPointResult, containing the nearest vertex to the `inputPoint`

.- See also:

#### nearestVertices(geometry, inputPoint, searchRadius, maxVertexCountToReturn){Promise}

Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest and returns them as an array of Objects.

Parameters:geometry GeometryThe geometry to consider.

inputPoint PointThe point from which to measure.

searchRadius NumberThe distance to search from the inputPoint in the units of the view's spatial reference.

maxVertexCountToReturn NumberThe maximum number of vertices to return.

Returns:Type Description Promise Resolves to an array of NearestPointResult, containing the nearest vertices to the `inputPoint`

.- See also:

#### offset(geometry, offsetDistance, offsetUnit, joinType, bevelRatio, flattenError){Promise}

Creates offset version of the input geometry. The offset operation creates a geometry that is a constant distance from an input polyline or polygon. It is similar to buffering, but produces a one-sided result.

Parameters:geometry Geometry | Geometry[]The geometries to offset.

offsetDistance NumberThe offset distance for the Geometries. If offsetDistance > 0, then the offset geometry is constructed to the right of the oriented input geometry, if offsetDistance = 0, then there is no change in the geometries, otherwise it is constructed to the left. For a simple polygon, the orientation of outer rings is clockwise and for inner rings it is counter clockwise. So the "right side" of a simple polygon is always its inside.

Measurement unit of the offset distance. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsjoinType StringThe join type.

**Possible values:**round | bevel | miter | squareoptionalbevelRatio NumberApplicable when

`joinType = 'miter'`

; bevelRatio is multiplied by the offset distance and the result determines how far a mitered offset intersection can be located before it is beveled.optionalflattenError NumberApplicable when

`joinType = 'round'`

; flattenError determines the maximum distance of the resulting segments compared to the true circular arc. The algorithm never produces more than around 180 vertices for each round join.Returns:Type Description Promise When resolved, response is the offset geometries. - See also:

#### overlaps(geometry1, geometry2){Promise}

Indicates if one geometry overlaps another geometry.

Parameters:geometry1 GeometryThe base geometry that is tested for the "overlaps" relationship with the other geometry.

geometry2 GeometryThe comparison geometry that is tested for the "overlaps" relationship with the other geometry.

Returns:Type Description Promise When resolved, response is `true`

if the two geometries overlap.- See also:

#### planarArea(geometry, unit){Promise}

Calculates the area of the input geometry. As opposed to geodesicArea(), planarArea() performs this calculation using projected coordinates and does not take into account the earth's curvature. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or Web Mercator, it is best practice to calculate areas using geodesicArea(). If the input geometries have a projected coordinate system other than Web Mercator, use planarArea() instead.

Parameters:geometry PolygonThe input polygon.

Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for area units.

**Possible Values:**acres | ares | hectares | square-feet | square-meters | square-yards | square-kilometers | square-milesReturns:Type Description Promise When resolved, response is the area of the input geometry. - See also:

#### planarLength(geometry, unit){Promise}

Calculates the length of the input geometry. As opposed to geodesicLength(), planarLength() uses projected coordinates and does not take into account the curvature of the earth when performing this calculation. When using input geometries with a spatial reference of either WGS84 (wkid: 4326) or Web Mercator, it is best practice to calculate lengths using geodesicLength(). If the input geometries have a projected coordinate system other than Web Mercator, use planarLength() instead.

Parameters:geometry GeometryThe input geometry.

Measurement unit of the return value. Defaults to the units of the input geometries. Use one of the possible values listed below or any of the numeric codes for linear units.

**Possible Values:**meters | feet | kilometers | miles | nautical-miles | yardsReturns:Type Description Promise When resolved, response is the length of the input geometry. - See also:

#### relate(geometry1, geometry2, relation){Promise}

Indicates if the given DE-9IM relation holds for the two geometries.

Parameters:geometry1 GeometryThe first geometry for the relation.

geometry2 GeometryThe second geometry for the relation.

relation StringThe Dimensionally Extended 9 Intersection Model (DE-9IM) matrix relation (encoded as a string) to test against the relationship of the two geometries. This string contains the test result of each intersection represented in the DE-9IM matrix. Each result is one character of the string and may be represented as either a number (maximum dimension returned:

`0`

,`1`

,`2`

), a Boolean value (`T`

or`F`

), or a mask character (for ignoring results: '*').

Example: Each of the following DE-9IM string codes are valid for testing whether a polygon geometry completely contains a line geometry:`TTTFFTFFT`

(Boolean), 'T*****FF*' (ignore irrelevant intersections), or '102FF*FF*' (dimension form). Each returns the same result.

See this article and this ArcGIS help page for more information about the DE-9IM model and how string codes are constructed.Returns:Type Description Promise When resolved, response is `true`

if the relation of the input geometries holds.- See also:

#### rotate(geometry, angle, rotationOrigin){Promise}

Rotates a geometry counterclockwise by the specified number of degrees. Rotation is around the centroid, or a given rotation point.

Parameters:geometry GeometryThe geometry to rotate.

angle NumberThe rotation angle in degrees.

optionalrotationOrigin PointPoint to rotate the geometry around. Defaults to the centroid of the geometry.

Returns:Type Description Promise When resolved, response is the rotated geometry. - See also:

#### simplify(geometry){Promise}

Performs the simplify operation on the geometry which alters the given geometries to make their definitions topologically legal with respect to their geometry type.

Parameter:geometry GeometryThe geometry to be simplified.

Returns:Type Description Promise When resolved, response is the simplified geometry. - See also:

#### symmetricDifference(leftGeometry, rightGeometry){Promise}

Creates the symmetric difference of two geometries. The symmetric difference includes the parts that are in either of the sets, but not in both.

Parameters:leftGeometry Geometry | Geometry[]One of the Geometry instances in the XOR operation.

rightGeometry GeometryOne of the Geometry instances in the XOR operation.

Returns:Type Description Promise When resolved, response is the symmetric differences of the two geometries. - See also:

#### touches(geometry1, geometry2){Promise}

Indicates if one geometry touches another geometry.

Parameters:geometry1 GeometryThe geometry to test the "touches" relationship with the other geometry.

geometry2 GeometryThe geometry to be touched.

Returns:Type Description Promise When resolved, response is `true`

if geometry1 touches geometry2.- See also:

#### union(geometries){Promise}

All inputs must be of the same type of geometries and share one spatial reference.

Parameter:geometries Geometry[]An array of Geometries to union.

Returns:Type Description Promise When resolved, response is the union of the geometries. - See also:

Example:`// pt1 and pt2 are point objects to union together geometryEngine.union([pt1, pt2]).then(function(response){ console.log(response); // geometry representing the union of the input geometries });`

#### within(geometry1, geometry2){Promise}

Indicates if one geometry is within another geometry.

Parameters:geometry1 GeometryThe base geometry that is tested for the "within" relationship to the other geometry.

geometry2 GeometryThe comparison geometry that is tested for the "contains" relationship to the other geometry.

Returns:Type Description Promise When resolved, response is `true`

if geometry1 is within geometry2 (or if geometry2 contains geometry1).- See also: