Branch Coverage

blib/lib/Geo/OGR.pm
Criterion Covered Total %
branch 357 756 47.2


line true false branch
107 0 0 if defined $self
111 0 0 unless $_[0]->isa('HASH')
113 0 0 unless defined $self
115 0 0 if (exists $OWNER{$self})
182 1 1 if ($_[0]->isa('SCALAR')) { }
185 0 1 unless $_[0]->isa('HASH')
187 0 1 unless defined $self
190 1 1 if (exists $OWNER{$self})
300 9 9 if ($_[0]->isa('SCALAR')) { }
303 0 9 unless $_[0]->isa('HASH')
305 0 9 unless defined $self
308 9 9 if (exists $OWNER{$self})
320 18 0 if ($arg and $arg eq 'Geo::OGR::FeatureDefn') { }
326 18 0 if defined $self
392 52 52 if ($_[0]->isa('SCALAR')) { }
395 0 52 unless $_[0]->isa('HASH')
397 0 52 unless defined $self
400 2 102 if (exists $OWNER{$self})
414 0 2 if (@_ == 1 and ref $_[0] eq 'HASH') { }
2 0 elsif (@_ and @_ % 2 == 0) { }
420 0 2 if $fields and ref $fields ne 'ARRAY'
421 2 0 unless exists $schema{'Name'}
425 2 0 if ($fields) { }
428 0 0 if exists $schema{'GeometryType'}
430 0 2 if exists $schema{'StyleIgnored'}
433 6 1 if (ref $fd eq 'HASH')
434 0 6 if ($fd->{'GeometryType'} or exists $Geo::OGR::Geometry::TYPE_STRING2INT{$fd->{'Type'}}) { }
440 7 0 if (&blessed($d) and $d->isa('Geo::OGR::FieldDefn')) { }
0 0 elsif (&blessed($d) and $d->isa('Geo::OGR::GeomFieldDefn')) { }
490 330 330 if ($_[0]->isa('SCALAR')) { }
493 0 330 unless $_[0]->isa('HASH')
495 0 330 unless defined $self
498 98 562 if (exists $Geo::OGR::FieldDefn::OWNER{$self})
510 1 97 if (@_ == 0) { }
0 97 elsif (@_ == 1) { }
84 13 elsif (@_ == 2 and not $Geo::OGR::FieldDefn::SCHEMA_KEYS{$_[0]}) { }
519 25 0 if ($Geo::OGR::FieldDefn::SCHEMA_KEYS{$key}) { }
525 13 0 if exists $args{'Name'}
527 12 1 if exists $args{'Type'}
530 0 98 unless exists $Geo::OGR::FieldDefn::TYPE_STRING2INT{$type}
533 98 0 if (defined $self)
583 25 25 unless $_[0]->isa('HASH')
585 0 25 unless defined $self
587 2 23 if (exists $Geo::OGR::GeomFieldDefn::OWNER{$self})
598 0 2 if (@_ == 0) { }
0 2 elsif (@_ == 1) { }
0 2 elsif (@_ == 2 and not $Geo::OGR::GeomFieldDefn::SCHEMA_KEYS{$_[0]}) { }
607 3 0 if ($Geo::OGR::GeomFieldDefn::SCHEMA_KEYS{$key}) { }
613 1 1 if exists $args{'Name'}
615 2 0 if $args{'Type'}
617 0 2 if $args{'GeometryType'}
620 0 2 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
623 2 0 if (defined $self)
662 60 60 if ($_[0]->isa('SCALAR')) { }
665 0 60 unless $_[0]->isa('HASH')
667 0 60 unless defined $self
670 27 93 if (exists $Geo::OGR::Geometry::OWNER{$self})
682 4 36 if (@_ == 1 and ref $_[0] eq 'HASH') { }
16 20 elsif (@_ % 2 == 0) { }
695 0 40 if ($hex) { }
702 1 39 if ($hex)
713 13 27 if (defined $wkt) { }
1 26 elsif (defined $wkb) { }
1 25 elsif (defined $gml) { }
1 24 elsif (defined $json) { }
24 0 elsif (defined $type) { }
0 0 elsif (defined $arc) { }
722 0 24 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
725 0 24 if Geo::OGR::GT_HasZ($type)
731 39 0 if defined $self
732 3 36 if $points
938 0 1 if @_ == 0
942 1 1 if _TestCapability($self, $Geo::OGR::Driver::CAPABILITIES{$cap})
949 0 3 unless defined $Geo::OGR::Driver::CAPABILITIES{$cap}
976 0 1 if @_ == 0
980 4 2 if _TestCapability($self, $Geo::OGR::DataSource::CAPABILITIES{$cap})
987 0 1 unless defined $Geo::OGR::DataSource::CAPABILITIES{$cap}
1019 0 0 defined $name ? :
1020 0 0 unless defined $name
1021 0 0 unless $layer
1048 1 18 if (@_ == 0) { }
1 17 elsif (ref $_[0] eq 'HASH') { }
2 15 elsif (@_ % 2 == 0 and (defined $_[0] and exists $defaults{$_[0]})) { }
1057 0 81 unless exists $defaults{$_}
1059 15 4 if (exists $params{'Schema'})
1061 0 15 if exists $s->{'GeometryType'}
1062 0 15 if exists $s->{'Fields'}
1063 0 15 if exists $s->{'Name'}
1065 1 18 if $params{'Fields'}
1067 85 48 unless defined $params{$_}
1070 0 19 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$params{'GeometryType'}}
1075 1 18 if ($f)
1076 0 1 unless ref $f eq 'ARRAY'
1089 1 1 if $layer->GetName eq $name
1091 0 1 unless defined $index
1114 22 22 if ($_[0]->isa('SCALAR')) { }
1117 0 22 unless $_[0]->isa('HASH')
1119 0 22 unless defined $self
1121 0 44 if ($Geo::OGR::DataSource::RESULT_SET{$self})
1126 0 44 if (exists $Geo::OGR::Layer::OWNER{$self})
1138 0 1 if @_ == 0
1142 12 5 if _TestCapability($self, $Geo::OGR::Layer::CAPABILITIES{$cap})
1170 0 91 if (@_ == 0) { }
3 88 elsif (ref $_[0] eq 'HASH') { }
4 84 elsif (@_ % 2 == 0) { }
1179 176 6 unless defined $params{$_}
1181 84 7 if (&blessed($params{'Defn'}) and $params{'Defn'}->isa('Geo::OGR::FieldDefn')) { }
0 7 elsif (&blessed($_[0]) and $params{'Defn'}->isa('Geo::OGR::GeomFieldDefn')) { }
1188 1 6 if (exists $params{'GeometryType'})
1192 6 1 if (exists $Geo::OGR::FieldDefn::TYPE_STRING2INT{$params{'Type'}}) { }
1209 0 0 if $@
1210 0 0 if (&blessed($_[0]) and $_[0]->isa('Geo::OGR::FieldDefn')) { }
0 0 elsif (@_ % 2 == 0) { }
1216 0 0 if exists $params{'Name'}
1217 0 0 if exists $params{'Type'}
1218 0 0 if exists $params{'Width'} or exists $params{'Precision'}
1219 0 0 if exists $params{'Nullable'}
1220 0 0 if exists $params{'Default'}
1231 0 1 if $index < 0
1235 0 1 if $@
1240 0 2 if @_
1241 0 2 if (@_ and @_ % 2 == 0)
1243 0 0 if ($schema{'Fields'})
1257 1 0 defined $row{'FID'} ? :
1258 0 1 unless $feature
1260 0 1 if (defined wantarray) { }
1265 1 0 if $update
1266 1 0 unless defined wantarray
1273 1 0 defined $FID ? :
1274 0 1 unless $feature
1276 0 1 if $set
1278 1 0 if (defined wantarray) { }
1283 0 1 if $set
1284 0 1 unless defined wantarray
1290 0 0 if @_ == 1
1291 0 0 if @_ == 4
1292 0 0 unless defined wantarray
1299 0 4 unless ref $feature
1301 2 2 if (ref $feature eq 'HASH') { }
2 0 elsif (ref $feature eq 'ARRAY') { }
0 0 elsif (&blessed($feature) and $feature->isa('Geo::OGR::Feature')) { }
1318 0 0 if $in_place
1330 0 0 if ($in_place)
1355 0 0 if $fd->Name eq $name
1359 0 0 if $fd->Name eq $name
1368 0 0 if $fd
1375 0 0 if (not defined $field or &blessed($field) and $field->isa('Geo::OSR::SpatialReference')) { }
1381 0 0 if defined $sr
1382 0 0 if defined wantarray
1405 0 4 if @_
1406 0 4 if (@_ and @_ % 2 == 0)
1408 0 0 if ($schema{'Fields'})
1426 0 4 wantarray ? :
1432 0 1 if $Geo::OGR::Feature::DEFNS{$self} or $Geo::OGR::Layer::DEFNS{$self}
1434 0 1 if (@_ == 0) { }
0 1 elsif (ref $_[0] eq 'HASH') { }
1 0 elsif (@_ % 2 == 0) { }
1440 0 1 unless defined $params{'Type'}
1441 0 1 if (exists $Geo::OGR::FieldDefn::TYPE_STRING2INT{$params{'Type'}}) { }
1452 0 0 if $Geo::OGR::Feature::DEFNS{$self} or $Geo::OGR::Layer::DEFNS{$self}
1454 0 0 if $self->GetFieldDefn($i)->Name eq $name
1457 0 0 if $self->GetGeomFieldDefn($i)->Name eq $name
1489 0 12 if $Geo::OGR::Feature::DEFNS{$self} or $Geo::OGR::Layer::DEFNS{$self}
1490 0 12 if (defined $type)
1491 0 0 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
1495 12 0 if defined wantarray
1501 0 0 if @_
1502 0 0 if defined wantarray
1507 0 4 if @_
1508 4 0 if defined wantarray
1526 0 0 unless $@
1536 0 0 unless $@
1543 0 0 if @_
1544 0 0 unless defined wantarray
1550 0 0 if @_
1551 0 0 unless defined wantarray
1567 0 1 if @_
1576 4 3 if (@_)
1578 0 4 if (@_ == 1 and ref $_[0] eq 'HASH') { }
4 0 elsif (@_ and @_ % 2 == 0) { }
1585 1 3 if defined $row{'FID'}
1588 1 12 if $name eq 'FID'
1589 3 9 if ($name eq 'Geometry')
1595 9 18 if ($self->GetFieldDefnRef($i)->Name eq $name)
1601 9 0 if $f
1603 0 0 if ($self->GetGeomFieldDefnRef($i)->Name eq $name)
1609 0 0 if $f
1613 4 3 unless defined wantarray
1621 2 1 if $name eq ''
1633 2 4 if (@_)
1635 1 1 if @_ == $nf + $ngf + 1
1636 1 1 if defined $FID
1638 1 1 if (@$values != $nf + $ngf)
1650 1 4 unless defined wantarray
1675 114 6 if ($field =~ /^\d+$/) { }
1676 114 0 if $field >= 0 and $field < $self->GetFieldCount
1679 6 15 if $self->GetFieldDefnRef($i)->Name eq $field
1688 9 17 unless IsFieldSet($self, $field)
1690 8 9 if ($type == $Geo::OGR::OFTInteger)
1693 0 9 if ($type == $Geo::OGR::OFTInteger64)
1696 1 8 if ($type == $Geo::OGR::OFTReal)
1699 2 6 if ($type == $Geo::OGR::OFTString)
1702 1 5 if ($type == $Geo::OGR::OFTIntegerList)
1704 1 0 wantarray ? :
1706 0 5 if ($type == $Geo::OGR::OFTInteger64List)
1708 0 0 wantarray ? :
1710 1 4 if ($type == $Geo::OGR::OFTRealList)
1712 1 0 wantarray ? :
1714 1 3 if ($type == $Geo::OGR::OFTStringList)
1716 1 0 wantarray ? :
1718 0 3 if ($type == $Geo::OGR::OFTBinary)
1721 1 2 if ($type == $Geo::OGR::OFTDate)
1724 1 0 wantarray ? :
1726 1 1 if ($type == $Geo::OGR::OFTTime)
1728 1 0 wantarray ? :
1730 1 0 if ($type == $Geo::OGR::OFTDateTime)
1746 0 94 if (@_ == 0 or not defined $_[0])
1750 6 88 ref $_[0] ? :
1752 52 42 if ($type == $Geo::OGR::OFTInteger or $type == $Geo::OGR::OFTInteger64 or $type == $Geo::OGR::OFTReal or $type == $Geo::OGR::OFTString or $type == $Geo::OGR::OFTBinary) { }
13 29 elsif ($type == $Geo::OGR::OFTIntegerList) { }
0 29 elsif ($type == $Geo::OGR::OFTInteger64List) { }
13 16 elsif ($type == $Geo::OGR::OFTRealList) { }
13 3 elsif ($type == $Geo::OGR::OFTStringList) { }
1 2 elsif ($type == $Geo::OGR::OFTDate) { }
1 1 elsif ($type == $Geo::OGR::OFTTime) { }
1 0 elsif ($type == $Geo::OGR::OFTDateTime) { }
1775 4 3 unless defined $list->[$i]
1780 1 0 unless defined $list->[3]
1784 1 0 unless defined $list->[6]
1795 0 1 if @_
1801 14 11 unless (defined $field)
1802 14 0 if $self->GetGeomFieldCount > 0
1803 11 0 if ($field =~ /^\d+$/) { }
1804 11 0 if $field >= 0 and $field < $self->GetGeomFieldCount
1807 0 0 if $self->GetGeomFieldDefn($i)->Name eq $field
1809 0 0 if $self->GetGeomFieldCount > 0 and $field eq 'Geometry'
1816 12 13 ref $_[0] eq '' || @_ > 2 && @_ % 2 == 1 ? :
1818 17 8 if (@_)
1821 17 0 if (@_ == 1) { }
0 0 elsif (@_ and @_ % 2 == 0) { }
1826 13 4 if (&blessed($geometry) and $geometry->isa('Geo::OGR::Geometry')) { }
4 0 elsif (ref $geometry eq 'HASH') { }
1827 0 13 if $type ne 'Unknown' and $type ne $geometry->GeometryType
1832 0 13 if $@
1835 4 0 unless exists $geometry->{'GeometryType'}
1839 0 4 if $type ne 'Unknown' and $type ne $geometry->GeometryType
1844 0 4 if $@
1849 17 8 unless defined wantarray
1851 0 8 unless $geometry
1860 0 0 if @_ <= 2
1862 0 0 if @_ <= 3
1922 1 107 if (@_)
1926 0 9 if $@
1929 98 10 unless defined wantarray
1934 0 10 wantarray ? :
1941 0 65 if @_
1942 65 0 if defined wantarray
1947 0 94 if (defined $type)
1948 0 0 unless exists $Geo::OGR::FieldDefn::TYPE_STRING2INT{$type}
1952 94 0 if defined wantarray
1957 0 10 if (defined $sub_type)
1958 0 0 unless exists $Geo::OGR::FieldDefn::SUB_TYPE_STRING2INT{$sub_type}
1962 10 0 if defined wantarray
1967 0 10 if (defined $justify)
1968 0 0 unless exists $Geo::OGR::FieldDefn::JUSTIFY_STRING2INT{$justify}
1969 0 0 if exists $Geo::OGR::FieldDefn::JUSTIFY_STRING2INT{$justify}
1972 10 0 if defined wantarray
1977 1 10 if @_
1978 10 1 if defined wantarray
1983 0 10 if @_
1984 10 0 if defined wantarray
1989 0 10 if @_
1990 10 0 if defined wantarray
1995 0 10 if @_
1996 10 0 if defined wantarray
2001 0 10 if @_
2002 10 0 if defined wantarray
2018 0 5 if (@_)
2022 0 0 if $@
2025 2 3 unless defined wantarray
2030 0 3 wantarray ? :
2037 0 6 if @_
2038 6 0 if defined wantarray
2043 0 20 if (defined $type)
2044 0 0 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
2048 20 0 if defined wantarray
2057 0 3 if @_
2058 3 0 if defined wantarray
2063 0 3 if @_
2064 3 0 if defined wantarray
2069 0 3 if @_
2070 3 0 if defined wantarray
2126 0 0 if (exists $default{$p}) { }
2127 0 0 unless defined $p{$p}
2133 0 0 unless exists $p{$p}
2135 0 0 unless ref $p{'Center'} eq 'ARRAY'
2137 0 0 unless defined $p{'Center'}[$i]
2145 0 0 if (@_ == 1 and ref $_[0] eq 'HASH') { }
0 0 elsif (@_ % 2 == 0) { }
2152 0 0 unless $param{'ByteOrder'}
2155 0 0 unless defined $x
2156 0 0 if ($f =~ /text/i) { }
0 0 elsif ($f =~ /wkt/i) { }
0 0 elsif ($f =~ /binary/i) { }
0 0 elsif ($f =~ /wkb/i) { }
0 0 elsif ($f =~ /gml/i) { }
0 0 elsif ($f =~ /kml/i) { }
0 0 elsif ($f =~ /json/i) { }
2159 0 0 if ($f =~ /iso/i) { }
2167 0 0 if ($f =~ /iso/i) { }
0 0 elsif ($f =~ /hexe/i) { }
0 0 elsif ($f =~ /hex/i) { }
2170 0 0 unless $param{'srid'}
2171 0 0 unless defined $x
2195 0 0 if length $x == 1
2204 0 0 if ($srid) { }
2208 0 0 if (length $s > 2) { }
0 0 elsif (length $s > 1) { }
2236 0 0 if @_
2237 0 0 if defined wantarray
2241 1 20 @_ == 4 ? :
2245 0 1 @_ == 5 ? :
2250 4 12 unless defined $i
2251 16 0 ($self->GetGeometryType & 2147483648) == 0 ? :
2258 1 1 if (@_)
2260 1 0 if ($t == $Geo::OGR::wkbPoint) { }
0 0 elsif ($t == $Geo::OGR::wkbPoint25D) { }
2261 0 1 if @_ > 2
2264 0 0 if @_ > 3
2271 1 1 if defined wantarray
2281 5 4 if ($points)
2283 0 5 if ($t eq 'Unknown' or $t eq 'None' or $t eq 'GeometryCollection') { }
4 1 elsif ($t eq 'Point') { }
1 0 elsif ($t eq 'LineString' or $t eq 'LinearRing') { }
0 0 elsif ($t eq 'Polygon') { }
0 0 elsif ($t eq 'MultiPoint') { }
0 0 elsif ($t eq 'MultiLineString') { }
0 0 elsif ($t eq 'MultiPolygon') { }
2287 0 4 if (ref $points->[0]) { }
2290 0 0 $flat ? :
2292 4 0 $flat ? :
2297 1 0 if ($flat) { }
2309 0 0 unless $flat
2315 0 0 $flat ? :
2321 0 0 $flat ? :
2327 0 0 $flat ? :
2333 5 4 unless defined wantarray
2341 0 4 if ($n) { }
2347 2 2 if ($n == 1) { }
2348 2 0 $flat ? :
2351 2 0 if ($flat) { }
2367 0 0 if (defined $bo)
2368 0 0 unless exists $Geo::OGR::Geometry::BYTE_ORDER_STRING2INT{$bo}
2377 0 0 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
2382 0 0 if $@
2432 1 0 if ($n > 0) { }
2457 54 1 if (defined $type_or_name) { }
2459 27 27 if exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type_or_name}
2461 27 0 if exists $Geo::OGR::Geometry::TYPE_INT2STRING{$type_or_name}
2470 0 0 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
2472 0 0 if $modifier =~ /flat/i
2473 0 0 if $modifier =~ /z/i
2474 0 0 if $modifier =~ /collection/i
2475 0 0 if $modifier =~ /curve/i
2476 0 0 if $modifier =~ /linear/i
2482 0 0 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type}
2484 0 0 if (defined $type2) { }
2485 0 0 unless exists $Geo::OGR::Geometry::TYPE_STRING2INT{$type2}
2488 0 0 if $test =~ /subclass/i
2490 0 0 if $test =~ /z/i
2491 0 0 if $test =~ /subclass/i
2492 0 0 if $test =~ /curve/i
2493 0 0 if $test =~ /surface/i
2494 0 0 if $test =~ /linear/i
2522 0 4 unless defined $name
2524 0 4 if $name =~ /^\d+$/
2525 4 0 unless $driver
2526 4 0 if $driver