Skip Menu |

This queue is for tickets about the Geo-Gpx CPAN distribution.

Report information
The Basics
Id: 90864
Status: open
Priority: 0/
Queue: Geo-Gpx

People
Owner: Nobody in particular
Requestors: dougmc [...] frenzied.us
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Is there any way to build a track with Geo::Gpx?
Date: Wed, 27 Nov 2013 18:20:34 -0600
To: bug-Geo-Gpx [...] rt.cpan.org
From: Doug McLaren <dougmc [...] frenzied.us>
I'm using Geo::Gpx to make a gpx file and then convert it to a map, and it was working great using the $gpx->add_waypoint($wpt) interface, but I couldn't figure out why I was getting points rather than a track. ... and then it hit me -- I was adding waypoints, not a track. Looks like Geo::Gpx doesn't have a way to create a track, only read it. $gpx->tracks is read only, so I can't write a track to it. Is there any way to create a track using it that I have missed? If not, it might be a worthy feature to add. As it stands, it looks like my best bet is to just write the gpx file with waypoints, then use gpsbabel to convert them into track points. Or just make the xml file myself. Hmm, gpsbabel is being difficult. Looks like this is the easiest way I found -- my $gpx = Geo::Gpx->new(); ... repeat a lot of $gpx->add_waypoint($wpt) ... my $xml = $gpx->xml ; $xml =~ s!(<wpt )!<trk><trkseg>$1! ; $xml =~ s!(</gpx>)!</trkseg></trk>$1! ; $xml =~ s!<wpt !<trkpt !g ; $xml =~ s!</wpt>!</trkpt>!g ; ... and boy, is that nasty! -- Doug McLaren, dougmc@frenzied.us
It does sound like a good feature. Do you have a patch? It has been many years since I've touched that code, so it might take me a while to get up to speed on it.
CC: dougmc [...] frenzied.us
Subject: Re: [rt.cpan.org #90864] Is there any way to build a track with Geo::Gpx?
Date: Tue, 3 Dec 2013 12:47:32 -0600
To: Richard_Bowen via RT <bug-Geo-Gpx [...] rt.cpan.org>
From: Doug McLaren <dougmc [...] frenzied.us>
On Tue, Dec 03, 2013 at 09:46:55AM -0500, Richard_Bowen via RT wrote: | <URL: https://rt.cpan.org/Ticket/Display.html?id=90864 > | | It does sound like a good feature. Do you have a patch? It has been | many years since I've touched that code, so it might take me a while | to get up to speed on it. I do not. My workaround, ugly as it was, got me past my need. That said, I haven't looked at the module code carefully, but I imagine it can't be that difficult to use the add_waypoint() code as an example to add code to make it able to add a track (of course, one gpx file can have multiple tracks, so that adds some complexity right there.) If I do so, I'll submit a patch. -- Doug McLaren, dougmc@frenzied.us