|
[Return to the Tutorials index] Tutorial: Building Plain-Text Waypoint Files by HandContents
This document will show you how to build plain-text (tab- or commma-separated) files that can be used to make maps with GPS Visualizer. It's actually very easy to get started, but there are some powerful features that you might not be aware of. After reading this, you should have a better understanding of what GPS Visualizer can do and how you can take advantage of it. For most of the examples on this page, I've created very simple JPEG maps. They're not very fancy, but this document isn't about spectacular maps, it's about massaging data into a mappable format. Unless otherwise noted, all the information here also applies to creating Google Maps, Google Earth files, etc. Once you have a nice, clean data file, you can do anything you want with it. 1: The bare essentialsAll you really need is a collection of coordinates, or even just one pair of coordinates; adding a "name" to each point is not necessary, but very helpful (and it lets GPS Visualizer know that you're uploading waypoints rather than a sequence of trackpoints). For this example, I'll use the tallest Cascade Range volcanoes in southern Washington and Northern Oregon. The easiest way to organize your data is using a spreadsheet, like Microsoft Excel. On the left, below, is a screen shot of an Excel worksheet, and on the right is the same data in simple, comma-separated format.
To make a map from data like this, just cut and paste the data from Excel or your text editor into the text area on GPS Visualizer's map form. (When you copy data from Excel, it gets pasted with tabs, which will work fine but might look strange.) If you prefer, you can also save the file as tab-delimited text (.txt) or a comma-separated values (.csv) and then upload the file to GPS Visualizer.
Here's the most important thing I can emphasize about creating plain-text data files for GPS Visualizer: Having a sensible "header row" above your data is VERY important. The order of the fields is NOT important. Spaces between fields and capitalization of the header row aren't important either. So "name,latitude,longitude" is identical to "NAME, latitude , Longitude." These "not important" factors are a big part of what makes this program so powerful: chances are, if a human could read your data and make sense of it, so can GPS Visualizer. Include as many or as few fields as you want; as long as a waypoint contains information that might let you plot it on a map, GPS Visualizer will try. 2: A little more informationNow, let's add a "description" field to each point (usually abbreviated as "desc"). For now, we'll put the full name of the mountain, along with the state it's in. So Rainier's description is "Mount Rainier, Washington." We'll also add a field that contains the height of each mountain. I'll call it "alt" to keep it short, but you could also use "altitude" or "elevation." NOTE: if no units are specified, GPS Visualizer will think your numbers are metric (meters for elevation, km/h for speed, etc.); but, in this example, we have our elevation data in feet, so we need to call the field "alt (feet)" or "alt (ft)".
(Click here to pre-fill the map form with this data.) There's something very important to notice about this comma-separated data: the items in the "desc" column MUST be enclosed in quotes because there is a comma inside each description. Without the quotes, everything would be shifted back one column, and the altitude of the first two points would be listed as "Washington"!
3: Building more interesting "desc" fieldsThe nice thing about storing your raw data in a spreadsheet like Excel is that you can manipulate the fields as needed. This is especially helpful for the description field. Let's say we want to display the height of each mountain on the map. All we have to do is concoct a simple Excel formula that reads the "alt" field and adds it to the end of the existing "desc" field. Since the column with the formulas in it will need to be called "desc" in order for GPS Visualizer to recognize it, we'll rename the original "desc" column to "full name," which GPS Visualizer will ignore. In the screen shot below, you can see the formula in cell C2 laid bare for the world to see; in cells C3 through C5, the results of the formula are visible.
(Click here to pre-fill the map form with this data.)
4: Adding colorsEach of your points can have its own color, defined by a "color" field. In our example data, we'll assign red to peaks over 14,000 feet high, green to peaks that are at least 11,000 feet, and blue to the rest.
(Click here to pre-fill the map form with this data.)
5: Adding symbols in Google Maps & Google EarthNow we're going to turn away from those simple JPEG maps for a moment, because in JPEG, PNG, and SVG maps, you have no control over what kind of marker ("symbol") appears for each waypoint; it's always a circle. In Google Maps and Google Earth, however, you can use a different marker style, either for all points or each point individually.
So, let's make a Google Map using triangles and squares. We'll say that triangles represent volcanoes that have erupted in historic time (Rainier & Hood), and squares are volcanoes that have been dormant longer (Adams & Jefferson).
(Click here to pre-fill the Google Maps form with this data.)
Custom icons in Google MapsGPS Visualizer now accepts absolute URLs in the "symbol" field for Google Maps, and it will try its best to make your custom symbols display properly without you doing any extra work. (However: if you also supply an "icon_size" field that contains something like "12x20", you'll make GPS Visualizer's task a little easier.) More info will be coming soon. If you need to, you can also define a whole set of custom markers in various colors, but for each new marker you need to create the main graphic, a 1% transparent version of it, and a "shadow" (although the shadow is optional), and then repeat the process for however many different colors you want available. Then you have to add some JavaScript code to the guts of your map page that defines certain parameters of the new icon. It's powerful, but a pain to set up; contact me if you want to give it a try. Custom icons in Google EarthGoogle Earth makes it very easy to incorporate custom icons into your maps: all you need to supply is the URL of the icon graphic (even photograph thumbnails will work), and GE will take care of the rest. Google Earth can even colorize them if you supply a "color" field. Google Earth also has hundreds of "standard" icons that you can easily use. To see all of them, click here; to find the URL of one of the icons on that page, right-click on the graphic and choose the appropriate command to find its URL. (In Firefox, it's "Copy image location.") 6: Resizing & colorizing pointsUsing the "quantitative data" input form, you can have GPS Visualizer resize or colorize your waypoints based on a field (or fields) of your choice. It's not hard to do, but this feature is important enough to warrant its own tutorial. 7: Adding points without coordinates (e.g., addresses)It's possible to specify the location of a waypoint using information other than coordinates: address, city, state, ZIP code, country, airport code, etc. NOTE: If your entire data file is a collection of addresses, you will find it MUCH easier and more efficient in the long run to use GPS Visualizer's Batch Geocoder to add coordinates to your points before proceeding; then you can skip this section altogether. As always, the header row on your data is important, and preserving the structure of the columns is crucial: you can't put an airport code in the "latitude" column or a city name under "airport." In this next example, I've added Seattle and Portland to the file, using two different methods. For Seattle, I've supplied a city and state; for Portland, just its airport code. The unknown fields are left blank. (In the .csv data file on the right, that means multiple commas with nothing between them.)
(Click here to pre-fill the Google Maps form with this data.)
What to do when it doesn't workEntering an address or a city and state to find a location is far from an exact science. When you enter an address in the United States, GPS Visualizer first attempts to find it in a local database containing geocoding information from the U.S. Census Bureau; this database is not 100% accurate, and you may find addresses plotted on the wrong side of the street or worse. C'est la vie. If the Census database doesn't work, the Google and/or Yahoo geocoding Web services are consulted (click here to read more about GPS Visualizer's data sources). But sometimes, it's still not right. When that happens, you may have to enter the coordinates into your file by hand; there is an entire section in the Address Tutorial on how to do that. 8: Adding URLs to waypointsFurther documentation coming soon. Suffice it to say that if your input data includes a "url" field, the point's info window will contain a link to that URL. (For SVG maps, the marker itself becomes a link.) 9: Adding thumbnails and photos to waypointsMore information will be coming soon, but you can see an example here. Suffice to say that in Google Maps and Google Earth, you can do a lot with fields in your input file named "thumbnail", "photo", and (optionally) "thumbnail_width". 10: SummaryHere's a list of the fields that are important in terms of how GPS Visualizer handles your waypoints. Alternate names are separated by slashes; for example, you can specify latitude with "lat" or "latitude."
[Return to the Tutorials index] Return to the main GPS Visualizer page
|