line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package GIS::Distance::GeoEllipsoid; |
2
|
1
|
|
|
1
|
|
931
|
use 5.008001; |
|
1
|
|
|
|
|
4
|
|
3
|
1
|
|
|
1
|
|
5
|
use strictures 2; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
36
|
|
4
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
647
|
use Geo::Ellipsoid; |
|
1
|
|
|
|
|
15381
|
|
|
1
|
|
|
|
|
29
|
|
7
|
1
|
|
|
1
|
|
6
|
use namespace::clean; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $cache = {}; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
my $ellipsoid_args = { |
12
|
|
|
|
|
|
|
units => 'degrees' , |
13
|
|
|
|
|
|
|
distance_units => 'kilometer', |
14
|
|
|
|
|
|
|
longitude => 0, |
15
|
|
|
|
|
|
|
bearing => 0, |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub distance { |
19
|
5
|
50
|
|
5
|
0
|
7249
|
my $ellipsoid = (@_ == 5) ? shift() : undef; |
20
|
|
|
|
|
|
|
|
21
|
5
|
|
50
|
|
|
29
|
$ellipsoid ||= 'WGS84'; |
22
|
|
|
|
|
|
|
|
23
|
5
|
|
66
|
|
|
16
|
my $instance = $cache->{$ellipsoid} ||= Geo::Ellipsoid->new( |
24
|
|
|
|
|
|
|
%$ellipsoid_args, |
25
|
|
|
|
|
|
|
ellipsoid => $ellipsoid, |
26
|
|
|
|
|
|
|
); |
27
|
|
|
|
|
|
|
|
28
|
5
|
|
|
|
|
147
|
return $instance->range( @_ ); |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
__END__ |