geos::geom::CoordinateList Class Reference

A list of `Coordinate`s, which may be set to prevent repeated coordinates from occurring in the list. More...

`#include <CoordinateList.h>`

## Public Types

typedef std::list< Coordinate >::iterator | iterator
typedef std::list< Coordinate >::const_iterator | const_iterator

## Public Member Functions

template<typename T>
| CoordinateList (const T &v)
| Constructs a new list from an array of Coordinates, allowing repeated points.
| CoordinateList (const CoordinateSequence &v)
size_t | size () const
bool | empty () const
iterator | begin ()
iterator | end ()
const_iterator | begin () const
const_iterator | end () const
iterator | insert (iterator pos, const Coordinate &c, bool allowRepeated)
| Inserts the specified coordinate at the specified position in this list.
iterator | add (const Coordinate &c, bool allowRepeated)
iterator | insert (iterator pos, const Coordinate &c)
iterator | erase (iterator pos)
iterator | erase (iterator first, iterator last)
std::unique_ptr< Coordinate::Vect > | toCoordinateArray () const
std::unique_ptr< geom::CoordinateSequence > | toCoordinateSequence () const
void | closeRing ()

## Static Public Member Functions

static void | closeRing (std::vector< Coordinate > &coords)

## Friends

std::ostream & | operator<< (std::ostream &os, const CoordinateList &cl)

## Detailed Description

A list of `Coordinate`s, which may be set to prevent repeated coordinates from occurring in the list.

Use this class when fast insertions and removal at arbitrary position is needed. The class keeps ownership of the Coordinates.

## Constructor & Destructor Documentation

## CoordinateList()

template<typename T>

geos::geom::CoordinateList::CoordinateList | ( | const T & | v | ) |

inline

Constructs a new list from an array of Coordinates, allowing repeated points.

(I.e. this constructor produces a `CoordinateList` with exactly the same set of points as the input array.)

Parameters

  v | the initial coordinates

## Member Function Documentation

## insert()

iterator geos::geom::CoordinateList::insert | ( | iterator | pos,
|  | const Coordinate & | c,
|  | bool | allowRepeated )

inline

Inserts the specified coordinate at the specified position in this list.

Parameters

  pos | the position at which to insert
  c | the coordinate to insert
  allowRepeated | if set to false, repeated coordinates are collapsed

Returns
  an iterator to the newly installed coordinate (or previous, if equal and repeated are not allowed)

NOTE: when allowRepeated is false next point is not checked this matches JTS behavior

The documentation for this class was generated from the following file:

- CoordinateList.h