How to calculate the route between city X and city Y? #maps

How would you calculate the route between two cities (for cars)? I need only large cities in Germany.

Entrance : starting city and final city

Exit : starting city, city1, city2, ..., final city

When I look at Google Maps, I found information here . So this is well documented. I see some limitation: 2500 calls per day. You need to display the graphics. This is bad.

But when I look at openstreetmap or bing cards, I can not find the relevant information. could you help me? And are there any such services?

Update . I created my own Java routing engine . Although this is the only requirement here was not the main reason.

+3
source share
1 answer

I used the Google API and Bing Maps. Without additional information or requirements, I can provide only general information.

Google Directions API

Bing route calculation

Just from a few quick studies, I do not believe that the Open Street Map has a native routes API. For other Open Street Map solutions, take a look at your wiki (YOURS are especially interesting).

Google Directions API

API Google Directions : http://maps.googleapis.com/maps/api/directions/json?region=de&language=de&origin=Berlin&destination=Hamburg&sensor=false

parameters:

  • origin .
  • destination .
  • - , ?

():

  • region = de Google Maps , , .
  • language = de Google Maps, (. )

.


Bing

Bing , API .

Bing : http://dev.virtualearth.net/REST/v1/Routes?wayPoint.1=Berlin&waypoint.2=Hamburg&culture=de-DE&key=YOUR_KEY_HERE

:

  • wayPoint.1 .
  • wayPoint.2 ( , ).
  • API- Bing Map.

:

  • culture = de-DE Bing , .

Google Bing API , , .

+4

Source: https://habr.com/ru/post/1784415/


All Articles