java.lang.Object | |
↳ | com.esri.core.geometry.GeometryEngine |
Provides services that operate on geometry instances.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
GeometryEngine() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
static Polygon |
buffer(Geometry geometry, SpatialReference spatialReference, double distance, Unit unit)
Calculates buffer polygon of the geometry as specified by the distance input.
| ||||||||||
static Polygon[] |
buffer(Geometry[] geometries, SpatialReference spatialReference, double[] distances, Unit unit, boolean toUnionResults)
Calculates a buffer polygon for each geometry at each of the corresponding specified distances.
| ||||||||||
static Geometry |
clip(Geometry geometry, Envelope envelope, SpatialReference spatialReference)
Calculates the clipped geometry from an target geometry by an envelope.
| ||||||||||
static boolean |
contains(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference)
Indicates if one geometry contains another geometry.
| ||||||||||
static boolean |
crosses(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference)
Indicates if one geometry crosses another geometry.
| ||||||||||
static Geometry |
difference(Geometry inputGeometry, Geometry substractor, SpatialReference spatialReference)
Creates the difference of two geometries.
| ||||||||||
static double |
distance(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference)
Calculates the 2D planar distance between two geometries.
| ||||||||||
static boolean |
equals(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference)
Indicates if two geometries are equal.
| ||||||||||
static double |
geodesicLength(Geometry geometry, SpatialReference spatialReference, LinearUnit lengthUnit)
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.
| ||||||||||
static Geometry |
geometryFromEsriShape(byte[] esriShapeBuffer, Geometry.Type geometryType)
Imports geometry from the ESRI shape file format.
| ||||||||||
static byte[] |
geometryToEsriShape(Geometry geometry)
Exports geometry to the ESRI shape file format.
| ||||||||||
static String |
geometryToJson(int wkid, Geometry geometry)
Exports the specified geometry instance to its Json representation.
| ||||||||||
static String |
geometryToJson(SpatialReference spatialReference, Geometry geometry)
Exports the specified geometry instance to its JSON representation.
| ||||||||||
static Proximity2DResult |
getNearestCoordinate(Geometry geometry, Point inputPoint, boolean bTestPolygonInterior)
Finds the coordinate of the geometry which is closest to the specified point.
| ||||||||||
static Proximity2DResult |
getNearestVertex(Geometry geometry, Point inputPoint)
Finds nearest vertex on the geometry which is closed to the specified point.
| ||||||||||
static Proximity2DResult[] |
getNearestVertices(Geometry geometry, Point inputPoint, double searchRadius, int maxVertexCountToReturn)
Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest.
| ||||||||||
static Geometry |
intersect(Geometry inputGeometry, Geometry intersector, SpatialReference spatialReference)
Creates a geometry through intersection between two geometries.
| ||||||||||
static MapGeometry |
jsonToGeometry(JsonParser json)
Imports the MapGeometry from it's JSON representation.
| ||||||||||
static Point |
project(double x, double y, SpatialReference sr)
Projects the given point from EPSG:4326 to the output Spatial Reference.
| ||||||||||
static Geometry |
project(Geometry geometry, SpatialReference inputSR, SpatialReference outputSR)
Projects the given geometry instance from the input spatial reference to the output Spatial Reference.
| ||||||||||
static Geometry |
simplify(Geometry geometry, SpatialReference spatialReference)
Performs the simplify operation on the geometry.
| ||||||||||
static boolean |
touches(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference)
Indicates if one geometry touches another geometry.
| ||||||||||
static Geometry |
union(Geometry[] geometries, SpatialReference spatialReference)
Constructs a new geometry by union an array of geometries.
| ||||||||||
static boolean |
within(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference)
Indicates if one geometry is within another geometry.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
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.
geometry | Geometry to be buffered. |
---|---|
spatialReference | The spatial reference of the geometry. |
distance | The specified distance for buffer. |
unit | The unit of the values in the distances array. Must be of the same unit type as spatial reference. |
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.
geometries | An array of geometries to be buffered. |
---|---|
spatialReference | The spatial reference of the geometries. |
distances | The corresponding distances for the input geometries to be buffered. |
unit | The unit of the values in the distances array. Must be of the same unit type as spatial reference. |
toUnionResults | True if all geometries buffered at a given distance are to be unioned into a single polygon. |
Calculates the clipped geometry from an target geometry by an envelope.
geometry | The geometry to be clipped. |
---|---|
envelope | The envelope used to clip. |
spatialReference | The spatial reference of the geometries. |
Indicates if one geometry contains another geometry.
geometry1 | The geometry that is tested for the contains relationship to the other geometry.. |
---|---|
geometry2 | The geometry that is tested for within relationship to the other geometry. |
spatialReference | The spatial reference of the geometries. |
Indicates if one geometry crosses another geometry.
geometry1 | The geometry to cross. |
---|---|
geometry2 | The geometry being crossed. |
spatialReference | The spatial reference of the geometries. |
Creates the difference of two geometries. The resultant geometry is the part of inputGeometry not in the substractor. The dimension of substractor has to be equal to or greater than that of inputGeometry.
inputGeometry | The geometry being subtracted. |
---|---|
substractor | The geometry object to subtract from. |
spatialReference | The spatial reference of the geometries. |
Calculates the 2D planar distance between two geometries.
geometry1 | Geometry. |
---|---|
geometry2 | Geometry. |
spatialReference | The spatial reference of the geometries. |
Indicates if two geometries are equal.
geometry1 | Geometry. |
---|---|
geometry2 | Geometry. |
spatialReference | The spatial reference of the geometries. |
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.
geometry | The input geometry. |
---|---|
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 | The units to return the length in. If null is specified, the length is returned in meters. |
Imports geometry from the ESRI shape file format.
esriShapeBuffer | The buffer containing geometry in the ESRI shape file format. |
---|---|
geometryType | 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. |
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.
geometry | The geometry to export. (null value is not allowed) |
---|
Exports the specified geometry instance to its Json representation.
wkid | The spatial reference Well Known ID to be used for the Json representation. |
---|---|
geometry | The geometry to be exported to JSON. |
Exports the specified geometry instance to its JSON representation. M and Z values are not imported from JSON representation.
spatialReference | The spatial reference of associated object. |
---|---|
geometry | The geometry. |
Finds the coordinate of the geometry which is closest to the specified point.
geometry | The geometry to consider. |
---|---|
inputPoint | The point to find the nearest coordinate in the geometry for. |
Finds nearest vertex on the geometry which is closed to the specified point.
geometry | The geometry to consider. |
---|---|
inputPoint | The point to find the nearest vertex of the geometry for. |
Finds all vertices in the given distance from the specified point, sorted from the closest to the furthest.
geometry | The geometry to consider. |
---|---|
inputPoint | The point to start from. |
searchRadius | The search radius. |
maxVertexCountToReturn | The maximum number number of vertices to return. |
Creates a geometry through intersection between two geometries.
inputGeometry | Geometry. |
---|---|
intersector | Geometry |
spatialReference | The spatial reference of the geometries. |
Imports the MapGeometry from it's JSON representation. M and Z values are not imported from JSON representation.
json | The JSON representation of the geometry (with spatial reference). |
---|
Projects the given point from EPSG:4326 to the output Spatial Reference.
x | the x |
---|---|
y | the y |
sr | The spatial reference to project the geometry to. |
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.
geometry | The input geometry to be projected. |
---|---|
inputSR | The spatial reference of the input geometry. |
outputSR | The spatial reference to project the geometry to. |
Performs the simplify operation on the geometry.
geometry | The geometry to be simplified. |
---|---|
spatialReference | The spatial reference of the geometry to be simplified. |
Indicates if one geometry touches another geometry.
geometry1 | The geometry to touch. |
---|---|
geometry2 | The geometry to be touched. |
spatialReference | The spatial reference of the geometries. |
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.
geometries | The geometries to union. |
---|---|
spatialReference | The spatial reference of the geometries. |
Indicates if one geometry is within another geometry.
geometry1 | The base geometry that is tested for within relationship to the other geometry. |
---|---|
geometry2 | The comparison geometry that is tested for the contains relationship to the other geometry. |
spatialReference | The spatial reference of the geometries. |