Skip to main content

For the API objects Step - include lat/long?

MPrei-10732
Original Poster

Does anyone else have an easy way of getting the lat/longs from each step along the Leg of a GetDirections api call? It's useful to see the turn by turn directions, but it's limits its use when you can't see where those turns will be. Does anyone have any other ways of solving this?

Join the conversation

You need to be logged in to reply to this post and participate in the Geotab Community discussions.

2 Replies

EishiFUN
Geotabber

Hey @MPrei-10732​ ,

 

Thank you for asking your question in our community. I wanted to let you know I am looking into this questions I just didnt want you to think we were leaving you hanging here! I also wanted to tag in @TuckerBA-1087​ and @LPPapillon-1145​  in case this is something they may be able to help with before I can get an answer.

 

I will let you know what I find as soon as I do.

 

Have a good weekend!

Eishi FUN

EishiFUN
Geotabber

Hey @MPrei-10732​ ,

 

Sorry for the delay in getting back to you on this. I wanted to make sure I had a proper answer before following up!

 

After digging into it: the Step object in GetDirections does not include lat/long coordinates, and unfortunately there's no built-in way to get them from that API today. The Step only gives you Instructions (the turn-by-turn text), Distance, Duration, and Sequence — no coordinate field.

 

The one place you do get coordinates is at the Leg level — each Leg has an Origin and Destination Waypoint (with x = longitude, y = latitude), but those are just the waypoints you passed in, not the individual turn locations.

 

The most practical workaround is to call the Google Maps Directions API directly (maps.googleapis.com/maps/api/directions/json) with the same waypoints. GetDirections actually proxies to Google under the hood, but strips the step-level geometry before returning it. Calling Google directly gives you start_location/end_location per step plus an encoded polyline — exactly what you're looking for. You'll need your own Google Maps API key.

 

There's no existing product request to add coordinates to the Step object, so if this is a priority for you it's worth submitting feedback — the underlying data is there, it's just not being surfaced.

 

Hope that helps, and sorry again for the wait!

Eishi FUN

Still have questions?