Thomas Tingsted Mathiesen GPS, NMEA, WGS-84, GIS and VB.NET
By Thomas Tingsted Mathiesen (tma@tma.dk)
I made this page because I have almost surfed my self to death trying to piece all the different information together - It's out there, but somewhat scattered all over.
My goal is to develop a VB.NET class library where all functionality conserning positioning, Datum conversion, Grid transformation and direct serial interface to an external USB/Serial GPS reciever.

My Linked-In profile
My company - Gaudio ApS
My FaceBook profile
Navilock.de, NL-302U GPS reciever
Last changes made: 16 JUL 2008

  • Index
  • Coordinate formats
  • Get the NMEA linies from the GPS reciever
  • Convert NMEA format to Decimal format
  • Convert from Decimal format to NMEA/WGS-84
  • Calculate distance between two coordinates/locations
  • Calculate direction in degrees between two coordinates
  • Magnetic deviation/declination
  • Using maps.google.com to view Longitude/Latitude
  • Sirf Star III stability test
  • Links & references
  • The .NET GPS API ready for download
    Go to my GPS API page and check out the features :)
    Goto: .NET GPS API


    Contribute to the build of a comprehensive list of GPS/NMEA dumps.
    See sample data from around the globe using different GPS systems.

    Submit serial output, or check out the other dumps


    Please give your comment/rating at the bottom of this page


  • Coordinate formats
    NMEA(WGS-84) 5601.0318,N
    01211.3503,E
    Decimal format 56.01755
    12.19302
     




  • Get the NMEA linies from the GPS reciever
    (Link to all NMEA commands, line descriptions, fields etc. http://www.gpsinformation.org/dale/nmea.htm)
    I use the $GPGGA line for getting the current position data.
    Example: $GPGGA,165113.000,5601.0318,N,01211.3503,E,1,07,1.2,22.4,M,41.6,M,,0000*60

    As you can see my position is:(Denmark)
     Longitude: 5601.0318 N
     Latitude: 01211.3503 E


    Textfile with a NMEA/GPS dump from the terninal (Download)



  • Convert the recieved NMEA(WGS-84) location to a decimal number.Updated formula
    I had some trouble finding the correct formula for doing this, but I finally found this one, and it works like a charm.
    You have to do this conversion, due to the fact that all maps(that I know of) uses decimal longitudes and latitudes.(maps.google.com, Mappoint, Autoroute etc)
    If you should make the same mistake as I did, trying to type the location on maps.google.com without this conversion, you will get a position near to you, but not close enough.

    Formula (5601.0318) = 56+(1.0318/60)
    Example:
    Remember:
     If you are located on the Western hemisphere (America/US) or southern hemisphere (Australia), convert to negative position.(Decpos = Decpos * -1)


    Thank's to Leonardo for the currect formula.


  • Convert decimal location to NMEA/WGS-84 format.

    You can get the return value in two different formats.
     NMEA = 01211.3487,N
     WithSigns = 56°1"3.18'N

    Example: Returns: 01211.3487,N



  • Calculate the distance between two coordinates
    I found an article on codeproject.com by Gary Dryden, written in C#.
    Remember to convert your position to Decimals first.
    I converted it to VB.NET like so:
    Returns distance in Kilometers.
    Example: MyDistance = Calc(56.0176,12.19302,56.0176,12.19301)

  • Calculate direction in degrees between two coordinates
    This code was by far the hardest to dig up, but thanks to Jim Mischel and his fantastic article on informit.com it came to work.
    Copy code into a form containing a Button1.
    Edit values in Button1_Click:
     Source.lat
     Source.lon
     Destination.lat
     Destination.lon



  • Maps and magnetic deviation/declination
    If you need to calculate the magnetic deviation, use this link into NOAA.
    NOAA's website (Declination calculator)
    Under normal circumstances you will not need to manually do this calculation - your GPS reciever should do this for you.



  • Using Google maps to position your self with Longitude/Latitude
    Pretty simple really, just:
     http://maps.google.com?q=56.01717,12.18909





  • How stable is my GPS reciever with the new SirfStar III chipset
    I must admit that this reciever performs beyond what I had expected.
    This is a simple graph displaying how the position "jumps" around, when stationary.
    (X axis=2,78 Meters pr. square, Y axis=1,56 Meters pr.square, with 62 recieved GPS fixes)

    GPS map, stationary, using SirfStar III chipset


    This one is using the old SirfStar II chipset.
    GPS map, stationary, using SirfStar II chipset



  • Links to usefull pages and references

    Name Link
    National Geophysical Data Center(NGDC) http://www.ngdc.noaa.gov/seg/geomag/jsp/struts/calcDeclination
    GLOSSARY OF GPS TERMINOLOGY http://www.rbf.com/cgcc/glossary.htm
    Wikipedia's story on Magnetic declination http://en.wikipedia.org/wiki/Magnetic_variation
    NMEA Sentence information http://www.tma.dk/gps/nmeastrings.htm
    Deviation (Graphs) http://swepos.lmv.lm.se/english/sa.htm
    Google groups on the subject http://groups.google.dk/group/Google-Maps-API/browse_thread/thread/7b36c0f8b6a0d592/ab5580ea1b6adaaf?lnk=st&q=convert+NMEA+to+WGS-84+decimal&rnum=2&hl=da#ab5580ea1b6adaaf
    Jim Mischel's fantastic article on 'Computing Track Information in GPS' http://www.informit.com/guides/content.asp?g=dotnet&seqNum=513&rl=1


    Source:maps.google.com, my location using my GPS reciever