[mapserver-commits] r7558 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Mon May 5 10:41:50 EDT 2008


Author: pramsey
Date: 2008-05-05 10:41:50 -0400 (Mon, 05 May 2008)
New Revision: 7558

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mappostgis.c
   trunk/mapserver/mapquery.c
   trunk/mapserver/mapsearch.c
   trunk/mapserver/mapserver.h
Log:
WFS Multipoint query with PostGIS bug fixed (#2443)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-05-02 16:36:32 UTC (rev 7557)
+++ trunk/mapserver/HISTORY.TXT	2008-05-05 14:41:50 UTC (rev 7558)
@@ -13,6 +13,8 @@
 Current Version (5.1-dev, SVN trunk):
 -------------------------------------
 
+- WFS Multipoint query with PostGIS bug fixed (#2443)
+
 - Tiling API (RFC 43) mode=tile, tilemode=spheremerc, tile=x y zoom (#2581)
 
 - Remove C++-style comments and most other warnings thrown by -pedantic (#2598)

Modified: trunk/mapserver/mappostgis.c
===================================================================
--- trunk/mapserver/mappostgis.c	2008-05-02 16:36:32 UTC (rev 7557)
+++ trunk/mapserver/mappostgis.c	2008-05-05 14:41:50 UTC (rev 7558)
@@ -755,7 +755,8 @@
     shape->type = MS_SHAPE_NULL;  /* nothing in it */
 
     memcpy(&ngeoms, &wkb[5], 4);
-    offset = 9;  /* were the first geometry is */
+    offset = 9;  /* where the first geometry is */
+ 
     for(t=0; t < ngeoms; t++) {
         memcpy(&type, &wkb[offset + 1], 4);  /* type of this geometry */
 
@@ -809,7 +810,7 @@
             }
         }
     }
-
+    
     return MS_SUCCESS;
 }
 

Modified: trunk/mapserver/mapquery.c
===================================================================
--- trunk/mapserver/mapquery.c	2008-05-02 16:36:32 UTC (rev 7557)
+++ trunk/mapserver/mapquery.c	2008-05-05 14:41:50 UTC (rev 7558)
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id:$
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  layer query support.
@@ -506,13 +506,13 @@
 
       shape.classindex = msShapeGetClass(lp, &shape, map->scaledenom, classgroup, nclasses);
       if(!(lp->template) && ((shape.classindex == -1) || (lp->class[shape.classindex]->status == MS_OFF))) { /* not a valid shape */
-	msFreeShape(&shape);
-	continue;
+	      msFreeShape(&shape);
+	      continue;
       }
 
       if(!(lp->template) && !(lp->class[shape.classindex]->template)) { /* no valid template */
-	msFreeShape(&shape);
-	continue;
+        msFreeShape(&shape);
+	      continue;
       }
 
 #ifdef USE_PROJ
@@ -523,11 +523,11 @@
 #endif
 
       if(msRectContained(&shape.bounds, &rect) == MS_TRUE) { /* if the whole shape is in, don't intersect */	
-	status = MS_TRUE;
+	      status = MS_TRUE;
       } else {
 	switch(shape.type) { /* make sure shape actually intersects the rect (ADD FUNCTIONS SPECIFIC TO RECTOBJ) */
 	case MS_SHAPE_POINT:
-	  status = msIntersectMultipointPolygon(&shape.line[0], &searchshape);
+	  status = msIntersectMultipointPolygon(&shape, &searchshape);
 	  break;
 	case MS_SHAPE_LINE:
 	  status = msIntersectPolylinePolygon(&shape, &searchshape);
@@ -762,7 +762,7 @@
 	  switch(shape.type) { /* make sure shape actually intersects the selectshape */
 	  case MS_SHAPE_POINT:
 	    if(tolerance == 0) /* just test for intersection */
-	      status = msIntersectMultipointPolygon(&shape.line[0], &selectshape);
+	      status = msIntersectMultipointPolygon(&shape, &selectshape);
 	    else { /* check distance, distance=0 means they intersect */
 	      distance = msDistanceShapeToShape(&selectshape, &shape);
 	      if(distance < tolerance) status = MS_TRUE;
@@ -1159,7 +1159,7 @@
       switch(shape.type) { /* make sure shape actually intersects the shape */
       case MS_SHAPE_POINT:
         if(tolerance == 0) /* just test for intersection */
-	  status = msIntersectMultipointPolygon(&shape.line[0], selectshape);
+	  status = msIntersectMultipointPolygon(&shape, selectshape);
 	else { /* check distance, distance=0 means they intersect */
 	  distance = msDistanceShapeToShape(selectshape, &shape);
 	  if(distance < tolerance) status = MS_TRUE;
@@ -1454,8 +1454,9 @@
 {
   int i, found=0;
   rectObj tmpBounds;
-  
+
   for(i=0; i<map->numlayers; i++) {
+
     layerObj *lp;
     lp = (GET_LAYER(map, i));
 

Modified: trunk/mapserver/mapsearch.c
===================================================================
--- trunk/mapserver/mapsearch.c	2008-05-02 16:36:32 UTC (rev 7557)
+++ trunk/mapserver/mapsearch.c	2008-05-05 14:41:50 UTC (rev 7558)
@@ -1,5 +1,5 @@
 /******************************************************************************
- * $Id:$
+ * $Id$
  *
  * Project:  MapServer
  * Purpose:  Various geospatial search operations.
@@ -180,12 +180,15 @@
   return(status);  
 }
 
-int msIntersectMultipointPolygon(multipointObj *points, shapeObj *poly) {
-  int i;
+int msIntersectMultipointPolygon(shapeObj *multipoint, shapeObj *poly) {
+  int i,j;
   
-  for(i=0; i<points->numpoints; i++) {
-    if(msIntersectPointPolygon(&(points->point[i]), poly) == MS_TRUE)
-      return(MS_TRUE);
+  for(i=0; i<multipoint->numlines; i++ ) {
+    lineObj points = multipoint->line[i];
+    for(j=0; j<points.numpoints; j++) {
+          if(msIntersectPointPolygon(&(points.point[j]), poly) == MS_TRUE)
+        return(MS_TRUE);
+    }
   }
     
   return(MS_FALSE);

Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h	2008-05-02 16:36:32 UTC (rev 7557)
+++ trunk/mapserver/mapserver.h	2008-05-05 14:41:50 UTC (rev 7558)
@@ -1559,7 +1559,7 @@
 MS_DLL_EXPORT double msDistanceShapeToShape(shapeObj *shape1, shapeObj *shape2);
 MS_DLL_EXPORT int msIntersectSegments(pointObj *a, pointObj *b, pointObj *c, pointObj *d);
 MS_DLL_EXPORT int msPointInPolygon(pointObj *p, lineObj *c);
-MS_DLL_EXPORT int msIntersectMultipointPolygon(multipointObj *points, shapeObj *polygon);
+MS_DLL_EXPORT int msIntersectMultipointPolygon(shapeObj *multipoint, shapeObj *polygon);
 MS_DLL_EXPORT int msIntersectPointPolygon(pointObj *p, shapeObj *polygon);
 MS_DLL_EXPORT int msIntersectPolylinePolygon(shapeObj *line, shapeObj *poly);
 MS_DLL_EXPORT int msIntersectPolygons(shapeObj *p1, shapeObj *p2);



More information about the mapserver-commits mailing list