15 #ifndef GEOS_GEOM_COORDINATESEQUENCE_H 16 #define GEOS_GEOM_COORDINATESEQUENCE_H 31 class CoordinateFilter;
68 typedef std::unique_ptr<CoordinateSequence>
Ptr;
76 virtual std::unique_ptr<CoordinateSequence> clone()
const = 0;
84 virtual const Coordinate& getAt(std::size_t i)
const = 0;
90 return getAt(size() - 1);
106 virtual Envelope getEnvelope()
const;
111 virtual void getAt(std::size_t i,
Coordinate& c)
const = 0;
117 virtual std::size_t getSize()
const = 0;
129 virtual void toVector(std::vector<Coordinate>& coords)
const = 0;
132 virtual bool isEmpty()
const = 0;
135 virtual void setAt(
const Coordinate& c, std::size_t pos) = 0;
138 std::string toString()
const;
141 virtual void setPoints(
const std::vector<Coordinate>& v) = 0;
144 bool hasRepeatedPoints()
const;
167 static size_t indexOf(
const Coordinate* coordinate,
223 virtual std::size_t getDimension()
const = 0;
226 return getDimension() > 2;
239 virtual double getOrdinate(std::size_t index, std::size_t ordinateIndex)
const;
250 return getOrdinate(index, X);
262 return getOrdinate(index, Y);
274 virtual void setOrdinate(std::size_t index, std::size_t ordinateIndex,
double value) = 0;
283 virtual void expandEnvelope(
Envelope& env)
const;
301 for(std::size_t i = 0, n = size(); i < n; ++i) {
323 #endif // ndef GEOS_GEOM_COORDINATESEQUENCE_H void applyCoordinateFilter(T &f)
Apply a filter to each Coordinate of this sequence. The filter is expected to provide a ...
An Envelope defines a rectangulare region of the 2D coordinate plane.
Coordinate is the lightweight class used to store coordinates.
const Coordinate & back() const
Return last Coordinate in the sequence.
virtual double getY(std::size_t index) const
Geometry classes support the concept of applying a coordinate filter to every coordinate in the Geome...
std::unique_ptr< CoordinateSequence > Ptr
std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
const Coordinate & operator[](std::size_t i) const
virtual ~CoordinateSequence()
Basic namespace for all GEOS functionalities.
bool operator!=(const Coordinate &a, const Coordinate &b)
Inequality operator for Coordinate. 2D only.
CoordinateSequence(const CoordinateSequence &)
The internal representation of a list of coordinates inside a Geometry.
bool operator==(const Coordinate &a, const Coordinate &b)
Equality operator for Coordinate. 2D only.
virtual double getX(std::size_t index) const
const Coordinate & front() const
Return first Coordinate in the sequence.