question

AnthonySgro-1169 avatar image
0 Votes"
AnthonySgro-1169 asked IoTGirl answered

Bing Maps REST API - No route was found for the waypoints provided

I have created an app that works perfectly with driving and walking for the Bing Routes API between two latitudes and longitudes. Here is the structure:

 http://dev.virtualearth.net/REST/V1/driving?wp.0=${employee.latitude},${employee.longitude}&wp.1=${client.latitude},${client.longitude}&dateTime=12:00:00&distanceUnit=mi&output=json&key=${process.env.BING_MAPS_KEY}`,

Whenever I replace driving with walking, it works. But whenever I replace driving with "transit", it doesnt! This is supposed to be used for NYC, so I don't know what to do. I am only limiting my request to two waypoints like the documentation says.

Let me know if there is something specific I have to do for the transit search to work. Thank you.

windows-maps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IoTGirl avatar image
1 Vote"
IoTGirl answered

Hi Anthony,

You need to do like the web site does. Try the steps at Bing.com/maps and you will see what I mean. Basically not all points are "Routeable" and transit legs can go beyond the leg limits of the routing REST API.

Repro Steps:
1. Go to Bing.com/maps and enter your starting point in the UI -> You will see this immediately convert to the closest routable address
2. Choose "Directions" and then enter the second coordinate -> You will see this do the same transformation
3. Find the route -> This will work because the non-routable points have been converted to the closest routable points

The number one question I get is why doesn't the API do this for me and the best answer is, we don't want to mislead and say a point is accessible for routing of a certain type if it isn't so to accomplish the same thing with the REST API:

  1. Call https://docs.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-point and use the Geopoint with "<UsageType>Route</UsageType> " for the start and end points

  2. Call the REST Route API with the "Route" co-ordinates

NOTE: Bing Maps TOU (https://www.microsoft.com/en-us/maps/product) does allow for the caching of geocodes while you are licensed so if you do have a license, you can store the routable geocodes for addresses you use frequently.

Sincerely,
IoTGirl



5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.