sortPOIsByGraphDistance
abstract suspend fun sortPOIsByGraphDistance(origin: Coordinate, pois: List<PointOfInterest> = getPOIs().toList()): List<PointOfInterestWithInfo>
Sorts a list of Points of Interest (POIs) by their graph distance from a given origin coordinate.
This function utilizes a graph-based routing to calculate the distance from the origin to each POI. The POIs are then sorted in ascending order of distance.
Return
A list of PointOfInterestWithInfo objects, sorted by graph distance from the origin. The PointOfInterestWithInfo objects contain the original POI data and additional information including the calculated distance. If a POI's distance cannot be determined, it will likely be placed at the end of the sorted list, or an error will be thrown.
Parameters
origin
The starting Coordinate for distance calculations.
pois
An optional list of PointOfInterest objects to be sorted. Defaults to all POIs obtained from getPOIs.