Given realtime location data of a moving device over a short period of time, how can I get a lat/long pair further along this road, say, 2 miles, or even better, 5 minutes worth of driving?
I see that I can use Google's Roads API to snap to a road given a lat/long pair https://developers.google.com/maps/documentation/roads/snap, but that only gets me part way there.
This will be in an Android app.
Given a route represented as a
List<LatLng>
, this function calculates the point on the route that results from travellingdistance
meters fromorigin
on that route (using the Google Maps API Utility Library to do some calculations):Here are some tests: