public class LineString<P extends Position> extends Geometry<P> implements Linear<P>, Simple
Geometry
consisting of the LineSegment
s defined by
consecutive pairs of Point
s 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 ProjectedGeometryOperations implementation. |
Modifier and Type | Method and Description |
---|---|
void |
accept(GeometryVisitor<P> visitor)
Accepts a
GeometryVisitor . |
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. |
equals, forceToCrs, getCoordinateDimension, getCoordinateReferenceSystem, getCrs, getEnvelope, getNumPositions, getPositionClass, getPositionN, getPositions, getSRID, hashCode, isEmpty, nestPositionSequences, toString
public LineString(CoordinateReferenceSystem<P> crs)
protected LineString(LineString<P> base)
base
- public LineString(PositionSequence<P> positions, CoordinateReferenceSystem<P> crs)
LineString
from the specified positions
and ProjectedGeometryOperations
implementation.positions
- the PositionSequence
that determines this geometryIllegalArgumentException
- if the passed PointSequence
is non-empty and of size < 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()
Geometry
Geometries
.getDimension
in class Geometry<P extends Position>
public GeometryType getGeometryType()
Geometry
Geometry
.getGeometryType
in class Geometry<P extends Position>
GeometryType
of this instance.Copyright © 2015 geolatte.org. All rights reserved.