Hi!
Does anyone have any code for detecting that current coordinate from the GPS module is within a certain area?. (The area is a shape of coordinates)
Any ideas how to solve this?
/Jonas
Hi!
Does anyone have any code for detecting that current coordinate from the GPS module is within a certain area?. (The area is a shape of coordinates)
Any ideas how to solve this?
/Jonas
someone might have a more specific answer - but its probably no different than the maths used in solving the same issue in GoogleMaps API.
If you checkout the googlemaps site, there is examples that talk about the maths needed for various conversions of co-ordinates in order to calculate distances between points given lat/lng etc etc. Also has good info on how Mercator data works (to deal with earth curvature when calculating distance between two or more points..)
So you can easily modify it to use the NMEA data instead of the GoogleMaps Waypoints.
The bigger question Im curious about - obviously the 'boundaries' of the polygon would need to be defined and stored. EEPROM would be an option, but I'd love to figure out how to read that data in from say an SD card so you could then just define the polygon say with googlemaps on a PC in a comfortable interface...
Anyway - I look forward to seeing what suggestions people come up with - I will have a similar requirement shortly (want to detect if current location is within the bounds of a couple of different polygons so that I can change 'operating modes'....)