Class LocationIndexOfPoint
Computes the LinearLocation of the point on a linear Geometrynearest a given Coordinate. The nearest point is not necessarily unique; this class always computes the nearest point closest to the start of the geometry.
Inherited Members
Namespace: NetTopologySuite.LinearReferencing
Assembly: NetTopologySuite.dll
Syntax
public class LocationIndexOfPoint
Constructors
| Edit this page View SourceLocationIndexOfPoint(Geometry)
Initializes a new instance of the LocationIndexOfPoint class.
Declaration
public LocationIndexOfPoint(Geometry linearGeom)
Parameters
Type | Name | Description |
---|---|---|
Geometry | linearGeom | A linear geometry. |
Methods
| Edit this page View SourceIndexOf(Coordinate)
Find the nearest location along a linear Geometry to a given point.
Declaration
public LinearLocation IndexOf(Coordinate inputPt)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | inputPt | The coordinate to locate. |
Returns
Type | Description |
---|---|
LinearLocation | The location of the nearest point. |
IndexOf(Geometry, Coordinate)
Declaration
public static LinearLocation IndexOf(Geometry linearGeom, Coordinate inputPt)
Parameters
Type | Name | Description |
---|---|---|
Geometry | linearGeom | |
Coordinate | inputPt |
Returns
Type | Description |
---|---|
LinearLocation |
IndexOfAfter(Coordinate, LinearLocation)
Find the nearest LinearLocation along the linear Geometry
to a given Geometry after the specified minimum LinearLocation.
If possible the location returned will be strictly greater than the minIndex
.
If this is not possible, the value returned will equal minIndex
.
(An example where this is not possible is when minIndex
= [end of line] ).
Declaration
public LinearLocation IndexOfAfter(Coordinate inputPt, LinearLocation minIndex)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | inputPt | The coordinate to locate. |
LinearLocation | minIndex | The minimum location for the point location. |
Returns
Type | Description |
---|---|
LinearLocation | The location of the nearest point. |
IndexOfAfter(Geometry, Coordinate, LinearLocation)
Declaration
public static LinearLocation IndexOfAfter(Geometry linearGeom, Coordinate inputPt, LinearLocation minIndex)
Parameters
Type | Name | Description |
---|---|---|
Geometry | linearGeom | |
Coordinate | inputPt | |
LinearLocation | minIndex |
Returns
Type | Description |
---|---|
LinearLocation |