-1

Trying to solve it for couple days and still no solution :( There is route on the map A to B it is a straight line. A and B is lat-Lon coords. I need to find if point C (lat-lon) is within certain distance from the route. I need this solution to be 'very fast' since it might be many such points. Here is a picture:

http://www.framesbyleon.com/images/map.png

A -> B is a route, I need to calculate that rectangle (or stripe) around the route and use its coords to filter results with MySql. In human language it is like driving on a highway and pick up something if it isnt that far off. It seems I need to convert coords to Cartesian and do calculations? Thanks in advance

Michael S
  • 7
  • 2
  • [Possible duplicate](http://stackoverflow.com/questions/3120357/get-closest-point-to-a-line). If you can show what you have tried, that is very useful here. You need to imagine A-B forms a line, and then create an intersecting line from C to A-B so that it is perpendicular. There is sure to be a solution to that if you search for it. – halfer Mar 12 '15 at 17:26
  • Possible duplicate [How to draw a polygon around a polyline in JavaScript?](http://stackoverflow.com/questions/19369363/how-to-draw-a-polygon-around-a-polyline-in-javascript) – geocodezip Mar 12 '15 at 18:09

1 Answers1

0

You can use isLocationOnEdge(point:LatLng, poly:Polygon|Polyline, tolerance?:number)) method in the geometry library

Verma
  • 8,199
  • 2
  • 15
  • 17