java.lang.Object  
↳  com.esri.core.geometry.GeometryEngine 
This class provides a set of static methods to perform geometric operations on geometry instances.
Geometric operations include:
A set of methods to perform geodesic operations, such as calculating a geodesic distance between two points or creating a geodesic ellipse, is also included.
Nested Classes  

GeometryEngine.JoinType  Join types for the geodesic offset operation. 
Public Constructors  

Public Methods  

Calculates a buffer polygon for each geometry at each of the corresponding specified distances.
 
Calculates buffer polygon of the geometry as specified by the distance input.
 
Calculates the clipped geometry from a target geometry by an envelope.
 
Indicates if one geometry contains another geometry.
 
Indicates if one geometry crosses another geometry.
 
Creates the difference of two geometries.
 
Calculates the 2D planar distance between two geometries.
 
Indicates if two geometries are equal.
 
Calculates the geodesic area of the input geometry.
 
Creates a geodesic geometry by densifying the input geometry.
 
Same as
geodesicDensifyGeometry(Geometry, SpatialReference, double, LinearUnit) with
maxSegmentLength =10000 meters.  
Calculates the geodesic distance between 2 points.
 
Same as
geodesicEllipse(Point, SpatialReference, double, double, double, int, LinearUnit, com.esri.core.geometry.Geometry.Type)
with majorAxisDirection=0, pointCount=100, outputType=Geometry.Type.POLYGON  
Creates a geodesic ellipse.
 
A geodesic length is the shortest distance between any two points on the earth's surface when the earth's surface
is approximated by a spheroid.
 
Returns a point that has been moved by geodesic calculation.
 
Returns a list of points that have been moved by geodesic calculations.
 
Creates offset versions of the input geometries.
 
Same as
geodesicSector(Point, SpatialReference, double, double, double, double, double, double, double, LinearUnit, com.esri.core.geometry.Geometry.Type)
with majorAxisDirection=0, maxArcSegmentLength=10, maxRadiusSegmentLength=10,
outputType=Geometry.Type.POLYGON  
Creates a geodesic sector.
 
Imports geometry from the binary ESRI shape file format.
 
Exports geometry to the ESRI shape file format; the exported binary can then be stored in SDE.
 
Exports the specified geometry instance to its JSON representation.
 
Calculates an interior point for a specified polygon.
 
Finds the coordinate of the geometry which is closest to the specified point.
 
Finds the nearest vertex on the geometry from the specified input point.
 
Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest.
 
Same as
getTransformations(SpatialReference, SpatialReference, Envelope, int) with maxEntries =0,
and extent =empty envelope.  
Gets transformations to project from
fromSR to toSR .  
Creates a geometry through intersection between two geometries.
 
Indicates if one geometry intersects another geometry.
 
Imports the MapGeometry from its JSON representation.
 
Returns a copy of the input geometry that does not intersect the minimum or maximum meridian of the spatial
reference.
 
Projects the given geometry using the provided projection transformation.
 
Projects the given geometry using the provided spatial references and transformation.
 
Projects the given point from a longitude/latitude (EPSG:4326 / WGS84 spatial
reference) to the specified output spatial reference.
 
Projects the given geometry instance from the input spatial reference to the output spatial reference.
 
Performs the simplify operation on the geometry.
 
Indicates if one geometry touches another geometry.
 
Constructs a new geometry by union an array of geometries.
 
Indicates if one geometry is within another geometry.

[Expand]
Inherited Methods  

From class
java.lang.Object

Calculates a buffer polygon for each geometry at each of the corresponding specified distances. It is assumed all geometries have the same spatial reference. The unit variable defines the unit of all the distances. If unit == null then the unit of distances is assumed to be that of the spatial reference. There is an option to union the returned geometries.
Parameters  

