LinearRing class
Models an OGC SFS LinearRing
.
A LinearRing
is a {@link LineString} which is both closed and simple.
In other words,
the first and last coordinate in the ring must be equal,
and the interior of the ring must not self-intersect.
Either orientation of the ring is allowed.
A ring must have either 0 or 4 or more points. The first and last points must be equal (in 2D). If these conditions are not met, the constructors throw an {@link IllegalArgumentException}
@version 1.7
- Inheritance
-
- Object
- Geometry
- LineString
- LinearRing
Constructors
-
LinearRing(List<
Coordinate> points, PrecisionModel precisionModel, int SRID) -
Constructs a
LinearRing
with the given points. - LinearRing.fromSequence(CoordinateSequence? points, GeometryFactory factory)
-
Constructs a
LinearRing
with the vertices specified by the given {@link CoordinateSequence}. -
LinearRing.withFactory(List<
Coordinate> points, GeometryFactory factory) - This method is ONLY used to avoid deprecation warnings. @param points @param factory @throws IllegalArgumentException if the ring is not closed, or has too few points
Properties
- 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
- points ↔ CoordinateSequence
-
The points of this
LineString
.getter/setter pairinherited - 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).inherited -
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.inherited -
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.
inherited
-
applyGF(
GeometryFilter filter) → void -
Performs an operation with or on this
Geometry
and its subelementGeometry
s (if any). Only GeometryCollections and subclasses have subelement Geometry's.inherited -
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 LineString} object.
(including all coordinates contained by it).
inherited
-
compare(
List a, List b) → int -
Returns the first non-zero result of
compareTo
encountered as the twoCollection
s 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. Ifb
completes beforea
, 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 anotherGeometry
.inherited -
compareToSameClass(
Object o) → int -
Returns whether this
Geometry
is greater than, equal to, or less than anotherGeometry
having the same class.inherited -
compareToSameClassWithComparator(
Object o, Comparator< CoordinateSequence> comp) → int -
Returns whether this
Geometry
is greater than, equal to, or less than anotherGeometry
of the same class. using the given {@link CoordinateSequenceComparator}.inherited -
compareToWithComparator(
Object o, Comparator< CoordinateSequence> comp) → int -
Returns whether this
Geometry
is greater than, equal to, or less than anotherGeometry
, using the given {@link CoordinateSequenceComparator}.inherited -
computeEnvelopeInternal(
) → Envelope -
Returns the minimum and maximum x and y values in this
Geometry
, or a nullEnvelope
if thisGeometry
is empty. UnlikegetEnvelopeInternal
, this method calculates theEnvelope
each time it is called;getEnvelopeInternal
caches the result of this method.inherited -
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 theGeometry
. This obviously applies only toGeometry
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(
) → LinearRing -
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 thisGeometry
that are not contained in theother
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 anotherGeometry
.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
Geometry
s are exactly equal. Two Geometries are exactly equal iff:inherited -
equalsExactWithTol(
Geometry other, double tolerance) → bool -
Returns true if the two
Geometry
s are exactly equal, up to a specified distance tolerance. Two Geometries are exactly equal within a distance tolerance if and only if:inherited -
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 argumentObject
is not aGeometry
, the result isfalse
. 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.0inherited -
getBoundary(
) → Geometry -
Gets the boundary of this geometry.
The boundary of a lineal geometry is always a zero-dimensional geometry (which may be empty).
inherited
-
getBoundaryDimension(
) → int -
Returns
Dimension.FALSE
, since by definition LinearRings do not have a 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.inherited -
getCoordinateN(
int n) → Coordinate -
inherited
-
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.
inherited
-
getCoordinateSequence(
) → CoordinateSequence -
inherited
-
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}.
inherited
-
getEndPoint(
) → Point? -
inherited
-
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 emptyEnvelope
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
LineString
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
Geometry
s vertices. TheGeometry
s contained by compositeGeometry
s must be Geometry's; that is, they must implementgetNumPoints
inherited -
getPointN(
int n) → Point -
inherited
-
getPrecisionModel(
) → PrecisionModel -
Returns the
PrecisionModel
used by theGeometry
.inherited -
getSortIndex(
) → int -
override
-
getSRID(
) → int -
Returns the ID of the Spatial Reference System used by the
Geometry
.inherited -
getStartPoint(
) → Point? -
inherited
-
getUserData(
) → Object? -
Gets the user data object for this geometry, if any.
inherited
-
init(
CoordinateSequence? points) → void -
inherited
-
intersection(
Geometry other) → Geometry -
Computes a
Geometry
representing the point-set which is common to both thisGeometry
and theother
Geometry.inherited -
intersects(
Geometry g) → bool -
Tests whether this geometry intersects the argument geometry.
inherited
-
isClosed(
) → bool -
Tests whether this ring is closed.
Empty rings are closed by definition.
override
-
isCoordinate(
Coordinate pt) → bool -
Returns true if the given point is a vertex of this
LineString
.inherited -
isEmpty(
) → bool -
Tests whether the set of points covered by this
Geometry
is empty.inherited -
isEquivalentClass(
Geometry other) → bool -
Returns whether the two
Geometry
s are equal, from the point of view of theequalsExact
method. Called byequalsExact
. In general, twoGeometry
classes are considered to be "equivalent" only if they are the same class. An exception isLineString
, 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
-
isRing(
) → bool -
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.
inherited
-
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 -
Normalizes a LineString. A normalized linestring
has the first point which is not equal to it's reflected point
less than the reflected point.
inherited
-
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
Geometry
s.inherited -
relateWithPattern(
Geometry g, String intersectionPattern) → bool -
Tests whether the elements in the DE-9IM
{@link IntersectionMatrix} for the two
Geometry
s match the elements inintersectionPattern
. The pattern is a 9-character string, with symbols drawn from the following set:inherited -
reverse(
) → Geometry -
Creates a {@link LineString} whose coordinates are in the reverse
order of this objects
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 thisGeometry
which are not contained in theother
Geometry, with the points in theother
Geometry not contained in thisGeometry
. 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 thisGeometry
and theother
Geometry.inherited -
validateConstruction(
) → void -
within(
Geometry g) → bool -
Tests whether this geometry is within the
specified geometry.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- MINIMUM_VALID_SIZE → int
-
The minimum number of vertices allowed in a valid non-empty ring (= 4).
Empty rings with 0 vertices are also valid.
final