geos::geom::LineString Class Reference

`#include <LineString.h>`

Inheritance diagram for geos::geom::LineString:

## Public Types

typedef std::vector< const LineString * > | ConstVect
| A vector of const LineString pointers.

## Public Member Functions

std::unique_ptr< LineString > | clone () const
| Creates and returns a full copy of this `LineString` object (including all coordinates contained by it).
std::string | getGeometryType () const override
| Return a string representation of this Geometry type.
GeometryTypeId | getGeometryTypeId () const override
| Return an integer representation of this Geometry type.
double | getLength () const override
| Returns the length of this Geometry.
bool | isCurved () const override
std::unique_ptr< LineString > | reverse () const

## Protected Member Functions

| LineString (const LineString &ls)
| LineString (CoordinateSequence::Ptr &&pts, const GeometryFactory &newFactory)
| Constructs a LineString taking ownership the given CoordinateSequence.
LineString * | cloneImpl () const override
| Make a deep-copy of this Geometry.
LineString * | reverseImpl () const override
| Make a geometry with coordinates in reverse order.
int | getSortIndex () const override
void | geometryChangedAction () override
| Notifies this Geometry that its Coordinates have been changed by an external party.

## Friends

class | GeometryFactory

## Detailed Description

Models an OGC-style `LineString`.

A LineString consists of a sequence of two or more vertices, along with all points along the linearly-interpolated curves (line segments) between each pair of consecutive vertices. Consecutive vertices may be equal. The line segments in the line may intersect each other (in other words, the linestring may "curl back" in itself and self-intersect). Linestrings with exactly two identical points are invalid.

A linestring must have either 0 or 2 or more points. If these conditions are not met, the constructors throw an `util::IllegalArgumentException`.

## Member Function Documentation

## clone()

std::unique_ptr< LineString > geos::geom::LineString::clone | ( |  | ) | const

inline

Creates and returns a full copy of this `LineString` object (including all coordinates contained by it).

Returns
  A clone of this instance

References cloneImpl().

## cloneImpl()

LineString * geos::geom::LineString::cloneImpl | ( |  | ) | const

inline override protected virtual

Make a deep-copy of this Geometry.

Implements geos::geom::Geometry.

Referenced by clone().

## geometryChangedAction()

void geos::geom::LineString::geometryChangedAction | ( |  | ) |

inline override protected virtual

Notifies this Geometry that its Coordinates have been changed by an external party.

Implements geos::geom::Geometry.

## getGeometryType()

std::string geos::geom::LineString::getGeometryType | ( |  | ) | const

override virtual

Return a string representation of this Geometry type.

Implements geos::geom::Geometry.

## getGeometryTypeId()

GeometryTypeId geos::geom::LineString::getGeometryTypeId | ( |  | ) | const

override virtual

Return an integer representation of this Geometry type.

Implements geos::geom::Geometry.

## getLength()

double geos::geom::LineString::getLength | ( |  | ) | const

override virtual

Returns the length of this Geometry.

Reimplemented from geos::geom::Geometry.

## getSortIndex()

int geos::geom::LineString::getSortIndex | ( |  | ) | const

inline override protected virtual

Implements geos::geom::Geometry.

## reverse()

std::unique_ptr< LineString > geos::geom::LineString::reverse | ( |  | ) | const

inline

Creates a LineString whose coordinates are in the reverse order of this object's

Returns
  a LineString with coordinates in the reverse order

References reverseImpl().

## reverseImpl()

LineString * geos::geom::LineString::reverseImpl | ( |  | ) | const

override protected virtual

Make a geometry with coordinates in reverse order.

Implements geos::geom::Geometry.

Referenced by reverse().

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

- LineString.h