[lug] Mapping Software

J. Wayde Allen wallen at lug.boulder.co.us
Wed Oct 24 11:35:45 MDT 2001


On Wed, 24 Oct 2001, Timothy C. Klein wrote:

> Finally, to the Linux part of my message.  Any tools to do something
> like this with my favorite OS?

I'd suggest searching at Sourceforge or Freshmeat to see what you can
find.  I know that there are several programs under development that I
think do what you are wanting.

If you need something that can pull latitude, longitude, and elevation
from an NMEA data stream you are welcome to the little Python snippet I
wrote below.  What I've done with this is connect a laptop to a GPS
receiver and captured the raw data to a file using a terminal
program.  The following code runs over the NMEA data in the file and
extracts the time, latitude, longitude, and altitude.  I've then ploted
these data with the plot program of your choice.  You might be able to
expand on this.

- Wayde
  (wallen at lug.boulder.co.us)
--------------------------------------------------------------------------

#!/usr/bin/env python

import string

class nmeafile:

   def __init__(self, filename):
      self.filename = filename
      print '#Time (UTC), Latitude, Longitude, Elevation (meters)'   

      for line in open(self.filename, 'r').readlines():
         if line[:6] == '$GPGGA':
            field = string.split(line,",")
            self.time = field[1]
            self.latitude = field[2] + field[3] 
            self.longitude = field[4] + field[5]
            self.quality = field[6]
            self.num_svs = field[7]
            self.hdop = field[8]
            self.altitude = field[9] + field[10]

            print self.time, self.latitude, self.longitude, self.altitude
            
         
if __name__ == '__main__':
   
   gps = nmeafile('../gps/nmeafile.dat')
            




More information about the LUG mailing list