Branch Coverage

blib/lib/Geo/GDAL.pm
Criterion Covered Total %
branch 256 580 44.1


line true false branch
255 18 0 if defined $self
260 32 32 unless ($self->isa('SCALAR'))
261 0 32 unless $self->isa('HASH')
263 0 32 unless defined $self
268 32 32 if (exists $OWNER{$self})
273 0 64 if ($code)
301 0 0 unless $_[0]->isa('HASH')
303 0 0 unless defined $self
305 0 0 if (exists $OWNER{$self})
342 61 61 unless ($self->isa('SCALAR'))
343 0 61 unless $self->isa('HASH')
345 0 61 unless defined $self
350 60 62 if (exists $OWNER{$self})
355 1 121 if ($code)
493 10 0 if defined $self
498 20 20 unless ($self->isa('SCALAR'))
499 0 20 unless $self->isa('HASH')
501 0 20 unless defined $self
506 10 30 if (exists $OWNER{$self})
511 0 40 if ($code)
547 3 0 if defined $self
552 5 5 unless ($self->isa('SCALAR'))
553 0 5 unless $self->isa('HASH')
555 0 5 unless defined $self
560 3 7 if (exists $OWNER{$self})
565 0 10 if ($code)
615 0 0 if defined $self
619 0 0 unless $_[0]->isa('HASH')
621 0 0 unless defined $self
623 0 0 if (exists $OWNER{$self})
655 0 0 if defined $self
659 0 0 unless $_[0]->isa('HASH')
661 0 0 unless defined $self
663 0 0 if (exists $OWNER{$self})
692 0 0 if defined $self
696 0 0 unless $_[0]->isa('HASH')
698 0 0 unless defined $self
700 0 0 if (exists $OWNER{$self})
729 2 0 if defined $self
733 2 2 unless $_[0]->isa('HASH')
735 0 2 unless defined $self
737 2 0 if (exists $OWNER{$self})
766 0 0 if defined $self
770 0 0 unless $_[0]->isa('HASH')
772 0 0 unless defined $self
774 0 0 if (exists $OWNER{$self})
803 0 0 if defined $self
807 0 0 unless $_[0]->isa('HASH')
809 0 0 unless defined $self
811 0 0 if (exists $OWNER{$self})
840 0 0 if defined $self
844 0 0 unless $_[0]->isa('HASH')
846 0 0 unless defined $self
848 0 0 if (exists $OWNER{$self})
877 0 0 if defined $self
881 0 0 unless $_[0]->isa('HASH')
883 0 0 unless defined $self
885 0 0 if (exists $OWNER{$self})
914 0 0 if defined $self
918 0 0 unless $_[0]->isa('HASH')
920 0 0 unless defined $self
922 0 0 if (exists $OWNER{$self})
951 0 0 if defined $self
955 0 0 unless $_[0]->isa('HASH')
957 0 0 unless defined $self
959 0 0 if (exists $OWNER{$self})
1122 13 0 if (@_)
1124 2 11 if (@_ == 3) { }
1126 2 0 if ($ecode == 1) { }
0 0 elsif ($ecode == 2) { }
1128 2 0 if defined $offender
1144 0 0 wantarray ? :
1171 2 756 ref $parameters->[0] eq 'HASH' ? :
1172 745 13 if (@p)
1174 66 679 if (@p % 2 == 0 and defined $c and exists $c{$c}) { }
1177 0 205 unless defined $c{$c} and exists $defaults{$c{$c}}
1184 0 3373 if (not &blessed($p[$i]) and ref $p[$i] ne $t)
1185 0 0 $t eq '' ? :
1201 1 1123 if defined $default and not defined $string
1202 1 1123 unless defined $string
1203 87 747 if $int2string_hash and exists $int2string_hash->{$string}
1204 2 1034 unless exists $string2int_hash->{$string}
1241 307 0 if $type =~ /^\d/
1266 0 12 unless exists $Geo::GDAL::TYPE_STRING2INT{$t}
1268 1 11 if $t =~ /Byte/
1269 1 10 if $t =~ /UInt16/
1270 2 8 if $t =~ /Int16/
1271 1 7 if $t =~ /UInt32/
1272 2 5 if $t =~ /Int32/
1273 2 3 if $t =~ /Float32/
1274 2 1 if $t =~ /Float64/
1283 41 14 if exists $Geo::GDAL::TYPE_INT2STRING{$t}
1284 0 55 unless exists $Geo::GDAL::TYPE_STRING2INT{$t}
1286 24 31 if $t =~ /^Byte$/
1287 0 2 $is_big_endian ? :
2 29 if $t =~ /^UInt16$/
1288 2 27 if $t =~ /^Int16$/
1289 0 1 $is_big_endian ? :
1 26 if $t =~ /^UInt32$/
1290 10 16 if $t =~ /^Int32$/
1291 2 14 if $t =~ /^Float32$/
1292 6 8 if $t =~ /^Float64$/
1299 220 86 if $driver->TestCapability('RASTER')
1309 110 43 if $driver->TestCapability('RASTER')
1315 3 58 unless @_
1327 0 2 unless $o{uc $p->{'access'}}
1330 0 2 unless $o{uc $p->{'type'}}
1331 0 2 unless uc $p->{'type'} eq 'ANY'
1333 0 2 unless ($dataset)
1335 0 0 unless uc $p->{'type'} eq 'ANY'
1345 0 2 unless $p[1] eq 'ReadOnly' or $p[1] eq 'Update'
1346 2 0 if $p[1] eq 'ReadOnly'
1347 0 2 if $p[1] eq 'Update'
1349 0 2 unless $dataset
1355 0 6 unless ($p)
1360 6 0 if ($p->{'flags'})
1363 0 8 unless exists $Geo::GDAL::OF_STRING2INT{$flag}
1373 0 0 unless $params[3] =~ /^\d/
1379 0 1 if $p[2]
1385 1 1 if $p[2]
1398 0 0 if (defined $p[$i] and ref $p[$i])
1408 2 0 if (ref $o eq 'HASH')
1410 2 0 unless ($key =~ /^-/)
1434 0 0 if defined $desc
1435 0 0 if defined wantarray
1439 0 0 ref $_[0] ? :
1442 0 0 if defined $metadata
1443 0 0 if defined wantarray
1472 1 2 unless $self
1477 8 10 if defined $test and $test eq 'YES'
1485 447 173 defined $h && $h eq 'YES' ? :
1491 1 1 if (wantarray) { }
1494 0 1 if $e =~ m[/]
1501 0 1 if $e =~ m[/]
1517 1 0 if ($h)
1520 1 0 if ($value eq 'CreationOptionList')
1526 39 111 if ($key eq 'Value') { }
1542 1 0 if $h->{'DMD_CREATIONDATATYPES'}
1548 1 51 if ($name and &blessed($name))
1558 1 51 if ($object)
1559 1 0 if ($ds) { }
1566 1 51 if $@
1567 0 51 unless $ds
1597 0 0 if $p[1] eq 'ReadOnly'
1598 0 0 if $p[1] eq 'Update'
1600 0 0 unless $dataset
1658 0 52 unless $band
1669 3 0 unless defined wantarray
1691 0 0 defined $name ? :
1693 0 0 unless $layer
1720 0 16 if $p->{'fields'} and ref $p->{'fields'} ne 'ARRAY'
1721 0 16 if (defined $p->{'schema'})
1723 0 0 if exists $s->{'GeometryType'}
1724 0 0 if exists $s->{'Fields'}
1725 0 0 if exists $s->{'Name'}
1727 8 8 unless ref $p->{'fields'} eq 'ARRAY'
1730 3 10 if ($f->{'GeometryType'} or exists $Geo::OGR::Geometry::TYPE_STRING2INT{$f->{'Type'}})
1749 1 1 if $layer->GetName eq $name
1751 0 1 unless defined $index
1757 0 0 if defined $proj
1758 0 0 if defined wantarray
1763 0 0 if defined $sr
1764 0 0 if (defined wantarray)
1766 0 0 unless $p
1774 4 3 if (@_ == 1) { }
1 2 elsif (@_ > 1) { }
1780 0 7 if $@
1781 3 4 unless defined wantarray
1783 0 4 if (wantarray) { }
1801 0 0 unless $gt->NorthUp
1804 0 0 if $xoff < 0
1806 0 0 if $yoff < 0
1808 0 0 if $xsize > $w - $xoff
1810 0 0 if $ysize > $h - $yoff
1816 0 0 if (@_ > 0)
1818 0 0 if $proj and ref $proj
1821 0 0 unless defined wantarray
1895 1 0 if $p[0]
1899 0 1 if $@
1905 0 2 if ($name and &blessed($name))
1915 0 2 if ($object)
1916 0 0 if ($ds) { }
1923 0 2 if $@
1941 0 0 if ($b and $b eq 'Geo::GDAL::Dataset') { }
1959 0 0 if ($self->_GetRasterBand(1)) { }
1976 0 2 if $p->{$srs} and &blessed($p->{$srs})
1980 1 0 if $warped
1989 1 1 unless ref $self eq 'ARRAY'
1990 0 2 if ($b and $b eq 'Geo::GDAL::Dataset') { }
2022 0 0 if ($b and $b eq 'Geo::GDAL::Dataset') { }
2036 0 0 unless ref $sources eq 'ARRAY' and defined $sources->[0]
2038 0 0 if (&blessed($dest)) { }
2039 0 0 if (&blessed($sources->[0])) { }
2045 0 0 if (&blessed($sources->[0])) { }
2071 1 2 if ($cion eq 'RedBand')
2072 1 1 if ($cion eq 'GreenBand')
2073 1 0 if ($cion eq 'BlueBand')
2098 1 2 if ($cion eq 'RedBand')
2099 1 1 if ($cion eq 'GreenBand')
2100 1 0 if ($cion eq 'BlueBand')
2197 54 54 unless ($self->isa('SCALAR'))
2198 0 54 unless $self->isa('HASH')
2200 0 54 unless defined $self
2203 0 108 if (exists $Geo::GDAL::Band::OWNER{$self})
2236 2 6 if (@_ > 0)
2237 2 0 if (defined $_[0]) { }
2248 1 1 if (@_ > 0)
2253 1 1 unless defined wantarray
2259 1 1 if @_ > 0 and defined $_[0]
2260 1 1 if @_ > 1 and defined $_[1]
2261 1 1 unless defined wantarray
2296 0 15 if ($xsize > $self->{'XSize'} - $xoff)
2301 0 15 if ($ysize > $self->{'YSize'} - $yoff)
2314 11 15 if (defined $ci)
2318 11 15 unless defined wantarray
2324 9 9 if @_ and defined $_[0]
2325 8 10 unless defined wantarray
2331 0 0 if @_
2332 0 0 unless defined wantarray
2339 2 1 if @_ and defined $_[0]
2340 1 2 unless defined wantarray
2342 2 0 if $r
2357 0 3 if $p->{'progress'} and not defined $p->{'progressdata'}
2380 0 0 unless ($p->{'idfield'} =~ /^[+-]?\d+$/ or $fields{$p->{'idfield'}})
2383 0 0 unless ($p->{'elevfield'} =~ /^[+-]?\d+$/ or $fields{$p->{'elevfield'}})
2384 0 0 $self->DataType =~ /Float/ ? :
2390 0 0 unless $p->{$_} =~ /^[+-]?\d+$/
2392 0 0 if $p->{'progress'} and not defined $p->{'progressdata'}
2402 1 1 unless $mask
2450 0 660 unless defined $p->{'buf'}
2460 2 6 if $f & $Geo::GDAL::Band::MASK_FLAGS{$flag}
2462 2 0 wantarray ? :
2468 0 1 if (@_ and $_[0] =~ /^\d$/) { }
2472 0 1 unless $Geo::GDAL::Band::MASK_FLAGS{$flag}
2481 0 0 unless $Geo::GDAL::HAVE_PDL
2484 0 0 unless (defined wantarray)
2486 0 0 unless $Geo::GDAL::Band::PDL2DATATYPE{$pdl->get_datatype} == $t
2492 0 0 if ($xdim > $self->{'XSize'} - $xoff)
2496 0 0 if ($ydim > $self->{'YSize'} - $yoff)
2517 0 0 if $datatype < 0
2525 0 0 if defined $bad
2562 0 0 unless exists $known_options{$option}
2567 0 1 $dt =~ /Float/ ? :
2573 0 1 if $p->{'options'}{'Connectedness'} and $p->{'options'}{'Connectedness'} == 8
2574 1 0 if ($leInt32 or $p->{'options'}{'ForceIntPixel'}) { }
2580 0 0 if 'was'->it('here'->created((return $p->{'outlayer'})))
2586 1 0 unless ($p->{'dest'})
2591 1 0 if ($p->{'options'}{'Connectedness'})
2606 1 0 unless ($p->{'distance'})
2640 11 1 if (ref $_[0] eq 'ARRAY') { }
2648 0 12 if $@
2654 5 262 if @_
2655 5 262 unless defined wantarray
2656 262 0 wantarray ? :
2662 2 3 if (@_)
2669 0 5 unless defined wantarray
2744 0 0 if (@_)
2762 8 220 if $usage eq $color and $type ne 'Integer'
2771 57 0 if defined $_[3]
2772 0 57 unless defined wantarray
2778 0 0 if @_ > 0
2779 0 0 unless defined wantarray
2781 0 0 $a[0] ? :
2867 1 1 if (not $recursive) { }
2871 0 1 if $f eq '..' or $f eq '.'
2873 1 0 if ($s[0] eq 'f') { }
0 0 elsif ($s[0] eq 'd') { }
2883 0 2 if ($@)
2884 0 0 $recursive ? :
2912 2 9 if (@_ == 0) { }
4 5 elsif (@_ == 1) { }
2932 1 1 if (ref $p eq 'ARRAY') { }
2942 0 2 unless @$gcps
2950 5 1 unless ref $columns eq 'ARRAY'
2962 1 1 if defined wantarray
2970 0 0 if $x < $e->[0]
2971 0 0 if $x > $e->[2]
2974 0 0 if $y < $e->[1]
2975 0 0 if $y > $e->[3]
2990 0 0 if (@_ == 0) { }
0 0 elsif (ref $_[0]) { }
3013 0 0 unless $self->Overlaps($e)
3015 0 0 if $self->[0] < $e->[0]
3016 0 0 if $self->[1] < $e->[1]
3017 0 0 if $self->[2] > $e->[2]
3018 0 0 if $self->[3] > $e->[3]
3024 0 0 if $e->[0] < $self->[0]
3025 0 0 if $e->[1] < $self->[1]
3026 0 0 if $e->[2] > $self->[2]
3027 0 0 if $e->[3] > $self->[3]