16 |
} |
} |
17 |
|
|
18 |
my $got_it; |
my $got_it; |
19 |
|
my $stats; |
20 |
|
|
21 |
sub line { |
sub line { |
22 |
my $self = shift; |
my $self = shift; |
26 |
chomp; |
chomp; |
27 |
my @a = split(/,/,$_); |
my @a = split(/,/,$_); |
28 |
|
|
29 |
# next unless $#a == 12; |
return unless $#a == 12; |
30 |
|
|
31 |
warn "## [$#a] ", join(' ', |
# warn "## [$#a] ", join(' ', map { "$_:$a[$_]" } ( 0 .. $#a )), " from $_\n"; |
|
map { "$_:$a[$_]" } |
|
|
( 0 .. $#a ) |
|
|
), " from $_\n"; |
|
32 |
|
|
33 |
# is valid? |
# is valid? |
34 |
return unless $a[2] eq 'A'; |
return unless $a[2] eq 'A'; |
40 |
/ ); |
/ ); |
41 |
|
|
42 |
$hash->{lat} = hhmm( ( $hash->{lat_ns} eq 'S' ? -1 : 1 ) * $hash->{lat_hhmm} ) || return; |
$hash->{lat} = hhmm( ( $hash->{lat_ns} eq 'S' ? -1 : 1 ) * $hash->{lat_hhmm} ) || return; |
43 |
$hash->{lon} = hhmm( ( $hash->{lon_ns} eq 'W' ? -1 : 1 ) * $hash->{lon_hhmm} ) || return; |
$hash->{lon} = hhmm( ( $hash->{lon_ew} eq 'W' ? -1 : 1 ) * $hash->{lon_hhmm} ) || return; |
44 |
|
|
45 |
return if ( $got_it->{ $hash->{lat} . ' ' . $hash->{lon} }++ ); |
return if ( $got_it->{ $hash->{lat} . ' ' . $hash->{lon} }++ ); |
46 |
|
|
47 |
warn "##>>>> ",dump( $hash ); |
# warn "##>>>> ",dump( $hash ); |
48 |
return $hash; |
return $hash; |
49 |
} |
} |
50 |
|
|