line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geo::SpatialDB::BBox; |
2
|
|
|
|
|
|
|
$Geo::SpatialDB::BBox::VERSION = '0.000_001'; # TRIAL |
3
|
|
|
|
|
|
|
$Geo::SpatialDB::BBox::VERSION = '0.000001'; |
4
|
2
|
|
|
2
|
|
7
|
use strict; |
|
2
|
|
|
|
|
1
|
|
|
2
|
|
|
|
|
42
|
|
5
|
2
|
|
|
2
|
|
5
|
use warnings; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
491
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Describes a min/max latitude and longitude box |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
0
|
|
|
0
|
0
|
|
my ($class, $lat0, $lon0, $lat1, $lon1)= @_; |
11
|
0
|
|
|
|
|
|
bless [ $lat0, $lon0, $lat1, $lon1 ], $class; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
sub clone { |
14
|
0
|
|
|
0
|
0
|
|
my $self= shift; |
15
|
0
|
|
|
|
|
|
bless [ @$self ], ref $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
sub coerce { |
18
|
0
|
|
|
0
|
0
|
|
my $class= shift; |
19
|
|
|
|
|
|
|
ref $_[0] eq __PACKAGE__? $_[0] |
20
|
0
|
0
|
|
|
|
|
: ref $_[0] eq 'ARRAY'? $class->new(@{$_[0]}) |
|
0
|
0
|
|
|
|
|
|
21
|
|
|
|
|
|
|
: die "Can't coerce $_[0] to ".__PACKAGE__; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
0
|
0
|
|
0
|
0
|
|
sub lat0 { @_ > 1? ($_[0][0]= $_[1]) : $_[0][0]; } |
25
|
0
|
0
|
|
0
|
0
|
|
sub lon0 { @_ > 1? ($_[0][1]= $_[1]) : $_[0][1]; } |
26
|
0
|
0
|
|
0
|
0
|
|
sub lat1 { @_ > 1? ($_[0][2]= $_[1]) : $_[0][2]; } |
27
|
0
|
0
|
|
0
|
0
|
|
sub lon1 { @_ > 1? ($_[0][3]= $_[1]) : $_[0][3]; } |
28
|
|
|
|
|
|
|
|
29
|
0
|
|
|
0
|
0
|
|
sub dLat { $_[0][2] - $_[0][0] } |
30
|
0
|
|
|
0
|
0
|
|
sub dLon { $_[0][3] - $_[0][1] } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub center { |
33
|
0
|
|
|
0
|
0
|
|
[ ($_[0][0]+$_[0][2])*.5, ($_[0][1]+$_[0][3])*.5 ] |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |