[fusion-commits] r2440 - trunk/widgets/Query/classes

svn_fusion at osgeo.org svn_fusion at osgeo.org
Mon Oct 24 21:02:03 EDT 2011


Author: jng
Date: 2011-10-24 18:02:03 -0700 (Mon, 24 Oct 2011)
New Revision: 2440

Modified:
   trunk/widgets/Query/classes/query.php
Log:
Fix query widget not being able to query data stores that do not have spatial contexts correctly set up. Patch provided by Adam Jamison

Modified: trunk/widgets/Query/classes/query.php
===================================================================
--- trunk/widgets/Query/classes/query.php	2011-10-21 19:35:22 UTC (rev 2439)
+++ trunk/widgets/Query/classes/query.php	2011-10-25 01:02:03 UTC (rev 2440)
@@ -283,7 +283,8 @@
         if ($this->args['USESPATIALFILTER'] == 'true')
         {
             $polygon = $this->CreatePolygonFromGeomText($this->args['GEOMTEXT']);
-            $polygon = $polygon->Transform($csInverseTransform);
+            if ($csInverseTransform)
+                $polygon = $polygon->Transform($csInverseTransform);
 
             $queryOptions->SetSpatialFilter($featureGeometry, $polygon, MgFeatureSpatialOperations::Intersects);
         }
@@ -298,7 +299,8 @@
             $byteReader = $featureReader->GetGeometry($featureGeometry);
             $geometry = $geometryReaderWriter->Read($byteReader);
             $centerPoint = $geometry->GetCentroid();
-            $centerPoint = $centerPoint->Transform($csTransform);
+            if ($csTransform)
+                $centerPoint = $centerPoint->Transform($csTransform);
 
             $idList = $this->GetFeatureIdList($map, $layer, $featureReader);
 



More information about the fusion-commits mailing list