geometries 
Geometry :
An array of geometries to be buffered. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
distances 
double :
The corresponding distances for the input geometries to be buffered. 
unit 
Unit :
The unit of the values in the distances array. Must be of the same unit type as spatial reference. 
toUnionResults 
boolean :
True if all geometries buffered at a given distance are to be unioned into a single polygon. 
Returns  

Polygon[] 
The buffer of the geometries. 
Throws  

IllegalArgumentException 
if the input unit and the spatial reference unit are not of the same unit type. 
Calculates buffer polygon of the geometry as specified by the distance input. If unit == null, then the distance is assumed to be in the unit of the spatial reference.
Parameters  

geometry 
Geometry :
Geometry to be buffered. 
spatialReference 
SpatialReference :
The spatial reference of the geometry. 
distance 
double :
The specified distance for buffer. 
unit 
Unit :
The unit of the values in the distances array. Must be of the same unit type as spatial reference. 
Returns  

Polygon 
The buffer polygon at the specified distances. 
Throws  

IllegalArgumentException 
if the input unit and the spatial reference unit are not of the same unit type. 
Calculates the clipped geometry from a target geometry by an envelope.
Parameters  

geometry 
Geometry :
The geometry to be clipped. 
envelope 
Envelope :
The envelope used to clip. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

Geometry 
The geometry created by the clipping. 
Indicates if one geometry contains another geometry.
Parameters  

geometry1 
Geometry :
The geometry that is tested for the contains relationship to the other geometry.. 
geometry2 
Geometry :
The geometry that is tested for within relationship to the other geometry. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

boolean 
True if geometry1 contains geometry2. 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Indicates if one geometry crosses another geometry.
Parameters  

geometry1 
Geometry :
The geometry to cross. 
geometry2 
Geometry :
The geometry being crossed. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

boolean 
True if geometry1 crosses geometry2 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Creates the difference of two geometries. The resultant geometry is the part of inputGeometry not in the subtractor. The dimension of subtractor has to be equal to or greater than that of inputGeometry.
Parameters  

inputGeometry 
Geometry :
The geometry being subtracted. 
subtractor 
Geometry :
The geometry object to subtract from. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

Geometry 
The geometry of the differences. 
Throws  

IllegalArgumentException 
if inputGeometry or subtractor parameter is null. 
Calculates the 2D planar distance between two geometries.
Parameters  

geometry1 
Geometry :
Geometry. 
geometry2 
Geometry :
Geometry. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

double 
The distance between the two geometries. 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Indicates if two geometries are equal.
Parameters  

geometry1 
Geometry :
Geometry. 
geometry2 
Geometry :
Geometry. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

boolean 
True if both geometry objects are equal. 
Calculates the geodesic area of the input geometry.
Parameters  

geometry 
Geometry :
The geometry to calculate the area of. 
spatialReference 
SpatialReference :
The spatial reference of the geometry. 
areaUnit 
AreaUnit :
Unit of the area returned. If this is null, returned area is in square meters. 
Returns  

double 
the geodesic area of the input geometry; 0 if geometry is not a polygon or a envelope. Returned area is in square meters if the input areaUnit is null. 
Throws  

IllegalArgumentException 
if input geometry or spatial reference is null. 
Creates a geodesic geometry by densifying the input geometry.
Parameters  

geometry 
Geometry :
input geometry to be used to create corresponding geodesic geometry. 
spatialReference 
SpatialReference :
spatial reference of input and output geometry. 
maxSegmentLength 
double :
the geodesic geometry consists of a number of segments. This specifies
the maximum length of those segments. 
lengthUnit 
LinearUnit :
Unit of the input lengthMaxSegment. If null, the unit
assumed is meters. 
Returns  

Geometry 
geodesic line/polygon if input is a line/polygon; same geometry for point. 
Throws  

IllegalArgumentException 
if input geometry is null,
or if spatial reference is null,
or if the lengthMaxSegment is 0 or negative. 
Same as geodesicDensifyGeometry(Geometry, SpatialReference, double, LinearUnit)
with
maxSegmentLength
=10000 meters.
Parameters  

