23#include <geos/export.h>
24#include <geos/geom/Geometry.h>
25#include <geos/geom/CoordinateSequence.h>
26#include <geos/geom/Envelope.h>
27#include <geos/geom/Dimension.h>
36#pragma warning(disable: 4251)
42class CoordinateArraySequence;
43class CoordinateSequenceFilter;
84 std::unique_ptr<LineString>
clone()
const
86 return std::unique_ptr<LineString>(cloneImpl());
94 virtual const Coordinate& getCoordinateN(std::size_t n)
const;
129 virtual std::unique_ptr<Point> getPointN(std::size_t n)
const;
143 virtual bool isClosed()
const;
145 virtual bool isRing()
const;
151 virtual bool isCoordinate(
Coordinate& pt)
const;
182 int compareToSameClass(
const Geometry* ls)
const override;
194 std::unique_ptr<LineString>
reverse()
const {
return std::unique_ptr<LineString>(reverseImpl()); }
216 Envelope::Ptr computeEnvelopeInternal()
const override;
218 CoordinateSequence::Ptr points;
221 getSortIndex()
const override
223 return SORTINDEX_LINESTRING;
228 void validateConstruction();
229 void normalizeClosed();
234struct GEOS_DLL LineStringLT {
236 operator()(
const LineString* ls1,
const LineString* ls2)
const
238 return ls1->compareTo(ls2) < 0;
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:41
Interface for classes which provide operations that can be applied to the coordinates in a Coordinate...
Definition: CoordinateSequenceFilter.h:55
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
DimensionType
Definition: Dimension.h:29
Definition: GeometryComponentFilter.h:41
Supplies a set of utility methods for building Geometry objects from CoordinateSequence or other Geom...
Definition: GeometryFactory.h:66
Geometry classes support the concept of applying a Geometry filter to the Geometry.
Definition: GeometryFilter.h:45
Basic implementation of Geometry, constructed and destructed by GeometryFactory.
Definition: Geometry.h:186
Definition: LineString.h:66
void apply_ro(CoordinateSequenceFilter &filter) const override
virtual std::unique_ptr< Point > getStartPoint() const
Return the start point of the LineString or NULL if this is an EMPTY LineString.
std::unique_ptr< Geometry > getBoundary() const override
Returns a MultiPoint. Empty for closed LineString, a Point for each vertex otherwise.
LineString * reverseImpl() const override
Make a geometry with coordinates in reverse order.
LineString(CoordinateSequence *pts, const GeometryFactory *newFactory)
Constructs a LineString taking ownership the given CoordinateSequence.
void normalize() override
Normalizes a LineString.
std::unique_ptr< CoordinateSequence > getCoordinates() const override
Returns this Geometry vertices. Caller takes ownership of the returned object.
const Coordinate * getCoordinate() const override
Returns a vertex of this Geometry, or NULL if this is the empty geometry.
bool isEmpty() const override
Returns whether or not the set of points in this Geometry is empty.
Dimension::DimensionType getDimension() const override
Returns line dimension (1)
LineString * cloneImpl() const override
Make a deep-copy of this Geometry.
Definition: LineString.h:212
GeometryTypeId getGeometryTypeId() const override
Return an integer representation of this Geometry type.
std::unique_ptr< LineString > reverse() const
Definition: LineString.h:194
virtual std::unique_ptr< Point > getEndPoint() const
Return the end point of the LineString or NULL if this is an EMPTY LineString.
std::vector< const LineString * > ConstVect
A vector of const LineString pointers.
Definition: LineString.h:73
void apply_rw(CoordinateSequenceFilter &filter) override
std::unique_ptr< CoordinateSequence > releaseCoordinates()
Take ownership of the CoordinateSequence managed by this geometry. After releasing the coordinates,...
LineString(CoordinateSequence::Ptr &&pts, const GeometryFactory &newFactory)
Hopefully cleaner version of the above.
double getLength() const override
Returns the length of this Geometry.
int getBoundaryDimension() const override
Returns Dimension::False for a closed LineString, 0 otherwise (LineString boundary is a MultiPoint)
std::string getGeometryType() const override
Return a string representation of this Geometry type.
bool equalsExact(const Geometry *other, double tolerance=0) const override
Returns true iff the two Geometrys are of the same type and their vertices corresponding by index are...
const CoordinateSequence * getCoordinatesRO() const
Returns a read-only pointer to internal CoordinateSequence.
uint8_t getCoordinateDimension() const override
Returns coordinate dimension.
std::size_t getNumPoints() const override
Returns the count of this Geometrys vertices.
std::unique_ptr< LineString > clone() const
Creates and returns a full copy of this LineString object (including all coordinates contained by it)
Definition: LineString.h:84
GeometryTypeId
Geometry types.
Definition: Geometry.h:73
Basic namespace for all GEOS functionalities.
Definition: geos.h:39