[Geomoose-users] Help with querybyAttribute function! Help

Dan Little danlittle at yahoo.com
Sun Sep 20 16:50:59 EDT 2009


queryByAttributes is not as predictable as I think is useful.  It's usually better to set the filter and the query by the extents of the data.

So (in complete psuedo code):

layer.setFilter("(($field1 == $userv1) or ($fields2 == $userv2))")
layer.queryByRect(map.extent)

Then iterate through the results set.  The problem with queryByAttributes and using the filter is that the syntax changes depending on whether or not the datasource is a database or a shapefile as MapServer does not "virtualize" the Filter settings.


>
>From: FRANZ OKYERE <franzzoa at hotmail.com>
>To: geomoose-users at lists.sourceforge.net
>Sent: Sunday, September 20, 2009 12:03:24 AM
>Subject: Re: [Geomoose-users] Help with querybyAttribute function! Help
>
> >Sorry about that. Its like this. ...some code... $querystring="(($field1=$userv1) or ($field2=$userv2))";      $queryLayer->querybyattributes($ques, $querystring,MS_MULTIPLE);  $ques is one of my attributes and field and userv in the expression are replaced with the attribute and a user supplied string. When will the method, why the errors? I hope it helps. Cheers Brent. 
>
>> Date: Sat, 19 Sep 2009 19:47:16 -0600
>> Subject: Re: [Geomoose-users] Help with querybyAttribute function! Help
>> From: bfraser at geoanalytic.com
>> To: franzzoa at hotmail.com
>> CC: geomoose-users at lists.sourceforge.net
>> 
>> Franz,
>> 
>>   Did attach your sample?
>> 
>> Brent
>> 
>> >
>> > Dear all,
>> >
>> > I have done comprehensive search and reading on how to use the
>> > querybyAttributes php mapscript function to evaluate a logical expression.
>> > It looks to me no one seems to find a solution to the errors that  come
>> > up. The problem is that there are so many suggestions on the syntax.
>> > Please, please, can someone do all of us a favour and explain to us what
>> > exactly is the right and working way to use the querybyAttribute (I am
>> > using GM 2- does it matter). Here is a sample of how I am using it and I
>> > have tried a thousand different combinations of code. Please what is wrong
>> > so we (the geomoose users) can move on.
>> >
>> > Thanks a million.
>> >
>> > Franz Okyere
>> >
>> > Lecturer/GIS Specialist
>> >
>> > _________________________________________________________________
>> > Get the best of MSN on your mobile
>> > http://clk.atdmt.com/UKM/go/147991039/direct/01/
>> > ------------------------------------------------------------------------------
>> > Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
>> > is the only developer event you need to attend this year. Jumpstart your
>> > developing skills, take BlackBerry mobile applications to market and stay
>> > ahead of the curve. Join us from November 9&#45;12, 2009. Register
>> > now&#33;
>> > http://p.sf.net/sfu/devconf
>> > _______________________________________________
>> > Geomoose-users mailing list
>> > Geomoose-users at lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/geomoose-users
>> >
>> >
>> 
>> 
>
>________________________________
Beyond Hotmail - see what else you can do with Windows Live. Find out more.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/geomoose-users/attachments/20090920/726cc9a9/attachment.html


More information about the Geomoose-users mailing list