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
182 std::unique_ptr<Coordinate::Vect> ret(
new Coordinate::Vect);
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;
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