17#include <geos/export.h>
19#include <geos/geom/Coordinate.h>
29class CoordinateFilter;
54 typedef std::unique_ptr<CoordinateSequence> Ptr;
62 virtual std::unique_ptr<CoordinateSequence>
clone()
const = 0;
76 return getAt(size() - 1);
87 operator[](std::size_t i)
const
92 virtual Envelope getEnvelope()
const;
115 virtual void toVector(std::vector<Coordinate>& coords)
const = 0;
127 virtual void setPoints(
const std::vector<Coordinate>& v) = 0;
209 return getDimension() > 2;
222 virtual double getOrdinate(std::size_t index, std::size_t ordinateIndex)
const;
233 return getOrdinate(index, X);
245 return getOrdinate(index, Y);
257 virtual void setOrdinate(std::size_t index, std::size_t ordinateIndex,
double value) = 0;
284 for(std::size_t i = 0, n = size(); i < n; ++i) {
293GEOS_DLL std::ostream& operator<< (std::ostream& os,
const CoordinateSequence& cs);
295GEOS_DLL
bool operator== (
const CoordinateSequence& s1,
const CoordinateSequence& s2);
297GEOS_DLL
bool operator!= (
const CoordinateSequence& s1,
const CoordinateSequence& s2);
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
Definition: CoordinateFilter.h:41
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:44
virtual bool isEmpty() const =0
Returns true it list contains no coordinates.
static void reverse(CoordinateSequence *cl)
Reverse Coordinate order in given CoordinateSequence.
virtual std::size_t getSize() const =0
Returns the number of Coordinates (actual or otherwise, as this implementation may not store its data...
const Coordinate & front() const
Return first Coordinate in the sequence.
Definition: CoordinateSequence.h:81
virtual void getAt(std::size_t i, Coordinate &c) const =0
Write Coordinate at position i to given Coordinate.
static bool hasRepeatedPoints(const CoordinateSequence *cl)
Returns true if given CoordinateSequence contains any two consecutive Coordinate.
virtual void setAt(const Coordinate &c, std::size_t pos)=0
Copy Coordinate c to position pos.
virtual double getX(std::size_t index) const
Definition: CoordinateSequence.h:231
virtual double getY(std::size_t index) const
Definition: CoordinateSequence.h:243
virtual double getOrdinate(std::size_t index, std::size_t ordinateIndex) const
static std::size_t indexOf(const Coordinate *coordinate, const CoordinateSequence *cl)
Return position of a Coordinate.
virtual void expandEnvelope(Envelope &env) const
void applyCoordinateFilter(T &f)
Apply a filter to each Coordinate of this sequence. The filter is expected to provide a ....
Definition: CoordinateSequence.h:281
virtual void setOrdinate(std::size_t index, std::size_t ordinateIndex, double value)=0
const Coordinate & back() const
Return last Coordinate in the sequence.
Definition: CoordinateSequence.h:74
static int increasingDirection(const CoordinateSequence &pts)
Determines which orientation of the Coordinate array is (overall) increasing.
static CoordinateSequence * atLeastNCoordinatesOrNothing(std::size_t n, CoordinateSequence *c)
Returns either the given CoordinateSequence if its length is greater than the given amount,...
virtual std::size_t getDimension() const =0
virtual const Coordinate & getAt(std::size_t i) const =0
Returns a read-only reference to Coordinate at position i.
bool hasRepeatedPoints() const
Returns true if contains any two consecutive points.
virtual void toVector(std::vector< Coordinate > &coords) const =0
bool isRing() const
Tests whether an a CoordinateSequence forms a ring, by checking length and closure....
virtual std::unique_ptr< CoordinateSequence > clone() const =0
Returns a deep copy of this collection.
std::string toString() const
Get a string representation of CoordinateSequence.
static void scroll(CoordinateSequence *cl, const Coordinate *firstCoordinate)
Scroll given CoordinateSequence so to start with given Coordinate.
const Coordinate * minCoordinate() const
Returns lower-left Coordinate in list.
virtual void setPoints(const std::vector< Coordinate > &v)=0
Substitute Coordinate list with a copy of the given vector.
static bool equals(const CoordinateSequence *cl1, const CoordinateSequence *cl2)
Returns true if the two arrays are identical, both null, or pointwise equal.
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
An Envelope defines a rectangulare region of the 2D coordinate plane.
Definition: Envelope.h:58
Basic namespace for all GEOS functionalities.
Definition: geos.h:39