Package com.esri.core.geometry.ogc
Class OGCConcreteGeometryCollection
- java.lang.Object
-
- com.esri.core.geometry.ogc.OGCGeometry
-
- com.esri.core.geometry.ogc.OGCGeometryCollection
-
- com.esri.core.geometry.ogc.OGCConcreteGeometryCollection
-
public class OGCConcreteGeometryCollection extends OGCGeometryCollection
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
OGCConcreteGeometryCollection.FlatteningCollectionCursor
private static class
OGCConcreteGeometryCollection.GeometryCursorOGC
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<OGCGeometry>
geometries
static java.lang.String
TYPE
-
Fields inherited from class com.esri.core.geometry.ogc.OGCGeometry
esriSR
-
-
Constructor Summary
Constructors Constructor Description OGCConcreteGeometryCollection(GeometryCursor geoms, SpatialReference sr)
OGCConcreteGeometryCollection(OGCGeometry geom, SpatialReference sr)
OGCConcreteGeometryCollection(SpatialReference sr)
OGCConcreteGeometryCollection(java.util.List<OGCGeometry> geoms, SpatialReference sr)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.nio.ByteBuffer
asBinary()
java.lang.String
asGeoJson()
(package private) java.lang.String
asGeoJsonImpl(int export_flags)
java.lang.String
asJson()
java.lang.String
asText()
OGCGeometry
boundary()
boolean
contains(OGCGeometry another)
OGCGeometry
convertToMulti()
Converts this Geometry to the OGCMulti* if it is not OGCMulti* or OGCGeometryCollection already.OGCGeometry
convexHull()
int
coordinateDimension()
boolean
crosses(OGCGeometry another)
OGCGeometry
difference(OGCGeometry another)
int
dimension()
boolean
disjoint(OGCGeometry another)
double
distance(OGCGeometry another)
OGCGeometry
envelope()
boolean
equals(java.lang.Object other)
boolean
Equals(OGCGeometry another)
OGC equals.long
estimateMemorySize()
Returns an estimate of this object size in bytes.OGCConcreteGeometryCollection
flatten()
Flattens Geometry Collection.OGCConcreteGeometryCollection
flattenAndRemoveOverlaps()
Fixes topological overlaps in the GeometryCollecion.OGCGeometry
geometryN(int n)
Returns the Nth geometry in this GeometryCollection.java.lang.String
geometryType()
Geometry
getEsriGeometry()
GeometryCursor
getEsriGeometryCursor()
int
hashCode()
OGCGeometry
intersection(OGCGeometry another)
boolean
is3D()
protected boolean
isConcreteGeometryCollection()
boolean
isEmpty()
boolean
isFlattened()
Checks if collection is flattened.boolean
isMeasured()
boolean
isSimple()
Returns true if this geometric object has no anomalous geometric points, such as self intersection or self tangency.boolean
isSimpleRelaxed()
Extension method - checks if geometry is simple for Geodatabase.OGCGeometry
locateAlong(double mValue)
OGCGeometry
locateBetween(double mStart, double mEnd)
OGCGeometry
makeSimple()
makeSimpleRelaxed is not supported for the GeometryCollection instance.OGCGeometry
makeSimpleRelaxed(boolean forceProcessing)
makeSimpleRelaxed is not supported for the GeometryCollection instance.double
MaxMeasure()
double
MaxZ()
double
MinMeasure()
double
MinZ()
int
numGeometries()
Returns the number of geometries in this GeometryCollection.boolean
overlaps(OGCGeometry another)
private GeometryCursor
prepare_for_ops_(OGCConcreteGeometryCollection collection)
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.boolean
relate(OGCGeometry another, java.lang.String matrix)
private GeometryCursor
removeOverlapsHelper_(java.util.List<Geometry> geoms)
void
setSpatialReference(SpatialReference esriSR_)
OGCGeometry
symDifference(OGCGeometry another)
private static OGCConcreteGeometryCollection
toGeometryCollection(OGCGeometry geometry)
private static java.util.List<Geometry>
toList(GeometryCursor cursor)
boolean
touches(OGCGeometry another)
-
Methods inherited from class com.esri.core.geometry.ogc.OGCGeometry
buffer, centroid, createFromEsriCursor, createFromEsriCursor, createFromEsriGeometry, createFromEsriGeometry, createFromOGCStructure, equals, fromBinary, fromEsriShape, fromGeoJson, fromJson, fromText, getEsriSpatialReference, intersects, MakeSimpleRelaxed, SRID, toString, union, within
-
-
-
-
Field Detail
-
TYPE
public static java.lang.String TYPE
-
geometries
java.util.List<OGCGeometry> geometries
-
-
Constructor Detail
-
OGCConcreteGeometryCollection
public OGCConcreteGeometryCollection(java.util.List<OGCGeometry> geoms, SpatialReference sr)
-
OGCConcreteGeometryCollection
public OGCConcreteGeometryCollection(GeometryCursor geoms, SpatialReference sr)
-
OGCConcreteGeometryCollection
public OGCConcreteGeometryCollection(OGCGeometry geom, SpatialReference sr)
-
OGCConcreteGeometryCollection
public OGCConcreteGeometryCollection(SpatialReference sr)
-
-
Method Detail
-
dimension
public int dimension()
- Overrides:
dimension
in classOGCGeometry
-
coordinateDimension
public int coordinateDimension()
- Overrides:
coordinateDimension
in classOGCGeometry
-
is3D
public boolean is3D()
- Overrides:
is3D
in classOGCGeometry
-
isMeasured
public boolean isMeasured()
- Overrides:
isMeasured
in classOGCGeometry
-
envelope
public OGCGeometry envelope()
- Overrides:
envelope
in classOGCGeometry
-
numGeometries
public int numGeometries()
Description copied from class:OGCGeometryCollection
Returns the number of geometries in this GeometryCollection.- Specified by:
numGeometries
in classOGCGeometryCollection
-
geometryN
public OGCGeometry geometryN(int n)
Description copied from class:OGCGeometryCollection
Returns the Nth geometry in this GeometryCollection.- Specified by:
geometryN
in classOGCGeometryCollection
- Parameters:
n
- The 0 based index of the geometry.
-
geometryType
public java.lang.String geometryType()
- Specified by:
geometryType
in classOGCGeometry
-
estimateMemorySize
public long estimateMemorySize()
Description copied from class:OGCGeometry
Returns an estimate of this object size in bytes.This estimate doesn't include the size of the
SpatialReference
object because instances ofSpatialReference
are expected to be shared among geometry objects.- Specified by:
estimateMemorySize
in classOGCGeometry
- Returns:
- Returns an estimate of this object size in bytes.
-
asText
public java.lang.String asText()
- Overrides:
asText
in classOGCGeometry
-
asBinary
public java.nio.ByteBuffer asBinary()
- Overrides:
asBinary
in classOGCGeometry
-
asGeoJson
public java.lang.String asGeoJson()
- Overrides:
asGeoJson
in classOGCGeometry
-
asGeoJsonImpl
java.lang.String asGeoJsonImpl(int export_flags)
- Overrides:
asGeoJsonImpl
in classOGCGeometry
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmpty
in classOGCGeometry
-
MinZ
public double MinZ()
- Overrides:
MinZ
in classOGCGeometry
-
MaxZ
public double MaxZ()
- Overrides:
MaxZ
in classOGCGeometry
-
MinMeasure
public double MinMeasure()
- Overrides:
MinMeasure
in classOGCGeometry
-
MaxMeasure
public double MaxMeasure()
- Overrides:
MaxMeasure
in classOGCGeometry
-
isSimple
public boolean isSimple()
Description copied from class:OGCGeometry
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.- Overrides:
isSimple
in classOGCGeometry
- Returns:
- True if geometry is simple and false otherwise. Note: If isSimple is true, then isSimpleRelaxed is true too.
-
makeSimple
public OGCGeometry makeSimple()
makeSimpleRelaxed is not supported for the GeometryCollection instance.- Overrides:
makeSimple
in classOGCGeometry
- Returns:
- Returns simplified geometry. Note: isSimple and isSimpleRelaxed should return true after this operation.
-
isSimpleRelaxed
public boolean isSimpleRelaxed()
Description copied from class:OGCGeometry
Extension method - checks if geometry is simple for Geodatabase.- Overrides:
isSimpleRelaxed
in classOGCGeometry
- 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
public OGCGeometry makeSimpleRelaxed(boolean forceProcessing)
makeSimpleRelaxed is not supported for the GeometryCollection instance.- Overrides:
makeSimpleRelaxed
in classOGCGeometry
- Returns:
- Returns simplified geometry. Note: isSimpleRelaxed should return true after this operation.
-
boundary
public OGCGeometry boundary()
- Specified by:
boundary
in classOGCGeometry
-
locateAlong
public OGCGeometry locateAlong(double mValue)
- Specified by:
locateAlong
in classOGCGeometry
-
locateBetween
public OGCGeometry locateBetween(double mStart, double mEnd)
- Specified by:
locateBetween
in classOGCGeometry
-
getEsriGeometry
public Geometry getEsriGeometry()
- Specified by:
getEsriGeometry
in classOGCGeometry
-
getEsriGeometryCursor
public GeometryCursor getEsriGeometryCursor()
- Overrides:
getEsriGeometryCursor
in classOGCGeometry
-
isConcreteGeometryCollection
protected boolean isConcreteGeometryCollection()
- Overrides:
isConcreteGeometryCollection
in classOGCGeometry
-
convexHull
public OGCGeometry convexHull()
- Overrides:
convexHull
in classOGCGeometry
-
setSpatialReference
public void setSpatialReference(SpatialReference esriSR_)
- Overrides:
setSpatialReference
in classOGCGeometry
-
convertToMulti
public OGCGeometry convertToMulti()
Description copied from class:OGCGeometry
Converts this Geometry to the OGCMulti* if it is not OGCMulti* or OGCGeometryCollection already.- Specified by:
convertToMulti
in classOGCGeometry
- Returns:
- OGCMulti* or OGCGeometryCollection instance.
-
reduceFromMulti
public OGCGeometry reduceFromMulti()
Description copied from class:OGCGeometry
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.- Specified by:
reduceFromMulti
in classOGCGeometry
- Returns:
- A reduced geometry or this.
-
asJson
public java.lang.String asJson()
- Overrides:
asJson
in classOGCGeometry
- Returns:
- Convert to REST JSON.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classOGCGeometry
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classOGCGeometry
-
distance
public double distance(OGCGeometry another)
- Overrides:
distance
in classOGCGeometry
-
overlaps
public boolean overlaps(OGCGeometry another)
- Overrides:
overlaps
in classOGCGeometry
-
touches
public boolean touches(OGCGeometry another)
- Overrides:
touches
in classOGCGeometry
-
crosses
public boolean crosses(OGCGeometry another)
- Overrides:
crosses
in classOGCGeometry
-
relate
public boolean relate(OGCGeometry another, java.lang.String matrix)
- Overrides:
relate
in classOGCGeometry
-
disjoint
public boolean disjoint(OGCGeometry another)
- Overrides:
disjoint
in classOGCGeometry
-
contains
public boolean contains(OGCGeometry another)
- Overrides:
contains
in classOGCGeometry
-
Equals
public boolean Equals(OGCGeometry another)
Description copied from class:OGCGeometry
OGC equals. Performs topological comparison with tolerance. This is different from equals(Object), that uses exact comparison.- Overrides:
Equals
in classOGCGeometry
-
toGeometryCollection
private static OGCConcreteGeometryCollection toGeometryCollection(OGCGeometry geometry)
-
toList
private static java.util.List<Geometry> toList(GeometryCursor cursor)
-
difference
public OGCGeometry difference(OGCGeometry another)
- Overrides:
difference
in classOGCGeometry
-
intersection
public OGCGeometry intersection(OGCGeometry another)
- Overrides:
intersection
in classOGCGeometry
-
symDifference
public OGCGeometry symDifference(OGCGeometry another)
- Overrides:
symDifference
in classOGCGeometry
-
isFlattened
public boolean isFlattened()
Checks if collection is flattened.- Returns:
- True for the flattened collection. A flattened collection contains up to three non-empty geometries: an OGCMultiPoint, an OGCMultiPolygon, and an OGCMultiLineString.
-
flatten
public OGCConcreteGeometryCollection flatten()
Flattens Geometry Collection. The result collection contains up to three geometries: an OGCMultiPoint, an OGCMultilineString, and an OGCMultiPolygon (in that order).- Returns:
- A flattened Geometry Collection, or self if already flattened.
-
flattenAndRemoveOverlaps
public OGCConcreteGeometryCollection flattenAndRemoveOverlaps()
Fixes topological overlaps in the GeometryCollecion. This is equivalent to union of the geometry collection elements. TODO "flattened" collection is supposed to contain only mutli-geometries, but this method may return single geometries e.g. for GEOMETRYCOLLECTION (LINESTRING (...)) it returns GEOMETRYCOLLECTION (LINESTRING (...)) and not GEOMETRYCOLLECTION (MULTILINESTRING (...))- Returns:
- A geometry collection that is flattened and has no overlapping elements.
-
removeOverlapsHelper_
private GeometryCursor removeOverlapsHelper_(java.util.List<Geometry> geoms)
-
prepare_for_ops_
private GeometryCursor prepare_for_ops_(OGCConcreteGeometryCollection collection)
-
-