NAME
GPS::Point - Provides an object interface for a GPS point.
SYNOPSIS
use GPS::Point;
my $obj=GPS::Point->newGPSD($GPSD_O_line);#e.g. GPSD,O=....
my $obj=GPS::Point->new(
time => $time, #float seconds from the unix epoch
lat => $lat, #signed degrees
lon => $lon, #signed degrees
alt => $hae, #meters above the WGS-84 ellipsoid
speed => $speed, #meters/second (over ground)
heading => $heading, #degrees clockwise from North
climb => $climb, #meters/second
etime => $etime, #float seconds
ehorizontal => $ehz, #float meters
evertical => $evert, #float meters
espeed => $espeed, #meters/second
eheading => $ehead, #degrees
eclimb => $eclimb, #meters/second
mode => $mode, #GPS mode [?=>undef,None=>1,2D=>2,3D=>3]
tag => $tag, #Name of the GPS message for data
);
DESCRIPTION
This is a re-write of Net::GPSD::Point that is more portable.
GPS::Point - Provides an object interface for a GPS fix (e.g. Position, Velocity and Time).
Note: Please use Geo::Point, if you want 2D or projection support.
USAGE
print $point->latlon. "\n"; #use a "." here to force latlon to scalar context
my ($x,$y,$z)=$point->ecef; #if Geo::ECEF is available
my $GeoPointObject=$point->GeoPoint; #if Geo::Point is available
my @distance=$point->distance($point2); #if Geo::Inverse is available
my $distance=$point->distance($point2); #if Geo::Inverse->VERSION >=0.05
USAGE TODO
my $obj=GPS::Point->newNMEA($NMEA_lines); #e.g. GGA+GSA+RMC
CONSTRUCTOR
new
my $obj = GPS::Point->new();
newGPSD
my $obj=GPS::Point->newGPSD($GPSD_O_line);#e.g. GPSD,O=....
METHODS
time
Sets or returns seconds since the Unix epoch, UTC (float, seconds)
print $obj->time, "\n";
lat, latitude
Sets or returns Latitude (float, degrees)
print $obj->lat, "\n";
lon, long or longitude
Sets or returns Longitude (float, degrees)
print $obj->lon, "\n";
alt, altitude
Sets or returns Altitude (float, meters)
print $obj->alt, "\n";
speed
Sets or returns speed (float, meters/sec)
print $obj->speed, "\n";
heading, bearing
Sets or returns heading (float, degrees)
print $obj->heading, "\n";
climb
Sets or returns vertical velocity (float, meters/sec)
print $obj->climb, "\n";
etime
Sets or returns estimated timestamp error (float, seconds, 95% confidence)
print $obj->etime, "\n";
ehorizontal
Sets or returns horizontal error estimate (float, meters)
print $obj->ehorizontal, "\n";
evertical
Sets or returns vertical error estimate (float, meters)
print $obj->evertical, "\n";
espeed
Sets or returns error estimate for speed (float, meters/sec, 95% confidence)
print $obj->espeed, "\n";
eheading
Sets or returns error estimate for course (float, degrees, 95% confidence)
print $obj->eheading, "\n";
eclimb
Sets or returns Estimated error for climb/sink (float, meters/sec, 95% confidence)
print $obj->eclimb, "\n";
mode
Sets or returns the NMEA mode (integer; undef=>no mode value yet seen, 1=>no fix, 2=>2D, 3=>3D)
print $obj->mode, "\n";
tag
Sets or returns a tag identifying the last sentence received. For NMEA devices this is just the NMEA sentence name; the talker-ID portion may be useful for distinguishing among results produced by different NMEA talkers in the same wire. (string)
print $obj->tag, "\n";
fix
Returns either 1 or 0 based upon if the GPS point is from a valid fix or not.
print $obj->fix, "\n";
latlon, latlong
Returns Latitude, Longitude as an array in array context and as a space joined string in scalar context
my @latlon=$point->latlon;
my $latlon=$point->latlon;
ecef
Returns ECEF coordinates if Geo::ECEF is available.
my ($x,$y,$z) = $point->ecef;
my @xyz = $point->ecef;
my $xyz_aref = $point->ecef; #if Geo::ECEF->VERSION >= 0.08
GeoPoint
Returns a Geo::Point Object in the WGS-84 projection.
my $GeoPointObject = $point->GeoPoint;
distance
Returns distance if Geo::Inverse is installed. The argument can be a GPS::Point, Geo::Point or a Lat, Lon scalar pair.
my ($faz, $baz, $dist) = $point->distance($pt2); #Array context
my $dist = $point->distance($lat, $lon); #if Geo::Inverse->VERSION >=0.05
BUGS
SUPPORT
Try GPSD-DEV email list
AUTHOR
Michael R. Davis
CPAN ID: MRDVT
DavisNetworks.com
account=>perl,tld=>com,domain=>michaelrdavis
http://www.davisnetworks.com/
COPYRIGHT
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the LICENSE file included with this module.
SEE ALSO
Geo::Point, Net::GPSD::Point, Geo::ECEF, Geo::Functions, Geo::Inverse, Geo::Distance