public abstract class Geometry<P extends Position>
extends java.lang.Object
implements java.io.Serializable
Geometrys.| Modifier and Type | Class and Description |
|---|---|
private static class |
Geometry.EnvelopeVisitor<P extends Position> |
private static class |
Geometry.SerializationProxy |
| Modifier and Type | Field and Description |
|---|---|
private CoordinateReferenceSystem<P> |
crs |
private static GeometryEquality |
geomEq |
private PositionSequence<P> |
positions |
private static long |
serialVersionUID |
| Modifier | Constructor and Description |
|---|---|
protected |
Geometry(CoordinateReferenceSystem<P> crs)
Creates an empty Geometry
|
protected |
Geometry(PositionSequence<P> positions,
CoordinateReferenceSystem<P> crs) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
accept(GeometryVisitor<P> visitor)
Accepts a
GeometryVisitor. |
boolean |
equals(java.lang.Object o) |
static <Q extends Position> |
forceToCrs(Geometry<?> geometry,
CoordinateReferenceSystem<Q> crs)
Creates a new
Geometry with the positions from the specified geometry and having the specified
CoordinateReferenceSystem |
int |
getCoordinateDimension()
Returns the coordinate dimension of this
Geometry
|
CoordinateReferenceSystem<P> |
getCoordinateReferenceSystem()
Returns the coordinate reference system of this
Geometry |
protected static <T extends Position> |
getCrs(Geometry<T>[] geometries) |
abstract int |
getDimension()
Returns the topological dimension of this instance.
|
Envelope<P> |
getEnvelope()
Returns the
Envelope of this instance. |
abstract GeometryType |
getGeometryType()
Returns the type of this
Geometry. |
int |
getNumPositions()
Returns the number of positions in the
PositionSequence of this Geometry. |
java.lang.Class<P> |
getPositionClass() |
P |
getPositionN(int index)
Returns the position at the specified index in the
PositionSequence of this Geometry. |
PositionSequence<P> |
getPositions()
Returns the
PositionSequence of this instance |
int |
getSRID()
Returns the numeric identifier of the coordinate reference system of this
Geometry. |
int |
hashCode() |
boolean |
isEmpty()
Tests whether this
Geometry corresponds to the empty set. |
protected static <T extends Position> |
nestPositionSequences(Geometry<T>[] geometries) |
private void |
readObject(java.io.ObjectInputStream in) |
java.lang.String |
toString()
Returns the Well-Known Text (WKT) representation of this
Geometry. |
protected java.lang.Object |
writeReplace() |
private static final long serialVersionUID
private static GeometryEquality geomEq
private final PositionSequence<P extends Position> positions
private final CoordinateReferenceSystem<P extends Position> crs
protected Geometry(CoordinateReferenceSystem<P> crs)
crs - the CoordinateReferenceSystem to useprotected Geometry(PositionSequence<P> positions, CoordinateReferenceSystem<P> crs)
public static <Q extends Position> Geometry<Q> forceToCrs(Geometry<?> geometry, CoordinateReferenceSystem<Q> crs)
Geometry with the positions from the specified geometry and having the specified
CoordinateReferenceSystemQ - the Position type for the returned Geometrygeometry - source Geometry that supplies the Positions for the returned Geometrycrs - the CoordinateReferenceSystem for the returned GeometryGeometry with the positions of the specified geometry and having
the specified CoordinateReferenceSystemprotected static <T extends Position> PositionSequence<T> nestPositionSequences(Geometry<T>[] geometries)
protected static <T extends Position> CoordinateReferenceSystem<T> getCrs(Geometry<T>[] geometries)
public int getCoordinateDimension()
Geometry
The coordinate dimension is the number of components in the coordinates of the points in
this Geometry.
public CoordinateReferenceSystem<P> getCoordinateReferenceSystem()
GeometryGeometrypublic int getSRID()
Geometry.
A SRID is usually interpreted as meaning the EPSG-code for the coordinate reference system. In this implementation, this is not enforced.
Geometry.public boolean isEmpty()
Geometry corresponds to the empty set.Geometry corresponds to the empty set, false otherwise.public int getNumPositions()
PositionSequence of this Geometry.PositionSequence of this Geometry.public java.lang.Class<P> getPositionClass()
public P getPositionN(int index)
PositionSequence of this Geometry.index - the position in the PositionSequence (first point is at index 0).PositionSequence of this Geometry.public PositionSequence<P> getPositions()
PositionSequence of this instancePositionSequence of this instancepublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic Envelope<P> getEnvelope()
Envelope of this instance.Envelope of this instance.public int hashCode()
hashCode in class java.lang.Objectpublic abstract GeometryType getGeometryType()
Geometry.GeometryType of this instance.public java.lang.String toString()
Geometry.toString in class java.lang.ObjectGeometry.public abstract int getDimension()
Geometries.public abstract void accept(GeometryVisitor<P> visitor)
GeometryVisitor.
If this Geometry instance is a GeometryCollection then it will pass the
visitor to its contained Geometries.
visitor - private void readObject(java.io.ObjectInputStream in)
throws java.io.IOException
java.io.IOExceptionprotected java.lang.Object writeReplace()
throws java.io.ObjectStreamException
java.io.ObjectStreamException