2
votes

ANDROID APP

I've use google direction API to get a route from 2 points.

All the routes returned is saved if there is a need to reference to any of that data

Then I decoded the overview_polyline into a list of LatLng and drew the polyline on the google map.

How do I find out if a given coordinate (traffic accident for example) is on/nearby the polyline route , plus minus a constant distance (maybe 100m?)

1
what you want exactly .. distance between two point - Abhinav singh
I don't know how will that relate to finding if a point is on the route? - Tim

1 Answers

2
votes

You can use Google Maps Utility Library.

Especially isLocationOnPath(LatLng point, java.util.List<LatLng> polyline, boolean geodesic, double tolerance).

Here's the full documentation.