The Marengo GPS Route Planner

I recently built a Javascript application, based around Google Maps, which enables a user to plot a cycle route online, and then upload it to their GPS unit to allow them to be directed en route. I designed a 72-mile route on it when I first built it, and then rode it. I wasn’t familiar with the route, but at each junction the GPS told me which way to turn. Fantastic. No stopping to consult the map, just a good training ride.

You can see my reasons for building it here: http://www.marengo-ltd.com/gps/

The actual application is here: http://www.marengo-ltd.com/map/

Feedback so far has been overwhelmingly positive. I’ll be using this blog to update you on any updates, and other comments related to it. If you are a user of the application, consider susbscribing to this site’s RSS feed. And feel free to post comments!

Comments 49

  1. benjou wrote:

    Hello

    I continue playing a lot with your app and my scripts. I wrote another tiny script for directly working with GPX files in scilab:

    filepath=xgetfile(‘*’,’/path/to/your/GPXfiles/directory’,title=’Choose a GPX file’)
    gpx=mgetl(filepath);
    gpx_mod=gpx(grep(gpx,”

    Posted 26 Jun 2006 at 18:19
  2. Martyn wrote:

    Not sure what happened there, benjou, but your script doesn’t look complete :) It may be some filter in WordPress – I’m completely new to WP, so I may need to check configurations.

    Regarding your comment elsewhere about resource usage in the GPS Route Planner, I’ll have to have a look – it may be that I could add an option to avoid placing markers on the screen. It’s certainly not really designed for more than 100 markers currently, and that’s pushing it.

    Posted 26 Jun 2006 at 19:46
  3. benjou wrote:

    Ok I posted the script at http://ben-jou.ifrance.com/shared/profilegpx.sce

    You just need to adapt the paths (in my case /home/benoit/*) to your config.

    Concerning the ressource problem I encourage you to check out this
    http://www.gmap-pedometer.com/ and their script http://www.gmap-pedometer.com/gmapPedometer.js
    They do not display marks at every waypoint and thus you can work with many more waypoints.

    I think the problem with your app will come when you try to load a track from your GPS device onto marengo. A GPS takes approx. 1 point every 10 seconds so it is 360 per hour so can be more than 1000 for a long ride.

    I tried to upload a GPX file with 500 waypoints. It eventually showed up on the map but my browser complained about a stalled script several time.

    Posted 27 Jun 2006 at 08:58
  4. Martyn wrote:

    Although to be fair, the route planner is simply not designed for that type of abuse :) The two GPS units I’ve owned will only take a (relatively) small number of waypoints (as opposed to trackpoints). So although loading a track into the app is possible, it would be preferable to use, say, GPSBabel to simplify the route prior to loading it in. However, I take your point and will, for a future release, look at ways of turning off the markers to save resources. Thanks for your continued feedback!

    Posted 27 Jun 2006 at 09:30
  5. benjou wrote:

    Hi!

    I uploaded a newer version of the script that will work with coordinates having 0 to 5 numbers after the comma (that can happen in GPX files)

    Yep, I agree the route planner is not intended for this use but since one can upload GPX files to display them on the map, it would be really neat if one could display the track one has recorded on the GPS device. :p

    Posted 27 Jun 2006 at 11:36
  6. Ben Wilson wrote:

    I read about you today in the RoadBikeRider.com Newsletter. I understand how to create a GPX file of a route using your site at http://www.marengo-ltd.com/map/. But once I have a file, I don’t understand how to use the GPSBabel program. The Garmin Training Center is looking for files with .hst, .wkt and .crs extensions. What format do I convert my gpx file to and then how do we upload it to the Edge. I recently purchased an Edge 305 with HR and Cadence.

    Thanks for any help you can give me/us.
    ben

    Posted 29 Jun 2006 at 21:55
  7. Martyn wrote:

    Hi Ben… you don’t need to convert the GPX to anything, GPSBabel will take that and feed it to your Edge. Nor do you need the Garmin Training center software at all to make use of the Route Planner. See http://www.marengo-ltd.com/gps/ for some help on using GSPBabel. More detail can be obtained from the GPSBabel site itself at http://www.gpsbabel.org.

    Posted 29 Jun 2006 at 23:59
  8. Ben Wilson wrote:

    Marty:

    Thanks for the quick reply. I’m still doing something wrong as the Garmin 305 “won’t initialize”

    GPSBabel says:

    gpsbabel.exe -w -r -t -i gpx -f “foo.gpx” -o garmin -F USB:

    [ERROR] CreateFile on ‘USB:’ failed: The filename, directory name, or volume label syntax is incorrect.

    GARMIN:Can’t init USB:

    or

    gpsbabel.exe -w -r -t -i gpx -f “E:\foo.gpx” -o garmin -F USB:

    [ERROR] CreateFile on ‘USB:’ failed: The filename, directory name, or volume label syntax is incorrect.

    GARMIN:Can’t init USB:

    I have the Edge on and plugged into my USB cable. Is there a particular setting that should display for receiving an upload?

    Posted 30 Jun 2006 at 19:32
  9. Martyn wrote:

    I’m afraid my knowledge of doing it under Windows is extremely limited – I tried it once to test it and it worked for me OK. Presumably you’ve got the Garmin driver loaded? Is it possible that the Garmin software is “blocking” the device? If all else fails you might want to do some Googling around – see if any other GPSBabel users have had similar issues.

    Posted 30 Jun 2006 at 22:33
  10. jonellis wrote:

    hi thanks for www
    ive just bought a 305 but finding it hard to understand this website:
    using a mac osx 10.3.9
    on macgpsbabel running your richmond park route, i’m unable to load it into the 305
    the file is called rp.gpx.rtf (i dont know how to remove the rtf)
    the filter input ive tried all of them
    the output file type im using the gps receiver for output.
    i tap upload, another screen says
    ‘select GPSr type’ i put garmin
    and the port = garmin usb

    it then says cant get item “0”

    is there something simple i should be doing?
    cheers

    Posted 02 Jul 2006 at 15:04
  11. Martyn wrote:

    Hey Jon – first thing to try – sounds like you pasted it into Mac’s TextEdit application, which will save all kinds of extraneous junk in the file by default (hence the RTF extension). In TextEdit, try doing from the menu Format -> Make Plain Text (or press Shift-Cmd-T), then save the file out and ensure it just has a TXT extension. Try again, let me know how you get on.

    By the way, what version of macgpsbabel are you running, and where did you download it from?

    PS Hope the bones are healing

    Posted 02 Jul 2006 at 15:45
  12. mrwilli wrote:

    Has anyone actually used the The Marengo GPS Route Planner and WindowsXP Babelgui to send waypoints (routes) to their Garmin Edge 305? If so, would that person(s) please post a step by step procedure in simple language so the many who have failed may soon succeed in enjoying this added extra feature. Prior explainations have been somewhat vague and uninformative leading one to believe either a limited knowledge of Windows or it has yet to be accomplished.
    Thanks

    Posted 02 Jul 2006 at 22:18
  13. Martyn wrote:

    Try reading the GPSBabel manual. When you’ve figured it out, please post your step-by-step procedure for the enlightenment of “the many”.

    Posted 03 Jul 2006 at 04:41
  14. jonellis wrote:

    Martyn cheers for that works a treat
    i’m running MacGPSBabel 1.2.5 (v1.1)
    but i dont remember where i got it from, think i was from your link.

    I’m running a turbo in the garden at the mo, i’ll hopefully use the GPS in a month or so

    cheers

    Posted 03 Jul 2006 at 18:26
  15. benjou wrote:

    Hi

    I got my edge 205!
    Tried it yesterday for a ride.

    Well, I have mixed feelings about it:
    -No simple way to get your GPS coordinates. Maybe not so usefull when road cycling but crucial for mountain biking or hiking. I’m pretty sure it is just a way to make you buy another GPS for hiking (come on! you can display 10000 things such as thedawn and dusk times, why would’nt you be able to simply display the coordinates?)

    -the “profile” display as you can see here (http://garmin.ch/n_edge.php3) does not seem to exist at all (not even mentioned in the manual)…

    that were the cons.
    the pros: the precision is incredible
    I can download the track with GPSbabel and save it as a .kml file to display on googleearth (http://ben-jou.ifrance.com/shared/croisette.jpg)

    I had to do a few hacks before:

    I’m running ubuntu 6.06LTS;
    -I had to download the latest version of GPSbable directly from their site as an .rpm file and convert it to .deb using alien

    -the kernel support of Garmin GPS is a bit buggy, therefore GPSbabel recommend to use their driver instead. This require to blacklist the garmin gPS kernel module: just add this line: blacklist garmin_gps
    at the end of the /etc/modprobe.d/blacklist file

    then, track transfer is done with this command: sudo gpsbabel -t -i garmin -f usb: -o kml -F /path/to/your.kml

    And this works great.

    Posted 04 Jul 2006 at 12:25
  16. Martyn wrote:

    Hi Benjou

    I too am surprised that it’s not easy to get your current coordinates. The easiest way (I seem to remember) is to mark your current location as a waypoint and then look at that waypoint. Not too complicated, but not immediately obvious…!

    Agree with you too about the profile… I wondered about that. Unless we’re missing some setting somewhere? Anyone else had any luck with that?

    Thanks for the details regarding getting a track into Google Earth – I’m sure that will be useful to people.

    Posted 05 Jul 2006 at 10:56
  17. Tom wrote:

    I cheered when I found this website – here was someone doing what I was wanting to do – using a GPS to follow new routes. My question is this; with the Garmin Edge 205 what exactly do you see when you reach a turn waypoint? My problem is I need to use reading glasses (getting old!) and a GPS would be useless if I had to stop and put on glasses to see which way to go – it wouldn’t be much better than a map. What does the display actually show?
    Thanks in anticipation.
    Tom

    Posted 08 Jul 2006 at 08:21
  18. Martyn wrote:

    Hi Tom,

    The text you’ve put against your waypoint that comes up is small – I think you’d have trouble reading it. However, when you do come to a waypoint, the Edge also puts up a zoomed-in version of the route, so most times it’s easy to deduce, from the lines it has drawn on the screen, which way to turn.

    I would re-iterate however, that the software I designed is not specific to this model – if you feel you need a larger display, then other GPS models may be more suitable, and MAY still allow GPX upload via gpsbabel (I’ve only tested it personally with the Edge).

    Posted 08 Jul 2006 at 08:42
  19. benjou wrote:

    Hi again

    For those of you who do not want or cannot use the garmin software (for OS related reasons), I found this java software called GPSAR, that basically does the same thing. It is a sailor oriented software but since it can display altigraphs, it is a perfect tool for training (It displays the track with a color code relating to speed which is very informative)
    see the screenshot of this WE ride:
    http://ben-jou.ifrance.com/shared/Screenshot-6.jpg

    Posted 10 Jul 2006 at 10:33
  20. benjou wrote:

    And by the way, I found the way to display the profile from the edge205. It is function of the “virtual partner”. when you start a course against your virtual partner (basically on a ride that you have already done), you can display your position together with your position (on the previous ride) along your profile…

    Posted 10 Jul 2006 at 11:52
  21. Kevin Pfeiffer wrote:

    Hi Martyn,

    You recommend saving the return trip as a separate route. When I uploaded 2 routes to my device they both appeared on the map at the same time. And the 2nd route’s labels were modified to give them unique names, so instead of “0-START” I got “0-STA 1″ — or something similar. Can I really store up to 50 routes each containing up to 100 waypoints on the device at the same time? (If you know)

    -Kevin

    Posted 22 Jul 2006 at 14:37
  22. Kevin Pfeiffer wrote:

    Using the Marengo Route Planner with Garmin Edge “courses”

    Courses are like tracks in that they allow a large number of points and other data as well; if one wants more than 100 waypoints, one can switch to courses. Here is one way to do this:

    Create your GPX file as usual; then convert it to a course using GPX2CRS. Then upload course to Edge with GPSBabel (using usual Garmin USB setting).

    GPX2CRS is located here:
    http://www.niniu.com/Garmin/Gpx2Crs.zip

    (The application requires the .Net Framework 2.0 which one can get from Microsoft, if needed.)

    Posted 22 Jul 2006 at 19:54
  23. Martyn wrote:

    Hi Kevin, thanks for the info regarding courses.

    To answer your question regarding “out and back” routes, I must admit I haven’t actually tried this – all the routes I’ve done recently have been loops! More research required! If you (or anyone else) find anything useful regarding this then do please let us know.

    Posted 22 Jul 2006 at 23:49
  24. Kevin Pfeiffer wrote:

    Hi, regarding my last posting, I am unable to duplicate this. :-( I don’t know what I did before, or if I misread something. Anyhow, for now it seems, one has to import the course into the Garmin Training Center software (Win) and then upload to device. And this uploads _all_ courses in the Training Center.

    Posted 23 Jul 2006 at 09:43
  25. Kevin Pfeiffer wrote:

    I don’t think that there is a need for also uploading a return route as the Edge offers a “Back to the Start” function that lets you retrace your steps back.

    Posted 23 Jul 2006 at 13:38
  26. Kevin Pfeiffer wrote:

    I’ve found a better way of organizing things:

    I am using the 100 available waypoints for storing useful locations (such as rail transit stations in the city and country). Then if I decide to cut a ride short, for example, I can use the Edge’s “Find Nearest” to locate the closest transit stop. Another possibility would be gas stations, or ice cream shops.

    For my routes I am using the Garmin “courses” (Gpx2Crs does the conversion).

    Using the waypoint icons, one can uniquely identify these features (change one on the Edge, then download and use search and replace to change all the other entries).

    One does have to be careful to always use unique (max. 8 char.) names.

    Posted 23 Jul 2006 at 21:58
  27. Kevin Pfeiffer wrote:

    [Here is a copy of my "first-hand report" on using the Edge that I posted on the MotionBased forum.]

    Did my first course with the Edge, a 40K loop, tonight and learned a few things. First a brief explanation of how I set up the course and then my learning experiences (aka “Aha” experiences).

    I created the course using the Marengo Route Planner (http://www.marengo-ltd.com/map/), whose interface I prefer to Brad’s Course Creator. It creates a waypoint list which I easily convert to a course using Gpx2Crs (search forums for link).

    Gpx2Crs is set to automatically mark turns greater than 50 deg. (these will appear as left- and right-turn signs on the course map). I also set it to create course points every 70 meters to avoid extraneous “off course” messages (though other reports say this is no longer necessary). The resulting crs file is then uploaded to the Edge using the famous Garmin Training Center software.

    And off I went to meet my non-virtual riding partners. Here my notes:

    1. No history is created unless you are either following a course or have started the timer (? – here I am not sure, someone pls. confirm that the timer starts the history record).

    2. You should not try out new devices on your road bike when riding with other cyclists (they were patient and there were no accidents, but still…)

    3. At critical junctions (such as where one needs to “jump” from the road across a sidewalk to a parallel side road), one should either be sure that these are set with angles sharp enough to create a “turn” flag or one should manually flag them with the Training Center software (for example).

    4. If your course contains two closely spaced junctions (such as the dogleg described in point 3), be sure that the map resolution is sufficient to make them out (or use a flag as above).

    5. The compass function is much more useful and easier to read when following a course; it also warns of pending turns, tells you in advance which direction and how many minutes away they are (more useful than dist. to turn). The arrow is also very good about showing you that you are indeed following a curve correctly.

    6. The message that pops up announcing a turn is _too late_ (another reason to use the compass). This is not because, as posted earlier, the flags are set one waypoint off — I can see that they are on the correct points — the software simply does not take your speed and reaction time into account; the Edge beeps at me about a turn as I am pulling out of it.

    7. If you choose to go off-course, say to take a detour, switch to map view and zoom out a little so that you can see the original route; this lets you keep track of where you are relative to where you want to be, so that you can eventually return to the course.

    8. Be especially careful when planning your route to manually flag _forks_ in the road; these can otherwise sneak up on you, even with the GPS (not good if six guys are on your tail). It helps to try out the Edge at a couple zoom levels; this makes a big difference as to what you see or not on the map and when.

    That’s all for now. As you can see, I’m only using the course navigation features right now; all in all I am delighted with the unit (after a week); when I checked, the positioning resolution was 7m — not bad.

    Posted 25 Jul 2006 at 22:25
  28. Martyn wrote:

    Kevin, many thanks for your useful input – I can see I have plenty to research here. I’ll consider putting .crs support into the Route Planner at some stage when I get some time to work on it some more.

    Posted 26 Jul 2006 at 06:13
  29. Kevin Pfeiffer wrote:

    To confirm, someone clarified for me that the Edge begins to record a history when you press the Timer start/stop button.

    Posted 27 Jul 2006 at 09:55
  30. Tom Finding wrote:

    Kevin, very interested in your observations. Following on from my previous message about being able to clearly see route without glasses, I did briefly try a Magellan GPS with a slightly larger screen but the waypoints Marengo created would not give me a workable route, and it was heavier and more expensive than a Garmin Edge. So back to the Edge. “The compass function was much more useful and easier to read when following a course…warns of pending turns, tells you in advance which direction” Any chance you could give more information about this – perhaps a few photos? Sorry to go on but I am wanting to buy one but only if it would work for me.

    Posted 27 Jul 2006 at 16:12
  31. Michael Calwell wrote:

    Thanks for the site and scripts. So glad can use my garmin with my Ubuntu machine.

    Thanks for your work. Much appreciated.

    Posted 03 Aug 2006 at 12:01
  32. Nick Fielibert wrote:

    Is there a way to get the waypoints giving Kilometers rather than miles?

    Posted 04 Aug 2006 at 08:09
  33. Martyn wrote:

    Hi Nick,

    In the current release, no. But if you hover over the mile value with your mouse, a Km version of the distance will pop up.

    But please try the “beta beta” at http://www.marengo-ltd.com/map/development.html. Here you can set your preference for miles or kilometers as an option from the “Tools” button.

    If you use the development version and see any problems with it, please let me know.

    Posted 04 Aug 2006 at 08:21
  34. Nick Fielibert wrote:

    I’ve played with it a bit and it seems to work very well. Have not tested the GPX compatibility, but I’m assuming it will work the same as before.
    BTW, I’m using this together with the NGI topo DVD (Belgium, NGI is national Geographic Institute) and will be downloading routes to the Edge 205.
    Loading a route in the topo map, gives me the profile of the track (hills etc.).

    Posted 04 Aug 2006 at 09:15
  35. Kevin Pfeiffer wrote:

    Response to Tom:

    Here is a review someone mentioned to me; it is the _only_ online source I have found that seems to display all of the Edge screen shots (are you listening, Garmin):

    No guarantees that the link will come through. If not, go to http://www.pocketgpsworld.com and do a search for Garmin Edge.

    -K

    Posted 05 Aug 2006 at 20:40
  36. Nic Fielibert wrote:

    I just got my Edge205 and started playing with it. I managed to load a course it is and when I try to follow the course (and take a different road), it just pionts to the start of the course (the compass) and it tells me how far I am from the course. Do you have to start the course somehow?

    Posted 11 Aug 2006 at 08:19
  37. Martyn wrote:

    Hi Nic, please see your manual, page 51, the section entitled “To find and follow a route”

    Posted 11 Aug 2006 at 10:10
  38. Nick Fielibert wrote:

    Stupid me! it is simple. To start a course one has to push the start button. I was trying to do a course rather than a route. routes are limited to 100 waypoints.

    Posted 11 Aug 2006 at 15:33
  39. Guy wrote:

    Works fine with a Garmin Etrex Legend (linux Mandriva 2007 and usb/serial)
    Thanks a lot.
    Guy

    Posted 26 Oct 2006 at 15:15
  40. Martyn wrote:

    Cool… thanks for the feedback Guy.

    Posted 26 Oct 2006 at 15:19
  41. Paul wrote:

    Your open-source GPS is just what I’ve been looking for. I need to get off road in Slovenia, and not get too lost. I have been able to create my own GPX files with your programme, but with other files – e.g. http://www.bikely.com/maps/bike-path/To-ko-elo – I get the message “Failed to load the route… maybe the text was incomplete? But when I compare this GPX file with my own, I can’t see where the file could be complete. Can you help?

    Posted 24 Nov 2006 at 19:44
  42. Martyn wrote:

    OK, the GPX you reference appears to have two things which my app doesn’t like… if I replace the name “Toško ƒåelo” with “foo”, and also add a xyz to each routepoint, it seems to load in OK. Interesting. I’ll put it on the TO DO list… :) In the meantime, you’d just need to do a bit of editing if you want to import a Bikely GPX.

    Posted 24 Nov 2006 at 23:46
  43. Paul wrote:

    Hi Martyn. Thanks for the speedy reply. I still haven’t cracked it. I suspected the name “Toško Čelo” might be a problem, so I changed that to TC (top and bottom) and then I deleted the Iz Podutika na Toško Čelo line, just in case. And then by xyz I thought you must mean the 0 part that goes with every lat and lon, but it still doesn’t work for me. But, OK, it isn’t so important, basically I want to make my own routes so I don’t have to stop every few mins with a map.

    Another thing. You GPX file doesn’t contain any altitude information (and niether does the file relating to Tosco Celo that I got from Bikely – as far as I can see), but on the Bikely page I can click to view the altitude. So I am guessing that this information is carried by a different file. I’m kinda new at this, so I am not sure how it works exactly. But I was hoping that I could plan a route using a site like yours, and that I would not only know where to turn left and right, but also how much climbing and descending I would be doing on my planned ride.
    I have been fddling with this for ages. Think maybe it’s time to go out on the bike :-)

    Posted 25 Nov 2006 at 10:00
  44. Ulugeyik wrote:

    Hello,

    Wonderful program. I am curious if it is at all possible to combine this with “get directions” functionality. I am interested in exporting google map directions to gpx files after manipulating them by adding some way points in the middle.

    Also, is there a way to go to a location without dragging it along? I did not see it.

    Thanks :)

    Posted 15 Dec 2006 at 23:03
  45. Martyn wrote:

    Hi Ulugeyik, last time I looked, I couldn’t see any (easy) way of combining it with the Google “get directions”. This may have changed as they update the API frequently. I’ll bear it in mind!

    WRT to going to a location, I’m afraid there’s no way other than dragging currently… I find however you can usually get to where you want to go quite quickly by zooming out sufficiently and then zooming in on the desired area. If you are doing lots of dragging to the same area, you can always save that area as your “home” (Tools->Save).

    Posted 16 Dec 2006 at 11:45
  46. benjou wrote:

    Hello Ulugeyik

    There is a way to make a gpx file from a google get direction. You have to use the gmaptogpx bookmarklet.

    You can get either on point per crossroad (normal view) or the real (and thus very long) track (full view)

    It is at elsewhere.org

    Posted 19 Dec 2006 at 10:41
  47. chris warner wrote:

    This is an excellent piece of software, well done!!
    You can get directions ‘from’ & ‘to’ in Google Maps. Carry out query> Click ‘Link To Page’>Append ‘&output=js’ to the end of the url string in the address bar and hit ‘enter’>’File Save As’ to hard disk>

    1-Open>gpsbabel
    2- yourfile.htm = file in question.
    3- com1: being your file upload to gps destination.
    4- & count=30 to ensure that you do not exceed too many waypoints.

    C:\> gpsbabel -i google -f yourfile.htm -x simplify, count=30 -o garmin -F com1:

    To convert straight to a gpx file without simplifying them i.e. count=30

    C:\> gpsbabel -i google -f yourfile.htm -o gpx -F renameYourFile.gpx

    Good luck!

    Chris.

    Posted 28 Dec 2006 at 23:13
  48. chris warner wrote:

    In relation to my last post about directions to GPX in Google Maps:

    Please ensure that you save the web page as ‘Web Page, HTML only’.

    If you save as ‘Web Page Complete’ the page will save as a non-complient XHTML file. This file is not compatible with gpsbabel.

    The GPX output can be viewed easily in the freely available EasyGPS program.

    Chris.

    Posted 29 Dec 2006 at 02:00
  49. Bill Wohler wrote:

    Hi Martyn,

    Thanks very much for the tip about gpsbabel. It’s a great program and my laptop and my shiny new Garmin GPSmap 60CSx are squawking merrily with each other. As benjou mentioned in #15, the use of /dev/ttyUSB0 is discouraged. In fact, for me, it resulted in timeouts two out of three times, and truncated data on the third. Forget tracks. Once I followed the directions in http://www.gpsbabel.org/os/Linux_Hotplug.html to use the usb: device, even tracks transferred quickly. Check it out.

    When I have some time (ha!) I’ll check out your Google Map interface since the GPS and Google Maps together provide a great synergistic force. In the meantime, I just wanted to thank you for turning me on to gpsbabel (which was thoughtfully already a Debian package).

    If you ever get to San Francisco, drop by for a homebrew ;-).

    Posted 29 Jun 2007 at 05:01

Post a Comment

Your email is never published nor shared. Required fields are marked *