findShortestDistance

fun findShortestDistance(startLocation: LngLatAlt, startWay: Way, endLocation: LngLatAlt?, endWay: Way?, endIntersection: Intersection?, debugFeatureCollection: FeatureCollection?, maxDistance: Double = Double.MAX_VALUE): ShortestDistanceResults

findShortestDistance gets the shortest distance between two points, or between one point and an intersection. The points have to already be associated with a nearest Way and temporary start and end locations are added as connected nodes in the graph.

Parameters

startLocation

The location of the start point

startWay

The nearest matched Way to the start point

endLocation

The location of the end point (not used if endIntersection is specified)

endWay

The nearest matched Way to the end point (not used if endIntersection is specified)

endIntersection

The intersection to end the search at

debugFeatureCollection

A FeatureCollection used for debug only

maxDistance

The maximum distance to search for