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