[mapserver-commits] r9969 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon Mar 22 09:39:01 EDT 2010


Author: dmorissette
Date: 2010-03-22 09:39:00 -0400 (Mon, 22 Mar 2010)
New Revision: 9969

Modified:
   trunk/mapserver/mappostgis.c
Log:
Fix PostGIS SQL bbox problem introduced by r9804 (#3324)

Modified: trunk/mapserver/mappostgis.c
===================================================================
--- trunk/mapserver/mappostgis.c	2010-03-22 13:27:09 UTC (rev 9968)
+++ trunk/mapserver/mappostgis.c	2010-03-22 13:39:00 UTC (rev 9969)
@@ -919,9 +919,9 @@
     }
 
     if ( strSRID ) {
-        static char *strBoxTemplate = "GeomFromText('POLYGON((%.15f %.15f,%.15f %.15f,%.15f %.15f,%.15f %.15f,%.15f %.15f))',%s)";
+        static char *strBoxTemplate = "GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))',%s)";
         /* 10 doubles + 1 integer + template characters */
-        sz = 10 * 26 + strlen(strSRID) + strlen(strBoxTemplate);
+        sz = 10 * 22 + strlen(strSRID) + strlen(strBoxTemplate);
         strBox = (char*)malloc(sz+1); /* add space for terminating NULL */
         if ( sz <= snprintf(strBox, sz, strBoxTemplate,
                 rect->minx, rect->miny,
@@ -935,9 +935,9 @@
         	return 0;
 	}
     } else {
-        static char *strBoxTemplate = "GeomFromText('POLYGON((%.15f %.15f,%.15f %.15f,%.15f %.15f,%.15f %.15f,%.15f %.15f))')";
+        static char *strBoxTemplate = "GeomFromText('POLYGON((%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g,%.15g %.15g))')";
         /* 10 doubles + template characters */
-        sz = 10 * 26 + strlen(strBoxTemplate);
+        sz = 10 * 22 + strlen(strBoxTemplate);
         strBox = (char*)malloc(sz+1); /* add space for terminating NULL */
         if ( sz <= snprintf(strBox, sz, strBoxTemplate,
                 rect->minx, rect->miny,



More information about the mapserver-commits mailing list