Branch Coverage

blib/lib/Geo/Index.pm
Criterion Covered Total %
branch 342 534 64.0


line true false branch
33 11 0 $Geo::Index::Config{'use64bitint'} ? :
450 14 5 if (ref $_points eq 'HASH')
471 14 5 if (ref $_options eq 'HASH')
473 0 14 if ($_options->{'radius'})
478 0 0 $_options->{'polar_circumference'} ? :
479 0 0 $_options->{'equatorial_circumference'} ? :
513 14 5 if (ref $_options eq 'HASH')
514 7 7 if $_options->{'levels'}
517 0 19 if ($self->{'levels'} > 30) { }
0 19 elsif ($self->{'levels'} < 1) { }
532 10 9 unless (defined $ACTIVE_CODE)
535 10 0 if ($C_CODE_COMPILED) { }
545 14 5 if (ref $_options eq 'HASH')
546 6 8 if (defined $_options->{'function_type'})
552 0 0 if (defined $_points and scalar @$_points)
556 6 13 defined $_options->{'quiet'} ? :
599 685 0 if ($type eq 'ARRAY' or $type eq 'HASH') { }
617 0 0 if ($type eq 'ARRAY') { }
0 0 elsif ($type eq 'HASH') { }
631 0 0 wantarray ? :
672 1 686 if ($type eq 'ARRAY') { }
686 0 elsif ($type eq 'HASH') { }
687 0 687 if (defined $self->{'positions'}{$_point})
691 0 0 if ($lat == $indexed_position->[0] and $lon == $indexed_position->[1])
723 464 13276 if ($lat_idx_0 == 0) { }
803 12473 elsif ($lat_idx_0 >= $size_minus_one) { }
849 0 0 unless $self->{'quiet'}
855 0 0 if (wantarray) { }
887 105 37 if ($_point eq $_indexed)
916 91 14 unless scalar @{$_index->{$formatted_key};}
1181 2 208 if (ref $_search_point eq 'ARRAY')
1231 2 208 defined $tile_adjust ? :
1233 2 208 defined $quick_results ? :
1235 29 181 unless defined $search_radius
1241 208 2 if (defined $_search_point->{'lat_rad'}) { }
1249 208 2 if (defined $_search_point->{'lon_rad'}) { }
1270 90 120 if ($search_radius == -1 or $search_radius > $self->{'equatorial_circumference'} / 4) { }
1298 91 29 if ($C_CODE_ACTIVE) { }
1360 0 29 if ($shift < 0) { }
1 28 elsif ($shift >= $max_level) { }
1409 2 27 if ($lon_0 < -180) { }
0 27 elsif ($lon_0 > 180) { }
1412 0 29 if ($lon_1 < -180) { }
6 23 elsif ($lon_1 > 180) { }
1415 6 23 if ($lat_0 < -90) { }
0 23 elsif ($lat_0 > 90) { }
1418 0 29 if ($lat_1 < -90) { }
4 25 elsif ($lat_1 > 90) { }
1431 1 28 if $lat_0_idx >= $max_size
1435 5 24 if $lat_1_idx >= $max_size
1446 0 29 if $lat_0_idx > $lat_1_idx
1456 88 32 if ($lon_0_idx <= $lon_1_idx) { }
1460 20 103 if ($lat_idx == 0) { }
30 73 elsif ($lat_idx >= $max_grid_idx) { }
1462 20 0 unless ($seen_s_polar)
1475 30 0 unless ($seen_n_polar)
1507 24 48 if ($lat_idx == 0) { }
0 48 elsif ($lat_idx >= $max_grid_idx) { }
1509 24 0 unless ($seen_s_polar)
1522 0 0 unless ($seen_n_polar)
1644 2 208 if ($quick_results)
1652 0 2 wantarray ? :
1664 156 52 if ($search_radius > 0) { }
1667 0 156 if (defined $pre_condition or defined $post_condition) { }
1671 0 0 if (defined $pre_condition) { }
1672 0 0 if (defined $post_condition) { }
1675 0 0 unless defined $_set
1677 0 0 if (&$pre_condition($_point, $_search_point, $user_data))
1679 0 0 if ($distance <= $search_radius)
1681 0 0 if (&$post_condition($_point, $_search_point, $user_data))
1691 0 0 unless defined $_set
1693 0 0 if (&$pre_condition($_point, $_search_point, $user_data))
1695 0 0 if ($distance <= $search_radius)
1706 0 0 unless defined $_set
1709 0 0 if ($distance <= $search_radius)
1711 0 0 if (&$post_condition($_point, $_search_point, $user_data))
1724 28609 214 unless defined $_set
1727 494 148 if ($distance <= $search_radius)
1739 2 50 if (defined $pre_condition or defined $post_condition) { }
1743 1 1 if (defined $pre_condition) { }
1744 0 1 if (defined $post_condition) { }
1747 0 0 unless defined $_set
1749 0 0 if (&$pre_condition($_point, $_search_point, $user_data))
1752 0 0 if (&$post_condition($_point, $_search_point, $user_data))
1761 0 1 unless defined $_set
1763 9 197 if (&$pre_condition($_point, $_search_point, $user_data))
1774 0 1 unless defined $_set
1778 9 197 if (&$post_condition($_point, $_search_point, $user_data))
1790 0 50 unless defined $_set
1800 205 3 if (defined $_options->{'sort_results'})
1806 1 207 if ($max_results)
1808 0 1 if $result_count < $max_results
1813 0 0 scalar @$_results > $max_results ? :
0 0 $max_results ? :
0 0 scalar @$_results ? :
1 0 scalar @$_results > $max_results ? :
1 207 $max_results ? :
208 0 scalar @$_results ? :
0 208 wantarray ? :
2036 14 7 if (ref $_bounding_box eq 'HASH') { }
2042 14 0 $_bounding_box->{'west'} ? :
0 14 $_bounding_box->{'W'} ? :
0 14 $_bounding_box->{'w'} ? :
2047 14 0 $_bounding_box->{'south'} ? :
0 14 $_bounding_box->{'S'} ? :
0 14 $_bounding_box->{'s'} ? :
2052 14 0 $_bounding_box->{'east'} ? :
0 14 $_bounding_box->{'E'} ? :
0 14 $_bounding_box->{'e'} ? :
2057 14 0 $_bounding_box->{'north'} ? :
0 14 $_bounding_box->{'N'} ? :
0 14 $_bounding_box->{'n'} ? :
2075 1 20 if ($west < -180)
2076 0 1 unless $self->{'quiet'}
2080 1 20 if ($east > 180)
2081 0 1 unless $self->{'quiet'}
2085 1 20 if ($south < -90)
2086 0 1 unless $self->{'quiet'}
2090 1 20 if ($north > 90)
2091 0 1 unless $self->{'quiet'}
2095 1 20 if ($south > $north) { }
0 20 elsif ($south == $north) { }
2096 0 1 unless $self->{'quiet'}
2099 0 0 unless $self->{'quiet'}
2103 2 19 if ($has_errors)
2104 0 2 wantarray ? :
2137 2 17 defined $tile_adjust ? :
2139 1 18 defined $quick_results ? :
2164 0 19 if ($lat_degrees <= 0)
2165 0 0 unless $self->{'quiet'}
2166 0 0 wantarray ? :
2169 17 2 $west <= $east ? :
2181 5 14 $lat_best_level > $lon_best_level ? :
2203 9 10 if $east == 180
2204 9 10 if $north == 90
2206 10 9 $south == -90 ? :
2207 9 10 $north == 90 ? :
2223 17 2 if ($west <= $east) { }
2229 9 49 if ($lat_idx == 0) { }
8 41 elsif ($lat_idx >= $max_grid_idx) { }
2231 9 0 unless ($seen_s_polar)
2245 8 0 unless ($seen_n_polar)
2282 1 8 if ($lat_idx == 0) { }
1 7 elsif ($lat_idx >= $max_grid_idx) { }
2284 1 0 unless ($seen_s_polar)
2293 1 0 unless ($seen_n_polar)
2416 1 18 if ($quick_results)
2424 0 1 wantarray ? :
2432 16 2 if ($west <= $east) { }
2438 1 15 if (defined $condition) { }
2442 3 9 unless defined $_set
2460 0 5 if ($p_lat >= $south and $p_lat <= $north and $p_lon >= $west and $p_lon <= $east or $include_south_pole and $p_lat == -90 or $include_north_pole and $p_lat == 90)
2470 5 39 if (&$condition($_point, $_bounding_box, $user_data)) { }
2482 109 108 unless defined $_set
2500 670 64 if ($p_lat >= $south and $p_lat <= $north and $p_lon >= $west and $p_lon <= $east or $include_south_pole and $p_lat == -90 or $include_north_pole and $p_lat == 90) { }
2525 0 2 if (defined $condition) { }
2529 0 0 unless defined $_set
2547 0 0 if ($p_lat >= $south and $p_lat <= $north and $p_lon >= $west || $p_lon <= $east || $include_south_pole && $p_lat == -90 || $include_north_pole && $p_lat == 90)
2557 0 0 if (&$condition($_point, $_bounding_box, $user_data)) { }
2569 14 12 unless defined $_set
2587 11 9 if ($p_lat >= $south and $p_lat <= $north and $p_lon >= $west || $p_lon <= $east || $include_south_pole && $p_lat == -90 || $include_north_pole && $p_lat == 90) { }
2608 1 17 if ($max_results)
2610 0 1 if $results_count < $max_results
2615 0 0 scalar @$_results > $max_results ? :
0 6 $max_results ? :
6 0 scalar @$_results ? :
1 0 scalar @$_results > $max_results ? :
1 11 $max_results ? :
12 0 scalar @$_results ? :
6 12 wantarray ? :
2789 2 14 if (ref $number_of_points_desired)
2798 13 3 if (ref $_search_point eq 'ARRAY')
2845 3 13 unless defined $number_of_points_desired
2847 10 6 if (not defined $post_condition) { }
2 4 elsif ($post_condition eq 'NONE') { }
2855 2 14 defined $pre_condition ? :
2856 14 2 defined $post_condition ? :
2858 0 16 defined $search_radius ? :
2861 16 0 unless defined $sort_results
2874 0 16 if $p_lat_idx > $cur_size
2891 3 13 if (defined $_search_point->{'lat_rad'}) { }
2899 3 13 if (defined $_search_point->{'lon_rad'}) { }
2953 9 258 if ($cur_level < 0) { }
2965 0 9 unless defined $_results
2968 18 81 if $considered{$_point}
2970 73 8 if ($no_pre_condition or &$pre_condition($_point, $_search_point, $user_data)) { }
2973 31 42 if (defined $distances{$_point}) { }
2982 73 0 if ($no_search_radius or $distance <= $search_radius)
2983 73 0 if ($no_post_condition or &$post_condition($_point, $_search_point, $user_data))
3040 70 188 if ($lat_low_bit) { }
3046 10 60 if ($adj_lat_idx == $cur_size)
3061 76 112 if ($adj_lat_idx < 0)
3070 71 187 if ($lon_low_bit) { }
3088 0 258 $valid_radius_lat_m < $valid_radius_lon_m ? :
3098 95 439 unless defined $lat_idx
3100 91 348 if ($lat_idx == 0) { }
130 218 elsif ($lat_idx >= $max_grid_idx) { }
3109 16 75 unless defined $_results
3112 25 75 if $considered{$_point}
3114 69 6 if ($no_pre_condition or &$pre_condition($_point, $_search_point, $user_data)) { }
3117 45 24 if (defined $distances{$_point}) { }
3125 9 60 if ($distance <= $valid_radius_m)
3127 0 9 unless $no_search_radius or $distance < $largest_distance_seen
3128 9 0 if ($no_search_radius or $distance <= $search_radius)
3129 9 0 if ($no_post_condition or &$post_condition($_point, $_search_point, $user_data))
3149 62 68 unless defined $_results
3152 29 86 if $considered{$_point}
3154 86 0 if ($no_pre_condition or &$pre_condition($_point, $_search_point, $user_data)) { }
3157 58 28 if (defined $distances{$_point}) { }
3165 8 78 if ($distance <= $valid_radius_m)
3167 0 8 unless $no_search_radius or $distance < $largest_distance_seen
3168 8 0 if ($no_search_radius or $distance <= $search_radius)
3170 8 0 if ($no_post_condition or &$post_condition($_point, $_search_point, $user_data))
3192 415 21 unless defined $_results
3195 17 4 if $considered{$_point}
3197 4 0 if ($no_pre_condition or &$pre_condition($_point, $_search_point, $user_data)) { }
3200 0 4 if (defined $distances{$_point}) { }
3208 3 1 if ($distance <= $valid_radius_m)
3210 0 3 unless $no_search_radius or $distance < $largest_distance_seen
3211 3 0 if ($no_search_radius or $distance <= $search_radius)
3212 2 1 if ($no_post_condition or &$post_condition($_point, $_search_point, $user_data))
3345 8 259 if $number_of_points_desired and scalar @valid >= $number_of_points_desired
3348 0 259 unless $no_search_radius or $largest_distance_seen < $search_radius
3352 16 0 if $sort_results
3355 8 8 if ($number_of_points_desired)
3357 1 7 if $number_of_points_desired < $count_to_return
3364 12 4 wantarray ? :
3534 0 4 if (ref $number_of_points_desired)
3543 4 0 if (ref $_search_point eq 'ARRAY')
3558 4 0 if $antipode_lon >= 180
3595 4 0 if (not defined $post_condition || defined $user_data) { }
0 0 elsif ($post_condition eq 'NONE') { }
3606 2 2 unless defined $number_of_points_desired
3619 0 4 if (defined $_search_point->{'lat_rad'}) { }
3627 0 4 if (defined $_search_point->{'lon_rad'}) { }
3647 4 0 wantarray ? :
3744 5 9 if (ref $p0 eq 'ARRAY')
3749 8 6 unless $p0->{'lat_rad'}
3750 8 6 unless $p0->{'lon_rad'}
3796 5 9 if (ref $p1 eq 'ARRAY')
3801 6 8 unless $p1->{'lat_rad'}
3802 6 8 unless $p1->{'lon_rad'}
3865 10 6 unless defined $SetUpDistance_perl
3866 10 6 unless defined $HaversineDistance_perl
3867 10 6 unless defined $ComputeAreaExtrema_perl
3868 10 6 unless defined $fast_log2_perl
3872 2 14 if ($type eq 'perl') { }
12 2 elsif ($C_CODE_COMPILED and $type eq 'double') { }
2 0 elsif ($C_CODE_COMPILED and $type eq 'float') { }
3989 0 161 if ($n < 0)
4086 2 0 if ($C_CODE_COMPILED == 1) { }
4181 0 0 if $lat == 536870911
4182 0 0 if $lon == 536870911
4184 0 0 if $level > $levels
4200 0 0 if (not defined $stats[$level]{'min_tile_points'} or $count < $stats[$level]{'min_tile_points'})
4206 0 0 if (not defined $stats[$level]{'max_tile_points'} or $count > $stats[$level]{'max_tile_points'})
4217 0 0 if ($tiles) { }
4285 0 0 if (not defined $_points) { }
0 0 elsif (ref $_points eq 'HASH') { }
4304 0 0 if (ref $_extra_keys eq 'ARRAY') { }
4379 0 0 if (not defined $_points) { }
0 0 elsif (ref $_points eq 'HASH') { }
4398 0 0 if (ref $_extra_keys eq 'ARRAY') { }
4479 0 1 if (wantarray) { }
4544 0 754 if $lat_int > $self->{'max_size'}
4572 0 0 if $lat_int > $self->{'max_size'}
4666 0 0 if ($EW_circumference_in_meters) { }