Hack 42. Map Your Tracklogs on the Web
GPS Visualizer makes zoomable SVG vector maps of your tracks via a web site.
SVG is a perfect vector format for web mapping. It's in XML, which allows you to look at the source code, see how it works, and borrow bits you like. The SVG Viewer from Adobe is a popular plug-in: your web browser will probably attempt to install or find it for you the first time you look at a bit of SVG on the Web.
GPS Visualizer is a neat service on the Web, to which you can upload your tracklogs in many different formats and get back interesting SVG maps of your travels. As usual, coverage is biased toward the U.S. because of the many good sources of free geospatial data available there. You can overlay your tracks on top of vector street maps, aerial photographs, or topographical maps.
4.9.1. Making Tracklog Maps on the Web
To get started, visit http://www.gpsvisualizer.com/map/ where you'll be presented with a form that looks like Figure 4-11. Append ?form=simple to this URL to see a refreshingly simplified version of the form. You can upload from your hard drive as many as 12 separate tracks to put on the same map; currently there is a volume limit of 2 MB of tracks at once.
Figure 4-11. Uploading tracks to GPS Visualizer
GPS Visualizer will read many popular tracklog formats including Garmin, some XML formats, and regular comma-separated values. You can upload .csv files in the format of your choice, as long as the first row consists of "headers" indicating the name of that fieldparticularly latitude and longitudeso GPS Visualizer knows what to do with it. So the simplest possible tracklog format is:
latitude,longitude 24.9699926,121.5500093 25.0620890,121.6402817 25.0620890,121.6402602
These are the points recorded when our GPS device was turned on for testing in Taiwan!
4.9.1.1 General map parameters
You can set size and presentation for your map, and give an optional label and scale. GPS Visualizer uses a range of different web mapping services to overlay your tracks on a map. For the U.S. and Canada, there are a lot of options, including better resolution aerial photographs and topographical outlines. For these maps, which are from free sources, GPS Visualizer also offers a "localize" service that allows you to copy a map for online use at http://www.gpsvisualize.com/localize. You can also create a "fader" control that allows you to tune the appearance of your SVG map dynamically.
4.9.1.2 Track options
Sometimes you don't care about the sequence implied by the spatial display of your points. There are options to view tracks simply as points, as lines, or as a continuous shape. You also have the option of displaying waypoints and their labels. You are able to move labels around in the final SVG map. Tracks can also be colored according to altitude, distance, and other factors.
4.9.1.3 Waypoint options.
You can display waypoints, and optionally their descriptions, over a map. Append ?form=waypoints to the map-page address to get a text box where you can paste or type in a collection of points with their descriptions.
Figure 4-12 shows GPS Visualizer's basic output: in this case, a tracklog of part of a journey from San Francisco to San Diego, overlaid on a colorized USGS topo map. GPS Visualizer will also accept georeferenced logs from Netstumbler, so you can make maps of the wireless access points you pick up while walking or driving around [Hack #17] .
Figure 4-12. A GPS Visualizer tracklog map
GPS Visualizer has yet another trick; once you create a map, you can download your SVG file to your local drive. This is shown in Figure 4-13. Once you have the SVG file on your own machine, you can do whatever you'd like with it. GPS Visualizer is an amazingly easy and flexible tool, so get online and start mapping your tracks!
Figure 4-13. You can save your SVG file from GPS Visualizer