Point class

Represents a single point.

A Point is topologically valid if and only if:

  • the coordinate which defines it (if any) is a valid coordinate (i.e. does not have an NaN X or Y ordinate)

@version 1.7

Inheritance
Implemented types

Constructors

Point(Coordinate? coordinate, PrecisionModel precisionModel, int SRID)
Constructs a Point with the given coordinate.
Point.fromSequence(CoordinateSequence? coordinates, GeometryFactory factory)
@param coordinates contains the single coordinate on which to base this Point , or null to create the empty geometry.

Properties

coordinates CoordinateSequence?
The Coordinate wrapped by this Point.
getter/setter pair
envelope Envelope?
The bounding box of this Geometry.
getter/setter pairinherited
geomFactory GeometryFactory
The {@link GeometryFactory} used to create this Geometry
latefinalinherited
hashCode int
Gets a hash code for the Geometry.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
SRID int
The ID of the Spatial Reference System used by this Geometry
getter/setter pairinherited
userData Object?
An object reference which can be used to carry ancillary data defined by the client.
getter/setter pairinherited

Methods

applyCF(CoordinateFilter cf) → void
Performs an operation with or on this Geometry's coordinates. If this method modifies any coordinate values, {@link #geometryChanged} must be called to update the geometry state. 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 Coordinate objects at all).
override
applyCSF(CoordinateSequenceFilter filter) → void
Performs an operation on the coordinates in this Geometry's {@link CoordinateSequence}s. If the filter reports that a coordinate value has been changed, {@link #geometryChanged} will be called automatically.
override
applyGCF(GeometryComponentFilter filter) → void
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.
override
applyGF(GeometryFilter filter) → void
Performs an operation with or on this Geometry and its subelement Geometrys (if any). Only GeometryCollections and subclasses have subelement Geometry's.
override
buffer(double distance) Geometry
Computes a buffer area around this geometry having the given width. The buffer of a Geometry is the Minkowski sum or difference of the geometry with a disc of radius abs(distance).
inherited
buffer2(double distance, int quadrantSegments) Geometry
Computes a buffer area around this geometry having the given width and with a specified accuracy of approximation for circular arcs.
inherited
buffer3(double distance, int quadrantSegments, int endCapStyle) Geometry
Computes a buffer area around this geometry having the given width and with a specified accuracy of approximation for circular arcs, and using a specified end cap style.
inherited
clone() Object
Creates and returns a full copy of this {@link Point} object. (including all coordinates contained by it).
override
compare(List a, List b) int
Returns the first non-zero result of compareTo encountered as the two Collections are iterated over. If, by the time one of the iterations is complete, no non-zero result has been encountered, returns 0 if the other iteration is also complete. If b completes before a, a positive number is returned; if a before b, a negative number.
inherited
compareTo(dynamic o) int
Returns whether this Geometry is greater than, equal to, or less than another Geometry.
inherited
compareToSameClass(Object other) int
Returns whether this Geometry is greater than, equal to, or less than another Geometry having the same class.
override
compareToSameClassWithComparator(Object other, Comparator<CoordinateSequence> comp) int
Returns whether this Geometry is greater than, equal to, or less than another Geometry of the same class. using the given {@link CoordinateSequenceComparator}.
override
compareToWithComparator(Object o, Comparator<CoordinateSequence> comp) int
Returns whether this Geometry is greater than, equal to, or less than another Geometry, using the given {@link CoordinateSequenceComparator}.
inherited
computeEnvelopeInternal() Envelope
Returns the minimum and maximum x and y values in this Geometry , or a null Envelope if this Geometry is empty. Unlike getEnvelopeInternal, this method calculates the Envelope each time it is called; getEnvelopeInternal caches the result of this method.
override
contains(Geometry g) bool
Tests whether this geometry contains the argument geometry.
inherited
convexHull() Geometry
Computes the smallest convex Polygon that contains all the points in the Geometry. This obviously applies only to Geometry s which contain 3 or more points; the results for degenerate cases are specified as follows:
inherited
copy() Geometry
Creates a deep copy of this {@link Geometry} object. Coordinate sequences contained in it are copied. All instance fields are copied (i.e. the SRID and userData).
inherited
copyInternal() Point
An internal method to copy subclass-specific geometry data.
override
coveredBy(Geometry g) bool
Tests whether this geometry is covered by the argument geometry.
inherited
covers(Geometry g) bool
Tests whether this geometry covers the argument geometry.
inherited
createPointFromInternalCoord(Coordinate coord, Geometry exemplar) Point
inherited
crosses(Geometry g) bool
Tests whether this geometry crosses the argument geometry.
inherited
difference(Geometry other) Geometry
Computes a Geometry representing the closure of the point-set of the points contained in this Geometry that are not contained in the other Geometry.
inherited
disjoint(Geometry g) bool
Tests whether this geometry is disjoint from the argument geometry.
inherited
distance(Geometry g) double
Returns the minimum distance between this Geometry and another Geometry.
inherited
equal(Coordinate a, Coordinate b, double tolerance) bool
inherited
equals(Geometry? g) bool
Tests whether this geometry is topologically equal to the argument geometry.
inherited
equalsExactGeom(Geometry other) bool
Returns true if the two Geometrys are exactly equal. Two Geometries are exactly equal iff:
inherited
equalsExactWithTol(Geometry other, double tolerance) bool
Returns true if the two Geometrys are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance if and only if:
override
equalsNorm(Geometry? g) bool
Tests whether two geometries are exactly equal in their normalized forms. This is a convenience method which creates normalized versions of both geometries before computing {@link #equalsExact(Geometry)}.
inherited
equalsObj(Object o) bool
Tests whether this geometry is structurally and numerically equal to a given Object. If the argument Object is not a Geometry, the result is false. Otherwise, the result is computed using {@link #equalsExact(Geometry)}.
inherited
equalsTopo(Geometry g) bool
Tests whether this geometry is topologically equal to the argument geometry as defined by the SFS equals predicate.
inherited
geometryChanged() → void
Notifies this geometry that its coordinates have been changed by an external party (for example, via a {@link CoordinateFilter}). When this method is called the geometry will flush and/or update any derived information it has cached (such as its {@link Envelope} ). The operation is applied to all component Geometries.
inherited
geometryChangedAction() → void
Notifies this Geometry that its Coordinates have been changed by an external party. When #geometryChanged is called, this method will be called for this Geometry and its component Geometries.
inherited
getArea() double
Returns the area of this Geometry. Areal Geometries have a non-zero area. They override this function to compute the area. Others return 0.0
inherited
getBoundary() Geometry
Gets the boundary of this geometry. Zero-dimensional geometries have no boundary by definition, so an empty GeometryCollection is returned.
override
getBoundaryDimension() int
Returns the dimension of this Geometrys inherent boundary.
override
getCentroid() Point
Computes the centroid of this Geometry. The centroid is equal to the centroid of the set of component Geometries of highest dimension (since the lower-dimension geometries contribute zero "weight" to the centroid).
inherited
getCoordinate() Coordinate?
Returns a vertex of this Geometry (usually, but not necessarily, the first one). The returned coordinate should not be assumed to be an actual Coordinate object used in the internal representation.
override
getCoordinates() List<Coordinate>
Returns an array containing the values of all the vertices for this geometry. If the geometry is a composite, the array will contain all the vertices for the components, in the order in which the components occur in the geometry.
override
getCoordinateSequence() CoordinateSequence
getDimension() int
Returns the dimension of this geometry. The dimension of a geometry is is the topological dimension of its embedding in the 2-D Euclidean plane. In the JTS spatial model, dimension values are in the set {0,1,2}.
override
getEnvelope() Geometry
Gets a Geometry representing the envelope (bounding box) of this Geometry.
inherited
getEnvelopeInternal() Envelope
Gets an {@link Envelope} containing the minimum and maximum x and y values in this Geometry. If the geometry is empty, an empty Envelope is returned.
inherited
getFactory() GeometryFactory
Gets the factory which contains the context in which this geometry was created.
inherited
getGeometryN(int n) Geometry
Returns an element {@link Geometry} from a {@link GeometryCollection} (or this, if the geometry is not a collection).
inherited
getGeometryType() String
Returns the name of this Geometry's actual class.
override
getInteriorPoint() Point
Computes an interior point of this Geometry. An interior point is guaranteed to lie in the interior of the Geometry, if it possible to calculate such a point exactly. Otherwise, the point may lie on the boundary of the geometry.
inherited
getLength() double
Returns the length of this Geometry. Linear geometries return their length. Areal geometries return their perimeter. They override this function to compute the area. Others return 0.0
inherited
getNumGeometries() int
Returns the number of {@link Geometry}s in a {@link GeometryCollection} (or 1, if the geometry is not a collection).
inherited
getNumPoints() int
Returns the count of this Geometrys vertices. The Geometry s contained by composite Geometrys must be Geometry's; that is, they must implement getNumPoints
override
getPrecisionModel() PrecisionModel
Returns the PrecisionModel used by the Geometry.
inherited
getSortIndex() int
override
getSRID() int
Returns the ID of the Spatial Reference System used by the Geometry.
inherited
getUserData() Object?
Gets the user data object for this geometry, if any.
inherited
getX() double
getY() double
init(CoordinateSequence? coordinates) → void
intersection(Geometry other) Geometry
Computes a Geometry representing the point-set which is common to both this Geometry and the other Geometry.
inherited
intersects(Geometry g) bool
Tests whether this geometry intersects the argument geometry.
inherited
isEmpty() bool
Tests whether the set of points covered by this Geometry is empty.
override
isEquivalentClass(Geometry other) bool
Returns whether the two Geometrys 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.
inherited
isGeometryCollection() bool
Tests whether this is an instance of a general {@link GeometryCollection}, rather than a homogeneous subclass.
inherited
isRectangle() bool
Tests whether this is a rectangular {@link Polygon}.
inherited
isSimple() bool
Tests whether this {@link Geometry} 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.
override
isValid() bool
Tests whether this Geometry is topologically valid, according to the OGC SFS specification.
inherited
isWithinDistance(Geometry geom, double distance) bool
Tests whether the distance from this Geometry to another is less than or equal to a specified value.
inherited
norm() Geometry
Creates a new Geometry which is a normalized copy of this Geometry.
inherited
normalize() → void
Converts this Geometry 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.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
overlaps(Geometry g) bool
Tests whether this geometry overlaps the specified geometry.
inherited
relate(Geometry g) IntersectionMatrix
Returns the DE-9IM {@link IntersectionMatrix} for the two Geometrys.
inherited
relateWithPattern(Geometry g, String intersectionPattern) bool
Tests whether the elements in the DE-9IM {@link IntersectionMatrix} for the two Geometrys match the elements in intersectionPattern. The pattern is a 9-character string, with symbols drawn from the following set:
inherited
reverse() Geometry
Computes a new geometry which has all component coordinate sequences in reverse order (opposite orientation) to this one.
override
setSRID(int SRID) → void
Sets the ID of the Spatial Reference System used by the Geometry.
inherited
setUserData(Object? userData) → void
A simple scheme for applications to add their own custom data to a Geometry. An example use might be to add an object representing a Coordinate Reference System.
inherited
symDifference(Geometry other) Geometry
Computes a Geometry representing the closure of the point-set which is the union of the points in this Geometry which are not contained in the other Geometry, with the points in the other Geometry not contained in this Geometry. If the result is empty, it is an atomic geometry with the dimension of the highest input dimension.
inherited
toString() String
A string representation of this object.
inherited
toText() String
Returns the Well-known Text representation of this Geometry. For a definition of the Well-known Text format, see the OpenGIS Simple Features Specification.
inherited
touches(Geometry g) bool
Tests whether this geometry touches the argument geometry.
inherited
union() Geometry
Computes the union of all the elements of this geometry.
inherited
unionGeom(Geometry other) Geometry
Computes a Geometry representing the point-set which is contained in both this Geometry and the other Geometry.
inherited
within(Geometry g) bool
Tests whether this geometry is within the specified geometry.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited