BEGIN{
unshift
@INC
,
'.'
}
my
$TEST_FILE
;
foreach
my
$inc
(
@INC
) {
if
(-e
"$inc/Geo/Sample-GRIB/akw.HTSGW.grb"
) {
$TEST_FILE
=
"$inc/Geo/Sample-GRIB/akw.HTSGW.grb"
;
last
;
}
}
ok(-e
"$TEST_FILE"
) or
diag(
"Path to sample GRIB file not found"
);
my
$w
= Geo::ReadGRIB->new(
"$TEST_FILE"
);
$w
->getFullCatalog();
ok( not
$w
->getError ) or
diag(
$w
->getError );
$tpit
=
$w
->extractLaLo(
"HTSGW"
, 56, 170, 55, 171, 1142218800 );
print
$w
->getError,
"\n"
if
defined
$w
->getError;
ok( not
$w
->getError ) or
diag(
$w
->getError );
ok( not
defined
$tpit
->isSorted ) or
diag(
"PlaceIterator data should not be sorted at this point"
);
$tpit
->first;
for
( 1 .. 4 ) {
$tpit
->
next
;
}
ok(
$tpit
->current->data(
'HTSGW'
) == 2.53) or
diag(
"5th data value should be 2.53"
);
ok(
$tpit
->isSorted ) or
diag(
"PlaceIterator data should be sorted at this point"
);
ok (
$tpit
->{count_of_places} == 15 ) or
diag(
"count_of_places should be 15"
);