andrashann / gptt

Get public transport timetables from the Google Transit API
Apache License 2.0
1 stars 0 forks source link

No results returned for certain origin/destination pairs #3

Open andrashann opened 4 years ago

andrashann commented 4 years ago

The Directions API does not return results for some origin/destination pairs, e.g. Beijing–Shanghai or Kyoto–Tokyo. For example, the query https://maps.googleapis.com/maps/api/directions/json?origin=Tokyo&destination=Kyoto&mode=transit&language=en&key=[API_KEY]&departure_time=1590483732 returns this:

{
   "available_travel_modes" : [ "DRIVING", "WALKING" ],
   "geocoded_waypoints" : [
      {
         "geocoder_status" : "OK",
         "place_id" : "ChIJXSModoWLGGARILWiCfeu2M0",
         "types" : [ "colloquial_area", "locality", "political" ]
      },
      {
         "geocoder_status" : "OK",
         "place_id" : "ChIJ8cM8zdaoAWARPR27azYdlsA",
         "types" : [ "locality", "political" ]
      }
   ],
   "routes" : [],
   "status" : "ZERO_RESULTS"
}

However, the Google Maps web interface does give results.

I have not been able to figure out the reason for this.

andrashann commented 4 years ago

Note: this is partially fixed in 79345f5e2baab3b631c5e88b0c3386a347602f19 for cases when there are some valid results and some empty ones (e.g. London–Barnstaple). However, the examples given above still return empty.