[aprssig] Tablet PC
Andrew Rich
vk4tec at tech-software.net
Mon Oct 17 21:40:26 EDT 2011
Here is what I am doing, making perl tell me some basic GPS calcs
Next is ETA
#!/usr/bin/perl
#
# Take NMEA and work out range and bearing to a waypoint
# Andrew Rich 22/10/2011 - next do the ETA
#
use Geo::Coordinates::DecimalDegrees;
use Geo::Ellipsoid;
$geo = Geo::Ellipsoid->new(ellipsoid=>'wgs84', units=>'degrees');
$geo->set_distance_unit('nm');
open (gps, "+>COM7") or die "Nope";
while (<gps>)
{
if (m/^\$GPRMC/)
{
@data = split(/,/);
$deg = substr($data[3],0,2);
$min = substr($data[3],2,7);
$decimal_degrees = dm2decimal($deg, $min);
$lat1 = $decimal_degrees;
$deg = substr($data[5],0,3);
$min = substr($data[5],3,7);
$decimal_degrees = dm2decimal($deg, $min);
$lon1 = $decimal_degrees;
@origin = ( -$lat1,$lon1 );
@dest = (-27.357737,153.116059);
( $range, $bearing ) = $geo->to( @origin, @dest );
print "BN is $range NM at angle $bearing \n";
}
}
More information about the aprssig
mailing list