nearestPointOnLine

fun nearestPointOnLine(line: LineString, point: Position, units: Units = Units.Kilometers): Feature<Point>

Finds the closest Position along a LineString to a given position

Return

Feature with Feature.properties:

  • distance: Distance between the input position and Feature.geometry

  • location: Distance along the line from the start to the Feature.geometry

  • index: Index of the segment of the line on which point lies

Parameters

line

The LineString to find a position along

point

The Position given to find the closest point along the line


fun nearestPointOnLine(lines: MultiLineString, point: Position, units: Units = Units.Kilometers): Feature<Point>

Finds the closest Position along a MultiLineString to a given position

Return

Feature with Feature.properties:

  • distance: Distance between the input position and Feature.geometry

  • location: Distance along the lines from the start to the Feature.geometry

  • index: Index of the segment of the line on which point lies

Parameters

lines

The MultiLineString to find a position along

point

The Position given to find the closest point along the lines