4

I made a HTTP request to a Google Maps Directions which includes transit step. The transit step in the response only returns object with information about departure and arrival stops and a number of stops in between them (5).

<transit_details>
      <departure_stop>
        <name>Wien Mitte-Landstraße</name>
        <location>
          <lat>48.2060950</lat>
          <lng>16.3848860</lng>
        </location>
      </departure_stop>
      <arrival_stop>
        <name>Wien Hbf (Bahnsteige 1-2)</name>
        <location>
          <lat>48.1861220</lat>
          <lng>16.3755230</lng>
        </location> 
      </arrival_stop>
      <line>  
        <short_name>S 1</short_name>
        <vehicle>
          <name>Commuter train</name>
          <type>COMMUTER_TRAIN</type>
          <icon>//maps.gstatic.com/mapfiles/transit/iw2/6/rail.png</icon>
        </vehicle>
        <agency>
          <name>ÖBB</name>
          <url>http://www.oebb.at/</url>
        </agency>
      </line>
      <num_stops>5</num_stops>
      <headsign>Mödling</headsign>
      <departure_time>
        <value>1439805780</value>
        <text>12:03pm</text>
        <time_zone>Europe/Berlin</time_zone>
      </departure_time>
      <arrival_time>
        <value>1439806200</value>
        <text>12:10pm</text>
        <time_zone>Europe/Berlin</time_zone>
      </arrival_time>
    </transit_details>

What I need are the details of all individual stops along the transit leg. Is there a way to acquire that kind of information?

purfufna
  • 101
  • 1
  • 6

2 Answers2

2

It's not currently possible in the Google API to get that information. There's an issue under review to be added in the gmaps api bug tracker: https://code.google.com/p/gmaps-api-issues/issues/detail?id=7807

Be sure to click the star to show your support to add it.

jonaz
  • 111
  • 4
  • Soon it will be four years, since this issue is open. It's disappointing to see how concerned people are not looking into this on priority when this is something really important feature. – androidStud Oct 14 '19 at 02:15
  • This is unbelievable! Approaching 5 years soon and no solution yet! I've added another star to show support for this issue. – iaforek Dec 23 '19 at 14:55
0

For each waypoint in the request, the directions response includes an additional entry in the legs array to provide the corresponding details for that leg of the journey.

Verma
  • 8,199
  • 2
  • 15
  • 17
  • The problem is, I'm not using waypoints in the request, the route is calculated and the returned response has only 1 leg with all the including steps(walking and transit). I had to make an algorithm that will divide steps into legs to have something to work with. Its pretty confusing how Google does this. – purfufna Sep 10 '15 at 08:44
  • Adding waypoints does not work for transit Google Directions requests. The information of the location of the stops is contained in the polyline of each leg step among a bunch of other points, but there's no clear way of distinguishing the from those points. – jonaz Dec 08 '15 at 22:51