Thomas Tingsted Mathiesen GPS, NMEA, WGS-84, GIS and VB.NET
By Thomas Tingsted Mathiesen (
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, 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 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
    Decimal format 56.01755

  • Get the NMEA linies from the GPS reciever
    (Link to all NMEA commands, line descriptions, fields etc.
    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.(, Mappoint, Autoroute etc)
    If you should make the same mistake as I did, trying to type the location on without this conversion, you will get a position near to you, but not close enough.

    Formula (5601.0318) = 56+(1.0318/60)
     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 = 561"3.18'N

    Example: Returns: 01211.3487,N

  • Calculate the distance between two coordinates
    I found an article on 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 it came to work.
    Copy code into a form containing a Button1.
    Edit values in Button1_Click:

  • 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:,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)
    Wikipedia's story on Magnetic declination
    NMEA Sentence information
    Deviation (Graphs)
    Google groups on the subject
    Jim Mischel's fantastic article on 'Computing Track Information in GPS', my location using my GPS reciever