[fusion-commits] r2218 - sandbox/jxlib-3.0/layers/MapServer/php

svn_fusion at osgeo.org svn_fusion at osgeo.org
Thu Sep 9 09:48:34 EDT 2010


Author: pagameba
Date: 2010-09-09 13:48:33 +0000 (Thu, 09 Sep 2010)
New Revision: 2218

Modified:
   sandbox/jxlib-3.0/layers/MapServer/php/Query.php
Log:
updating mapserver query support to include correctly filtering POSTGIS layers.

Modified: sandbox/jxlib-3.0/layers/MapServer/php/Query.php
===================================================================
--- sandbox/jxlib-3.0/layers/MapServer/php/Query.php	2010-09-07 19:36:56 UTC (rev 2217)
+++ sandbox/jxlib-3.0/layers/MapServer/php/Query.php	2010-09-09 13:48:33 UTC (rev 2218)
@@ -131,6 +131,10 @@
       }
     }
     if ($filter !== false ) {
+      if ($oLayer->connectiontype == MS_POSTGIS && $filterItem != '') {
+        $f = $filter;
+        $filter = $filterItem . ' IN (' . $filter . ')';
+      }
       if (@$oLayer->queryByAttributes($filterItem,$filter,MS_MULTIPLE) == MS_SUCCESS) {
       //if (@$oLayer->queryByAttributes($filterItem,'([REG_CODE] eq 61)',MS_MULTIPLE) == MS_SUCCESS) {
       //if (@$oLayer->queryByAttributes('NAME_E','/.*Buffalo.*/gi',MS_MULTIPLE) == MS_SUCCESS) {
@@ -140,6 +144,9 @@
           $result->$layerName->featureCount = $oLayer->getNumResults();
           //TODO: dump out the extents of the selection
       }
+      if ($oLayer->connectiontype == MS_POSTGIS && $filterItem != '') {
+        $filter = $f;
+      }
     }
 
     if ($bExtendSelection) {



More information about the fusion-commits mailing list