Posted on 2005-03-29
Ok I need to figure out how to write an effective and efficient geofence. Here is my situation....I am writing a vehicle tracking application for my final project in undergrad. This application is going to be used to track our area transit system for the school. Obviously we have bus stops...so...I have gotten a lat/long for the stops (an approximation atleast). Now I can add these to the database where I have all the stops information. We also have a database that is keeping the NMEA strings for the buses locations.
Now what I want to be able to do is...when I query to see where bus "123" currently is I would like to then have an efficient means to compare the busses current location to the coordinates I have for the stops to tell where the bus is. I am not asking for anyone to help me with the database part (I can take care of all the myself)...what I am asking for is an idea/algorithym/psuedo code (any of the 3 would be good) to do the comparison for the buses location against the stops on the route.
I appreciate your help.