[mapserver-commits] r10396 - branches/branch-5-4/mapserver

svn at osgeo.org svn at osgeo.org
Sat Jul 24 15:21:37 EDT 2010


Author: tamas
Date: 2010-07-24 19:21:37 +0000 (Sat, 24 Jul 2010)
New Revision: 10396

Modified:
   branches/branch-5-4/mapserver/HISTORY.TXT
   branches/branch-5-4/mapserver/mapmssql2008.c
Log:
Fixed MSSQL2008 driver returning invalid extent (#3498)

Modified: branches/branch-5-4/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-4/mapserver/HISTORY.TXT	2010-07-24 19:20:29 UTC (rev 10395)
+++ branches/branch-5-4/mapserver/HISTORY.TXT	2010-07-24 19:21:37 UTC (rev 10396)
@@ -13,6 +13,7 @@
 
 Current Version:
 ----------------
+- Fixed MSSQL2008 driver returning invalid extent (#3498)
 
 - Backport the recent fixes in the MSSQL2008 driver (#3058, #3244)
 

Modified: branches/branch-5-4/mapserver/mapmssql2008.c
===================================================================
--- branches/branch-5-4/mapserver/mapmssql2008.c	2010-07-24 19:20:29 UTC (rev 10395)
+++ branches/branch-5-4/mapserver/mapmssql2008.c	2010-07-24 19:21:37 UTC (rev 10396)
@@ -1608,16 +1608,27 @@
     return msMSSQL2008LayerInitItemInfo(layer);
 }
 
-/* Dont know if this function actually called */
-/* So just return some large area for now*/
+/* Get the layer extent as specified in the mapfile or a largest area */
+/* covering all features */
 int msMSSQL2008LayerGetExtent(layerObj *layer, rectObj *extent)
 {
     if(layer->debug) {
         msDebug("msMSSQL2008LayerGetExtent called\n");
     }
 
-    extent->minx = extent->miny = -1000000;
-    extent->maxx = extent->maxy = 1000000;
+    if (layer->extent.minx == -1.0 && layer->extent.miny == -1.0 &&
+        layer->extent.maxx == -1.0 && layer->extent.maxy == -1.0)
+    {
+        extent->minx = extent->miny = -1.0 * FLT_MAX;
+        extent->maxx = extent->maxy = FLT_MAX;
+    }
+    else
+    {
+        extent->minx = layer->extent.minx;
+        extent->miny = layer->extent.miny;
+        extent->maxx = layer->extent.maxx;
+        extent->maxy = layer->extent.maxy;
+    }
 
     return MS_SUCCESS;
 }



More information about the mapserver-commits mailing list