20#ifndef GEOS_GEOM_COORDINATELIST_H
21#define GEOS_GEOM_COORDINATELIST_H
23#include <geos/export.h>
24#include <geos/geom/Coordinate.h>
32#pragma warning(disable: 4251)
59 typedef std::list<Coordinate>::iterator iterator;
60 typedef std::list<Coordinate>::const_iterator const_iterator;
62 friend std::ostream& operator<< (std::ostream& os,
76 coords(v.begin(), v.end())
95 return coords.empty();
101 return coords.begin();
113 return coords.begin();
138 if(!allowRepeated && pos != coords.begin()) {
141 if(c.equals2D(*prev)) {
145 return coords.insert(pos, c);
151 return coords.insert(pos, c);
157 return coords.erase(pos);
161 erase(iterator first, iterator last)
163 return coords.erase(first, last);
166 std::unique_ptr<Coordinate::Vect>
167 toCoordinateArray()
const
169 std::unique_ptr<Coordinate::Vect> ret(
new Coordinate::Vect);
170 ret->assign(coords.begin(), coords.end());
176 if(!coords.empty() && !(*(coords.begin())).equals(*(coords.rbegin()))) {
177 const Coordinate& c = *(coords.begin());
178 coords.insert(coords.end(), c);
185 std::list<Coordinate> coords;
190operator<< (std::ostream& os,
const CoordinateList& cl)
193 for(CoordinateList::const_iterator
194 it = cl.begin(), end = cl.end();
197 const Coordinate& c = *it;
198 if(it != cl.begin()) {
A list of Coordinates, which may be set to prevent repeated coordinates from occuring in the list.
Definition CoordinateList.h:55
CoordinateList(const std::vector< Coordinate > &v)
Constructs a new list from an array of Coordinates, allowing repeated points.
Definition CoordinateList.h:74
iterator insert(iterator pos, const Coordinate &c, bool allowRepeated)
Inserts the specified coordinate at the specified position in this list.
Definition CoordinateList.h:136
Coordinate is the lightweight class used to store coordinates.
Definition Coordinate.h:60
std::ostream & operator<<(std::ostream &os, const Coordinate &c)
Output function.
Basic namespace for all GEOS functionalities.
Definition IndexedNestedRingTester.h:26