geometryEngine
constgeometryEngine:object
Defined in: src/geometryEngine.ts:24
Spatial operations mirroring ArcGIS.GeometryEngine (Swift) /
com.arcgismaps.geometry.GeometryEngine (Kotlin). Every call is synchronous and
works on plain Geometry values (see GeometryCodec on the native side).
Planar operations (buffer, area, length, distance, …) assume a projected
coordinate system; their geodesic* counterparts measure on the spheroid and take
an optional unit + curve type.
Type Declaration
Section titled “Type Declaration”area: (
geometry) =>number
Planar area (negative if the ring is clockwise).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”number
autoComplete
Section titled “autoComplete”autoComplete: (
existingPolygons,boundaries) =>Geometry[]
Auto-completes polygons from existing polygon boundaries and new boundary polylines.
Parameters
Section titled “Parameters”existingPolygons
Section titled “existingPolygons”Geometry[]
boundaries
Section titled “boundaries”Geometry[]
Returns
Section titled “Returns”Geometry[]
boundary
Section titled “boundary”boundary: (
geometry) =>Geometry|null
Boundary of the geometry (polygon → polyline, polyline → multipoint).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”Geometry | null
buffer
Section titled “buffer”buffer: (
geometry,distance) =>Geometry|null
Planar buffer polygon at distance (in the geometry’s units).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”distance
Section titled “distance”number
Returns
Section titled “Returns”Geometry | null
clip: (
geometry,envelope) =>Geometry|null
Clips a geometry to an envelope.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”envelope
Section titled “envelope”Returns
Section titled “Returns”Geometry | null
combineExtents
Section titled “combineExtents”combineExtents: (
a,b) =>Geometry|null
Envelope that contains both geometries’ extents.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Geometry | null
contains
Section titled “contains”contains: (
a,b) =>boolean
True if a contains b.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
convexHull
Section titled “convexHull”convexHull: (
geometry) =>Geometry|null
Smallest convex polygon that contains the geometry.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”Geometry | null
crosses
Section titled “crosses”crosses: (
a,b) =>boolean
True if a crosses b.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
cut: (
geometry,cutter) =>Geometry[]
Cuts a geometry with a polyline, returning the resulting parts.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”cutter
Section titled “cutter”Returns
Section titled “Returns”Geometry[]
densify
Section titled “densify”densify: (
geometry,maxSegmentLength) =>Geometry|null
Adds vertices so no segment is longer than maxSegmentLength.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”maxSegmentLength
Section titled “maxSegmentLength”number
Returns
Section titled “Returns”Geometry | null
difference
Section titled “difference”difference: (
a,b) =>Geometry|null
Part of a that does not intersect b.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Geometry | null
disjoint
Section titled “disjoint”disjoint: (
a,b) =>boolean
True if a and b are disjoint.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
distance
Section titled “distance”distance: (
a,b) =>number|null
Planar distance between two geometries.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”number | null
ellipseGeodesic
Section titled “ellipseGeodesic”ellipseGeodesic: (
params) =>Geometry|null
Constructs a geodesic ellipse as a polygon, polyline, or multipoint from the given params.
Mirrors GeometryEngine.geodesicEllipse(parameters:) (Swift) /
GeometryEngine.ellipseGeodesicOrNull(parameters) (Kotlin).
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Geometry | null
equals
Section titled “equals”equals: (
a,b) =>boolean
True if a and b are spatially equal.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
extend
Section titled “extend”extend: (
polyline,extender) =>Geometry|null
Extends a polyline to meet an extender polyline.
Parameters
Section titled “Parameters”polyline
Section titled “polyline”extender
Section titled “extender”Returns
Section titled “Returns”Geometry | null
generalize
Section titled “generalize”generalize: (
geometry,maxDeviation,removeDegenerateParts) =>Geometry|null
Removes vertices within maxDeviation (Douglas–Peucker).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”maxDeviation
Section titled “maxDeviation”number
removeDegenerateParts?
Section titled “removeDegenerateParts?”boolean = false
Returns
Section titled “Returns”Geometry | null
geodesicArea
Section titled “geodesicArea”geodesicArea: (
geometry,unit?,curveType?) =>number
Geodesic area in unit (default squareMeters).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”curveType?
Section titled “curveType?”Returns
Section titled “Returns”number
geodesicBuffer
Section titled “geodesicBuffer”geodesicBuffer: (
geometry,distance,unit?,curveType?,maxDeviation?) =>Geometry|null
Geodesic buffer polygon at distance in unit (default meters).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”distance
Section titled “distance”number
curveType?
Section titled “curveType?”maxDeviation?
Section titled “maxDeviation?”number
Returns
Section titled “Returns”Geometry | null
geodesicDistance
Section titled “geodesicDistance”geodesicDistance: (
a,b,unit?,curveType?) =>GeodeticDistanceResult|null
Geodesic distance + azimuths between two points, in unit (default meters).
Parameters
Section titled “Parameters”curveType?
Section titled “curveType?”Returns
Section titled “Returns”GeodeticDistanceResult | null
geodesicLength
Section titled “geodesicLength”geodesicLength: (
geometry,unit?,curveType?) =>number
Geodesic length in unit (default meters).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”curveType?
Section titled “curveType?”Returns
Section titled “Returns”number
intersect
Section titled “intersect”intersect: (
a,b) =>Geometry|null
Intersection (overlap) of two geometries.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Geometry | null
intersections
Section titled “intersections”intersections: (
a,b) =>Geometry[]
All intersection geometries of two geometries (points, lines and/or polygons).
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Geometry[]
intersects
Section titled “intersects”intersects: (
a,b) =>boolean
True if a and b intersect.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
isSimple
Section titled “isSimple”isSimple: (
geometry) =>boolean
True if the geometry is topologically simple.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”boolean
labelPoint
Section titled “labelPoint”labelPoint: (
polygon) =>Geometry|null
Interior point suitable for placing a label inside a polygon.
Parameters
Section titled “Parameters”polygon
Section titled “polygon”Returns
Section titled “Returns”Geometry | null
length
Section titled “length”length: (
geometry) =>number
Planar length / perimeter.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”number
move: (
geometry,deltaX,deltaY) =>Geometry|null
Moves a geometry by (deltaX, deltaY).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”deltaX
Section titled “deltaX”number
deltaY
Section titled “deltaY”number
Returns
Section titled “Returns”Geometry | null
nearestCoordinate
Section titled “nearestCoordinate”nearestCoordinate: (
geometry,point) =>ProximityResult|null
Nearest point on the geometry to point.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”ProximityResult | null
nearestVertex
Section titled “nearestVertex”nearestVertex: (
geometry,point) =>ProximityResult|null
Nearest vertex of the geometry to point.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”ProximityResult | null
normalizeCentralMeridian
Section titled “normalizeCentralMeridian”normalizeCentralMeridian: (
geometry) =>Geometry|null
Normalizes a geometry that crosses the antimeridian back into the −180…180 range.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”Geometry | null
offset
Section titled “offset”offset: (
geometry,distance,offsetType?,bevelRatio,flattenError) =>Geometry|null
Offsets a geometry by distance with the given join style.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”distance
Section titled “distance”number
offsetType?
Section titled “offsetType?”bevelRatio?
Section titled “bevelRatio?”number = 0
flattenError?
Section titled “flattenError?”number = 0
Returns
Section titled “Returns”Geometry | null
overlaps
Section titled “overlaps”overlaps: (
a,b) =>boolean
True if a and b overlap.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
project
Section titled “project”project: (
geometry,spatialReference) =>Geometry|null
Re-projects a geometry into another coordinate system (by WKID).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”spatialReference
Section titled “spatialReference”number
Returns
Section titled “Returns”Geometry | null
relate
Section titled “relate”relate: (
a,b,relation) =>boolean
True if a and b satisfy the DE-9IM relation string.
Parameters
Section titled “Parameters”relation
Section titled “relation”string
Returns
Section titled “Returns”boolean
reshape
Section titled “reshape”reshape: (
geometry,reshaper) =>Geometry|null
Reshapes a polyline/polygon using a reshaper polyline.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”reshaper
Section titled “reshaper”Returns
Section titled “Returns”Geometry | null
rotate
Section titled “rotate”rotate: (
geometry,angle,origin?) =>Geometry|null
Rotates a geometry by angle degrees around origin (default: its centroid).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”number
origin?
Section titled “origin?”Returns
Section titled “Returns”Geometry | null
scale: (
geometry,factorX,factorY,origin?) =>Geometry|null
Scales a geometry by (factorX, factorY) relative to origin (default: its centroid).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”factorX
Section titled “factorX”number
factorY
Section titled “factorY”number
origin?
Section titled “origin?”Returns
Section titled “Returns”Geometry | null
sectorGeodesic
Section titled “sectorGeodesic”sectorGeodesic: (
params) =>Geometry|null
Constructs a geodesic sector (pie slice) from the given params.
Mirrors GeometryEngine.geodesicSector(parameters:) (Swift) /
GeometryEngine.sectorGeodesicOrNull(parameters) (Kotlin).
Parameters
Section titled “Parameters”params
Section titled “params”Returns
Section titled “Returns”Geometry | null
simplify
Section titled “simplify”simplify: (
geometry) =>Geometry|null
Returns a topologically simple, valid copy of the geometry.
Parameters
Section titled “Parameters”geometry
Section titled “geometry”Returns
Section titled “Returns”Geometry | null
symmetricDifference
Section titled “symmetricDifference”symmetricDifference: (
a,b) =>Geometry|null
Parts of a and b that do not intersect each other.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Geometry | null
touches
Section titled “touches”touches: (
a,b) =>boolean
True if a and b touch only at a boundary.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
union: (
geometries) =>Geometry|null
Union of all input geometries.
Parameters
Section titled “Parameters”geometries
Section titled “geometries”Geometry[]
Returns
Section titled “Returns”Geometry | null
within
Section titled “within”within: (
a,b) =>boolean
True if a is within b.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”boolean
withM: (
geometry,m) =>Geometry|null
Returns a copy of the geometry with m set as the M (measure) value on all vertices.
Mirrors GeometryEngine.makeGeometry(from:m:) (Swift) /
GeometryEngine.createWithMOrNull(geometry, m) (Kotlin).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”number
Returns
Section titled “Returns”Geometry | null
withZ: (
geometry,z) =>Geometry|null
Returns a copy of the geometry with z set as the Z (elevation) value on all vertices.
Mirrors GeometryEngine.makeGeometry(from:z:) (Swift) /
GeometryEngine.createWithZOrNull(geometry, z) (Kotlin).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”number
Returns
Section titled “Returns”Geometry | null
withZAndM
Section titled “withZAndM”withZAndM: (
geometry,z,m) =>Geometry|null
Returns a copy of the geometry with both z (elevation) and m (measure) set on all vertices.
Mirrors GeometryEngine.makeGeometry(from:z:m:) (Swift) /
GeometryEngine.createWithZAndMOrNull(geometry, z, m) (Kotlin).
Parameters
Section titled “Parameters”geometry
Section titled “geometry”number
number
Returns
Section titled “Returns”Geometry | null