I'm building a tool to understand levels of transport connectivity between major cities in 'global mega-regions'. It's pretty straightforward - we enter a bunch of cities into Googles distance matrix and Google in turn tells us transit times.
The code works perfectly fine for European and American cities. However, there seems to be some issue with East Asian cities (China and Japan). Google is either returning no result, or it is returning substantially longer transit times than are correct when compared to a search on Google maps itself.
Upon further investigation, it appears that the Google Distance Matrix API will not return any rail results for East Asian cities (only bus routes - if they exist). This is despite those rail routes showing up on Google Maps.
x = gmaps.distance_matrix(
['Kyoto, Japan'],
['Osaka, Japan'],
mode='transit',
units='metric' )
x
Which returns:
{'destination_addresses': ['Osaka, Japan'],
'origin_addresses': ['Kyoto, Japan'],
'rows': [{'elements': [{'status': 'ZERO_RESULTS'}]}],
'status': 'OK'}
However, as you can see in the image below, there are numerous perfectly suitable routes.
Image of Google Maps results via maps.google.com
Just to let you know what I have tried so far:
- Enforcing a preference for train transit_mode.
- Altering the departure time
- Running the code as a standard URL request rather than via the Python library
- Tried longitude/latitudes rather than city names.
Thanks in advance