Package com.esri.core.geometry.ogc
Class OGCGeometry
- java.lang.Object
-
- com.esri.core.geometry.ogc.OGCGeometry
-
- Direct Known Subclasses:
OGCCurve,OGCGeometryCollection,OGCPoint,OGCSurface
public abstract class OGCGeometry extends java.lang.ObjectOGC Simple Feature Access specification v.1.2.1
-
-
Field Summary
Fields Modifier and Type Field Description SpatialReferenceesriSRSpatialReference of the Geometry.
-
Constructor Summary
Constructors Constructor Description OGCGeometry()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.nio.ByteBufferasBinary()java.lang.StringasGeoJson()(package private) java.lang.StringasGeoJsonImpl(int export_flags)java.lang.StringasJson()java.lang.StringasText()abstract OGCGeometryboundary()OGCGeometrybuffer(double distance)OGCGeometrycentroid()booleancontains(OGCGeometry another)abstract OGCGeometryconvertToMulti()Converts this Geometry to the OGCMulti* if it is not OGCMulti* or OGCGeometryCollection already.OGCGeometryconvexHull()intcoordinateDimension()static OGCGeometrycreateFromEsriCursor(GeometryCursor gc, SpatialReference sr)Create an OGCGeometry instance from the GeometryCursor.static OGCGeometrycreateFromEsriCursor(GeometryCursor gc, SpatialReference sr, boolean skipEmpty)static OGCGeometrycreateFromEsriGeometry(Geometry geom, SpatialReference sr)static OGCGeometrycreateFromEsriGeometry(Geometry geom, SpatialReference sr, boolean multiType)static OGCGeometrycreateFromOGCStructure(OGCStructure ogcStructure, SpatialReference sr)booleancrosses(OGCGeometry another)OGCGeometrydifference(OGCGeometry another)intdimension()booleandisjoint(OGCGeometry another)doubledistance(OGCGeometry another)OGCGeometryenvelope()booleanequals(OGCGeometry another)Deprecated.booleanequals(java.lang.Object other)booleanEquals(OGCGeometry another)OGC equals.abstract longestimateMemorySize()Returns an estimate of this object size in bytes.static OGCGeometryfromBinary(java.nio.ByteBuffer binary)static OGCGeometryfromEsriShape(java.nio.ByteBuffer buffer)static OGCGeometryfromGeoJson(java.lang.String string)static OGCGeometryfromJson(java.lang.String string)static OGCGeometryfromText(java.lang.String text)abstract java.lang.StringgeometryType()abstract GeometrygetEsriGeometry()GeometryCursorgetEsriGeometryCursor()SpatialReferencegetEsriSpatialReference()inthashCode()OGCGeometryintersection(OGCGeometry another)booleanintersects(OGCGeometry another)booleanis3D()protected booleanisConcreteGeometryCollection()booleanisEmpty()booleanisMeasured()booleanisSimple()Returns true if this geometric object has no anomalous geometric points, such as self intersection or self tangency.booleanisSimpleRelaxed()Extension method - checks if geometry is simple for Geodatabase.abstract OGCGeometrylocateAlong(double mValue)abstract OGCGeometrylocateBetween(double mStart, double mEnd)OGCGeometrymakeSimple()Resolves topological issues in this geometry and makes it Simple according to OGC specification.OGCGeometrymakeSimpleRelaxed(boolean forceProcessing)Makes a simple geometry for Geodatabase.OGCGeometryMakeSimpleRelaxed(boolean forceProcessing)Deprecated.doubleMaxMeasure()doubleMaxZ()doubleMinMeasure()doubleMinZ()booleanoverlaps(OGCGeometry another)abstract OGCGeometryreduceFromMulti()For the geometry collection types, when it has 1 or 0 elements, converts a MultiPolygon to Polygon, MultiPoint to Point, MultiLineString to a LineString, and OGCConcretGeometryCollection to the reduced element it contains.booleanrelate(OGCGeometry another, java.lang.String matrix)voidsetSpatialReference(SpatialReference esriSR_)private OGCGeometrysimplifyBunch_(GeometryCursor gc)intSRID()OGCGeometrysymDifference(OGCGeometry another)java.lang.StringtoString()booleantouches(OGCGeometry another)OGCGeometryunion(OGCGeometry another)booleanwithin(OGCGeometry another)
-
-
-
Field Detail
-
esriSR
public SpatialReference esriSR
SpatialReference of the Geometry.
-
-
Method Detail
-
dimension
public int dimension()
-
coordinateDimension
public int coordinateDimension()
-
geometryType
public abstract java.lang.String geometryType()
-
estimateMemorySize
public abstract long estimateMemorySize()
Returns an estimate of this object size in bytes.This estimate doesn't include the size of the
SpatialReferenceobject because instances ofSpatialReferenceare expected to be shared among geometry objects.- Returns:
- Returns an estimate of this object size in bytes.
-
SRID
public int SRID()
-
envelope
public OGCGeometry envelope()
-
asText
public java.lang.String asText()
-
asBinary
public java.nio.ByteBuffer asBinary()
-
asGeoJson
public java.lang.String asGeoJson()
-
asGeoJsonImpl
java.lang.String asGeoJsonImpl(int export_flags)
-
asJson
public java.lang.String asJson()
- Returns:
- Convert to REST JSON.
-
isEmpty
public boolean isEmpty()
-
MinZ
public double MinZ()
-
MaxZ
public double MaxZ()
-
MinMeasure
public double MinMeasure()
-
MaxMeasure
public double MaxMeasure()
-
isSimple
public boolean isSimple()
Returns true if this geometric object has no anomalous geometric points, such as self intersection or self tangency. See the "Simple feature access - Part 1" document (OGC 06-103r4) for meaning of "simple" for each geometry type. The method has O(n log n) complexity when the input geometry is simple. For non-simple geometries, it terminates immediately when the first issue is encountered.- Returns:
- True if geometry is simple and false otherwise. Note: If isSimple is true, then isSimpleRelaxed is true too.
-
isSimpleRelaxed
public boolean isSimpleRelaxed()
Extension method - checks if geometry is simple for Geodatabase.- Returns:
- Returns true if geometry is simple, false otherwise. Note: If isSimpleRelaxed is true, then isSimple is either true or false. Geodatabase has more relaxed requirements for simple geometries than OGC.
-
MakeSimpleRelaxed
@Deprecated public OGCGeometry MakeSimpleRelaxed(boolean forceProcessing)
Deprecated.
-
makeSimpleRelaxed
public OGCGeometry makeSimpleRelaxed(boolean forceProcessing)
Makes a simple geometry for Geodatabase.- Returns:
- Returns simplified geometry. Note: isSimpleRelaxed should return true after this operation.
-
makeSimple
public OGCGeometry makeSimple()
Resolves topological issues in this geometry and makes it Simple according to OGC specification.- Returns:
- Returns simplified geometry. Note: isSimple and isSimpleRelaxed should return true after this operation.
-
is3D
public boolean is3D()
-
isMeasured
public boolean isMeasured()
-
boundary
public abstract OGCGeometry boundary()
-
Equals
public boolean Equals(OGCGeometry another)
OGC equals. Performs topological comparison with tolerance. This is different from equals(Object), that uses exact comparison.
-
equals
@Deprecated public boolean equals(OGCGeometry another)
Deprecated.
-
disjoint
public boolean disjoint(OGCGeometry another)
-
intersects
public boolean intersects(OGCGeometry another)
-
touches
public boolean touches(OGCGeometry another)
-
crosses
public boolean crosses(OGCGeometry another)
-
within
public boolean within(OGCGeometry another)
-
contains
public boolean contains(OGCGeometry another)
-
overlaps
public boolean overlaps(OGCGeometry another)
-
relate
public boolean relate(OGCGeometry another, java.lang.String matrix)
-
locateAlong
public abstract OGCGeometry locateAlong(double mValue)
-
locateBetween
public abstract OGCGeometry locateBetween(double mStart, double mEnd)
-
distance
public double distance(OGCGeometry another)
-
simplifyBunch_
private OGCGeometry simplifyBunch_(GeometryCursor gc)
-
buffer
public OGCGeometry buffer(double distance)
-
centroid
public OGCGeometry centroid()
-
convexHull
public OGCGeometry convexHull()
-
intersection
public OGCGeometry intersection(OGCGeometry another)
-
union
public OGCGeometry union(OGCGeometry another)
-
difference
public OGCGeometry difference(OGCGeometry another)
-
symDifference
public OGCGeometry symDifference(OGCGeometry another)
-
getEsriGeometry
public abstract Geometry getEsriGeometry()
-
getEsriGeometryCursor
public GeometryCursor getEsriGeometryCursor()
-
getEsriSpatialReference
public SpatialReference getEsriSpatialReference()
-
createFromEsriCursor
public static OGCGeometry createFromEsriCursor(GeometryCursor gc, SpatialReference sr)
Create an OGCGeometry instance from the GeometryCursor.- Parameters:
gc-sr-- Returns:
- Geometry instance created from the geometry cursor.
-
createFromEsriCursor
public static OGCGeometry createFromEsriCursor(GeometryCursor gc, SpatialReference sr, boolean skipEmpty)
-
fromText
public static OGCGeometry fromText(java.lang.String text)
-
fromBinary
public static OGCGeometry fromBinary(java.nio.ByteBuffer binary)
-
fromEsriShape
public static OGCGeometry fromEsriShape(java.nio.ByteBuffer buffer)
-
fromJson
public static OGCGeometry fromJson(java.lang.String string)
-
fromGeoJson
public static OGCGeometry fromGeoJson(java.lang.String string)
-
createFromEsriGeometry
public static OGCGeometry createFromEsriGeometry(Geometry geom, SpatialReference sr)
-
createFromEsriGeometry
public static OGCGeometry createFromEsriGeometry(Geometry geom, SpatialReference sr, boolean multiType)
-
createFromOGCStructure
public static OGCGeometry createFromOGCStructure(OGCStructure ogcStructure, SpatialReference sr)
-
isConcreteGeometryCollection
protected boolean isConcreteGeometryCollection()
-
setSpatialReference
public void setSpatialReference(SpatialReference esriSR_)
-
convertToMulti
public abstract OGCGeometry convertToMulti()
Converts this Geometry to the OGCMulti* if it is not OGCMulti* or OGCGeometryCollection already.- Returns:
- OGCMulti* or OGCGeometryCollection instance.
-
reduceFromMulti
public abstract OGCGeometry reduceFromMulti()
For the geometry collection types, when it has 1 or 0 elements, converts a MultiPolygon to Polygon, MultiPoint to Point, MultiLineString to a LineString, and OGCConcretGeometryCollection to the reduced element it contains. If OGCConcretGeometryCollection is empty, returns self.- Returns:
- A reduced geometry or this.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-