Branch Coverage

blib/lib/Geo/Shapelib.pm
Criterion Covered Total %
branch 125 216 57.8


line true false branch
348 8 3 unless (ref $options)
352 0 11 if defined $options and not ref $options
357 7 4 if $filename
373 7 125 if defined $$self{$_}
377 9 2 if (defined $options and ref $options)
379 0 14 unless defined $defaults{$_}
382 94 14 unless defined $$options{$_}
385 1 8 if ($$self{'Like'})
392 4 7 unless $filename
403 0 7 unless ($dbf_handle)
411 3 4 if ($$self{'Load'} and $$self{'LoadRecords'})
420 0 7 unless ($$self{'SHPHandle'})
425 0 7 unless ($info)
432 5 2 if ($$self{'UnhashFields'})
434 2 3 if ($$self{'Load'} and $$self{'LoadRecords'})
441 5 2 if ($$self{'Load'} and $$self{'LoadAll'})
448 1 6 if $$self{'Rtree'}
495 8594 14285 if (not $from_file and $$self{'Shapes'}) { }
501 14285 0 $$self{'CombineVertices'} ? :
0 14285 unless my $shape = SHPReadObject($$self{'SHPHandle'}, $i, $$self{'CombineVertices'} ? 1 : 0)
505 14285 0 if ($$self{'CombineVertices'})
527 2875 11431 if (not $from_file and $$self{'ShapeRecords'}) { }
534 0 11431 unless ($dbf_handle)
564 10 9 if (ref $rec eq 'HASH')
566 10 0 unless defined $FieldNames
593 1 1 if (ref $rec eq 'ARRAY')
616 0 1 if ($$shape{'NParts'}) { }
627 0 0 if ($$self{'CombineVertices'}) { }
630 0 0 unless defined $vmax
634 0 0 if ($prev)
636 0 0 if ($$self{'Shapetype'} < 10) { }
654 0 0 if ($prev)
656 0 0 if ($$self{'Shapetype'} < 10) { }
682 1 1 if ($prev)
684 1 0 if ($$self{'Shapetype'} < 10) { }
747 0 1 unless (defined $$self{'NShapes'})
748 0 0 unless $$self{'Shapes'} and ref $$self{'Shapes'} eq 'ARRAY' and @{$$self{'Shapes'};}
771 0 0 unless (defined $shape)
779 0 0 unless (defined $maxy)
788 0 0 unless $$v[$i][0] >= $minx and $$v[$i][0] <= $maxx and $$v[$i][1] >= $miny and $$v[$i][1] <= $maxy
800 0 0 unless $$self{'NShapes'}
805 0 0 unless $$shape{'SelectedVertices'} and @{$$shape{'SelectedVertices'};}
815 0 0 defined $rect[0] ? :
816 0 0 defined $rect[1] ? :
817 0 0 defined $rect[2] ? :
818 0 0 defined $rect[3] ? :
826 0 0 if ($$self{'Rtree'})
827 0 0 if ($count < 10) { }
830 0 0 unless $$shape{'SelectedVertices'} and @{$$shape{'SelectedVertices'};}
840 0 0 unless $$shape{'SelectedVertices'} and @{$$shape{'SelectedVertices'};}
869 13 5 $_[0] > $_[1] ? :
873 1 17 $_[0] > $_[1] ? :
889 0 1 unless @{$$self{'Shapes'};}
897 9 1 defined $rect[0] ? :
898 9 1 defined $rect[1] ? :
899 9 1 defined $rect[2] ? :
900 9 1 defined $rect[3] ? :
906 1 0 if ($first) { }
943 1 5 unless (defined $$self{'NShapes'})
944 0 1 unless $$self{'Shapes'} and ref $$self{'Shapes'} eq 'ARRAY' and @{$$self{'Shapes'};}
979 2 5 unless defined $filename
984 0 7 unless $$self{'_SHPhandle'}
987 0 7 unless $$self{'_DBFhandle'}
991 2 5 unless ($$self{'_fn'})
1000 3 22 if ($ftype eq 'String')
1002 2 1 defined $fwidth ? :
1005 7 15 if ($ftype eq 'Integer')
1007 6 1 defined $fwidth ? :
1010 15 0 if ($ftype eq 'Double')
1012 15 0 defined $fwidth ? :
1013 15 0 defined $fdeci ? :
1018 0 25 unless $type
1020 0 25 if $ret == -1
1029 14276 9 if (defined $$shape{'SHPType'}) { }
1030 0 14276 if ($$shape{'SHPType'} != 0 and $$shape{'SHPType'} != $$self{'Shapetype'})
1036 14276 9 exists $$shape{'Parts'} ? :
1037 14276 9 if (defined $$shape{'NParts'})
1038 0 14276 if ($$shape{'NParts'} > $nParts) { }
1044 14285 0 exists $$shape{'Vertices'} ? :
1045 14276 9 if (defined $$shape{'NVertices'})
1046 0 14276 if ($$shape{'NVertices'} > $nVertices) { }
1052 14276 9 defined $$shape{'ShapeId'} ? :
1055 0 14285 unless $s
1060 14275 10 if (ref $r eq 'HASH')
1069 0 57129 unless $$self{'_ftypes'}[$f]
1072 19 57110 if ($$self{'_ftypes'}[$f] == 1)
1073 19 0 if exists $$r[$f]
1076 14285 42825 if ($$self{'_ftypes'}[$f] == 2)
1077 14285 0 if exists $$r[$f]
1080 42825 0 if ($$self{'_ftypes'}[$f] == 3)
1081 42825 0 if exists $$r[$f]
1085 0 57129 unless $ret
1121 1 0 unless (defined $$self{'NShapes'})
1122 0 1 unless $$self{'Shapes'} and ref $$self{'Shapes'} eq 'ARRAY' and @{$$self{'Shapes'};}
1127 1 0 if (defined $file)
1128 1 0 unless (ref $file)
1133 0 1 unless (open $fh, ">$file")
1139 0 1 unless ref $file eq 'GLOB'
1145 0 1 if $$self{'MinBounds'}
1146 0 1 if $$self{'MaxBounds'}
1149 0 1 unless ($fn)
1165 0 9 if $$shape{'MinBounds'}
1166 0 9 if $$shape{'MaxBounds'}
1170 0 9 if ($$shape{'NParts'}) { }
1178 0 0 if ($$self{'CombineVertices'}) { }
1182 0 0 unless defined $vmax
1211 1 0 if defined $old_select
1217 7 4 if defined $$self{'SHPHandle'}