--- AnyEvent-GPSD/GPSD.pm 2008/07/25 13:26:06 1.6 +++ AnyEvent-GPSD/GPSD.pm 2008/07/26 05:34:58 1.7 @@ -59,6 +59,12 @@ The port to connect to, default is C<2947>. +=item min_speed => $speed_in_m_per_s + +Sets the mininum speed (default: 0) that is considered real for the +purposes of replay compression or estimate. Speeds below this value will +be considered 0. + =item on_error => $cb->($gps) Called on every connection or protocol failure, reason is in C<$!> @@ -344,9 +350,13 @@ =item ($lat, $lon) = $gps->estimate ([$max_seconds]) This returns an estimate of the current position based on the last fix and -the time passed since then. Useful for interactive applications where you -want more frequent updates, but not very useful to store, as the next fix -might well be totally off. +the time passed since then. + +Useful for interactive applications where you want more frequent updates, +but not very useful to store, as the next fix might well be totally +off. For example, when displaying a real-time map, you could simply call +C ten times a second and update the cursor or map position, but +you should use C to actually gather data to plot the course itself. If the fix is older then C<$max_seconds> (default: C<1.9> times the update interval, i.e. usually C<1.9> seconds) or if no fix is available, returns @@ -368,7 +378,7 @@ $diff <= $max or return; - if ($fix->{speed} > $fix->{serr}) { + if ($fix->{speed} >= $self->{min_speed}) { my ($lat, $lon) = $geo->forward ($fix->{lat}, $fix->{lon}, $fix->{bearing}, $fix->{speed} * $diff); ($lat, $lon) @@ -423,6 +433,10 @@ will not be restored, so it's best not to reuse a gpsd object after a replay. +The C distribution comes with an example log +(F) that you can replay for testing or enjoyment +purposes. + The options include: =over 4 @@ -483,7 +497,7 @@ if ( $type eq "start" or ($self->{compress} - and $self->{fix} && ($self->{fix}{mode} < 2 || $self->{fix}{speed} < 5)) + and $self->{fix} && ($self->{fix}{mode} < 2 || $self->{fix}{speed} < $self->{min_speed})) ) { $self->{replay_now} = $time; }