public class LineString<P extends Position> extends Geometry<P> implements Linear<P>, Simple
Geometry consisting of the LineSegments defined by
consecutive pairs of Points of a PointSequence.| Modifier | Constructor and Description |
|---|---|
|
LineString(CoordinateReferenceSystem<P> crs) |
protected |
LineString(LineString<P> base)
This constructor has been added to speed up object creation of LinearRings
|
|
LineString(PositionSequence<P> positions,
CoordinateReferenceSystem<P> crs)
Constructs a
LineString from the specified positions
and CoordinateReferenceSystem. |
| Modifier and Type | Method and Description |
|---|---|
void |
accept(GeometryVisitor<P> visitor)
Accepts a
GeometryVisitor. |
<Q extends Position> |
as(Class<Q> castToType) |
int |
getDimension()
Returns the topological dimension of this instance.
|
P |
getEndPosition()
Returns the last
Position of this LineString. |
GeometryType |
getGeometryType()
Returns the type of this
Geometry. |
P |
getStartPosition()
Returns the first
Position of this LineString. |
boolean |
isClosed()
Checks whether this
LineString is closed, i.e. |
boolean |
isRing()
Checks whether this
LineString is a ring, i.e. |
checkCast, equals, forceToCrs, forceToCrs, getBoundingBox, getCoordinateDimension, getCoordinateReferenceSystem, getCrs, getEnvelope, getNumPositions, getPositionClass, getPositionN, getPositions, getSRID, hashCode, hasM, hasZ, isEmpty, nestPositionSequences, toCrs, toString, writeReplacepublic LineString(CoordinateReferenceSystem<P> crs)
protected LineString(LineString<P> base)
base - public LineString(PositionSequence<P> positions, CoordinateReferenceSystem<P> crs)
LineString from the specified positions
and CoordinateReferenceSystem.positions - the PositionSequence that determines the geometryIllegalArgumentException - if the passed PointSequence is non-empty and of size less than 2public P getStartPosition()
Position of this LineString.getStartPosition in interface Linear<P extends Position>Position of this LineString.public P getEndPosition()
Position of this LineString.getEndPosition in interface Linear<P extends Position>Position of this LineString.public boolean isClosed()
LineString is closed, i.e. the first Point equals the last.LineString is closed.public boolean isRing()
LineString is a ring, i.e. is closed and non-empty.
Note that this implementation allows rings thate are non-simple.
LineString is a ring.public int getDimension()
GeometryGeometries.getDimension in class Geometry<P extends Position>public GeometryType getGeometryType()
GeometryGeometry.getGeometryType in class Geometry<P extends Position>GeometryType of this instance.public void accept(GeometryVisitor<P> visitor)
GeometryGeometryVisitor.
If this Geometry instance is a GeometryCollection then it will pass the
visitor to its contained Geometries.
Copyright © 2023 geolatte.org. All rights reserved.