Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking at implementing a PHP based application, where by you have a certain route for example London to Edinburgh. Along this route, I want to calculate say a 10mi Radius or Polygon around the whole route/driving directions, check whether certain defined points/lat-lon's are within this radius. If so - Add them to the waypoint list, re-calculate the route and re-generate the driving directions.

I know there's various different API's for Google Maps, but I'm basically looking for some advice on which API's I should be looking through. I believe the phrase I'm looking for is 'Geofencing', and for that I've seen the Google Tracks API has methods incorporating that ( - But I can't seem to work out how that would help me, or how I'd be able to use it.

Is it possible to do the lookup in an alternative method? For example, producing driving directions using 1 API call, storing all of the waypoints of this route in a MySQL DB and then using something along the lines of to see if each point is within the polygon/geofenced route?

share|improve this question
Hello Christian and welcome. I've dropped the question in the GIS Stack Exchange chat room, to get a few more eyes on it. If you don't find a satisfactory answer here in a couple of days, it might make sense to migrate the question to GIS. – Yannis Jan 16 '13 at 11:40
Thanks Yannis, appreciate it. – christian.thomas Jan 16 '13 at 12:02
have you found any solution? I am stuck at same point. – preetam Jan 9 '15 at 10:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.