line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Coordinates::Converter::Format::Degree; |
2
|
6
|
|
|
6
|
|
7248
|
use strict; |
|
6
|
|
|
|
|
15
|
|
|
6
|
|
|
|
|
261
|
|
3
|
6
|
|
|
6
|
|
30
|
use warnings; |
|
6
|
|
|
|
|
7
|
|
|
6
|
|
|
|
|
176
|
|
4
|
6
|
|
|
6
|
|
5820
|
use parent 'Geo::Coordinates::Converter::Format'; |
|
6
|
|
|
|
|
1784
|
|
|
6
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $DIGITS = 6; |
7
|
|
|
|
|
|
|
|
8
|
89
|
|
|
89
|
0
|
632
|
sub name { 'degree' } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub detect { |
11
|
46
|
|
|
46
|
0
|
78
|
my($self, $point) = @_; |
12
|
|
|
|
|
|
|
|
13
|
46
|
100
|
100
|
|
|
2412
|
return unless defined $point->lat && $point->lat =~ /^[\-\+NS]?([0-9]{1,2}(?:\.[0-9]+))$/i; |
14
|
21
|
|
|
|
|
431
|
my $lat_nums = $1; |
15
|
21
|
50
|
33
|
|
|
116
|
return unless defined $point->lng && $point->lng =~ /^[\-\+WE]?([0-9]{1,3}(?:\.[0-9]+))$/i; |
16
|
21
|
|
|
|
|
381
|
my $lng_nums = $1; |
17
|
|
|
|
|
|
|
|
18
|
21
|
50
|
33
|
|
|
175
|
return unless -90 < $lat_nums && $lat_nums < 90 ; |
19
|
21
|
50
|
33
|
|
|
144
|
return unless -180 < $lng_nums && $lng_nums < 180; |
20
|
|
|
|
|
|
|
|
21
|
21
|
|
|
|
|
63
|
return $self->name; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub round { |
25
|
50
|
|
|
50
|
0
|
751
|
my($self, $val) = @_; |
26
|
50
|
|
|
|
|
990
|
sprintf "%0${DIGITS}f", $val; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |