Displaying GPS tracks as maps on the web
There are now many brands of GPS tracking device which allow collection of routes for incorporation into maps.
Although there are some websites that allow upload of these GPS
tracks, there are problems with the different data formats used by
different devices and also file size limits imposed by some
websites. Some of the tracking devices make unnecessarily large
data files which aggravates the problems.
The problems in using this tracker data are:
- Transfer of the data to a computer
- Conversion of the data to a suitable map display format
- Reduction of the data file size
- Display of the resulting route information on a map
These are the procedures I use to resolve these problems.
Transfer of the data to a computer
Many trackers use a USB connection to a computer to transfer the data off of the (small) memory in the tracker. These tend to use a virtual serial transfer over the USB connection and a device driver is required to implement this. Holux trackers and many others use this method. But drivers are not available for all operating systems and Linux and Android systems cannot be used easily, if at all with these trackers. I use the Columbus V990 tracker because it logs to a micro memory card, which can be removed and easily connected to any computer, including android tablets. This avoids the requirement for special device drivers for the tracker and computer system in use.
Data format conversion
Many trackers save the data as a CSV or text-like file which can be read by spreadsheet programs. But this format is not suitable for direct use to display a map of the route. Software to convert the data format often comes with the tracker. But conversion can also be done with web sites, such as gpsvisualizer.com . Or the conversion can be done with simple perl scripts such as this contributed file at exoweb.com which converts a columbus CSV file to a gpx format file. These conversions do not try to minimize the size of the data file by removing unnecessary line segments. Other common map format files are kml (google maps, google earth) or kmz (compressed kml, also used by google maps and google earth).
Reducing the data file size
Most trackers record positions at regular time or distance intervals, which can be inefficient. We really only need position information when the route changes direction. It is not too hard to process the tracker data file and eliminate unnecessary straight line points. This is discussed here where the perl script I wrote to do this is available. This perl script also converts the CSV input format to a gpx output file while eliminating unnecessary data points. It assumes the CSV format provided by the Columbus tracker in standard mode, but you can easily change the script to match the format of other trackers. The optimized gpx file can then be considerably reduced in size by converting it to a kmz file, which can be done online at gpsvisualizer.com . (or with gpsbabel software)
The reason the data file size is important is not just for speed of display on a website, but because some websites, such as google "my maps" have a very small file size limit of about 50 Kbyte. Even using the gpsvisualizer website can be a problem if you try to upload a file larger than about 1 Mbyte. To avoid this, upload the gpx file for conversion to a web location and then provide the URL of the file instead of using the file upload feature. (This problem may be because of a slow internet connection and no fault of the gpsvisualizer website.)
Display of the route on a website
You now have an optimized route file in compressed kmz format. But it is still likely to be some 300Kbyte or more in size, and many map display websites will not allow upload of route files this big. You can however display such files using the mappingsupport website. You do need to upload your route kmz file to a web location to use this website. Read the FAQ on the website for details, but you simply add the URL of your kmz file to the mappingsupport precursor. This will then display your kmz file in a user interactive (pan, and zoom capable) map with a background you can choose, such as roads or terrain etc.
An example is the route map of my cycle tour in NZ 2013. This was 2400 Km long and collected some 500,000 GPS coordinates, about 10 Mbyte of CSV data. This would typically result in a gpx file of about 50 Mbyte. But after optimization and KMZ compression this route file is just 300 Kbyte.
- Transfer your tracker data file to your computer.
- Convert and optimize the tracker file into a gpx format file using my perl script or gpsvisualizer.com .
- If necessary, upload the gpx file to a website
- Use gpsvisualizer.com or gpsbabel software to convert the gpx file to a kmz file
- Upload the kmz file to a web location (you can use google sites)
- Make a link to mappingsupport.com with your kmz location appended. (read the mappingsupport.com FAQ for details)
- Add this link to your website, or email it to recipients.
Many thanks to Joseph Elfelt for his excellent mappingsupport.com website which solves the major problem of effective display of large-ish route files.
And thanks also to Adam Schneider for the great file conversion capabilities at gpsvisualizer.com