geometry 
Geometry

spatialReference 
SpatialReference

Returns  

Geometry 
Calculates the geodesic distance between 2 points.
Parameters  

p1 
Point :
One of the 2 points. 
p2 
Point :
The other point. 
spatialReference 
SpatialReference :
spatial reference of the input geometry. 
distanceUnit 
LinearUnit :
Unit of the result. If null, the unit assumed is meters. 
Returns  

double 
the geodesic distance between 2 points. 
Throws  

IllegalArgumentException 
if any of the input points or spatial reference is null. 
Same as geodesicEllipse(Point, SpatialReference, double, double, double, int, LinearUnit, com.esri.core.geometry.Geometry.Type)
with majorAxisDirection=0, pointCount=100, outputType=Geometry.Type.POLYGON
Parameters  

center 
Point

spatialReference 
SpatialReference

semiAxis1Length 
double

semiAxis2Length 
double

lengthUnit 
LinearUnit

Returns  

Polygon 
Creates a geodesic ellipse.
Parameters  

center 
Point :
center of ellipse in the coordinates of the specified spatial reference. 
spatialReference 
SpatialReference :
spatial reference of the input center and the output geometry. 
semiAxis1Length 
double :
length of one of the semiaxes. 
semiAxis2Length 
double :
length of the other semiaxis. 
majorAxisDirection 
double :
direction of major axis of the ellipse. Specified in degrees,
0 is East, measured anticlockwise. 
pointCount 
int :
the calculated geodesic geometry is a piecewise approximation. This specifies the number of
vertices in the result. (A projection applied on the result to consider the input spatialReference
may add or remove or add some vertices). Values less than 10 will reset to 10. 
lengthUnit 
LinearUnit :
Unit used to specify the length values. If null, the unit
assumed is meters. 
outputType 
Geometry.Type :
One of Geometry.Type.MULTIPOINT, Geometry.Type.POLYLINE, or Geometry.Type.POLYGON.For polygon or polyline, the result may have more than one path depending on the size of the ellipse and its position relative to the horizon of the coordinate system. For Polygon, the interior of the polygon is the interior of the ellipse. For Multipoint or polyline, the result vertices lie on the boundary of the ellipse. 
Returns  

Geometry 
geometry that represents the geodesic ellipse. 
Throws  

IllegalArgumentException 
if any of the input is null, or if any of the lengths is 0 or negative. 
IllegalArgumentException 
if the outputType is not one of MULTIPOINT, POLYLINE, or POLYGON. 
A geodesic length is the shortest distance between any two points on the earth's surface when the earth's surface is approximated by a spheroid.
Parameters  

geometry 
Geometry :
The input geometry. 
spatialReference 
SpatialReference :
The spatial reference in which the coordinates of the geometry are defined. This spatial
reference can be a Geographic Coordinate System or a Projected Coordinate System, but it cannot be local. 
lengthUnit 
LinearUnit :
The units to return the length in. If null is specified, the length is returned in meters. 
Returns  

double 
The geodesic length of geometry. Note: This method will always return 0 for Point and MultiPoint instances. 
Returns a point that has been moved by geodesic calculation. The input point is moved by specified distance and azimuth.
Parameters  

point 
Point :
point to be moved. 
spatialReference 
SpatialReference :
spatial reference of the input point. 
distance 
double :
distance to be moved. 
distanceUnit 
LinearUnit :
unit of distance specified. If null, unit assumed is meters. 
azimuth 
double :
the angle for the points to be moved along, in degrees. 
Returns  

Point 
the point moved. 
Throws  

IllegalArgumentException 
if the input point or spatial reference is null. 
Returns a list of points that have been moved by geodesic calculations. Each input point is moved by specified distance and azimuth.
Parameters  

points 
List :
points to be moved. 
spatialReference 
SpatialReference :
spatial reference of the input points. 
distance 
double :
distance to be moved. 
distanceUnit 
LinearUnit :
unit of distance specified. If null, unit assumed is meters. 
azimuth 
double :
the angle for the points to be moved along, in degrees. 
Returns  

