USING gmap15 FOR ROUTE VIEWING, CUE SHEETS and CUE SHEET EDITING


Randonneurs Ontario

I ) Objective

The goal of this page is to introduce you to gmap components and give a brief tutorial on cue sheet embedding in GPS files. The objective of gmap15 is to combine GPS technology and paper, turn-by-turn cue sheets. Reviewing and editing of cue sheets should be easier while the cues should be more accurate. Gmap15 uses the notes field stored in tcx files or the rte fields stored in gpx files to supply turn by turn cue sheets.

Browser limitations and security. I work with Firefox on Linux and test with Firefox and Safari on Mac OS-X and Firefox on Windows XP. Local file access uses FileReader and works with Firefox and is supposed to work in Internet Explorer 10.0 and Safari 6.0 and later. FileReader does not work in older versions of Internet Explorer or Safari.

The entire app is written in Javascript and executes in the browser. Security restrictions in the design of Javascript prevent access to the local hard drive in a standard fashion. To get edited files out I use a text window and ask that you copy and paste the entire window contents to a text editor and save the file. When a good mechanism for local file storage becomes available for browsers, I hope to change this.

II ) Overview

When gmap opens it should present a screen much like that shown below. The upper part of the display is a Google Map, a free service offered by Google. The lower left is a profile chart that shows a simplified elevation versus distance graph. The lower right is a statistics table which shows details of each track that was loaded. The map controls are in the upper right corner. The very top controls are the boxes Map Satellite which are provided by Google. Descending down the right side of the page there is a control for each track found in the given file. The number of these track controls will depend on how many tracks were read. To the left of MAP there is a box marked FULL. It is the control which hides the profile and statistics windows allowing a full screen view of the map. On the top left there is a box labeled "File" from which a menu should drop down on mouseover.

    The menu items should mostly explain themselves.
  • "Get gps file from server" opens a file dialog and asks where to store a copy of the gps file that is displayed.
  • "Create cue sheet" will try to open a pop-up window with a cue sheet. You may be asked if you allow www.randonneursontario.ca to open pop-ups. Allow us and you can see the sheet.
  • "Open file from hard drive" will open another file dialog and try to open a file. This works in Firefox and should work in most modern browsers that support HTML5, but see note above about browsers.
  • "Show gpx in export window" is the only way of extracting edited files from gmap at present. To save the edits locally, choose the text area and do a "Select All" and then "Copy". On my computer, that is 2 key strokes, Control_A followed by Control_C. On a Mac it is Apple_A Apple_C. Paste the text into an editor that saves text. On Mac I use Textedit.

Open gmap in a different tab by right clicking on this link and experiment with the controls in a live window. This is a tcx file. To see more files, there is a table of work in progress at the bottom of the page.

III )Inserting 1 cue

Insert a cue by zooming in to the location where you want the cue. Right click on the black track line at the spot you want the cue. The cursor changes from a waving hand to a pointing finger when this feature is active. A green balloon should appear on the track and a small edit window will open. It should look like the image at right. The distance from start of the track is visible at the left and if there is another cue after this, the distance to go will be in the box at right. Enter the text that should appear in the cue and click save. If this is a control use the word control in the description. The balloon colour will be changed to red and it will always appear on top of any other cue balloons. The text in the cue is activated by a mouse over so a series of cues can be inspected quickly by scanning with the mouse.

IV ) Editing and deleting cues

Right clicking on an existing cue re-opens the edit balloon. Make any changes you want then click Save. Delete a cue by openning the edit window with a right click and clicking on Delete. Cancel and "Close window" both close the window with no changes.

There is no Undo operation. If undo is really important to you please let me know and it may be included in a future version of gmap.

To reset everything, reload the page. That can easily be done with Reload or Back and then Forward. This is also a warning that any edits can be lost instantly by navigating away from the gmap page. This is the same behaviour as in Google Maps.

V )Google Directions Service

The Google Maps that you may be familiar with is a Google web site. The components used to make up Google's site have been made available for purchase or in a restricted form for free. We use the free service whic comes with 2 restrictions. 1) only 7 waypoints can be applied and 2) only 2500 requests per day are allowed. In addition, Google's terms of use specify that if we render te turn dirsctions ourselves, then we must attach Googles copyright notice. Our cue sheet is the rendering of the directions and you will find a Google copyright appended at the bottom of each cue sheet if Googles Directions Service was used.

Here is how to use Google Directions Service on one of my tracks. Right click this link and open in a new tab to try.

  • Right click on "1Winchester" over at the upper right. The name will be given a red background colour and a request will made for a route from the track start to the track end. You should have a screen like the image at right if you try this with the above link.

    The shortest route from A to B is not on the gps track and so we use the constraints to drag the route to match the cycling track.

  • After some dragging of the route we have the blue route matching the black track line. Right click "1Wincester" again to insert the new route points into the cue sheet. The cue sheet should now have 13 instructions.

  • If you are following these instructions, your map should look something like the image at right. The green balloons appear where a cue is needed. There are as many balloons as there will be lines on the cue sheet. Click on "File" -> "Create CueSheet" now in your trial tab/window and you should get a prototype of a cue sheet for the 31km of this track.

  • Longer tracks will require multiple fit steps. Move the end points and fit just a section of the track. Repeat as desired to fill in cues. Mouse over the green balloons, review the cues and if needed manually make corrections.

  • Cancel a directions request with the ESC key. If you ACCIDENTALLY right click on a track name and invoke the directions service, DO NOT RIGHT CLICK TO CLOSE THE SERVICE. An unknown number of cues could be inserted into the sheet. Press the ESC key to abort a directions service request without inserting any points into the cue sheet.

VI ) Rules for cues from the Google Directions Service

    Gmap always applys the following rules when incorporating cues from Google Directions Service. If a a cue is rejected, an alert window is openned describing each rejection.

    1. U-Turns and the point before and after the U-Turn are discarded.

    2. Duplicate cues are detected when a new cue is within 10 meters of an existing cue.

    3. Off track cues are detected when a cue is more than 100 meters from the track.

  • U-Turns indicate something wrong with the routing. One cause is using low magnification when dragging the route. Look at these images. On the left is a low magnification image that looks ok. But, look at the circle near centre. There is a blue smudge extending to the north east from the circle. The magnified view on the right shows that by accident we have clicked on a dead end road leading away from the track.

    The cue sheet generated here has a left turn onto the dead end road, followed by a U-Turn at the end and then another left turn back on route. Gmap detects the U-Turn and removes the u-turn and the points on each side.

    What if we do not remove the U-Turn? It will get removed by the 100 meter off track rule anyway. But what happens when the other rules are applied? Applying the duplicate cue rule removes the second cue back on route. So what is left? The original left turn off-route showing a distance to go to the next on-route cue. Following the cue will lead you to visit a farmer at the end of a dead end road and a few bonus kilometers. Gmap shows an alert like that on the right each time it removes a U-Turn.

    There are other computer logic rules that lead to U-Turns, but since I have never intentionally written a U-Turn into a cue sheet, I remove them all in gmap. If necessary, you can always rightclick a track and insert a U-Turn by hand.

  • Duplicate cues are easy to generate and make annoying zero length legs on the cue sheet. For example, I like to add key points by hand such as restaurants and controls which I can easily see on the GPS track. These cues I do not want over written so when gmap imports a set of cues from Google Directions Service it discards new points if they are within 10 meters of an existing cue. This also helps if you use the service more than once since there may be an overlap at the beginning or end of the segment. An example of a gmap alert that it is ignoring a duplicate is shown at right.

  • Cues that are more than 100 meters from the track are discarded. This is often a warning that some thing is wrong with the route. Gmap displays an alert message similar to that shown at right. It includes the distance from the start of the ride so that the area can be better inspected. Some times it is an indication that the map set is out of date and the road has been moved. Often it indicates that there was an error in forcing the route to match the track and it is advisable to read the cues around the given distance carefully.

VII ) Importing gpx files

GPX files are read in 3 sections: waypoints, tracks and routes. Waypoints are indexed by associating each point with a track point based on nearest approach. At present, only waypoints that have control in either thier name or desc field are inserted. All tracks are tested since waypoints do not inherently have an association with any track. On loop routes this will be unambiguous but on out and back routes the closest track point may be in the wrong direction. Check on what happens.

The route points are then indexed in sequence which should be unambiguous since they should occur in the sequence they will be passed. If a route point collides (closer than 10 meters) with one of the previously inserted waypoints, the route point is discharded.

VIII ) Getting a track file

Use a gps recorded track from last years ride. Go and ride the route with gps recording. Drive the route.

After each ride I try to remember to save the recorded track. Often some part of the track will be useful in making a different route. See far down on this page for track editing using gmap.

I think that breaking the route into segments at controls makes my visualization of the route easier. The track control switches both the track and any cues associated with that segment on and off. Tracks are 50 to 150km long and that is a reasonnable size to inspect at once. I break the route file by switching my Garmin GPSMap 60Cx off and then on again at each control. This makes tracks with names like ACTIVETRACK001 ACTIVETRACK002 etc..

Gmap however does not impose a requirement that tracks be broken or that track breaks are coincident with controls. Many of my old files have no breaks or breaks in the wrong places so not having a rule here lets me use old data with less work. It is however, very difficult to inspect out and back routes when both are turned on so I am in the process of breaking my files at controls.

IX ) Conventions in gpx files

  • Then word 'control' should appear in the description field or the name field of a cue for gmap to format that line as a control. "Start" and "Finish" are also considered controls when colouring the balloons and formating the sheet. If the control is entered from a gpx file waypoint, then the word control can be used in the waypoint name. The formating performed by gmap is to print the line with the cue with an empty distance box. This helps me see that line when on the bike.
  • Each track in a file must have a unique name. In order for gmap to assiciate a route section with a track, the route must have an identical name to the track. Routes that do no have a track with a matching name are ignored.
  • I place a cue at the beginning of a segment that tells how to exit the control. It helps when I have been resting in some place off the road to know that I should "Turn left and ride north..." or "Backtrack and return to ... ". Gmap automatically inserts the distance to next cue when "control" does not appear in the description. In order to escape the duplicate cue discard rule, my exit cue will be more than 100 meters down route from the control.
  • Breaking the track file into sections that run from control to control gives gmap an easier time to figure out which cue goes where around controls.
  • A naming convention that I use is to name controls by where they start. However, gmap does not try to enforce any naming convention except that track/route pairs have identical names.
  • Routes are not intended for navigation. There are a limited number of tags in gpx, routes and tracks are the only tags which are used for an ordered set of points. Tracks are the core of the gps file so only routes are available for storing cues. It is possible to download the routes to a gps and use them for navigation, however it is your responsibility to review the result and determine if it is suitable for navigation.
  • If Mapsource and Garmin extensions have been used to set options in a file that is then edited with gmap, an attempt is made to preserve the Garmin extensions. So far, it appears that the extensions only change presentation properties such as colour and symbols in the electronic unit and my interest is in the textual navigation information. Hopefully, our mutual irrelevance will allow me to continue to ignore the extensions.
  • TCX files are different than gpx in that a course tag encloses the equivalent of the track and route in a gpx file. This enclosure removes the name and naming convention. TCX removes the first and last course points and puts them in a header called first and last where they are easy to find, but lack descriptive text. TCX files do not seem to have waypoints. Gmap reads TCX as a variation of a gpx file, with different tag names.

X ) Track trimming, splitting and merging - a recent addition to gmap

I have a collection of gpx files and need a method of easily trimming off bits of the file and cutting tracks into sections. I use a few programs in combination, none of which is exactly right. gmap is mostly being made for me to make and check cue sheets easily.

Here I will demonstrate trim, split and merge additions to gmap using an archive file from a ride in 2005. The live link will show a bare track with no cues. There is extra stuff on the track because I turned the gps on at home and may have forgotten to turn it off later. Also I rode a few bonus kilometers that I would like to remove.

Start with trim. Zoom in on the start location, the Cheshire Cat pub which is at the corner of the route near Kanata and insert a cue on the start of the ride. The screen should show an edit menu in the ballon which has a split-trim-merge second from the right at the top. Notice that the distance shows 19.6km which is the distance from my house. Mouse over the STM menu and choose trim from the drop down list. The lead in track should disappear and the stats window should update to show about 20km removed from the track. You can now insert a cue that says Control some where and should see a distance of 0.0. Mouseover the return squiggle and right click again then trim again. The stats window and profile should upate to show that we have removed about 40km from the track.

Split can be demonstrated at Calabogie the first control. Select a point before the wool ball on the route and choose "Split Track". The track is split and the temporary balloon removed. Use Trim to remove the wool ball from the outbound tracks and then add cues.

Split trim merge can be demonstrated at Eganville. In 2005 I made an error and left the control going in the wrong direction. After a short distance down the road I turned around and continued on the route. This left a hair-pin in the track which I want to remove. In addition we now use a different location as a control.

Choose the very end of the hair pin as shown at right and then choose "Split Track". This split provides 2 track ends which can now be used by Trim which always removes track to the nearest end. Trim the part on CR-512 and then trim the part on ON-41 exactly at the intersection. Trim inserts a track point at the location of the trim so the intersection can be marked exactly. The extraneous distance has been removed by 3 mouse clicks but there is a gap on the route. The distance across the gap is included in the total but the clear area indicates the begining of a new track.

Merge joins the ends together and forms a single track with the same name as the arrival track.

XI ) Work in progress

Gmap and the cue sheets that it generates are a work in progress. Here is a look at what a selected set of gps files presently looks like.

LinkDescription
Toronto
Wiarton_Connection_600K.gpx File with waypoints.
Wiarton_Connection_600K.tcx TCX version
TOT_1000.gpx TOT_1000 as recieved
TOT_1000.tcx No changes
Woodville_200.tcx No changes
Ottawa Animalathon_300.gpx
Kingston_600.gpx
Kingston_600.gpx Cues are not restricted to roads. Here is an expansion of a bike path section of the Kingston 600.
Maberly_200.gpx
Mississippi_117.gpx
Original_200.gpx
Osgoode_133.gpx
Osgoode_60.gpx
Vennachar_300.gpx
Westport_400.gpx
Huron Wiarton_Willy_200.gpx Track from 2010 club ride. Note that turning off gps at beer stops provides good track breaks for gmap.


Copyright 2010, Randonneurs Ontario Comments? E-mail the WebMaster