GIS::Distance::Formula - Role for all the GIS::Distance::Formula:: classes.


GIS-Distance documentation Contained in the GIS-Distance distribution.

Index


Code Index:

NAME

Top

GIS::Distance::Formula - Role for all the GIS::Distance::Formula:: classes.

DESCRIPTION

Top

This role enforces an API and provides shared information for the formula classes that use it.

ATTRIBUTES

Top

kilometer_rho

Number of kilometers around the equator of the earth. Defaults to 6371.64.

deg_ratio

Number of units in a single decimal degree (lat or lon) at the equator. The default, 0.0174532925199433, is derived from:

  $gis->distance( 10,0 => 11,0 )->km() / $gis->kilometer_rho()

AUTHOR

Top

Aran Clary Deltac <bluefeet@cpan.org>

LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


GIS-Distance documentation Contained in the GIS-Distance distribution.
package GIS::Distance::Formula;

use Any::Moose '::Role';

use Carp qw( croak );

requires 'distance';

has 'kilometer_rho' => (
    is      => 'ro',
    isa     => 'Num',
    default => 6371.64,
);

has 'deg_ratio' => (
    is      => 'ro',
    isa     => 'Num',
    default => 0.0174532925199433,
);

1;
__END__