Geocodio's Distance API supports distance matrix calculations for both driving and straightline distance. A distance matrix calculates the distance between every combination of origins and destinations in a single request.
If you have 3 origins and 10 destinations, Geocodio will return a distance matrix with 30 results (3 × 10), i.e., the distance from each origin to each destination.
This is useful for:
TIP: If you had to describe your project and you start with the phrase "I need to find the closest...", you're probably looking for distance matrix calculations.
Geocodio has two endpoints for matrix calculations:
Distance Matrix (synchronous)
Distance Jobs (asynchronous)
To find which of 5 warehouses is closest to each of 100 customers:
The API will return the driving distance and driving time from each warehouse to each customer.
See the Distance Matrix API documentation for request/response formats and code examples.