| Prev Class | Next Class | Frames | No Frames |
| Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Objectcom.vividsolutions.jts.geom.Geometrycom.vividsolutions.jts.geom.GeometryCollectionpublic class GeometryCollectionextends GeometryGeometryCollection.
Field Summary | |
protected Geometry[] |
|
Constructor Summary | |
| |
| |
Method Summary | |
void |
|
void |
|
void |
|
Object |
|
protected int |
|
protected int |
|
protected Envelope |
|
boolean |
|
double |
|
Geometry |
|
int |
|
Coordinate |
|
Coordinate[] |
|
int |
|
Geometry |
|
String |
|
double |
|
int |
|
int |
|
boolean |
|
boolean | |
void |
|
Methods inherited from class com.vividsolutions.jts.geom.Geometry | |
apply, apply, apply, buffer, buffer, buffer, checkNotGeometryCollection, clone, compare, compareTo, compareTo, compareToSameClass, compareToSameClass, computeEnvelopeInternal, contains, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, equal, equals, equalsExact, equalsExact, geometryChanged, geometryChangedAction, getArea, getBoundary, getBoundaryDimension, getCentroid, getCoordinate, getCoordinates, getDimension, getEnvelope, getEnvelopeInternal, getFactory, getGeometryN, getGeometryType, getInteriorPoint, getLength, getNumGeometries, getNumPoints, getPrecisionModel, getSRID, getUserData, hasNonEmptyElements, hasNullElements, intersection, intersects, isEmpty, isEquivalentClass, isRectangle, isSimple, isValid, isWithinDistance, normalize, overlaps, relate, relate, setSRID, setUserData, symDifference, toString, toText, touches, union, within | |
public GeometryCollection(Geometry[] geometries, GeometryFactory factory)
- Parameters:
geometries- theGeometrys for thisGeometryCollection, ornullor an empty array to create the empty geometry. Elements may be emptyGeometrys, but notnulls.
public GeometryCollection(Geometry[] geometries, PrecisionModel precisionModel, int SRID)
Deprecated. Use GeometryFactory instead
public void apply(CoordinateFilter filter)
Performs an operation with or on thisGeometry's coordinates. If you are using this method to modify the geometry, be sure to call #geometryChanged() afterwards. Note that you cannot use this method to modify this Geometry if its underlying CoordinateSequence's #get method returns a copy of the Coordinate, rather than the actual Coordinate stored (if it even stores Coordinates at all).
- Parameters:
filter- the filter to apply to thisGeometry's coordinates
public void apply(GeometryComponentFilter filter)
Performs an operation with or on this Geometry and its component Geometry's. Only GeometryCollections and Polygons have component Geometry's; for Polygons they are the LinearRings of the shell and holes.
- Parameters:
filter- the filter to apply to thisGeometry.
public void apply(GeometryFilter filter)
Performs an operation with or on thisGeometryand its subelementGeometrys (if any). Only GeometryCollections and subclasses have subelement Geometry's.
- Parameters:
filter- the filter to apply to thisGeometry(and its children, if it is aGeometryCollection).
protected int compareToSameClass(Object o)
Returns whether thisGeometryis greater than, equal to, or less than anotherGeometryhaving the same class.
- Overrides:
- compareToSameClass in interface Geometry
- Parameters:
o- aGeometryhaving the same class as thisGeometry
- Returns:
- a positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than
o, as defined in "Normal Form For Geometry" in the JTS Technical Specifications
protected int compareToSameClass(Object o,
CoordinateSequenceComparator comp)Returns whether thisGeometryis greater than, equal to, or less than anotherGeometryof the same class. using the givenCoordinateSequenceComparator.
- Overrides:
- compareToSameClass in interface Geometry
- Parameters:
o- aGeometryhaving the same class as thisGeometrycomp- aCoordinateSequenceComparator
- Returns:
- a positive number, 0, or a negative number, depending on whether this object is greater than, equal to, or less than
o, as defined in "Normal Form For Geometry" in the JTS Technical Specifications
protected Envelope computeEnvelopeInternal()
Returns the minimum and maximum x and y values in thisGeometry, or a nullEnvelopeif thisGeometryis empty. UnlikegetEnvelopeInternal, this method calculates theEnvelopeeach time it is called;getEnvelopeInternalcaches the result of this method.
- Overrides:
- computeEnvelopeInternal in interface Geometry
- Returns:
- this
Geometrys bounding box; if theGeometryis empty,Envelope#isNullwill returntrue
public boolean equalsExact(Geometry other, double tolerance)
Returns true if the twoGeometrys are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance if and only if:If this and the other
- they have the same class
- they have the same values for their vertices, within the given tolerance distance, in exactly the same order.
Geometrys are composites and any children are notGeometrys, returnsfalse.
- Overrides:
- equalsExact in interface Geometry
- Parameters:
other- theGeometrywith which to compare thisGeometry
- Returns:
trueif this and the otherGeometryare of the same class and have equal internal data.
public double getArea()
Returns the area of thisGeometryCollection
- Returns:
- the area of the polygon
public Geometry getBoundary()
Returns the boundary, or the empty geometry if thisGeometryis empty. For a discussion of this function, see the OpenGIS Simple Features Specification. As stated in SFS Section 2.1.13.1, "the boundary of a Geometry is a set of Geometries of the next lower dimension."
- Overrides:
- getBoundary in interface Geometry
- Returns:
- the closure of the combinatorial boundary of this
Geometry
public int getBoundaryDimension()
Returns the dimension of thisGeometrys inherent boundary.
- Overrides:
- getBoundaryDimension in interface Geometry
- Returns:
- the dimension of the boundary of the class implementing this interface, whether or not this object is the empty geometry. Returns
Dimension.FALSEif the boundary is the empty geometry.
public Coordinate getCoordinate()
Returns a vertex of thisGeometry.
- Overrides:
- getCoordinate in interface Geometry
- Returns:
- a
Coordinatewhich is a vertex of thisGeometry. Returnsnullif this Geometry is empty
public Coordinate[] getCoordinates()
Collects all coordinates of all subgeometries into an Array. Note that while changes to the coordinate objects themselves may modify the Geometries in place, the returned Array as such is only a temporary container which is not synchronized back.
- Overrides:
- getCoordinates in interface Geometry
- Returns:
- the collected coordinates
public int getDimension()
Returns the dimension of thisGeometry.
- Overrides:
- getDimension in interface Geometry
- Returns:
- the dimension of the class implementing this interface, whether or not this object is the empty geometry
public Geometry getGeometryN(int n)
Returns an elementGeometryfrom aGeometryCollection(orthis, if the geometry is not a collection).
- Overrides:
- getGeometryN in interface Geometry
- Parameters:
n- the index of the geometry element
- Returns:
- the n'th geometry contained in this geometry
public String getGeometryType()
Returns the name of this object'scom.vivid.jts.geominterface.
- Overrides:
- getGeometryType in interface Geometry
- Returns:
- the name of this
Geometrys most specificcom.vividsolutions.jts.geominterface
public double getLength()
Returns the length of thisGeometry. Linear geometries return their length. Areal geometries return their perimeter. They override this function to compute the area. Others return 0.0
- Returns:
- the length of the Geometry
public int getNumGeometries()
Returns the number ofGeometrys in aGeometryCollection(or 1, if the geometry is not a collection).
- Overrides:
- getNumGeometries in interface Geometry
- Returns:
- the number of geometries contained in this geometry
public int getNumPoints()
Returns the count of thisGeometrys vertices. TheGeometrys contained by compositeGeometrys must be Geometry's; that is, they must implementgetNumPoints
- Overrides:
- getNumPoints in interface Geometry
- Returns:
- the number of vertices in this
Geometry
public boolean isEmpty()
Returns whether or not the set of points in thisGeometryis empty.
- Returns:
trueif thisGeometryequals the empty geometry
public boolean isSimple()
Tests whether thisGeometryis simple. In general, the SFS specification of simplicity follows the rule:Simplicity is defined for each
- A Geometry is simple iff the only self-intersections are at boundary points.
Geometrysubclass as follows:
- Valid polygonal geometries are simple by definition, so
isSimpletrivially returns true.- Linear geometries are simple iff they do not self-intersect at points other than boundary points.
- Zero-dimensional geometries (points) are simple iff they have no repeated points.
- Empty
Geometrys are always simple
- Returns:
trueif thisGeometryhas any points of self-tangency, self-intersection or other anomalous points
- See Also:
Geometry.isValid()
public void normalize()
Converts thisGeometryto normal form (or canonical form ). Normal form is a unique representation forGeometrys. It can be used to test whether twoGeometrys are equal in a way that is independent of the ordering of the coordinates within them. Normal form equality is a stronger condition than topological equality, but weaker than pointwise equality. The definitions for normal form use the standard lexicographical ordering for coordinates. "Sorted in order of coordinates" means the obvious extension of this ordering to sequences of coordinates.