From: Sandro Santilli Date: Fri, 5 Mar 2004 21:03:18 +0000 (+0000) Subject: Made the -bps switch specify the exact level(s) at which to run the test X-Git-Tag: pgis_0_8_2~87 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a3b2c10373c6ecde5deb4d4b310f48305a1186fb;p=postgis Made the -bps switch specify the exact level(s) at which to run the test git-svn-id: http://svn.osgeo.org/postgis/trunk@472 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/utils/test_estimation.pl b/utils/test_estimation.pl index 7bf80c8e9..fa85c8539 100755 --- a/utils/test_estimation.pl +++ b/utils/test_estimation.pl @@ -26,7 +26,8 @@ for ($i=0; $i<@ARGV; $i++) } elsif ( $ARGV[$i] eq '-bps' ) { - $BPS=$ARGV[++$i] + $BPS=int(abs($ARGV[++$i])); + push(@bps_list, $BPS); } else { @@ -51,6 +52,12 @@ for ($i=0; $i<@ARGV; $i++) } } +if ( ! $TABLE || ! $COLUMN ) +{ + usage(); + exit 1; +} + $SCHEMA = 'public'; $COLUMN = 'the_geom' if ( $COLUMN eq '' ); @@ -115,15 +122,14 @@ if ( $res->resultStatus != PGRES_COMMAND_OK ) { print " Type: $TYPE\n"; print "Extent: ".print_extent(\%ext)."\n" if ($VERBOSE); - -$ext = \%ext; -#print "BPS: $bps (".@extents." cells)\n"; print " bps\test\treal\tdelta\tmatch_factor\n"; print "----------------------------------------------------------\n"; -for ($bps=1; $bps<=$BPS; $bps*=2) -{ - @extents = split_extent($ext, $bps); +#for ($bps=1; $bps<=$BPS; $bps*=2) +for ($i=0; $i<@bps_list; $i++) +{ + $bps=$bps_list[$i]; + @extents = split_extent(\%ext, $bps); $best_match_factor=10000; $worst_match_factor=1; @@ -161,8 +167,8 @@ for ($bps=1; $bps<=$BPS; $bps*=2) } $avg_match_factor = $sum_match_factors/$count_match_factors; $avg_match_factor = int($avg_match_factor*1000)/1000; - print "(bps/best/worst/avg):\t". - $bps."\t". + print " $bps\t". + "(best/worst/avg) \t". $best_match_factor."\t". $worst_match_factor."\t".$avg_match_factor."\n"; } @@ -246,6 +252,9 @@ sub test_extent # # $Log$ +# Revision 1.5 2004/03/05 21:03:18 strk +# Made the -bps switch specify the exact level(s) at which to run the test +# # Revision 1.4 2004/03/05 16:40:30 strk # rewritten split_extent to be more datatype-conservative #