osrm-backend icon indicating copy to clipboard operation
osrm-backend copied to clipboard

Support Multiple Locations in the /nearest API

Open muteebali opened this issue 6 months ago • 3 comments

Description:

Currently, the OSRM /nearest API supports querying the nearest routable node for a single location at a time. This limitation results in increased overhead and slower performance when multiple locations need to be processed, as each location requires a separate API call.

Feature Request:

Add support for multiple locations in a single /nearest request, similar to how other OSRM APIs (like /route, /table, etc.) accept multiple coordinates via a semicolon-separated list.

Proposed Usage:

GET /nearest/v1/driving/13.388860,52.517037;13.397634,52.529407?number=1

Expected Behavior:

The response should return the nearest node(s) for each of the provided coordinates in the order they are specified. This would significantly improve the efficiency of nearest-node queries when working with batch data.

Benefits:

Reduced number of HTTP requests.

Improved performance and lower latency.

Better alignment with batch processing use cases.

Consistent API design with other OSRM endpoints

muteebali avatar Apr 13 '25 17:04 muteebali