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 classOGCConcreteGeometryCollection.FlatteningCollectionCursorprivate static classOGCConcreteGeometryCollection.GeometryCursorOGC
-
Field Summary
Fields Modifier and Type Field Description (package private) java.util.List<OGCGeometry>geometriesstatic java.lang.StringTYPE-
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.ByteBufferasBinary()java.lang.StringasGeoJson()(package private) java.lang.StringasGeoJsonImpl(int export_flags)java.lang.StringasJson()java.lang.StringasText()OGCGeometryboundary()booleancontains(OGCGeometry another)OGCGeometryconvertToMulti()Converts this Geometry to the OGCMulti* if it is not OGCMulti* or OGCGeometryCollection already.OGCGeometryconvexHull()intcoordinateDimension()booleancrosses(OGCGeometry another)OGCGeometrydifference(OGCGeometry another)intdimension()booleandisjoint(OGCGeometry another)doubledistance(OGCGeometry another)OGCGeometryenvelope()booleanequals(java.lang.Object other)booleanEquals(OGCGeometry another)OGC equals.longestimateMemorySize()Returns an estimate of this object size in bytes.OGCConcreteGeometryCollectionflatten()Flattens Geometry Collection.OGCConcreteGeometryCollectionflattenAndRemoveOverlaps()Fixes topological overlaps in the GeometryCollecion.OGCGeometrygeometryN(int n)Returns the Nth geometry in this GeometryCollection.java.lang.StringgeometryType()GeometrygetEsriGeometry()GeometryCursorgetEsriGeometryCursor()inthashCode()OGCGeometryintersection(OGCGeometry another)booleanis3D()protected booleanisConcreteGeometryCollection()booleanisEmpty()booleanisFlattened()Checks if collection is flattened.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.OGCGeometrylocateAlong(double mValue)OGCGeometrylocateBetween(double mStart, double mEnd)OGCGeometrymakeSimple()makeSimpleRelaxed is not supported for the GeometryCollection instance.OGCGeometrymakeSimpleRelaxed(boolean forceProcessing)makeSimpleRelaxed is not supported for the GeometryCollection instance.doubleMaxMeasure()doubleMaxZ()doubleMinMeasure()doubleMinZ()intnumGeometries()Returns the number of geometries in this GeometryCollection.booleanoverlaps(OGCGeometry another)private GeometryCursorprepare_for_ops_(OGCConcreteGeometryCollection collection)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)private GeometryCursorremoveOverlapsHelper_(java.util.List<Geometry> geoms)voidsetSpatialReference(SpatialReference esriSR_)OGCGeometrysymDifference(OGCGeometry another)private static OGCConcreteGeometryCollectiontoGeometryCollection(OGCGeometry geometry)private static java.util.List<Geometry>toList(GeometryCursor cursor)booleantouches(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:
dimensionin classOGCGeometry
-
coordinateDimension
public int coordinateDimension()
- Overrides:
coordinateDimensionin classOGCGeometry
-
is3D
public boolean is3D()
- Overrides:
is3Din classOGCGeometry
-
isMeasured
public boolean isMeasured()
- Overrides:
isMeasuredin classOGCGeometry
-
envelope
public OGCGeometry envelope()
- Overrides:
envelopein classOGCGeometry
-
numGeometries
public int numGeometries()
Description copied from class:OGCGeometryCollectionReturns the number of geometries in this GeometryCollection.- Specified by:
numGeometriesin classOGCGeometryCollection
-
geometryN
public OGCGeometry geometryN(int n)
Description copied from class:OGCGeometryCollectionReturns the Nth geometry in this GeometryCollection.- Specified by:
geometryNin classOGCGeometryCollection- Parameters:
n- The 0 based index of the geometry.
-
geometryType
public java.lang.String geometryType()
- Specified by:
geometryTypein classOGCGeometry
-
estimateMemorySize
public long estimateMemorySize()
Description copied from class:OGCGeometryReturns 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.- Specified by:
estimateMemorySizein classOGCGeometry- Returns:
- Returns an estimate of this object size in bytes.
-
asText
public java.lang.String asText()
- Overrides:
asTextin classOGCGeometry
-
asBinary
public java.nio.ByteBuffer asBinary()
- Overrides:
asBinaryin classOGCGeometry
-
asGeoJson
public java.lang.String asGeoJson()
- Overrides:
asGeoJsonin classOGCGeometry
-
asGeoJsonImpl
java.lang.String asGeoJsonImpl(int export_flags)
- Overrides:
asGeoJsonImplin classOGCGeometry
-
isEmpty
public boolean isEmpty()
- Overrides:
isEmptyin classOGCGeometry
-
MinZ
public double MinZ()
- Overrides:
MinZin classOGCGeometry
-
MaxZ
public double MaxZ()
- Overrides:
MaxZin classOGCGeometry
-
MinMeasure
public double MinMeasure()
- Overrides:
MinMeasurein classOGCGeometry
-
MaxMeasure
public double MaxMeasure()
- Overrides:
MaxMeasurein classOGCGeometry
-
isSimple
public boolean isSimple()
Description copied from class:OGCGeometryReturns 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:
isSimplein 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:
makeSimplein classOGCGeometry- Returns:
- Returns simplified geometry. Note: isSimple and isSimpleRelaxed should return true after this operation.
-
isSimpleRelaxed
public boolean isSimpleRelaxed()
Description copied from class:OGCGeometryExtension method - checks if geometry is simple for Geodatabase.- Overrides:
isSimpleRelaxedin 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:
makeSimpleRelaxedin classOGCGeometry- Returns:
- Returns simplified geometry. Note: isSimpleRelaxed should return true after this operation.
-
boundary
public OGCGeometry boundary()
- Specified by:
boundaryin classOGCGeometry
-
locateAlong
public OGCGeometry locateAlong(double mValue)
- Specified by:
locateAlongin classOGCGeometry
-
locateBetween
public OGCGeometry locateBetween(double mStart, double mEnd)
- Specified by:
locateBetweenin classOGCGeometry
-
getEsriGeometry
public Geometry getEsriGeometry()
- Specified by:
getEsriGeometryin classOGCGeometry
-
getEsriGeometryCursor
public GeometryCursor getEsriGeometryCursor()
- Overrides:
getEsriGeometryCursorin classOGCGeometry
-
isConcreteGeometryCollection
protected boolean isConcreteGeometryCollection()
- Overrides:
isConcreteGeometryCollectionin classOGCGeometry
-
convexHull
public OGCGeometry convexHull()
- Overrides:
convexHullin classOGCGeometry
-
setSpatialReference
public void setSpatialReference(SpatialReference esriSR_)
- Overrides:
setSpatialReferencein classOGCGeometry
-
convertToMulti
public OGCGeometry convertToMulti()
Description copied from class:OGCGeometryConverts this Geometry to the OGCMulti* if it is not OGCMulti* or OGCGeometryCollection already.- Specified by:
convertToMultiin classOGCGeometry- Returns:
- OGCMulti* or OGCGeometryCollection instance.
-
reduceFromMulti
public OGCGeometry reduceFromMulti()
Description copied from class:OGCGeometryFor 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:
reduceFromMultiin classOGCGeometry- Returns:
- A reduced geometry or this.
-
asJson
public java.lang.String asJson()
- Overrides:
asJsonin classOGCGeometry- Returns:
- Convert to REST JSON.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classOGCGeometry
-
hashCode
public int hashCode()
- Overrides:
hashCodein classOGCGeometry
-
distance
public double distance(OGCGeometry another)
- Overrides:
distancein classOGCGeometry
-
overlaps
public boolean overlaps(OGCGeometry another)
- Overrides:
overlapsin classOGCGeometry
-
touches
public boolean touches(OGCGeometry another)
- Overrides:
touchesin classOGCGeometry
-
crosses
public boolean crosses(OGCGeometry another)
- Overrides:
crossesin classOGCGeometry
-
relate
public boolean relate(OGCGeometry another, java.lang.String matrix)
- Overrides:
relatein classOGCGeometry
-
disjoint
public boolean disjoint(OGCGeometry another)
- Overrides:
disjointin classOGCGeometry
-
contains
public boolean contains(OGCGeometry another)
- Overrides:
containsin classOGCGeometry
-
Equals
public boolean Equals(OGCGeometry another)
Description copied from class:OGCGeometryOGC equals. Performs topological comparison with tolerance. This is different from equals(Object), that uses exact comparison.- Overrides:
Equalsin 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:
differencein classOGCGeometry
-
intersection
public OGCGeometry intersection(OGCGeometry another)
- Overrides:
intersectionin classOGCGeometry
-
symDifference
public OGCGeometry symDifference(OGCGeometry another)
- Overrides:
symDifferencein 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)
-
-