# working with GPX files



## FM (Apr 30, 2003)

Short version: What I am trying to do is trace over a map, then convert to gpx so I can bring it into my phone's GPS app. I'm trying to figure out if the issuse I'm hitting can be worked around by editing the GPX files, or if there are inherent limitiations to the gpx format.

Details: There is a local trails network with over 70 trails & roads...the only maps I have found are images (jpg), so I brought them into google earth as an overlay, and created a path traced over each trail, also adding waypoints for intersections. Looks great in google earth! Then I exported to KML, translated to GPX, so I could import into my GPS app (motion-X on the iPhone).

The first thing I found was that each trail became a separate "track", so I could not view the entire trail network at once- not very useful.
So I tried editing the gpx files in text format, deleting the trkseg tags... no change. Then I also tried deleting the trk tags, which allowed me to import all trails as a single track, but the GPS app showed straight lines connecting the ends of each trail. So now it occurs to me that GPX files show tracks, which means they may not be able to show two trails that intersect, but are not continuous. Great for showing a ride you did, but useless for showing all trails in an area.

Are there any other ways around this, or is it a limitation of the GPX format?
Would a dedicated GPS (say... a garmin edge 605) allow me to import a map (not a track) exported from google earth?

Nerdy stuff, I know


----------



## Harold (Dec 23, 2003)

What you're seeing is a limitation of the .gpx format. It interprets things as linear (point-to-point) features, not polylines (GIS-speak for spiderweb networks of interconnecting lines).

You need to work with a different format to make it work best. .kml (or .kmz) will work great with that sort of data. Unfortunately, most GPS receivers will not work with that format. I have no idea if any smartphone GPS apps will work with it well.

The newer Garmins (Oregon, Dakota, 62, 78, Edge 800) CAN work with .kmz formats.

Your OTHER option, if you want your map to be compatible with a wider range of GPS receivers, would be to use the technique described at www.gpsfiledepot.com to turn that network of trails into a transparent basemap overlay that can be loaded with Mapsource.


----------



## FM (Apr 30, 2003)

Thanks Natehawk. That confirms what I was thinking.
Doesn't seem like the GPS apps for phones support anything besides gpx files... so I don't think an overlay will work with my current hardware.


----------



## frenk (Jul 18, 2006)

GPX files can store routes and/or tracks. You generally use tracks for data you've collected on the go, while routes are to describe paths you (or other) plan to follow.

Tracks and routes are collections of points (with their coordinates): you can put as many or as few of them as you want: if you need a precise track you'll have to put more points as it will make the track smoother. Connecting points without intermediate coordinates just by following an existing trail on the map is rather hard and I don't know if there are applications that can do it (probably yes).



> The first thing I found was that each trail became a separate "track", so I could not view the entire trail network at once- not very useful.


This is more a limitation of the application than of the file format: there are applications that can show more tracks (and even more gpx files) at the same time. Anyways this is the correct way to store different trails in a single gpx file, otherwise it would be impossible to follow them once loaded on a GPS device.

Maybe part of your problem is the way you convert the google earth file to gpx. How did you do this? I usually had good results with gps Babel. Also it's possible that for performance reasons the iphone app skips several intermediate points giving you the "straight start-to-end line" effect.

I've worked quite a lot with gpx files, if you'd like to post your gpx and kml file (or part of it) I can take a look.


----------



## Harold (Dec 23, 2003)

frenk said:


> GPX files can store routes and/or tracks. You generally use tracks for data you've collected on the go, while routes are to describe paths you (or other) plan to follow.
> 
> Tracks and routes are collections of points (with their coordinates): you can put as many or as few of them as you want: if you need a precise track you'll have to put more points as it will make the track smoother. Connecting points without intermediate coordinates just by following an existing trail on the map is rather hard and I don't know if there are applications that can do it (probably yes).
> 
> ...


If you work on a computer all day exclusively, you can use the GPX file format. Topofusion can interpret a polyline .gpx file correctly. I'm sure other computer programs can, also. But I have yet to see a GPS that doesn't break these up into individual segments. AFAIAC, that's a limitation of the format.


----------



## FM (Apr 30, 2003)

frenk said:


> Maybe part of your problem is the way you convert the google earth file to gpx. How did you do this?
> I've worked quite a lot with gpx files, if you'd like to post your gpx and kml file (or part of it) I can take a look.


Hey thanks- I'll take you up on this- will post the files tonight while I am at home.

I used GPSBabel to do the conversion from kml to gpx. Tried importing several different versions of the gox file into my gps app, some edited to remove trkseg and trk tags. But I think the issue is that I am really trying to import a map (or view multiple tracks at once to create a map), so I am out of luck since I can only view one track at a time within motionX.


----------



## FM (Apr 30, 2003)

Here's the gpx file. Exported from google earth, then translated to gpx by GPS Babel.

I played with OSM a bit yesterday, I am wondering if that's a solution for me, since many GPS's and apps can import OSM files. But so far I'm not sure if the OSM files contain all user defined data. Any thoughts on this?


----------



## newfydog (May 8, 2009)

