[mapserver-commits] r10379 - branches/branch-5-6/mapserver

svn at osgeo.org svn at osgeo.org
Thu Jul 22 04:23:12 EDT 2010


Author: tbonfort
Date: 2010-07-22 08:23:12 +0000 (Thu, 22 Jul 2010)
New Revision: 10379

Modified:
   branches/branch-5-6/mapserver/HISTORY.TXT
   branches/branch-5-6/mapserver/mapprimitive.c
Log:
Fix computation of shape bounds when the first line contains no points (#3119)(fixes #3383)


Modified: branches/branch-5-6/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-5-6/mapserver/HISTORY.TXT	2010-07-22 08:16:24 UTC (rev 10378)
+++ branches/branch-5-6/mapserver/HISTORY.TXT	2010-07-22 08:23:12 UTC (rev 10379)
@@ -11,6 +11,10 @@
 
 For a complete change history, please see the Subversion log comments.
 
+Current Version
+---------------
+- Fix computation of shape bounds when the first line contains no points
+  (#3119)(fixes #3383)
 
 Version 5.6.5 (2010-07-14):
 ---------------------------

Modified: branches/branch-5-6/mapserver/mapprimitive.c
===================================================================
--- branches/branch-5-6/mapserver/mapprimitive.c	2010-07-22 08:16:24 UTC (rev 10378)
+++ branches/branch-5-6/mapserver/mapprimitive.c	2010-07-22 08:23:12 UTC (rev 10379)
@@ -187,12 +187,16 @@
 void msComputeBounds(shapeObj *shape)
 {
   int i, j;
-
   if(shape->numlines <= 0) return;
-  if(shape->line[0].numpoints <= 0) return;
-
-  shape->bounds.minx = shape->bounds.maxx = shape->line[0].point[0].x;
-  shape->bounds.miny = shape->bounds.maxy = shape->line[0].point[0].y;
+  for(i=0;i<shape->numlines;i++) {
+     if(shape->line[i].numpoints > 0) {
+        shape->bounds.minx = shape->bounds.maxx = shape->line[i].point[0].x;
+        shape->bounds.miny = shape->bounds.maxy = shape->line[i].point[0].y;
+        break;
+     }
+  }
+  if(i == shape->numlines)
+     return; //no lines inside the shape contain any points 
     
   for( i=0; i<shape->numlines; i++ ) {
     for( j=0; j<shape->line[i].numpoints; j++ ) {



More information about the mapserver-commits mailing list