List<Point> 
list of points moved, in same order as the input. 
Throws  

IllegalArgumentException 
if any of the input points or spatial reference is null. 
Parameters  

geometries 
List

spatialReference 
SpatialReference

distance 
double

Returns  

List<Geometry> 
Creates offset versions of the input geometries.
The offset operation creates a geometry that is at a constant distance (offset distance) from an input polyline
or polygon. It is similar to buffering, but produces a one sided result.
For transforming geometries (such as shift, rotate), see Transformation2D
.
Parameters  

geometries 
List :
The geometries to calculate the offset for. Point and Multipoint are not supported. 
spatialReference 
SpatialReference :
The Spatial reference of the Geometries. 
distance 
double :
The offset distance for the Geometries, in units of the spatial reference.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. 
joinType 
GeometryEngine.JoinType :
The GeometryEngine.JoinType of the offset geometry. 
bevelRatio 
double :
Applicable to 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. 
flattenError 
double :
Applicable to 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  

List<Geometry> 
the result of the offset operation; result is in order of the input geometries. 
Throws  

RuntimeException 
if any of the input geometry is a point or multipoint. 
IllegalArgumentException 
if the input geometries or join type is null. 
Parameters  

geometry 
Geometry

spatialReference 
SpatialReference

distance 
double

Returns  

Geometry 
Parameters  

geometry 
Geometry

spatialReference 
SpatialReference

distance 
double

joinType 
GeometryEngine.JoinType

bevelRatio 
double

flattenError 
double

Returns  

Geometry 
Same as geodesicSector(Point, SpatialReference, double, double, double, double, double, double, double, LinearUnit, com.esri.core.geometry.Geometry.Type)
with majorAxisDirection=0, maxArcSegmentLength=10, maxRadiusSegmentLength=10,
outputType=Geometry.Type.POLYGON
Parameters  

center 
Point

spatialReference 
SpatialReference

semiAxis1Length 
double

semiAxis2Length 
double

startDirection 
double

sectorAngle 
double

lengthUnit 
LinearUnit

Returns  

Polygon 
Creates a geodesic sector.
Parameters  

center 
Point :
center of the sector. 
spatialReference 
SpatialReference :
spatial reference of the center. 
semiAxis1Length 
double :
length of one of the semiaxes. 
semiAxis2Length 
double :
length of the other semiaxes. 
majorAxisDirection 
double :
direction of the major axis. 0 is East, measured anticlockwise. Measured in degrees. 
startDirection 
double :
direction of start of the sector relative to majorAxisDirection , measured
anticlockwise. Measured in degrees. 
sectorAngle 
double :
sector angle relative to the startDirection , measured clockwise. Measured in
degrees. 
maxArcSegmentLength 
double :
maximum length of a segment along the arc. 
maxRadiusSegmentLength 
double :
maximum length of a segment along the radius. 
lengthUnit 
LinearUnit :
unit to be used to measure the input lengths. If null, unit assumed is meters. 
outputType 
Geometry.Type :
output type that will represent the sector.When output type is polyline or a multipoint, the result vertices line on the boundary of the sector. When output type is a polygon, the interior of the polygon is the interior of the sector. When output type is a polyline or a polygon, the result may have more than one path, depending on the size of the sector and its position relative to the horizon of the coordinate system. 
Returns  

Geometry 
a geodesic sector. 
Throws  

IllegalArgumentException 
if the center point or spatial reference is null. 
IllegalArgumentException 
if input length of any axis is 0 or negative. 
IllegalArgumentException 
if input arc or radius length is 0 or negative. 
IllegalArgumentException 
if outputType parameter is null. 
Imports geometry from the binary ESRI shape file format. Note: this is not from a shapefile on disk.
Parameters  

esriShapeBuffer 
byte :
The buffer containing geometry in the ESRI shape file format. 
geometryType 
Geometry.Type :
The required type of the Geometry to be imported. Use Geometry.Type.Unknown if the geometry
type needs to be determined from the buffer content. 
Returns  

Geometry 
The geometry or null if the buffer contains null shape. 
Throws  

GeometryException 
when the geometryType is not Geometry.Type.Unknown and the buffer contains geometry that cannot be converted to the given geometryType. or the buffer is corrupt. Another exception possible is IllegalArgumentsException. 
Exports geometry to the ESRI shape file format; the exported binary can then be stored in SDE.
Parameters  

geometry 
Geometry :
The geometry to export. (null value is not allowed) 
Returns  

byte[] 
Array containing the exported ESRI shape file. Note: this is not a shapefile on disk. 
Exports the specified geometry instance to its JSON representation.
Parameters  

spatialReference 
SpatialReference :
The spatial reference of associated object. 
geometry 
Geometry :
The geometry. 
Returns  

String 
String The JSON representation of the specified geometry. 
Calculates an interior point for a specified polygon. This interior point can be used by clients to place a label for the polygon.
Parameters  

polygon 
Polygon :
The polygon to get label point for. 
sp 
SpatialReference :
SpatialReference 
Returns  

Point 
the label point, null returned if Polygon or SpatialReference is invalid 
Finds the coordinate of the geometry which is closest to the specified point.
Parameters  

geometry 
Geometry :
The geometry to consider. 
inputPoint 
Point :
The point to find the nearest coordinate in the geometry for. 
bTestPolygonInterior 
boolean

Returns  

Proximity2DResult 
Proximity2DResult containing the nearest coordinate 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Finds the nearest vertex on the geometry from the specified input point.
Parameters  

geometry 
Geometry :
The geometry to consider. 
inputPoint 
Point :
The point from which to find the nearest vertex of the geometry. 
Returns  

Proximity2DResult 
Proximity2DResult containing the nearest vertex. 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest.
Parameters  

geometry 
Geometry :
The geometry to consider. 
inputPoint 
Point :
The point to start from. 
searchRadius 
double :
The search radius. 
maxVertexCountToReturn 
int :
The maximum number number of vertices to return. 
Returns  

Proximity2DResult[] 
Proximity2DResult containing the array of nearest vertices. 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Same as getTransformations(SpatialReference, SpatialReference, Envelope, int)
with maxEntries
=0,
and extent
=empty envelope.
Parameters  

fromSR 
SpatialReference

toSR 
SpatialReference

Returns  

List<CompositeGeographicTransformation> 
Throws  

IllegalArgumentException 
if any of the spatial reference parameters is null 
Gets transformations to project from fromSR
to toSR
.
Parameters  

fromSR 
SpatialReference :
spatial reference to project from. 
toSR 
SpatialReference :
spatial reference to project to. 
extent 
Envelope :
area of interest to decide the best applicable projection, input empty envelope if area is to be
ignored. 
maxEntries 
int :
maximum number of entries in the return list, set to 0 for all entries. 
Returns  

List<CompositeGeographicTransformation> 
list of all transformations, empty list if fromSR equals toSR . 
Throws  

IllegalArgumentException 
if any of the spatial reference parameters is null, or if the input extent is null, or if maxEntries is negative. 
Creates a geometry through intersection between two geometries.
Parameters  

inputGeometry 
Geometry :
Geometry. 
intersector 
Geometry :
Geometry 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

Geometry 
The geometry created through intersection. 
Throws  

IllegalArgumentException 
if inputGeometry or intersector parameter is null. 
Indicates if one geometry intersects another geometry.
Parameters  

geometry1 
Geometry :
The geometry that is tested for the intersects relationship to the other geometry. 
geometry2 
Geometry :
The geometry being intersected. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

boolean 
True if geometry1 intersects geometry2. 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Imports the MapGeometry from its JSON representation.
Parameters  

json 
JsonParser :
The JSON representation of the geometry (with spatial reference). 
Returns  

MapGeometry 
The MapGeometry instance containing the imported geometry and its spatial reference. 
Returns a copy of the input geometry that does not intersect the minimum or maximum meridian of the spatial reference. The returned geometry may be cut into multiple parts. You may wish to use this method to normalize geometries before passing them to methods that require coordinates within the spatial reference domain, for example geodatabase editing methods or geocoding services.
The returned geometry is the same type as the input geometry, except in the case of an Envelope in which case the returned geometry is a Polygon.
Parameters  

geometry 
Geometry :
The geometry that you want normalized. This must be an Envelope , Point ,
MultiPoint , Polygon or Polyline . 
spatialReference 
SpatialReference :
The geometry's spatial reference. 
Returns  

Geometry 
The normalized geometry. May be empty if the input geometry is empty or invalid. 
Throws  

IllegalArgumentException 
if geometry or spatialReference is null, or if the type of geometry is invalid
(for example a Line ). 
Projects the given geometry using the provided projection transformation.
Parameters  

geometry 
Geometry :
geometry to project. 
tx 
ProjectionTransformation :
transformation to be used to project. 
Returns  

Geometry 
projected geometry. 
Projects the given geometry using the provided spatial references and transformation.
Parameters  

geometry 
Geometry :
geometry to project. 
inputSR 
SpatialReference :
spatial reference to project from. 
outputSR 
SpatialReference :
spatial reference to project to. 
tx 
CompositeGeographicTransformation :
transformation to be used to project. 
Returns  

Geometry 
projected geometry. Default transformation will be applied if input transformation is null or empty. 
Projects the given point from a longitude/latitude (EPSG:4326 / WGS84 spatial reference) to the specified output spatial reference.
Parameters  

x 
double :
the x coordinate (longitude) 
y 
double :
the y coordinate (latitude) 
sr 
SpatialReference :
The spatial reference to project the point to 
Returns  

Point 
Returns the projected point 
Parameters  

geometry 
Geometry

inputSR 
SpatialReference

outputSR 
SpatialReference

tx 
GeographicTransformation

Returns  

Geometry 
Projects the given geometry instance from the input spatial reference to the output spatial reference. To perform the projection, this method creates an instance of the ProjectionTransformation using the domain of the input spatial reference as the area of interest.
Parameters  

geometry 
Geometry :
The input geometry to be projected. 
inputSR 
SpatialReference :
The spatial reference of the input geometry. 
outputSR 
SpatialReference :
The spatial reference to project the geometry to. 
Returns  

Geometry 
Returns the projected geometry. 
Performs the simplify operation on the geometry.
Parameters  

geometry 
Geometry :
The geometry to be simplified. 
spatialReference 
SpatialReference :
The spatial reference of the geometry to be simplified. 
Returns  

Geometry 
The simplified geometry. 
Indicates if one geometry touches another geometry.
Parameters  

geometry1 
Geometry :
The geometry which may be touching another geometry. 
geometry2 
Geometry :
The geometry to be touched. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

boolean 
True if geometry1 touches geometry2. 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 
Constructs a new geometry by union an array of geometries. All inputs must be of the same type of geometries and share one spatial reference.
Parameters  

geometries 
Geometry :
The geometries to union. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

Geometry 
The geometry object representing the resultant union. 
Throws  

IllegalArgumentException 
if geometries parameter is null. 
Indicates if one geometry is within another geometry.
Parameters  

geometry1 
Geometry :
The base geometry that is tested for within relationship to the other geometry. 
geometry2 
Geometry :
The comparison geometry that is tested for the contains relationship to the other geometry. 
spatialReference 
SpatialReference :
The spatial reference of the geometries. 
Returns  

boolean 
True if the first geometry (geometry1) is within the other geometry (geometry2). 
Throws  

IllegalArgumentException 
if any of the input geometries is null. 