GEOS  3.14.0dev
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
geos::geom::LineString Class Reference

#include <LineString.h>

Inheritance diagram for geos::geom::LineString:
geos::geom::LinearRing

Public Types

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

Public Member Functions

std::unique_ptr< LineStringclone () const
 Creates and returns a full copy of this LineString object (including all coordinates contained by it) More...
 
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< LineStringreverse () const
 

Protected Member Functions

 LineString (const LineString &ls)
 
 LineString (CoordinateSequence::Ptr &&pts, const GeometryFactory &newFactory)
 Constructs a LineString taking ownership the given CoordinateSequence.
 
LineStringcloneImpl () const override
 Make a deep-copy of this Geometry.
 
LineStringreverseImpl () 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

◆ 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

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