[fusion-users] Problems using map.query() method

Paul Spencer pspencer at dmsolutions.ca
Sat May 31 20:30:39 EDT 2008


Vitor,

you are not doing anything wrong, the mapserver code for the query()  
function just hasn't been updated to use the filter value in Query.php  
(although it does parse it from the request parameters).

Patches welcome :)

Cheers

Paul

On 29-May-08, at 6:03 AM, Vitor Fortunato wrote:

> I am having problems to use the map.query() method to filter  
> attributes.
> In this method you can send a SQL filter inside the options parameter.
> But it didn't works for me...
>
> I think the query method is ignoring this parameter.
>
> I've found the code bellow in the query.php file, and it seems that  
> this file is not using the filter parameter...
> The code bellow, shows only the queryByShape using the  
> $oSpatialFilter parameter...
>
>
> /// ... ... ... >>>>>>>>>>>>>>>>>>>>>>>>>>>
>
> if (@$oLayer->queryByShape($oSpatialFilter) == MS_SUCCESS) {
>         $result->hasSelection = true;
>         $layerName = $oLayer->name;
>         array_push($result->layers, $layerName);
>         $result->$layerName->featureCount = $oLayer->getNumResults();
>         //TODO: dump out the extents of the selection
>     }
>
> /// >>>>>>>>>>>>>>>>>>>>>>>>>>> ... ... ...
>
>
>
>
> I have a simple widget that uses the following code:
>
> execute : function() {
>     var options = {};
>     options.selectionType = 'INTERSECTS';
>     options.geometry = "POLYGON((-75.58840579710144  
> -10.755072463768112, -61.16086956521739 -10.755072463768112,  
> -61.16086956521739 0.005797101449276809, -75.58840579710144  
> 0.005797101449276809, -75.58840579710144 -10.755072463768112))";
>     options.maxFeatures = 0;
>     options.filter = "gid=1"
>     options.layers = 'States';
>
>     this.getMap().query(options);
> }
>
>
> the polygon intersects with 5 states, but I would like to select  
> just the state with 'gid = 1', using the filter option.
> My code select the 5 states that intersect with the polygon and  
> don't apply the filter.
>
> What I am doing wrong?
>
> _______________________________________________
> fusion-users mailing list
> fusion-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/fusion-users


__________________________________________

    Paul Spencer
    Chief Technology Officer
    DM Solutions Group Inc
    http://www.dmsolutions.ca/



More information about the fusion-users mailing list