Yet Another Cycling Forum

General Category => The Knowledge => GPS => Topic started by: PhilO on 16 July, 2010, 09:03:06 am

Title: Spreadsheet --> GPX?
Post by: PhilO on 16 July, 2010, 09:03:06 am
Here’s a question – please excuse the length of the explanation:

I recently purchased a Garmin Edge 205 from a fellow YACFer, and am slowly getting to grips with its navigational features (Garmin don’t document these things very well, do they?  :facepalm:)

I’ve just about straightened out how to download routes created on BikeHike, and this seems to work a treat – so much so that I definitely want to take it with me on holiday in September with some stored routes ready to roll. The problem is, those stored routes will be off-road in the High Atlas, so plotting them on BikeHike is out. I have a printed list of Lat/Long coordinates for each piste that I want to ride, but have yet to find an easy way to convert that into a GPX file…

Does anybody know of a program or website which will allow me to type in the waypoints (say, into a spreadsheet), convert that into a GPX file and download it to the Edge?
Title: Re: Spreadsheet --> GPX?
Post by: Chris N on 16 July, 2010, 09:15:23 am
The basic format of a GPX file is very simple:

Code: [Select]
<?xml version="1.0"?>
<gpx version="1.1"
creator="Bikely - [url=http://www.bikely.com]Bike Trails, Paths & Routes From Over 40 Countries at Bikely.com[/url]"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="[url=http://www.topografix.com/GPX/1/1]GPX 1.1 Schema Documentation[/url]
http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata></metadata>
<rte>
<name>BREV-1</name>
<rtept lat="51.62796" lon="-2.6765"><name>AO-STA</name></rtept>
<rtept lat="51.62838" lon="-2.67753"><name>A1-L</name></rtept>
<rtept lat="51.62771" lon="-2.67912"><name>A2-RT</name></rtept>
<rtept lat="51.63013" lon="-2.68151"><name>A3-RT</name></rtept>
<rtept lat="51.63043" lon="-2.68124"><name>A4-L</name></rtept>
</rtept>
</rte>
</gpx>

It would be easy to type your own Lat/Longs directly into a gpx file in Notepad.

This is a part of a route (the Brevet Cymru audax) with named routepoints that works on the eTrex series of GPS.  Not sure if it works on the Edge.

(there's something funny going on with the <gpx version> data, something to do with the URLs in the the file and the forum software.  I don't know if these are necessary for the GPX file or not)
Title: Re: Spreadsheet --> GPX?
Post by: andygates on 16 July, 2010, 09:25:42 am
If you're typing anyway, I'd enter the points into Google Earth.  It takes about as long and in addition to sensible export options, you end up with a visualisation, which means it's easy to spot a wildly daft entry.

Manually entering coordinates is typo / silly entry hell, so viz is good. :thumbsup:
Title: Re: Spreadsheet --> GPX?
Post by: PhilO on 16 July, 2010, 09:36:13 am
If you're typing anyway, I'd enter the points into Google Earth.  It takes about as long and in addition to sensible export options, you end up with a visualisation, which means it's easy to spot a wildly daft entry.

Manually entering coordinates is typo / silly entry hell, so viz is good. :thumbsup:

Aye, I envisaged uploading the route to somewhere to preview it for that reason...

I didn't realise that you could enter points directly into Google Earth - will install it and have a play later...
Title: Re: Spreadsheet --> GPX?
Post by: inc on 16 July, 2010, 10:07:50 am


Does anybody know of a program or website which will allow me to type in the waypoints (say, into a spreadsheet), convert that into a GPX file and download it to the Edge?


Change your spreadsheet into a .csv list and gpsbabel should convert it to a .gpx file  or any other format including GE formats. I do this the other way to get .gpx into an OS mapping application with a closed file format.
Title: Re: Spreadsheet --> GPX?
Post by: andygates on 16 July, 2010, 10:23:33 am
Change your spreadsheet into a .csv list and gpsbabel should convert it to a .gpx file  or any other format including GE formats. I do this the other way to get .gpx into an OS mapping application with a closed file format.

Really? That's ever so cool.

Might make it more attractive to type them inna spreadsheet and viz in GE afterwards. 

Ambassador! With the number of ways to skin this cat, you are really spoiling us.

Title: Re: Spreadsheet --> GPX?
Post by: mattc on 16 July, 2010, 10:43:36 am
The basic format of a GPX file is very simple:

