Forum Discussion
HSBHSB
Oct 22, 2024Copper Contributor
Migrate Bing Maps Distance Matrix to Azure Maps Route Matrix
We currently use Bing Maps API to get distances between points using the distance matrix. We use the following URL:
I've reviewed the migration document and it says to use the Route Matrix in Azure Maps, specifically the following URL:
When I try to use this URL, I get a 405 error every time. I'm not sure of the format to add the origins and destinations like the Bing Maps example has. I'd really prefer to use this API over the SDK as I like to be in control of how I retrieve and pull data out of the results.
Is there an example of using the Route Matrix API?
- FarazGIS
Microsoft
Hello,
You can always refer to the API specification document for supported parameters and samples.
Route - Post Route Matrix Sync - REST API (Azure Maps) | Microsoft LearnHere is a sample to make a post synchronous call to Route Matrix.
POST https://atlas.microsoft.com/route/matrix/sync/json?api-version=1.0&routeType=shortest{
"origins": {
"type": "MultiPoint",
"coordinates": [
[
4.85106,
52.36006
],
[
4.85056,
52.36187
]
]
},
"destinations": {
"type": "MultiPoint",
"coordinates": [
[
4.85003,
52.36241
],
[
13.42937,
52.50931
]
]
}
}We have released a new version of the Route Matrix API that can support up to 50k matrix size in a single API call.
Route - Post Route Matrix Async - REST API (Azure Maps) | Microsoft LearnSummary of the latest stable and preview releases for Azure Maps rest APIs.
Links to the Azure Maps Rest API - Microsoft Azure Maps | Microsoft Learn