Skip Menu |

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

Report information
The Basics
Id: 28709
Status: resolved
Worked: 20 min
Priority: 0/
Queue: Geo-Gpx

People
Owner: andy [...] hexten.net
Requestors: bdfoy [...] cpan.org
Cc:
AdminCc:

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



Subject: How about adding waypoints one at a time?
I have a particular use that builds up tracks over time, so I'd like to be able to add waypoints to the Geo::Gpx object I already have. I'm not picky, but here's is what I hacked up. I'd really like a Geo::Gpx::Waypoint object, but I haven't got that far. :) sub Geo::Gpx::add_waypoint { unless( eval { keys %{$_[1]} } ) { carp "waypoint argument must be a hash reference"; return; } unless( exists $_[1]{lon} and exists $_[1]{lat} ) { carp "'lat' and 'lon' keys are mandatory in waypoint hash"; return; } push @{ $_[0]->{waypoints} }, $_[1]; }
From: andy [...] hexten.net
On Tue Aug 07 03:45:06 2007, BDFOY wrote: Show quoted text
> I have a particular use that builds up tracks over time, so I'd like > to be able to add waypoints > to the Geo::Gpx object I already have.
Thanks - I've added approximately that and released 0.18 that includes it. Show quoted text
> I'm not picky, but here's is > what I hacked up. I'd really > like a Geo::Gpx::Waypoint object, but I haven't got that far. :)
Yes, I considered that - in fact the first implementation had classes for waypoints, routes and tracks. Then it occurred to me that if I was writing a general purpose encapsulation of GPS data it shouldn't be tied to GPX - so I threw it all away and went with anon hashes :)