[ka-Map-users] Think There is a bug in map_query_float.php

Stéphane RIFF stephane.riff at cerene.fr
Thu Mar 8 13:45:37 EST 2007


I will look at map_query_float code and test my workaround more.

There is the same problem in  the kaSearch.php on line 180 
($oResultCache = $oLayer->getResult($i);)
This time $i is use in the layers FOR loop on line 114 ( for ($i = 0; $i 
< $tot; $i++) )
The same patch seems to work on line 180 : $oResultCache = 
$oLayer->getResult(0);


Another problem in kaSearch.php
the $searchstring concatenate itself if there more than one layer with 
result
so I rename the variable on line 66 : $searchstring become 
$searchstring_request

And a third problem (promise you it's the last one)
It doesn't work with postgis layer I have found a workaround but I have 
to test a little more

I have comment the line 68 because postgis doesn't like "*/i*" in the query
//$searchstring = "/" . $searchstring . "/i";//case insensitive

On line 142 I have replace the if condition for Postgis by :

if($oLayer->connectiontype == MS_POSTGIS){
   
            $szSearchfield = "".$szSearchfield."~* 
'".$searchstring_request."'";
                    $searchstring = "TRUE";
    }else {
      $searchstring = $searchstring_request;
    }

The old one didn't work at all because the queryByAttribute function 
always set the = operator so we can't get the case insensitive search
With my workaround The resulting mapserver query is :

SELECT 
wilaya::text,asbinary(force_collection(force_2d(geom)),'NDR'),gid::text 
from d25_algeriewilaya WHERE (*field ~* 'search' = TRUE*) and (geom && 
setSRID( 'BOX3D(218316.09375 3950741.25,296118.8125 
4024334.25)'::BOX3D,find_srid('','d25_algeriewilaya','geom') ))

Sorry my english is always so bad
I will look some more and send you more details later

Bye
Steff


More information about the ka-Map-users mailing list