22#include <geos/export.h>
23#include <geos/geom/Coordinate.h>
31#pragma warning(disable: 4251)
58 typedef std::list<Coordinate>::iterator iterator;
59 typedef std::list<Coordinate>::const_iterator const_iterator;
61 friend std::ostream& operator<< (std::ostream& os,
75 coords(v.begin(), v.end())
94 return coords.empty();
100 return coords.begin();
112 return coords.begin();
137 if(!allowRepeated && pos != coords.begin()) {
140 if(c.equals2D(*prev)) {
144 return coords.insert(pos, c);
150 return insert(coords.end(), c, allowRepeated);
154 insert(iterator pos,
const Coordinate& c)
156 return coords.insert(pos, c);
162 return coords.erase(pos);
166 erase(iterator first, iterator last)
168 return coords.erase(first, last);
171 std::unique_ptr<Coordinate::Vect>
172 toCoordinateArray()
const
175 ret->assign(coords.begin(), coords.end());
181 if(!coords.empty() && !(*(coords.begin())).equals(*(coords.rbegin()))) {
182 const Coordinate& c = *(coords.begin());
183 coords.insert(coords.end(), c);
188 closeRing(std::vector<Coordinate>& coords)
190 if(!coords.empty() && !(*(coords.begin())).equals(*(coords.rbegin()))) {
191 const Coordinate& c = *(coords.begin());
192 coords.insert(coords.end(), c);
198 std::list<Coordinate> coords;
203operator<< (std::ostream& os,
const CoordinateList& cl)
206 for(CoordinateList::const_iterator
207 it = cl.begin(), end = cl.end();
210 const Coordinate& c = *it;
211 if(it != cl.begin()) {
A list of Coordinates, which may be set to prevent repeated coordinates from occuring in the list.
Definition: CoordinateList.h:54
CoordinateList(const std::vector< Coordinate > &v)
Constructs a new list from an array of Coordinates, allowing repeated points.
Definition: CoordinateList.h:73
iterator insert(iterator pos, const Coordinate &c, bool allowRepeated)
Inserts the specified coordinate at the specified position in this list.
Definition: CoordinateList.h:135
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:58
std::vector< Coordinate > Vect
A vector of Coordinate objects (real object, not pointers)
Definition: Coordinate.h:75
Basic namespace for all GEOS functionalities.
Definition: geos.h:39