Valhalla Legends Archive

Programming => General Programming => Topic started by: FrOzeN on June 04, 2007, 01:47 AM

Title: GPS Latitude and Longitude values
Post by: FrOzeN on June 04, 2007, 01:47 AM
Seeing all these GPS devices everywhere these days, I assume it's fairly easy to acquire the lat/long values of your current location. I was curious if anyone here has worked with, or has any idea on how to get them. On an old laptop I have I thought it'd be fun to feed the lat/long values into it and read them through USB (or anything) then play around with them in a program I'd like to make.
Title: Re: GPS Latitude and Longitude values
Post by: Skywing on June 04, 2007, 10:03 AM
I would recommend consulting Google (http://www.google.com/search?q=nmea+gps&rls=com.microsoft:en-us&ie=UTF-8&oe=UTF-8&startIndex=&startPage=1) on the subject; there's a lot of information out there.  Most consumer GPS devices either connect to a serial port, or use a powered USB-to-serial converter and show up as a serial port on the computer they are connected to.

The above mentioned Google query should get you started on how to process the data as represented by most GPS devices.
Title: Re: GPS Latitude and Longitude values
Post by: K on June 04, 2007, 11:50 AM
I have done some work with GPS (in embedded devices);  if all you are interested in is getting the latitude and longitude from the unit, all you need to do is wait for and  parse the NMEA GGA sentence  (http://www.gpsinformation.org/dale/nmea.htm#GGA).

If you want to do more advanced things, you will need to switch into SiRF mode, which is a binary protocol.

The following may or may not be helpful:
C# Code to compute/validate a NMEA checksum (http://reznor.homelinux.net/~ledbettj/misc/nmeachecksum.cs)
SiRF Protocol Reference (http://reznor.homelinux.net/~ledbettj/misc/SiRF_Binary_Protocol.pdf)
NMEA Reference Manual (http://www.ekf.de/c/cgps/cg2/inf/nmea_reference_manual.pdf)