public abstract class AbstractPoint extends AbstractGeometry implements Point
Point is topologically valid if and only if:
NaN X or Y ordinate)
NULL_ORDINATE, X, Y, ZM, sortedGeometryTypes| Constructor and Description |
|---|
AbstractPoint() |
| Modifier and Type | Method and Description |
|---|---|
double |
angle2d(Point other)
Calculate the counter clockwise angle in radians of the vector from this
point to another point.
|
<V extends Geometry> |
appendVertex(Point newPoint,
int... geometryId) |
AbstractPoint |
clone()
Creates and returns a full copy of this
Point object. |
Point |
clonePoint() |
int |
compareTo(Object other)
Returns whether this
Geometry is greater than, equal to,
or less than another Geometry. |
int |
compareToSameClass(Geometry other)
Returns whether this
Geometry is greater than, equal to,
or less than another Geometry having the same class. |
protected BoundingBox |
computeBoundingBox()
Returns the minimum and maximum x and y values in this
Geometry
, or a null BoundingBoxDoubleGf if this Geometry is empty. |
<V extends Geometry> |
copy(GeometryFactory geometryFactory)
Create a copy of the geometry io the requried geometry factory.
|
void |
copyCoordinates(GeometryFactory geometryFactory,
double[] coordinates)
Copy the coordinates in this point to the coordinates array parameter and convert them to the geometry factory.
|
<V extends Geometry> |
deleteVertex(int... vertexId) |
double |
distance(double x,
double y) |
double |
distance(Point point)
Computes the 2-dimensional Euclidean distance to another location.
|
double |
distance3d(Point c)
Computes the 3-dimensional Euclidean distance to another location.
|
boolean |
doEquals(int axisCount,
Geometry geometry) |
boolean |
equals(double... coordinates) |
boolean |
equals(Object other)
Tests whether this geometry is structurally and numerically equal
to a given
Object. |
boolean |
equals(Point point) |
boolean |
equals2d(Point c,
double tolerance)
Tests if another coordinate has the same values for the X and Y ordinates.
|
boolean |
equalsExact(Geometry other,
double tolerance)
Returns true if the two
Geometrys are exactly equal,
up to a specified distance tolerance. |
Geometry |
getBoundary()
Gets the boundary of this geometry.
|
int |
getBoundaryDimension()
Returns the dimension of this
Geometrys inherent boundary. |
double[] |
getCoordinates() |
DataType |
getDataType() |
int |
getDimension()
Returns the dimension of this geometry.
|
GeometryFactory |
getGeometryFactory()
Gets the geometryFactory which contains the context in which this geometry was created.
|
double |
getM() |
Point |
getPoint()
Returns a vertex of this
Geometry
(usually, but not necessarily, the first one). |
Point |
getPointWithin() |
Segment |
getSegment(int... segmentId)
Get the
Segment at the specified vertexId (see Segment.getSegmentId()). |
long |
getTime() |
Vertex |
getToVertex(int... vertexId)
Get the
Vertex at the specified vertexId starting at the end of the geometry (see Vertex.getVertexId()). |
Vertex |
getVertex(int... vertexId)
Get the
Vertex at the specified vertexId (see Vertex.getVertexId()). |
int |
getVertexCount()
Returns the count of this
Geometrys vertices. |
double |
getX() |
double |
getY() |
double |
getZ() |
int |
hashCode()
Gets a hash code for the Geometry.
|
<V extends Geometry> |
insertVertex(Point newPoint,
int... vertexId) |
boolean |
intersects(BoundingBox boundingBox) |
boolean |
isEmpty()
Tests whether the set of points covered by this
Geometry is
empty. |
protected boolean |
isEquivalentClass(Geometry other)
Returns whether the two
Geometrys are equal, from the point
of view of the equalsExact method. |
boolean |
isSimple()
Tests whether this
Geometry is simple. |
boolean |
isValid()
Tests whether this
Geometry
is topologically valid, according to the OGC SFS specification. |
Point |
move(double... deltas) |
<V extends Geometry> |
moveVertex(Point newPoint,
int... vertexId) |
Point |
normalize()
Converts this
Geometry to normal form (or
canonical form ). |
Point |
prepare() |
Geometry |
reverse()
Computes a new geometry which has all component coordinate sequences
in reverse order (opposite orientation) to this one.
|
Reader<Segment> |
segments() |
Reader<Vertex> |
vertices()
|
buffer, buffer, buffer, checkNotGeometryCollection, compare, contains, containsProperly, convert, convert, convexHull, coveredBy, covers, createVertexId, crosses, difference, disjoint, distance, envelopeCovers, envelopesIntersect, equal, equals, equals, equalsExact, equalsNorm, equalsTopo, geometries, getArea, getAxisCount, getBoundingBox, getCentroid, getClassSortIndex, getCoordinateSystem, getEnvelope, getGeometries, getGeometries, getGeometry, getGeometryComponents, getGeometryCount, getGeometryType, getInteriorPoint, getLength, getNonZeroGeometryFactory, getSrid, getUserData, getVertexIndex, hasInvalidXyCoordinates, hasNonEmptyElements, hasNullElements, intersection, intersects, isAnyTargetComponentInTest, isGeometryCollection, isRectangle, isWithinDistance, overlaps, relate, relate, setUserData, setVertexIndex, symDifference, toClockwise, toCounterClockwise, toString, touches, toWkt, union, union, withinfinalize, getClass, notify, notifyAll, wait, wait, waitgetCoordinatebuffer, buffer, buffer, contains, containsProperly, convert, convert, convexHull, coveredBy, covers, crosses, difference, disjoint, distance, equal, equals, equals, equalsExact, equalsNorm, equalsTopo, geometries, getArea, getAxisCount, getBoundingBox, getCentroid, getClassSortIndex, getCoordinateSystem, getEnvelope, getGeometries, getGeometries, getGeometry, getGeometryComponents, getGeometryCount, getGeometryType, getInteriorPoint, getLength, getSrid, getUserData, hasInvalidXyCoordinates, intersection, intersects, isRectangle, isWithinDistance, overlaps, relate, relate, setUserData, symDifference, toClockwise, toCounterClockwise, touches, toWkt, union, union, withinpublic double angle2d(Point other)
Pointpublic <V extends Geometry> V appendVertex(Point newPoint, int... geometryId)
appendVertex in interface Geometrypublic AbstractPoint clone()
Point object.
(including all coordinates contained by it).public Point clonePoint()
clonePoint in interface Pointpublic int compareTo(Object other)
AbstractGeometryGeometry is greater than, equal to,
or less than another Geometry. If their classes are different, they are compared using the following ordering:
Geometrys have the same class, their first
elements are compared. If those are the same, the second elements are
compared, etc.compareTo in interface GeometrycompareTo in interface PointcompareTo in interface Comparable<Object>compareTo in class AbstractGeometryother - a Geometry with which to compare this Geometryo, as
defined in "Normal Form For Geometry" in the JTS Technical
Specificationspublic int compareToSameClass(Geometry other)
AbstractGeometryGeometry is greater than, equal to,
or less than another Geometry having the same class.compareToSameClass in interface GeometrycompareToSameClass in class AbstractGeometryother - a Geometry having the same class as this Geometryo, as
defined in "Normal Form For Geometry" in the JTS Technical
Specificationsprotected BoundingBox computeBoundingBox()
AbstractGeometryGeometry
, or a null BoundingBoxDoubleGf if this Geometry is empty.
Unlike getEnvelopeInternal, this method calculates the BoundingBoxDoubleGf
each time it is called; getEnvelopeInternal caches the result
of this method.computeBoundingBox in class AbstractGeometryGeometrys bounding box; if the Geometry
is empty, BoundingBoxDoubleGf#isNull will return truepublic <V extends Geometry> V copy(GeometryFactory geometryFactory)
Geometrypublic void copyCoordinates(GeometryFactory geometryFactory, double[] coordinates)
copyCoordinates in interface PointgeometryFactory - coordinates - public <V extends Geometry> V deleteVertex(int... vertexId)
deleteVertex in interface Geometrypublic double distance(Point point)
Pointpublic double distance3d(Point c)
distance3d in interface Pointc - a coordinatepublic boolean doEquals(int axisCount,
Geometry geometry)
doEquals in class AbstractGeometrypublic boolean equals(Object other)
AbstractGeometryObject.
If the argument Object is not a Geometry,
the result is false.
Otherwise, the result is computed using
AbstractGeometry.equals(2,Geometry).
This method is provided to fulfill the Java contract
for value-based object equality.
In conjunction with AbstractGeometry.hashCode()
it provides semantics which are most useful
for using
Geometrys as keys and values in Java collections.
Note that to produce the expected result the input geometries should be in normal form. It is the caller's responsibility to perform this where required (using Geometry#norm() or {@link #normalize()} as appropriate).
equals in interface Geometryequals in class AbstractGeometryother - the Object to compareAbstractGeometry.equals(2,Geometry),
AbstractGeometry.hashCode(),
#norm(),
AbstractGeometry.normalize()public boolean equals2d(Point c, double tolerance)
public boolean equalsExact(Geometry other, double tolerance)
AbstractGeometryGeometrys are exactly equal,
up to a specified distance tolerance.
Two Geometries are exactly equal within a distance tolerance
if and only if:
GeometryFactory, the SRID,
or the userData fields.
To properly test equality between different geometries,
it is usually necessary to AbstractGeometry.normalize() them first.
equalsExact in interface GeometryequalsExact in class AbstractGeometryother - the Geometry with which to compare this Geometrytolerance - distance at or below which two Coordinates
are considered equaltrue if this and the other Geometry
have identical structure and point values, up to the distance tolerance.AbstractGeometry.equals(2,Geometry),
AbstractGeometry.normalize(),
#norm()public Geometry getBoundary()
getBoundary in interface GeometrygetBoundary in class AbstractGeometryGeometry.getBoundary()public int getBoundaryDimension()
AbstractGeometryGeometrys inherent boundary.getBoundaryDimension in interface GeometrygetBoundaryDimension in class AbstractGeometryDimension.FALSE if the boundary is the empty geometry.public double[] getCoordinates()
getCoordinates in interface Pointpublic DataType getDataType()
getDataType in interface DataTypeProxygetDataType in class AbstractGeometrypublic int getDimension()
AbstractGeometry
Note that this is a different concept to the dimension of
the vertex Coordinatess.
The geometry dimension can never be greater than the coordinate dimension.
For example, a 0-dimensional geometry (e.g. a Point)
may have a coordinate dimension of 3 (X,Y,Z).
getDimension in interface GeometrygetDimension in class AbstractGeometrypublic GeometryFactory getGeometryFactory()
GeometrygetGeometryFactory in interface GeometrygetGeometryFactory in class AbstractGeometrypublic Point getPoint()
AbstractGeometryGeometry
(usually, but not necessarily, the first one).
The returned coordinate should not be assumed
to be an actual Point object used in
the internal representation.getPoint in interface GeometrygetPoint in class AbstractGeometryCoordinates which is a vertex of this Geometry.public Point getPointWithin()
getPointWithin in interface Geometrypublic Segment getSegment(int... segmentId)
GeometryGet the Segment at the specified vertexId (see Segment.getSegmentId()).
getSegment in interface Geometrypublic Vertex getToVertex(int... vertexId)
GeometryGet the Vertex at the specified vertexId starting at the end of the geometry (see Vertex.getVertexId()).
getToVertex in interface GeometryvertexId - The id of the vertex.public Vertex getVertex(int... vertexId)
GeometryGet the Vertex at the specified vertexId (see Vertex.getVertexId()).
public int getVertexCount()
GeometryGeometrys vertices. The Geometry
s contained by composite Geometrys must be
Geometry's; that is, they must implement getNumPointsgetVertexCount in interface GeometryGeometrypublic int hashCode()
AbstractGeometryhashCode in interface GeometryhashCode in class AbstractGeometrypublic <V extends Geometry> V insertVertex(Point newPoint, int... vertexId)
insertVertex in interface Geometrypublic boolean intersects(BoundingBox boundingBox)
intersects in interface Geometrypublic boolean isEmpty()
AbstractGeometryGeometry is
empty.isEmpty in interface GeometryisEmpty in class AbstractGeometrytrue if this Geometry does not cover any pointsprotected boolean isEquivalentClass(Geometry other)
AbstractGeometryGeometrys are equal, from the point
of view of the equalsExact method. Called by equalsExact
. In general, two Geometry classes are considered to be
"equivalent" only if they are the same class. An exception is LineString
, which is considered to be equivalent to its subclasses.isEquivalentClass in class AbstractGeometryother - the Geometry with which to compare this Geometry
for equalitytrue if the classes of the two Geometry
s are considered to be equal by the equalsExact method.public boolean isSimple()
AbstractGeometryGeometry is simple.
The SFS definition of simplicity
follows the general rule that a Geometry is simple if it has no points of
self-tangency, self-intersection or other anomalous points.
Simplicity is defined for each Geometry subclass as follows:
isSimple
tests for this condition and reports false if it is not met.
(This is a looser test than checking for validity).
Geometrys are always simple.
isSimple in interface GeometryisSimple in class AbstractGeometrytrue if this Geometry is simpleAbstractGeometry.isValid()public boolean isValid()
AbstractGeometryGeometry
is topologically valid, according to the OGC SFS specification.
For validity rules see the Javadoc for the specific Geometry subclass.
isValid in interface GeometryisValid in class AbstractGeometrytrue if this Geometry is validIsValidOppublic Point move(double... deltas)
public <V extends Geometry> V moveVertex(Point newPoint, int... vertexId)
moveVertex in interface Geometrypublic Point normalize()
AbstractGeometryGeometry to normal form (or
canonical form ). Normal form is a unique representation for Geometry
s. It can be used to test whether two Geometrys 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.normalize in interface Geometrynormalize in interface Pointnormalize in class AbstractGeometryAbstractGeometry.normalize()public Point prepare()
public Geometry reverse()
AbstractGeometryreverse in interface Geometryreverse in class AbstractGeometrypublic Reader<Vertex> vertices()
GeometryGet an Iterable that iterates over the Vertex of the geometry. For memory
efficiency the Vertex returned is the same instance for each call to next
on the iterator. If the vertex is required to track the previous vertex then the
Vertex.clone() method must be called to get a copy of the vertex.
The Iterable.iterator() method always returns the same Iterator instance.
Therefore that method should not be called more than once.
Copyright © 2015 Revolution Systems Inc.. All rights reserved.