public abstract class Geometry<P extends Position> extends Object implements Serializable
Geometrys.| 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. |
<Q extends Position> |
as(Class<Q> castToType) |
protected <Q extends Position> |
checkCast(Class<Q> castToType)
Checks whether a cast should succeed
|
boolean |
equals(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. |
static <Q extends Position> |
forceToCrs(Geometry<?> geometry,
CoordinateReferenceSystem<Q> crs,
double coordinateValue)
Creates a new
Geometry with the positions from the specified geometry and having the specified
CoordinateReferenceSystem. |
Box<P> |
getBoundingBox()
Returns the bounding
Box of this instance |
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 2D
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. |
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 |
hasM()
Does this
Geometry has Measure (M) coordinates |
boolean |
hasZ()
Does this
Geometry has vertical or Z coordinates |
boolean |
isEmpty()
Tests whether this
Geometry corresponds to the empty set. |
protected static <T extends Position> |
nestPositionSequences(Geometry<T>[] geometries) |
<Q extends Position> |
toCrs(CoordinateReferenceSystem<Q> crs,
double defaultCoordinateValue)
Returns a copy of this Geometry, but with the specified Coordinate Reference System.
|
String |
toString()
Returns the Well-Known Text (WKT) representation of this
Geometry. |
protected Object |
writeReplace() |
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, double coordinateValue)
Geometry with the positions from the specified geometry and having the specified
CoordinateReferenceSystem.
When forcing from a smaller to a larger coordinate dimension, the coordinateValue specified will be used
for filling the missing coordinate values.Q - the Position type for the returned Geometry*geometry - source Geometry that supplies the Positions for the returned Geometrycrs - the CoordinateReferenceSystem for the returned GeometrycoordinateValue - the default to fill in when for missing coordinate values (if any)Geometry with the positions of the specified geometry and having
the specified CoordinateReferenceSystempublic static <Q extends Position> Geometry<Q> forceToCrs(Geometry<?> geometry, CoordinateReferenceSystem<Q> crs)
Geometry with the positions from the specified geometry and having the specified
CoordinateReferenceSystem.
When forcing from a smaller to a larger coordinate dimension, the NaN will be used for the missing coordinate
values.Q - the Position type for the returned Geometry*geometry - 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 P getPositionN(int index)
PositionSequence of this Geometry.index - the position in the PositionSequence (first point is at index 0).PositionSequence of this Geometry.protected <Q extends Position> void checkCast(Class<Q> castToType)
Q - castToType - public PositionSequence<P> getPositions()
PositionSequence of this instancePositionSequence of this instancepublic Envelope<P> getEnvelope()
Envelope of this instance.Envelope of this instance.public Box<P> getBoundingBox()
Box of this instanceBox that encloses this geometrypublic boolean hasM()
Geometry has Measure (M) coordinatesGeometry has Measure coordinate valuespublic boolean hasZ()
Geometry has vertical or Z coordinatesGeometry has vertical coordinate valuespublic abstract GeometryType getGeometryType()
Geometry.GeometryType of this instance.public String toString()
Geometry.public abstract int getDimension()
Geometries.public <Q extends Position> Geometry<Q> toCrs(CoordinateReferenceSystem<Q> crs, double defaultCoordinateValue)
Q - Position type of the resultcrs - the CRS for the returned GeometrydefaultCoordinateValue - default value used in case the coordinate dimension is expandedpublic 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 - protected Object writeReplace() throws ObjectStreamException
ObjectStreamExceptionCopyright © 2023 geolatte.org. All rights reserved.