I use the file conversion function on GPS Visualizer.

I do all my routes in Google Earth, save as as a .kmz file and convert. You can do multiple files at a time, and it is nearly instant. And Free. I've done hundreds of them.


----------



## FM (Apr 30, 2003)

newfydog said:


> I use the file conversion function on GPS Visualizer.
> 
> I do all my routes in Google Earth, save as as a .kmz file and convert. You can do multiple files at a time, and it is nearly instant. And Free. I've done hundreds of them.


Same issue though, I just confirmed it...my KMZ from google earth, translated to a single gpx file by either GPSBabel or GPS visualizer, becomes 74 individual tracks in my GPS app (motion-X) with the ability to only view one at a time.

Does your GPS alow you to view multiple tracks at once? Up to 74?


----------



## newfydog (May 8, 2009)

Yeah, when I opened that file I saw that my first answer was no help.

I had the same problem with our trail network in Bend. There are a million trails and they load one at a time

A guy who posts here as MarkHL fixed it for me. He had made a mapset from the trails, so they all install as part of the base map. I managed to get it loaded, but I'm not real good with that stuff yet. I know there are several ways to make custom maps, including one on the Garmin website. Myself, I'm going to work through some tutorials at GPS FileDepot and see if I can't get up to speed.

Here's his answer:

"Download two free pieces of software call MapsetToolKit and cGPSMapper (links below)and use it to install the file I sent you (11112222.img) in your Mapsource program.
It is a transparent map of the Bend trails that will overlay on top of any other maps you have installed on your GPS (i.e., the trails show up on your current maps). 
The picture below is an image of the MapsetToolKit ready to install the new custom map in Mapsource. After that you just upload it with your other maps to you GPS)."

send me a PM and I'll forward his email with all the links.


----------



## Harold (Dec 23, 2003)

newfydog said:


> Yeah, when I opened that file I saw that my first answer was no help.
> 
> I had the same problem with our trail network in Bend. There are a million trails and they load one at a time
> 
> ...


Yep, this will do the job avoiding the hassle of working with .gpx files. HOWEVER, it only works with a Garmin GPS. Unfortunately, the OP is toast with a smartphone app. You might want to search your respective smartphone app store for an open source GIS app. They're not common, but there might be one or two out there, and you might be lucky that it'll work on your platform. I see there's a free one for iOS called Terrapad Lite (there's a pro version for $49.99). It looks to me like you'd want the Pro version, anyway, since it supports .kml import and all the extensions are free. It looks like options are there, though. I searched "GIS" in the app store to find this one. Try out the free version, keeping in mind the extra features pro would offer you.


----------



## FM (Apr 30, 2003)

Thanks both for the help.  

I could stomach $50 for terrapad pro. 

I'm happy enough with the current accuracy & reception of motion-X GPS on my iphone- interestingly, it was horrible for a while, but recently started working much better, not sure if it was a motionX update or an iOS update... regardless, the limitations of the GPX files on all the phone GPS apps I have tried are definitely a bummer, and if there's no way around that then buying a dedicated GPS is inevitable.

I just want the maps I've drawn in google earth, out with me on the trails... not to much to ask!  

I'll let you guys know how terrapad lite is. 
If it's decent than the pro version will be a no-brainer.


----------



## FM (Apr 30, 2003)

Hey guys, thanks again for the help.

Just posting a few things I've come across. I DL'd terrapad lite and exchanged some emails with their support folks. It's a cool app- I really liked the UI, and their customer support is awesome- the tried loading several files I provided on the pro version, to see how it would react before I spent $50. Unfortunately terrapad pro only imports shapefiles currently, and my attempts to translate KML to shapefile were not very successful.

I did find the iPhone app "GPS Kit" imports KML files very nicely. I was skeptical based on the website but this ended up being a great app- I like it much better than motionX GPS. In 2 days I've been able to load 3 local trail systems I ad drawn in google earth, probably 150 trails total, and I can view them all at once as I record tracks. Pretty cool.

It sounds like a dedicated GPS is in my future, but I'm not rushing into it, especially since I am a mac user, and the current mac software looks pretty limited.


----------



## Harold (Dec 23, 2003)

FM said:


> Hey guys, thanks again for the help.
> 
> Just posting a few things I've come across. I DL'd terrapad lite and exchanged some emails with their support folks. It's a cool app- I really liked the UI, and their customer support is awesome- the tried loading several files I provided on the pro version, to see how it would react before I spent $50. Unfortunately terrapad pro only imports shapefiles currently, and my attempts to translate KML to shapefile were not very successful.
> 
> ...


Thanks for the update. What method did you attempt when you tried to convert .kml to shapefiles? If you weren't aware already, shapefiles are actually a collection of multiple files referring to different parts of geographic data. Might be that Macs don't exactly like the format much and have a hard time with trying to convert.

Since you run a Mac and are getting into some mapping functionality, you might want to look into GIS software. Try out QGIS (Quantum GIS). It's open source and comes in a Mac flavor. I have it. It's not my favorite GIS program, but it will do a number of things for you...and it's free.


----------

