]> granicus.if.org Git - postgis/commitdiff
Fixed to work against LWGEOM installations
authorSandro Santilli <strk@keybit.net>
Mon, 18 Apr 2005 13:30:25 +0000 (13:30 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 18 Apr 2005 13:30:25 +0000 (13:30 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@1631 b70326c6-7e19-0410-871a-916f4a2858ee

utils/test_estimation.pl

index 5616f802d2f3cee404aaf1cf3e21ef4c78ed5a87..c21e57a3583adc772cfb397d586274cdf6c2cf45 100755 (executable)
@@ -111,11 +111,25 @@ $SRID = $res->getvalue(0, 0);
 
 
 # parse extent
-$EXTENT =~ /^BOX3D\((.*) (.*) (.*),(.*) (.*) (.*)\)$/;
-$ext{xmin} = $1;
-$ext{ymin} = $2;
-$ext{xmax} = $4;
-$ext{ymax} = $5;
+if ( $EXTENT =~ /^BOX3D\((.*) (.*) (.*),(.*) (.*) (.*)\)$/ ) 
+{
+       $ext{xmin} = $1;
+       $ext{ymin} = $2;
+       $ext{xmax} = $4;
+       $ext{ymax} = $5;
+}
+elsif ( $EXTENT =~ /^BOX\((.*) (.*),(.*) (.*)\)$/ ) 
+{
+       $ext{xmin} = $1;
+       $ext{ymin} = $2;
+       $ext{xmax} = $3;
+       $ext{ymax} = $4;
+}
+else
+{
+       print STDERR "Couldn't parse EXTENT: $EXTENT\n";
+       exit(1);
+}
 
 # vacuum analyze table
 if ( $VACUUM )
@@ -251,9 +265,9 @@ sub test_extent
        # Test whole extent query
        $query = 'explain analyze select oid from "'.
                $SCHEMA.'"."'.$TABLE.'" WHERE "'.$COLUMN.'" && '.
-               "'SRID=$SRID;BOX3D(".$ext->{'xmin'}." ".
+               "setSRID('BOX3D(".$ext->{'xmin'}." ".
                $ext->{'ymin'}.", ".$ext->{'xmax'}." ".
-               $ext->{'ymax'}.")'";
+               $ext->{'ymax'}.")'::BOX3D, $SRID)";
        $res = $conn->exec($query);
        if ( $res->resultStatus != PGRES_TUPLES_OK )  {
                print STDERR $conn->errorMessage;
@@ -272,6 +286,12 @@ sub test_extent
 
 # 
 # $Log$
+# Revision 1.9  2005/04/18 13:30:25  strk
+# Fixed to work against LWGEOM installations
+#
+# Revision 1.8.4.1  2005/04/18 13:28:19  strk
+# Fixed to work against LWGEOM installations
+#
 # Revision 1.8  2004/03/08 17:21:57  strk
 # changed error computation code to delta/totrows
 #