public abstract class Geometry extends Object implements Serializable
Geometry
s.Modifier | Constructor and Description |
---|---|
protected |
Geometry(GeometryOperations geometryOperations) |
Modifier and Type | Method and Description |
---|---|
abstract void |
accept(GeometryVisitor visitor)
Accepts a
GeometryVisitor . |
byte[] |
asBinary()
Returns a Well-Known Binary (WKB) representation of this
Geometry . |
String |
asText()
Returns a Well-Known Text (WKT) representation of this
Geometry . |
Geometry |
buffer(double distance)
Returns a
Geometry that represents all points whose distance from this Geometry is less
than or equal the specified distance. |
protected static PointCollection |
collectPointSets(Geometry[] geometries)
Collects all PointSets in the Geometry array into a (complex) PointCollection.
|
boolean |
contains(Geometry other)
Tests whether this
Geometry spatially contains the specified Geometry . |
Geometry |
convexHull()
Returns a
Geometry that represents the convex hull of this Geometry . |
boolean |
crosses(Geometry other)
Tests whether this
Geometry spatially crosses the specified Geometry . |
Geometry |
difference(Geometry other)
Returns a
Geometry that represents the point set difference of this Geometry with the
specified other Geometry . |
boolean |
disjoint(Geometry other)
Tests whether this
Geometry is spatially disjoint from the specified Geometry . |
double |
distance(Geometry other)
Returns the shortest distance between any two points in the two
Geometry s as calculated in the
coordinate reference system of this Geometry . |
boolean |
equals(Object o) |
Geometry |
getBoundary()
Returns the boundary of this
Geometry . |
int |
getCoordinateDimension()
Returns the coordinate dimension of this
Geometry
|
CrsId |
getCrsId()
Returns the reference to the coordinate reference system of this
Geometry |
protected static CrsId |
getCrsId(Geometry[] geometries)
Extracts the first
CrsId from an array of Geometry s if
the array is non-null and not empty. |
abstract int |
getDimension()
Returns the topological dimension of this instance.
|
DimensionalFlag |
getDimensionalFlag()
Returns the
DimensionalFlag of the Geometry |
Envelope |
getEnvelope()
Returns the
Envelope , or minimum bounding box, for this Geometry . |
GeometryOperations |
getGeometryOperations()
Returns the
GeometryOperations instance used by this instance. |
protected static GeometryOperations |
getGeometryOperations(Geometry[] geometries)
Extracts the first
GeometryOperations from an array of Geometry s if
the array is non-null and not empty. |
abstract GeometryType |
getGeometryType()
Returns the type of this
Geometry . |
int |
getNumPoints()
Returns the number of points in the
PointCollection of this Geometry . |
Point |
getPointN(int index)
Returns the point at the specified index in the
PointCollection of this Geometry . |
abstract PointCollection |
getPoints()
Returns the
PointCollection that is associated with this instance |
int |
getSRID()
Returns the numeric identifier of the coordinate reference system of this
Geometry . |
int |
hashCode() |
Geometry |
intersection(Geometry other)
Returns a
Geometry that represents the point set intersection of this Geometry with the
specified other Geometry . |
boolean |
intersects(Geometry other)
Tests whether this
Geometry spatially intersects the specified Geometry . |
boolean |
is3D()
Tests whether this
Geometry has Z-coordinates. |
boolean |
isEmpty()
Tests whether this
Geometry corresponds to the empty set. |
boolean |
isMeasured()
Tests whether this
Geometry has M-coordinates. |
boolean |
isSimple()
Tests if this
Geometry is simple; i.e. |
Geometry |
locateAlong(double mValue)
Returns a derived
GeometryCollection value that matches the specified M-coordinate value. |
Geometry |
locateBetween(double mStart,
double mEnd)
Returns a derived
GeometryCollection value that matches the specified range of M-coordinate values
inclusively. |
boolean |
overlaps(Geometry other)
Tests whether this
Geometry spatially overlaps the specified Geometry . |
boolean |
relate(Geometry other,
String matrix)
Tests whether this
Geometry is spatially related to the specified Geometry by testing
for intersections between the interior, boundary and exterior of the two geometric objects as specified by
the values in the intersection pattern matrix. |
Geometry |
symDifference(Geometry other)
Returns a
Geometry that represents the point set symmetric difference of this Geometry with the
specified other Geometry . |
String |
toString()
Returns the Well-Known Text (WKT) representation of this
Geometry . |
boolean |
touches(Geometry other)
Tests whether this
Geometry spatially touches the specified Geometry . |
Geometry |
union(Geometry other)
Returns the
Geometry that represents the point set union of this Geometry with the
specified other Geometry . |
boolean |
within(Geometry other)
Tests whether this
Geometry is spatially within the specified Geometry . |
protected Geometry(GeometryOperations geometryOperations)
protected static PointCollection collectPointSets(Geometry[] geometries)
This implementation assumes that the array does not contain NULL values. This condition should be tested before constructing the PointCollection.
geometries
- public int getCoordinateDimension()
Geometry
The coordinate dimension is the number of components in the coordinates of the points in
this Geometry
.
public CrsId getCrsId()
Geometry
public 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.
public boolean is3D()
Geometry
has Z-coordinates.public DimensionalFlag getDimensionalFlag()
DimensionalFlag
of the GeometryDimensionalFlag
of its PointSequence
public boolean isMeasured()
Geometry
has M-coordinates.public boolean isEmpty()
Geometry
corresponds to the empty set.public int getNumPoints()
PointCollection
of this Geometry
.public Point getPointN(int index)
PointCollection
of this Geometry
.index
- the position in the PointSequence
(first point is at index 0).protected static CrsId getCrsId(Geometry[] geometries)
CrsId
from an array of Geometry
s if
the array is non-null and not empty. Otherwise returns CrsId.UNDEFINED
.protected static GeometryOperations getGeometryOperations(Geometry[] geometries)
GeometryOperations
from an array of Geometry
s if
the array is non-null and not empty. Otherwise returns Null
.public abstract PointCollection getPoints()
PointCollection
that is associated with this instancepublic abstract GeometryType getGeometryType()
Geometry
.GeometryType
of this instance.public boolean isSimple()
Geometry
is simple; i.e. has no anomalous geometric points such as
self-intersections or self-tangency.public Geometry getBoundary()
Geometry
.public Envelope getEnvelope()
Envelope
, or minimum bounding box, for this Geometry
.public boolean disjoint(Geometry other)
Geometry
is spatially disjoint from the specified Geometry
.other
- the Geometry
to test againstpublic boolean intersects(Geometry other)
Geometry
spatially intersects the specified Geometry
.other
- the Geometry
to test againstGeometry
public boolean touches(Geometry other)
Geometry
spatially touches the specified Geometry
.other
- the Geometry
to test againstGeometry
public boolean crosses(Geometry other)
Geometry
spatially crosses the specified Geometry
.other
- the Geometry
to test againstGeometry
public boolean within(Geometry other)
Geometry
is spatially within the specified Geometry
.other
- the Geometry
to test againstGeometry
public boolean contains(Geometry other)
Geometry
spatially contains the specified Geometry
.other
- the Geometry
to test againstGeometry
public boolean overlaps(Geometry other)
Geometry
spatially overlaps the specified Geometry
.other
- the Geometry
to test againstGeometry
public boolean relate(Geometry other, String matrix)
Geometry
is spatially related to the specified Geometry
by testing
for intersections between the interior, boundary and exterior of the two geometric objects as specified by
the values in the intersection pattern matrix. This returns false if all the tested intersections are empty except
exterior (this) intersect exterior (another).other
- the Geometry
to test againstmatrix
- the intersection pattern matrixGeometry
public Geometry locateAlong(double mValue)
GeometryCollection
value that matches the specified M-coordinate value.
This method is only valid if executed on 0- or 1-dimensional objects or collections thereof.
The semantics implemented here are specified by SFA 1.2.1, § 6.1.2.6.
mValue
- the specified M-coordinate valueGeometryCollection
matching the specified M-value.IllegalArgumentException
- if this method is executed on 2-dimensional Geometry
s.public Geometry locateBetween(double mStart, double mEnd)
GeometryCollection
value that matches the specified range of M-coordinate values
inclusively.
This method is only valid if executed on 0- or 1-dimensional objects or collections thereof.
The semantics implemented here are specified by SFA 1.2.1, § 6.1.2.6.
mStart
- the start of the range of M-coordinate valuesmEnd
- the end of the range of M-coordinate valuesIllegalArgumentException
- if this method is executed on 2-dimensional Geometry
s.public double distance(Geometry other)
Geometry
s as calculated in the
coordinate reference system of this Geometry
. Only the X/Y-coordinates are used in the distance
calculation; M- and Z-coordinates are ignored.
The current implementation assumes that both Geometry
s are in a Cartesian coordinate
reference system. Using this method on Geometry
s in a geocentric or geographic coordinate reference
system returns a meaningless value.
other
- the Geometry
to which the min. distance is calculated.Geometry
.public Geometry buffer(double distance)
Geometry
that represents all points whose distance from this Geometry
is less
than or equal the specified distance. Calculations are in the CoordinateReferenceSystem
of this
Geometry
.
Z- or M-coordinates are ignored in the buffering operation; and the result will always be a 2D geometry.
distance
- the buffer distanceGeometry
representing this object buffered with the specified distance.public Geometry convexHull()
Geometry
that represents the convex hull of this Geometry
.public Geometry intersection(Geometry other)
Geometry
that represents the point set intersection of this Geometry
with the
specified other Geometry
.other
- the Geometry
to intersect withGeometry
representing the point set intersectionpublic Geometry union(Geometry other)
Geometry
that represents the point set union of this Geometry
with the
specified other Geometry
.other
- the Geometry
to union withGeometry
representing the point set union.public Geometry difference(Geometry other)
Geometry
that represents the point set difference of this Geometry
with the
specified other Geometry
.other
- the Geometry
with which to calculate the differenceGeometry
representing the point set difference.public Geometry symDifference(Geometry other)
Geometry
that represents the point set symmetric difference of this Geometry
with the
specified other Geometry
.other
- the Geometry
with which to calculate the symmetric differenceGeometry
representing the point set symmetric difference.public String asText()
Geometry
.Geometry
.public byte[] asBinary()
Geometry
.Geometry
.public String toString()
Geometry
.
This method is synonymous with asText()
.
public abstract int getDimension()
Geometries
.public abstract void accept(GeometryVisitor visitor)
GeometryVisitor
.
If this Geometry
instance is a GeometryCollection
then it will pass the
visitor to its contained Geometries
.
visitor
- public GeometryOperations getGeometryOperations()
GeometryOperations
instance used by this instance.Copyright © 2015 geolatte.org. All rights reserved.