Question : How to get the GPS data / NMEA right? Longitude, Latitude and distance between?

Hello.

I'm developing GPS software for the very first time.

I need to understand how the NMEA-system works. I've seen this link: http://www.geoaps.com/NMEA.htm. I get the information there, and I understand it to some points...

I've managed to get my current position marked on the map (and it's correct, I've figured out that longitude 6019.9829 actually is 60 (degrees) and 199829/60 = 3330 --> 60.3330).

However, here are my questions: (I use VB.NET, by the way)

1. How to read the data from the COM port in a proper way?
I use a bluetooth GPS device, and I get access to the input, and I register there are multiple lines in the input text all the time. That's okey, and I just make sure i get the $GPGGA-line (the first one, if there are more of them), but I'm going to read the signal about every second (to get my "route" during driving), so I wonder how often the GPGGA-line is produced. Is there a point in reading ALL the GPGGA-lines? I understand that each GPGGA-line also tells you how long it's since the last GPGGA-line. If I want to check every second, how can I be sure I'm not reading the same GPGGA-line more times?

2. Is it possible to read the COM-port on a Pocket PC? Can someone provide me with which reference to add in Visual Studio 2005 (when I create a PocketPC-application), and how to add the MSCOMM-object?

3. How can I calculate the distance from point (longitude/latitude) A to B? And what's the altitude value?

4. The MNEA-stuff should be 6 different lines. My GPS-device reports for instance 6 lines now and then, but there's not always 6 lines, apparently. Sometimes, the GPGGA is given on the first line, the 4th line and the 7th line... Is someting wrong?

5. Is the GPS-device providing a speed-value, meaning how fast my car drives there and then? I guess not, but I've seen some speed-parameters in the MNEA-stuff...

I will be very grateful for all hints and all kinds of help here! :)

PS! I don't know how to move a question, so I just added it here, because I added it under DB GPS, and that was not the right place...


Best regards,
BITK :)

Answer : How to get the GPS data / NMEA right? Longitude, Latitude and distance between?

As far as the distance is concerned I have explained it in another of your thread....

Between (CurLat,CurLong) and (lat0,long0) the distance will be....

Distance = 2*arcsin((sqrt(sin(lat0)-sin(curLat))²+(cos(lat0)*sin(lon0)-cos(curLat)*sin(curLong))²+(cos(lat0)*cos(lon0)-cos(curLat)*sin(curLong))²)/2)
This distance will be in Nautical Miles. Now to convert this to meters you need to multiply it by 1.852 and then divide the result by 1000
i.e Distance= Distance*1.852/1000 (In meters)

also have you tried the Smart Device Framework and their GPS sample???? It will do almost exactly what you want....

Imran
Random Solutions  
 
programming4us programming4us