# geos::geom::LineString Class Reference

Basic implementation of LineString. More...

`#include <geos.h>`

Inheritance diagram for geos::geom::LineString:

List of all members.

## Public Types

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

## Public Member Functions

virtual Geometry * | clone () const
virtual CoordinateSequence * | getCoordinates () const
| Returns this Geometry vertices. Caller takes ownership of the returned object.
const CoordinateSequence * | getCoordinatesRO () const
| Returns a read-only pointer to internal CoordinateSequence.
virtual const Coordinate & | getCoordinateN (int n) const
virtual Dimension::DimensionType | getDimension () const
| Returns line dimension (1)
virtual int | getBoundaryDimension () const
| Returns Dimension::False for a closed LineString, 0 otherwise (LineString boundary is a MultiPoint)
virtual Geometry * | getBoundary () const
| Returns a MultiPoint. Empty for closed LineString, a Point for each vertex otherwise.
virtual bool | isEmpty () const
| Returns whether or not the set of points in this Geometry is empty.
virtual size_t | getNumPoints () const
| Returns the count of this Geometrys vertices.
virtual Point * | getPointN (size_t n) const
virtual Point * | getStartPoint () const
| Return the start point of the LineString or NULL if this is an EMPTY LineString.
virtual Point * | getEndPoint () const
| Return the end point of the LineString or NULL if this is an EMPTY LineString.
virtual bool | isClosed () const
virtual bool | isRing () const
virtual std::string | getGeometryType () const
| Return a string representation of this Geometry type.
virtual GeometryTypeId | getGeometryTypeId () const
| Return an integer representation of this Geometry type.
virtual bool | isCoordinate (Coordinate &pt) const
virtual bool | equalsExact (const Geometry *other, double tolerance=0) const
| Returns true if the two Geometrys are exactly equal, up to a specified tolerance.
virtual void | apply_rw (const CoordinateFilter *filter)
virtual void | apply_ro (CoordinateFilter *filter) const
virtual void | apply_rw (GeometryFilter *filter)
virtual void | apply_ro (GeometryFilter *filter) const
virtual void | apply_rw (GeometryComponentFilter *filter)
virtual void | apply_ro (GeometryComponentFilter *filter) const
void | apply_rw (CoordinateSequenceFilter &filter)
void | apply_ro (CoordinateSequenceFilter &filter) const
virtual void | normalize ()
| Normalizes a LineString.
virtual int | compareToSameClass (const Geometry *ls) const
virtual const Coordinate * | getCoordinate () const
| Returns a vertex of this Geometry, or NULL if this is the empty geometry.
virtual double | getLength () const
| Returns the length of this Geometry.
Geometry * | reverse () const

## Protected Member Functions

| LineString (const LineString &ls)
| LineString (CoordinateSequence *pts, const GeometryFactory *newFactory)
| Constructs a LineString taking ownership the given CoordinateSequence.
| LineString (CoordinateSequence::AutoPtr pts, const GeometryFactory *newFactory)
| Hopefully cleaner version of the above.
Envelope::AutoPtr | computeEnvelopeInternal () const

## Protected Attributes

CoordinateSequence::AutoPtr | points

## Friends

class | GeometryFactory

## Detailed Description

Basic implementation of LineString.

## Member Function Documentation

void geos::geom::LineString::apply_ro | ( | CoordinateSequenceFilter & | filter ) | const`[virtual]`

Performs a read-only operation on the coordinates in this Geometry's CoordinateSequences.

Parameters:

  filter | the filter to apply

Implements geos::geom::Geometry.

void geos::geom::LineString::apply_rw | ( | CoordinateSequenceFilter & | filter ) | `[virtual]`

Performs an operation on the coordinates in this Geometry's CoordinateSequences.s If the filter reports that a coordinate value has been changed, geometryChanged will be called automatically.

Parameters:

  filter | the filter to apply

Implements geos::geom::Geometry.

Geometry * geos::geom::LineString::clone | ( | ) | const`[inline, virtual]`

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

Returns:
  a clone of this instance

Implements geos::geom::Geometry.

Reimplemented in geos::geom::LinearRing.

virtual void geos::geom::LineString::normalize | ( | ) | `[virtual]`

Normalizes a LineString.

A normalized linestring has the first point which is not equal to it's reflected point less than the reflected point.

Implements geos::geom::Geometry.

Geometry* geos::geom::LineString::reverse | ( | ) | const

Creates a LineString whose coordinates are in the reverse order of this objects

Returns:
  a LineString with coordinates in the reverse order

Reimplemented in geos::geom::LinearRing.

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

- LineString.h