# geos::noding::NodedSegmentString Class Reference

Represents a list of contiguous line segments, and supports noding the segments. More...

`#include <NodedSegmentString.h>`

Inheritance diagram for geos::noding::NodedSegmentString:

List of all members.

## Public Member Functions

| NodedSegmentString (geom::CoordinateSequence *newPts, const void *newContext)
SegmentNode * | addIntersectionNode (geom::Coordinate *intPt, size_t segmentIndex)
SegmentNodeList & | getNodeList ()
const SegmentNodeList & | getNodeList () const
virtual unsigned int | size () const
virtual const geom::Coordinate & | getCoordinate (unsigned int i) const
virtual geom::CoordinateSequence * | getCoordinates () const
| Return a pointer to the CoordinateSequence associated with this SegmentString.
virtual bool | isClosed () const
virtual std::ostream & | print (std::ostream &os) const
int | getSegmentOctant (unsigned int index) const
| Gets the octant of the segment starting at vertex index.
void | addIntersections (algorithm::LineIntersector *li, unsigned int segmentIndex, int geomIndex)
| Add {SegmentNode}s for one or both intersections found for a segment of an edge to the edge intersection list.
void | addIntersection (algorithm::LineIntersector *li, unsigned int segmentIndex, int geomIndex, int intIndex)
| Add an SegmentNode for intersection intIndex.
void | addIntersection (const geom::Coordinate &intPt, unsigned int segmentIndex)
| Add an SegmentNode for intersection intIndex.

## Static Public Member Functions

static void | getNodedSubstrings (SegmentString::ConstVect *segStrings, SegmentString::NonConstVect *resultEdgelist)
static void | getNodedSubstrings (const SegmentString::NonConstVect &segStrings, SegmentString::NonConstVect *resultEdgeList)
static SegmentString::NonConstVect * | getNodedSubstrings (const SegmentString::NonConstVect &segStrings)
| Returns allocated object.

## Detailed Description

Represents a list of contiguous line segments, and supports noding the segments.

The line segments are represented by an array of Coordinates. Intended to optimize the noding of contiguous segments by reducing the number of allocated objects. SegmentStrings can carry a context object, which is useful for preserving topological or parentage information. All noded substrings are initialized with the same context object.

## Constructor & Destructor Documentation

geos::noding::NodedSegmentString::NodedSegmentString | ( | geom::CoordinateSequence * | newPts,
|  | const void * | newContext
| ) |  | `[inline]`

Creates a new segment string from a list of vertices.

Parameters:

  newPts | CoordinateSequence representing the string, externally owned
  data | the user-defined data of this segment string (may be null)

## Member Function Documentation

void geos::noding::NodedSegmentString::addIntersection | ( | algorithm::LineIntersector * | li,
|  | unsigned int | segmentIndex,
|  | int | geomIndex,
|  | int | intIndex
| ) |  |

Add an SegmentNode for intersection intIndex.

An intersection that falls exactly on a vertex of the SegmentString is normalized to use the higher of the two possible segmentIndexes

void geos::noding::NodedSegmentString::addIntersection | ( | const geom::Coordinate & | intPt,
|  | unsigned int | segmentIndex
| ) |  |

Add an SegmentNode for intersection intIndex.

An intersection that falls exactly on a vertex of the edge is normalized to use the higher of the two possible segmentIndexes

SegmentNode* geos::noding::NodedSegmentString::addIntersectionNode | ( | geom::Coordinate * | intPt,
|  | size_t | segmentIndex
| ) |  | `[inline]`

Adds an intersection node for a given point and segment to this segment string. If an intersection already exists for this exact location, the existing node will be returned.

Parameters:

  intPt | the location of the intersection
  segmentIndex | the index of the segment containing the intersection

Returns:
  the intersection node for the point

References geos::noding::SegmentNodeList::add().

virtual geom::CoordinateSequence* geos::noding::NodedSegmentString::getCoordinates | ( | ) | const`[virtual]`

Return a pointer to the CoordinateSequence associated with this SegmentString.

Note that the CoordinateSequence is not owned by this SegmentString!

Implements geos::noding::SegmentString.

int geos::noding::NodedSegmentString::getSegmentOctant | ( | unsigned int | index ) | const

Gets the octant of the segment starting at vertex index.

Parameters:

  index | the index of the vertex starting the segment. Must not be the last index in the vertex list

Returns:
  the octant of the segment at the vertex

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

- NodedSegmentString.h