logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

GIS::Distance::Formula - Formula base class.

Authors

       See "AUTHORS" in GIS::Distance.

Description

       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 class:

           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 if, the entry point was "distance" in GIS::Distance and NOT "distance_metal" in GIS::Distance or
       otherwise.

       Much of the interface described in GIS::Distance is actually implemented by this module.

License

       See "LICENSE" in GIS::Distance.

perl v5.36.0                                       2023-10-21                        GIS::Distance::Formula(3pm)

Name

       GIS::Distance::Formula - Formula base class.

Support

       See "SUPPORT" in GIS::Distance.

See Also