0

google maps v3 javascript

I have an object that contains an array of all Latlng's within a route (overview_path array) I have a GPS device that is expected to move along that defined route. If this device aparts from the route X meters we can consider it out of route.

I've been thinking that setting a circle around my gps device will intersect the route. Circle radius will be the size of X meters, which are the allowed tollerance distance to consider the device still within the route.

If intersection responses with more than 1 Latlng elements, gps device still in path. If intersection responses with zero, gps device is out of route.

How to intersect a circle and a polyline?

Is there a better way to evaluate this requirement?

Thanks to all!! :)

  • possible duplicate of [Find a point in a polyline which is closest to a latlng](http://stackoverflow.com/questions/16429562/find-a-point-in-a-polyline-which-is-closest-to-a-latlng) – geocodezip May 15 '13 at 22:36
  • Thanks geocodezip for your comment. I already went to your link and it looks very promising for what my needs are. However, I would like to know if somebody else has solved this with a different approach. Thanks a lot. Your help is very much appreciated. :) – Ernesto Vallejo García May 15 '13 at 23:35
  • Thanks geocodezip, I went thru the example that you point me and with a few modifications, i have found a way to get the array I need. Thanks again :) – Ernesto Vallejo García May 16 '13 at 22:32
  • @ErnestoVallejoGarcía please post your answer. I have the same problem to solve. I need to find the intersection of a circle of radius r with a polyline (arrray of start/end lat,lng points for each segment). – Fraggle Apr 22 '14 at 17:50

0 Answers0