Code: [Select]
<?xml version="1.0"?>
<gpx version="1.1"
creator="Bikely - [url=http://www.bikely.com]Bike Trails, Paths & Routes From Over 40 Countries at Bikely.com[/url]"
xmlns="http://www.topografix.com/GPX/1/1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="[url=http://www.topografix.com/GPX/1/1]GPX 1.1 Schema Documentation[/url]
http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata></metadata>
<rte>
...
...
</gpx>


Does the header actually need all those fancy XML URLs? Will anything break if you just use:

Code: [Select]
<gpx version="1.1" >
<rte>
...
Title: Re: Spreadsheet --> GPX?
Post by: PhilO on 16 July, 2010, 12:07:35 pm
Thanks Peeps!  :thumbsup:

A few options to try, there.

I've also come across this site (http://www.gpsvisualizer.com/convert_input), which looks like it might do it all for me... Anybody any experience of this one?
Title: Re: Spreadsheet --> GPX?
Post by: inc on 16 July, 2010, 12:40:07 pm
Thanks Peeps!  :thumbsup:

A few options to try, there.

I've also come across this site (http://www.gpsvisualizer.com/convert_input), which looks like it might do it all for me... Anybody any experience of this one?

It is just a gpsbable web frontend. Gpsbabel is available as a gui for all OSs
Title: Re: Spreadsheet --> GPX?
Post by: Cunobelin on 18 July, 2010, 09:39:20 am
Although not to any great detail, Bike Hike and other sites such as Bike Route Toaster (http://www.bikeroutetoaster.com) enable road planning in North Africa.

May be enough to get the main route points if nothing else
Title: Re: Spreadsheet --> GPX?
Post by: TimO on 18 July, 2010, 10:25:10 am
Ambassador! With the number of ways to skin this cat, you are really spoiling us.

We should be doing it in perl then. ;D

TIMTOWTDI (http://en.wikipedia.org/wiki/There%27s_more_than_one_way_to_do_it)

I would have gone the GPSBabel way, but I routinely use it to reduce the number of points from my Active 10 (slowest sampling is once every 4 seconds, and most web site won't accept a days worth of GPX at that resolution!)
Title: Re: Spreadsheet --> GPX?
Post by: PhilO on 19 July, 2010, 05:20:54 pm
Thanks for the suggestions so far!  :thumbsup: I'm still struggling, though...  :-[

Change your spreadsheet into a .csv list and gpsbabel should convert it to a .gpx file  or any other format including GE formats. I do this the other way to get .gpx into an OS mapping application with a closed file format.

Well, I tried this and GPSBabel said it had converted the file successfully. So I tried to upload it to a mapping site (BikeHike) to review it and transfer the track to my GPS, only to get a 'file invalid' error.  :-\  I suspect that it must be something to do with how I'm formatting the input data on th espreadsheet - can anybody add some detail for me? Do I need headers? Lat/Long in decimal degres or degrees and minutes? etc, etc?

So, anyway, then I tried:

If you're typing anyway, I'd enter the points into Google Earth.  It takes about as long and in addition to sensible export options, you end up with a visualisation, which means it's easy to spot a wildly daft entry.

But I must be going senile, 'cause I'm buggered if I can see a way of entering the information into Google Earth...  :'(
Title: Re: Spreadsheet --> GPX?
Post by: inc on 19 July, 2010, 10:24:37 pm

Well, I tried this and GPSBabel said it had converted the file successfully.espreadsheet - can anybody add some detail for me? Do I need headers? Lat/Long in decimal degres or degrees and minutes? etc, etc?


It was a while ago since I last needed to do it so I just looked at and old file and the spreadsheet is like this

52.31351, -2.91277,    in column A, and descending, no headers and in decimal, this is as a text file called doc.csv and it converts fine to a gpx .
Title: Re: Spreadsheet --> GPX?
Post by: PhilO on 20 July, 2010, 08:10:17 am
Ta! Will give that a whirl!  :thumbsup:
Title: Re: Spreadsheet --> GPX?
Post by: frankly frankie on 20 July, 2010, 12:15:04 pm
Does the header actually need all those fancy XML URLs? Will anything break if you just use:
Code: [Select]
<gpx version="1.1" >
<rte>
...

Some programs are fussier than others.
Bikely will open this (not even an xml file header, tsk tsk):
Code: [Select]
<gpx>
  <rte>
    <rtept lat="52" lon="-1"/>
  </rte>
</gpx>
or did last time I tried - whereas Mapsource would want at least this:
Code: [Select]
<?xml version="1.0" ?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" creator="Fred Bloggs" version="1.1">
  <rte>
    <rtept lat="52" lon="-1"/>
  </rte>
</gpx>
Title: Re: Spreadsheet --> GPX?
Post by: bikefish on 20 July, 2010, 09:56:39 pm
I used a mapping garmin las t year in N-central Morocco. There were then at least 4 different maps for Maroc you could load into Mapsource on your computer, modify and then drag into gps. None were of city nav quality - when I left Ceueta / Mellila (on CNEu as Spanish enclaves) was like falling off the map into a black hole. Contours were useful, I had 20 m (over the German sites basemap, with some OSM) but 5 m intervals would be better where youare going as there wont be much other detail. Maybe some French or Spanish MTB sites for DL tracks ?. May be worth aggregating everything as you can find as you can turn off layers that dont add detail on gps. This time of year blistering days, near freezing nights...
Title: Re: Spreadsheet --> GPX?
Post by: PhilO on 21 July, 2010, 09:36:51 pm
Just to clarify: the Edge isn't a mapping GPS and I don't have Mapsource. Plus the routes in question are Off-road, so no online mapping software will show the details necessary to plot the route...

I gave up trying to find a package or site that would do it in the end, and reverse-engineered a file I'd successfully created for a local ride. From that, I've produced a spreadsheet which will take the input Lat/Long data and generate each line of code via simple concatenation. That, pasted into a text editor, forms the GPX file which I can then transfer to the Edge via BikeHike....

'Tis a bit of a ball-ache, but I can live with it for this one trip.   8)

All I need to do now is work out how many routes I can store before leaving...

Thanks for all the suggestions!  :thumbsup: