22 #include <geos/export.h>
23 #include <geos/geom/Coordinate.h>
24 #include <geos/geom/CoordinateSequence.h>
25 #include <geos/util.h>
33 #pragma warning(disable: 4251)
60 typedef std::list<Coordinate>::iterator iterator;
61 typedef std::list<Coordinate>::const_iterator const_iterator;
63 friend std::ostream& operator<< (std::ostream& os,
78 coords(v.begin(), v.end())
102 return coords.empty();
108 return coords.begin();
120 return coords.begin();
145 if(!allowRepeated && pos != coords.begin()) {
148 if(c.equals2D(*prev)) {
152 return coords.insert(pos, c);
158 return insert(coords.end(), c, allowRepeated);
162 insert(iterator pos,
const Coordinate& c)
164 return coords.insert(pos, c);
170 return coords.erase(pos);
174 erase(iterator first, iterator last)
176 return coords.erase(first, last);
179 std::unique_ptr<Coordinate::Vect>
180 toCoordinateArray()
const
183 ret->assign(coords.begin(), coords.end());
187 std::unique_ptr<geom::CoordinateSequence>
188 toCoordinateSequence()
const
190 auto ret = detail::make_unique<geom::CoordinateSequence>();
191 ret->add(begin(), end());
198 if(!coords.empty() && !(*(coords.begin())).equals(*(coords.rbegin()))) {
199 const Coordinate& c = *(coords.begin());
200 coords.insert(coords.end(), c);
205 closeRing(std::vector<Coordinate>& coords)
207 if(!coords.empty() && !(*(coords.begin())).equals(*(coords.rbegin()))) {
208 const Coordinate& c = *(coords.begin());
209 coords.insert(coords.end(), c);
215 std::list<Coordinate> coords;
220 operator<< (std::ostream& os,
const CoordinateList& cl)
223 for(CoordinateList::const_iterator
224 it = cl.begin(), end = cl.end();
227 const Coordinate& c = *it;
228 if(it != cl.begin()) {
A list of Coordinates, which may be set to prevent repeated coordinates from occurring in the list.
Definition: CoordinateList.h:56
iterator insert(iterator pos, const Coordinate &c, bool allowRepeated)
Inserts the specified coordinate at the specified position in this list.
Definition: CoordinateList.h:143
CoordinateList(const T &v)
Constructs a new list from an array of Coordinates, allowing repeated points.
Definition: CoordinateList.h:76
The internal representation of a list of coordinates inside a Geometry.
Definition: CoordinateSequence.h:56
Coordinate is the lightweight class used to store coordinates.
Definition: Coordinate.h:217
std::vector< Coordinate > Vect
A vector of Coordinate objects (real object, not pointers)
Definition: Coordinate.h:235
Basic namespace for all GEOS functionalities.
Definition: Angle.h:25