line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::Formatter::Format::Degree; |
2
|
|
|
|
|
|
|
|
3
|
6
|
|
|
6
|
|
67
|
use strict; |
|
6
|
|
|
|
|
20
|
|
|
6
|
|
|
|
|
204
|
|
4
|
6
|
|
|
6
|
|
31
|
use warnings; |
|
6
|
|
|
|
|
12
|
|
|
6
|
|
|
|
|
160
|
|
5
|
6
|
|
|
6
|
|
43
|
use Carp; |
|
6
|
|
|
|
|
11
|
|
|
6
|
|
|
|
|
384
|
|
6
|
6
|
|
|
6
|
|
34
|
use base qw(Geo::Formatter::FormatBase::Double); |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
672
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
493
|
use version; our $VERSION = qv('0.0.1'); |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
27
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub encode { |
11
|
7
|
|
|
7
|
1
|
18
|
my ($class,$lat,$lng,$opt) = @_; |
12
|
|
|
|
|
|
|
|
13
|
7
|
|
50
|
|
|
23
|
$opt ||= {}; |
14
|
|
|
|
|
|
|
|
15
|
7
|
100
|
|
|
|
32
|
my $under_decimal = defined($opt->{under_decimal}) ? $opt->{under_decimal} : 6; |
16
|
7
|
|
100
|
|
|
36
|
my $sign = $opt->{sign} || 0; |
17
|
|
|
|
|
|
|
|
18
|
7
|
100
|
|
|
|
45
|
my $form = sprintf("%%%s.%df",$sign ? "+" : "", $under_decimal); |
19
|
7
|
|
|
|
|
16
|
map { sprintf($form,$_) } ($lat,$lng); |
|
14
|
|
|
|
|
151
|
|
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub decode { |
23
|
6
|
|
|
6
|
1
|
55
|
map { $_ + 0.0 }@_[1..2]; |
|
12
|
|
|
|
|
54
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |