GEOS  3.9.1dev
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | List of all members
geos::linearref::LengthIndexOfPoint Class Reference

Computes the length index of the point on a linear Geometry nearest a given Coordinate. More...

#include <LengthIndexOfPoint.h>

Collaboration diagram for geos::linearref::LengthIndexOfPoint:
[legend]

Public Member Functions

 LengthIndexOfPoint (const geom::Geometry *linearGeom)
 
double indexOf (const geom::Coordinate &inputPt) const
 
double indexOfAfter (const geom::Coordinate &inputPt, double minIndex) const
 Finds the nearest index along the linear Geometry to a given Coordinate after the specified minimum index. More...
 

Static Public Member Functions

static double indexOf (const geom::Geometry *linearGeom, const geom::Coordinate &inputPt)
 
static double indexOfAfter (const geom::Geometry *linearGeom, const geom::Coordinate &inputPt, double minIndex)
 

Private Member Functions

double indexOfFromStart (const geom::Coordinate &inputPt, const double minIndex) const
 
double segmentNearestMeasure (const geom::LineSegment *seg, const geom::Coordinate &inputPt, double segmentStartMeasure) const
 

Private Attributes

const geom::GeometrylinearGeom
 

Detailed Description

Computes the length index of the point on a linear Geometry nearest a given Coordinate.

The nearest point is not necessarily unique; this class always computes the nearest point closest to the start of the geometry.

Definition at line 43 of file LengthIndexOfPoint.h.

Constructor & Destructor Documentation

geos::linearref::LengthIndexOfPoint::LengthIndexOfPoint ( const geom::Geometry linearGeom)

Member Function Documentation

static double geos::linearref::LengthIndexOfPoint::indexOf ( const geom::Geometry linearGeom,
const geom::Coordinate inputPt 
)
static
double geos::linearref::LengthIndexOfPoint::indexOf ( const geom::Coordinate inputPt) const

Find the nearest location along a linear Geometry to a given point.

Parameters
inputPtthe coordinate to locate
Returns
the location of the nearest point
static double geos::linearref::LengthIndexOfPoint::indexOfAfter ( const geom::Geometry linearGeom,
const geom::Coordinate inputPt,
double  minIndex 
)
static
double geos::linearref::LengthIndexOfPoint::indexOfAfter ( const geom::Coordinate inputPt,
double  minIndex 
) const

Finds the nearest index along the linear Geometry to a given Coordinate after the specified minimum index.

If possible the location returned will be strictly greater than the minLocation. If this is not possible, the value returned will equal minLocation. (An example where this is not possible is when minLocation = [end of line] ).

Parameters
inputPtthe coordinate to locate
minIndexthe minimum location for the point location
Returns
the location of the nearest point
double geos::linearref::LengthIndexOfPoint::indexOfFromStart ( const geom::Coordinate inputPt,
const double  minIndex 
) const
private
double geos::linearref::LengthIndexOfPoint::segmentNearestMeasure ( const geom::LineSegment seg,
const geom::Coordinate inputPt,
double  segmentStartMeasure 
) const
private

Member Data Documentation

const geom::Geometry* geos::linearref::LengthIndexOfPoint::linearGeom
private

Definition at line 46 of file LengthIndexOfPoint.h.


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