[Chameleon] CHAMELEON Query - parameters - map_query.php

William Bronsema wbronsema at dmsolutions.ca
Tue Dec 14 10:12:53 EST 2004


Hi Sandra,

If I understand you correctly (based on the additional info you sent to
me) you want to be able to query your map and filter the results
according to an expression, correct?

This can get very complex depending on how flexible you need the
expressions to be.  However, the ExpressionBuilder widget is set up to
do exactly what you want and more.  If you use it in conjunction with
the ROI widgets (circle, square, & polygon) you should be able to query
the way you would like and set any kind of expression.

Unfortunately is fairly complicated to get the results of the
expressionbuilder into tabular form (the visual hi-lighting on the map
is the main purpose of the expressionbuilder and is done by default).
To do this you will need to add a "expressionbuilderresults" shared
resource to your template and pass the results of it to the table widget.

It has been a long time since I have used the tabular form of the
results so maybe there is someone on the list who can talk you through
the exact steps involved?

The advantage in using the expressionbuilder widget as opposed to
customizing chameleon code is that you can still get the latest versions
and upgrades to chameleon without worrying about re-applying your
changes.  Make sense?

Hope this helps.

Regards,
Bill



Rodriguez Sandra wrote:
> 
>       Hi friends,
> 
>       Please, I need help!
> 
>       I have developed my application over the software: W2000 (Internet
>       Information Server), chameleon 1.99b2, php4.3.7, phpmapscript 4.2,
>       mapserver 4.
> 
>       My application needs to show the attributes of the layer and that
>       it displays the map and resulting data of the consultation like:
>       attribute > value .
> 
>       I personalized the file map_query.php (line 480), so that it
>       spreads to the data additionally a map with a consultation
>       defaulted (RANKGES = 3) . But, I need that the parameters of my
>       consultation are correspondents from my main page  where this file
>       map_query.php to obtain the results as it is shown in the figure 1.
> 
>       Thanks, very much
> 
>       Sandra
> 
> 
>       Adj.
> 
>       Part of the file map_query.php
> 
>          $campo = "RANKGES";
>                $consulta = "('[RANKGES]' = '3')";
> 
>                       
>       if(@$oLayer->querybyattributes($campo,$consulta,MS_MULTIPLE)==MS_SUCCESS)
> 
>               {
>                  $nNumResults = intval($oLayer->getNumResults());          
>               $oLayer->open();
>                  for ($i=0; $i < $nNumResults; $i++)
>                  {
>                   // get next shape row
>                   $oResult = $oLayer->getResult($i);
>                   $oShape = $oLayer->getShape($oResult->tileindex,
>                                                              
>       $oResult->shapeindex);
>          
>                   // push the row array onto the results array
>                   //$aTmp = $oShape->values;
>                   $aTmp = array("CONSEJO PROVINCIAL" =>
>       $oShape->values["CAN_PROV"],
>                             "MUNICIPIO" => $oShape->values["CAN_DES"],
>                             "COD_ENTI" =>
>       $oShape->values["COD_ENTI"],                     
>                     "RANK. GESTION" =>
>       $oShape->values["RANKGES"],                     
>                     "RANK. AUTOSUF." =>
>       $oShape->values["RANKAUTO"],                    
>                     "RANK. ENDEUD." =>
>       $oShape->values["RANKDEU"],                    
>                     "CALIF. RIESGO" => $oShape->values["CALIFICA"]);
>                   array_push( $axResults, $aTmp );
>              
>               // end for loop                       
>                 }        $q_img = $oMap->drawquery();       
>               $q_path =$q_img->savewebimage();
>               echo "Consulta:
>       "."<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;".$consulta."<br>";       
> 
> 
>               echo "<img src=".$q_path.">";
>               }         else
>                {
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 

William A. Bronsema, C.E.T.
Software & Applications Development,
DM Solutions Group Inc.

e-mail: wbronsema at dmsolutions.ca
Web   : http://www.dmsolutions.ca
Phone : (613) 565-5056 ext.25
Fax   : (613) 565-0925
________________________________________________




More information about the Chameleon mailing list