NAME
Geo::ECEF - Calculates ECEF coordinates (earth centered earth fixed) from latitude, longitude and height above ellipsoid information
SYNOPSIS
use Geo::ECEF;
my $obj=Geo::ECEF->new(); #WGS84 is the default
my ($x, $y, $z)=$obj->ecef(39.197807, -77.108574, 55); #Lat (deg), Lon (deg), HAE (meters)
print "X: $x\tY: $y\tZ: $z\n";
my ($lat, $lon, $hae)=$obj->geodetic($x, $y, $z); #X (meters), Y (meters), Z (meters)
print "Lat: $lat \tLon: $lon \tHAE $hae\n";
DESCRIPTION
Geo::ECEF provides two methods ecef and geodetic. The ecef method calculates the X,Y and Z coordinates in the ECEF (earth centered earth fixed) coordinate system from latitude, longitude and height information. The geodetic method calculates the latitude, longitude and height above ellipsoid from ECEF.
The formulas were found at http://www.u-blox.ch/ and http://waas.stanford.edu/~wwu/maast/maastWWW1_0.zip.
This code is an object Perl rewrite of a similar package by Morten Sickel, Norwegian Radiation Protection Authority
CONSTRUCTOR
new
The new() constructor initializes the ellipsoid from Geo::Ellipsoids.
my $obj=Geo::ECEF->new("WGS84"); #WGS84 is the default
METHODS
initialize
Method to reset the ellipsoid after construction. (see Geo::Ellipsoids)
$obj->initialize("GRS80");
ecef
Method returns X (meters), Y (meters), Z (meters) from lat (degrees), lon (degrees), HAE (meters).
my ($x, $y, $z)=$obj->ecef(39.197807, -77.108574, 55);
geodetic
Method returns latitude (degrees), longitude (degrees), HAE (meters) from X (meters), Y (meters), Z (meters).
my ($lat, $lon, $hae)=$obj->geodetic($x, $y, $z);
Portions of this method maybe
*************************************************************************
* Copyright c 2001 The board of trustees of the Leland Stanford *
* Junior University. All rights reserved. *
* This script file may be distributed and used freely, provided *
* this copyright notice is always kept with it. *
* *
* Questions and comments should be directed to Todd Walter at: *
* twalter@stanford.edu *
*************************************************************************
ellipsoid
Method to retrieve the current ellipsoid object.
my $ellipsoid=$obj->ellipsoid;
TODO
BUGS
LIMITS
AUTHORS
Michael R. Davis qw/perl michaelrdavis com/
Morten Sickel http://sickel.net/
LICENSE
Copyright (c) 2006 Michael R. Davis (mrdvt92)
Copyright (c) 2005 Morten Sickel (sickel.net)
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
geo::ecef Astro::Coord::ECI http://www.ngs.noaa.gov/cgi-bin/xyz_getxyz.prl