GEOS 3.11.1
|
The internal representation of a list of coordinates inside a Geometry. More...
#include <geos.h>
Public Types | |
enum | { X , Y , Z , M } |
Standard ordinate index values. | |
typedef std::unique_ptr< CoordinateSequence > | Ptr |
Public Member Functions | |
virtual std::unique_ptr< CoordinateSequence > | clone () const =0 |
Returns a deep copy of this collection. More... | |
virtual const Coordinate & | getAt (std::size_t i) const =0 |
Returns a read-only reference to Coordinate at position i. More... | |
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 |
virtual void | getAt (std::size_t i, Coordinate &c) const =0 |
Write Coordinate at position i to given Coordinate. More... | |
virtual std::size_t | getSize () const =0 |
Returns the number of Coordinates (actual or otherwise, as this implementation may not store its data in Coordinate objects). More... | |
size_t | size () const |
virtual void | toVector (std::vector< Coordinate > &coords) const =0 |
virtual bool | isEmpty () const =0 |
Returns true it list contains no coordinates. More... | |
virtual void | setAt (const Coordinate &c, std::size_t pos)=0 |
Copy Coordinate c to position pos. More... | |
std::string | toString () const |
Get a string representation of CoordinateSequence. | |
virtual void | setPoints (const std::vector< Coordinate > &v)=0 |
Substitute Coordinate list with a copy of the given vector. More... | |
bool | hasRepeatedPoints () const |
Returns true if contains any two consecutive points. | |
const Coordinate * | minCoordinate () const |
Returns lower-left Coordinate in list. | |
bool | isRing () const |
Tests whether an a CoordinateSequence forms a ring, by checking length and closure. Self-intersection is not checked. More... | |
virtual std::size_t | getDimension () const =0 |
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 |
virtual void | setOrdinate (std::size_t index, std::size_t ordinateIndex, double value)=0 |
virtual void | expandEnvelope (Envelope &env) const |
virtual void | apply_rw (const CoordinateFilter *filter)=0 |
virtual void | apply_ro (CoordinateFilter *filter) const =0 |
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... | |
Static Public Member Functions | |
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 std::size_t | indexOf (const Coordinate *coordinate, const CoordinateSequence *cl) |
Return position of a Coordinate. More... | |
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 void | reverse (CoordinateSequence *cl) |
Reverse Coordinate order in given CoordinateSequence. | |
Protected Member Functions | |
CoordinateSequence (const CoordinateSequence &) | |
The internal representation of a list of coordinates inside a Geometry.
|
inline |
Apply a filter to each Coordinate of this sequence. The filter is expected to provide a .filter(Coordinate&) method.
TODO: accept a Functor instead, will be more flexible. actually, define iterators on Geometry
|
pure virtual |
Returns a deep copy of this collection.
Implemented in geos::geom::CoordinateArraySequence.
|
virtual |
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 in geos::geom::CoordinateArraySequence.
|
pure virtual |
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.
Implemented in geos::geom::CoordinateArraySequence.
|
pure virtual |
Write Coordinate at position i to given Coordinate.
Implemented in geos::geom::CoordinateArraySequence.
|
pure virtual |
Returns the dimension (number of ordinates in each coordinate) for this sequence.
Implemented in geos::geom::CoordinateArraySequence.
|
virtual |
Returns the ordinate of a coordinate in this sequence. Ordinate indices 0 and 1 are assumed to be X and Y. Ordinates indices greater than 1 have user-defined semantics (for instance, they may contain other dimensions or measure values).
index | the coordinate index in the sequence |
ordinateIndex | the ordinate index in the coordinate (in range [0, dimension-1]) |
|
pure virtual |
Returns the number of Coordinates (actual or otherwise, as this implementation may not store its data in Coordinate objects).
Implemented in geos::geom::CoordinateArraySequence.
|
inlinevirtual |
Returns ordinate X (0) of the specified coordinate.
index |
|
inlinevirtual |
Returns ordinate Y (1) of the specified coordinate.
index |
|
static |
Determines which orientation of the Coordinate
array is (overall) increasing.
In other words, determines which end of the array is "smaller" (using the standard ordering on Coordinate
). Returns an integer indicating the increasing direction. If the sequence is a palindrome, it is defined to be oriented in a positive direction.
pts | the array of Coordinates to test |
1
if the array is smaller at the start or is a palindrome, -1
if smaller at the endNOTE: this method is found in CoordinateArrays class for JTS
|
static |
Return position of a Coordinate.
or numeric_limits<std::size_t>::max() if not found
|
pure virtual |
Returns true
it list contains no coordinates.
Implemented in geos::geom::CoordinateArraySequence.
bool geos::geom::CoordinateSequence::isRing | ( | ) | const |
Tests whether an a CoordinateSequence
forms a ring, by checking length and closure. Self-intersection is not checked.
|
pure virtual |
Copy Coordinate c to position pos.
Implemented in geos::geom::CoordinateArraySequence.
|
pure virtual |
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 |
Implemented in geos::geom::CoordinateArraySequence.
|
pure virtual |
Substitute Coordinate list with a copy of the given vector.
Implemented in geos::geom::CoordinateArraySequence.
|
pure virtual |
Pushes all Coordinates of this sequence into the provided vector.
This method is a port of the toCoordinateArray() method of JTS.
Implemented in geos::geom::CoordinateArraySequence.