GEOS
3.9.2
|
The default implementation of CoordinateSequence. More...
#include <CoordinateArraySequence.h>
Public Member Functions | |
CoordinateArraySequence (const CoordinateArraySequence &cl) | |
CoordinateArraySequence (const CoordinateSequence &cl) | |
std::unique_ptr < CoordinateSequence > | clone () const override |
Returns a deep copy of this collection. | |
const Coordinate & | getAt (std::size_t pos) const override |
Returns a read-only reference to Coordinate at position i. More... | |
void | getAt (std::size_t i, Coordinate &c) const override |
Copy Coordinate at position i to Coordinate c. | |
size_t | getSize () const override |
Returns the number of Coordinates (actual or otherwise, as this implementation may not store its data in Coordinate objects). | |
void | toVector (std::vector< Coordinate > &) const override |
CoordinateArraySequence () | |
Construct an empty sequence. | |
CoordinateArraySequence (std::vector< Coordinate > &&coords, std::size_t dimension=0) | |
Construct sequence moving from given Coordinate vector. | |
CoordinateArraySequence (std::vector< Coordinate > *coords, std::size_t dimension=0) | |
Construct sequence taking ownership of given Coordinate vector. | |
CoordinateArraySequence (std::size_t n, std::size_t dimension=0) | |
Construct sequence allocating space for n coordinates. | |
bool | isEmpty () const override |
Returns true it list contains no coordinates. | |
bool | empty () const |
void | clear () |
Reset this CoordinateArraySequence to the empty state. | |
void | add (const Coordinate &c) |
Add a Coordinate to the list. | |
void | add (const Coordinate &c, bool allowRepeated) |
Add a coordinate. More... | |
void | add (std::size_t i, const Coordinate &coord, bool allowRepeated) |
Inserts the specified coordinate at the specified position in this list. More... | |
void | add (const CoordinateSequence *cl, bool allowRepeated, bool direction) |
void | setAt (const Coordinate &c, std::size_t pos) override |
Copy Coordinate c to position pos. | |
void | setPoints (const std::vector< Coordinate > &v) override |
Substitute Coordinate list with a copy of the given vector. | |
void | setOrdinate (std::size_t index, std::size_t ordinateIndex, double value) override |
void | expandEnvelope (Envelope &env) const override |
std::size_t | getDimension () const override |
void | apply_rw (const CoordinateFilter *filter) override |
void | apply_ro (CoordinateFilter *filter) const override |
![]() | |
const Coordinate & | back () const |
Return last Coordinate in the sequence. | |
const Coordinate & | front () const |
Return first Coordinate in the sequence. | |
const Coordinate & | operator[] (std::size_t i) const |
virtual Envelope | getEnvelope () const |
size_t | size () const |
std::string | toString () const |
Get a string representation of CoordinateSequence. | |
bool | hasRepeatedPoints () const |
Returns true if contains any two consecutive points. | |
const Coordinate * | minCoordinate () const |
Returns lower-left Coordinate in list. | |
bool | hasZ () const |
virtual double | getOrdinate (std::size_t index, std::size_t ordinateIndex) const |
virtual double | getX (std::size_t index) const |
virtual double | getY (std::size_t index) const |
template<class T > | |
void | applyCoordinateFilter (T &f) |
Apply a filter to each Coordinate of this sequence. The filter is expected to provide a .filter(Coordinate&) method. More... | |
Additional Inherited Members | |
![]() | |
enum | { X, Y, Z, M } |
Standard ordinate index values. | |
typedef std::unique_ptr < CoordinateSequence > | Ptr |
![]() | |
static bool | hasRepeatedPoints (const CoordinateSequence *cl) |
Returns true if given CoordinateSequence contains any two consecutive Coordinate. | |
static CoordinateSequence * | atLeastNCoordinatesOrNothing (std::size_t n, CoordinateSequence *c) |
Returns either the given CoordinateSequence if its length is greater than the given amount, or an empty CoordinateSequence. | |
static size_t | indexOf (const Coordinate *coordinate, const CoordinateSequence *cl) |
static bool | equals (const CoordinateSequence *cl1, const CoordinateSequence *cl2) |
Returns true if the two arrays are identical, both null, or pointwise equal. | |
static void | scroll (CoordinateSequence *cl, const Coordinate *firstCoordinate) |
Scroll given CoordinateSequence so to start with given Coordinate. | |
static int | increasingDirection (const CoordinateSequence &pts) |
Determines which orientation of the Coordinate array is (overall) increasing. More... | |
static bool | isRing (const CoordinateSequence *pts) |
Tests whether an array of Coordinates forms a ring, by checking length and closure. Self-intersection is not checked. More... | |
static void | reverse (CoordinateSequence *cl) |
Reverse Coordinate order in given CoordinateSequence. | |
![]() | |
CoordinateSequence (const CoordinateSequence &) | |
The default implementation of CoordinateSequence.
void geos::geom::CoordinateArraySequence::add | ( | const Coordinate & | c, |
bool | allowRepeated | ||
) |
Add a coordinate.
c | the coordinate to add |
allowRepeated | if set to false, repeated coordinates are collapsed |
void geos::geom::CoordinateArraySequence::add | ( | std::size_t | i, |
const Coordinate & | coord, | ||
bool | allowRepeated | ||
) |
Inserts the specified coordinate at the specified position in this list.
i | the position at which to insert |
coord | the coordinate to insert |
allowRepeated | if set to false, repeated coordinates are collapsed |
|
overridevirtual |
Expands the given Envelope to include the coordinates in the sequence. Allows implementing classes to optimize access to coordinate values.
env | the envelope to expand |
Reimplemented from geos::geom::CoordinateSequence.
|
overridevirtual |
Returns a read-only reference to Coordinate at position i.
Whether or not the Coordinate returned is the actual underlying Coordinate or merely a copy depends on the implementation.
Implements geos::geom::CoordinateSequence.
|
overridevirtual |
Returns the dimension (number of ordinates in each coordinate) for this sequence.
Implements geos::geom::CoordinateSequence.
|
overridevirtual |
Sets the value for a given ordinate of a coordinate in this sequence.
index | the coordinate index in the sequence |
ordinateIndex | the ordinate index in the coordinate (in range [0, dimension-1]) |
value | the new ordinate value |
Implements geos::geom::CoordinateSequence.
|
overridevirtual |
Pushes all Coordinates of this sequence into the provided vector.
This method is a port of the toCoordinateArray() method of JTS.
Implements geos::geom::CoordinateSequence.