GIS::Distance::Formula - Formula base class.
This is the parent class for all GIS::Distance formula classes such as those listed at "FORMULAS" in GIS::Distance.
To author your own formula all you need to do is start here:
package My::Formula; use parent 'GIS::Distance::Formula'; sub _distance { my ($lat1, $lon1, $lat2, $lon2) = @_; # ... return $kilometers; } 1;
Then use it:
my $gis = GIS::Distance->new('My::Formula'); my $km = $gis->distance( @coords );
The global $GIS::Distance::Formula::SELF is available when your _distance() subroutine is called if, and only of, the entry point was "distance" in GIS::Distance and NOT "GIS::Distance/distance_metal" or otherwise.
$GIS::Distance::Formula::SELF
_distance()
Much of the interface described in GIS::Distance is actually implemented by this module.
See "SUPPORT" in GIS::Distance.
See "AUTHORS" in GIS::Distance.
See "LICENSE" in GIS::Distance.
To install GIS::Distance, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GIS::Distance
CPAN shell
perl -MCPAN -e shell install GIS::Distance
For more information on module installation, please visit the detailed CPAN module installation guide.