[mapserver-commits] r10394 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Sat Jul 24 15:19:00 EDT 2010
Author: tamas
Date: 2010-07-24 19:19:00 +0000 (Sat, 24 Jul 2010)
New Revision: 10394
Modified:
trunk/mapserver/HISTORY.TXT
trunk/mapserver/mapmssql2008.c
Log:
Fixed MSSQL2008 driver returning invalid extent (#3498)
Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT 2010-07-24 15:27:20 UTC (rev 10393)
+++ trunk/mapserver/HISTORY.TXT 2010-07-24 19:19:00 UTC (rev 10394)
@@ -13,6 +13,8 @@
Current Version (SVN trunk):
----------------------------
+- Fixed MSSQL2008 driver returning invalid extent (#3498)
+
- Added coordinate scaling to shpxy tag via parameters scale, scale_x or scale_y.
- Fix computation of shape bounds when the first line contains no points
Modified: trunk/mapserver/mapmssql2008.c
===================================================================
--- trunk/mapserver/mapmssql2008.c 2010-07-24 15:27:20 UTC (rev 10393)
+++ trunk/mapserver/mapmssql2008.c 2010-07-24 19:19:00 UTC (rev 10394)
@@ -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