[mapserver-users] QueryObjects: What is displayed versus what is returned

David Kriske David_Kriske at Hilton.com
Fri Jun 22 10:44:05 PDT 2001






Daniel,

If I query using point and set the expression filter on the query object,
filtered-out items will not be displayed on the map when you draw it, but they
seem to be in the result object.

For instance, if I have two overlapping polygons in a layer, one has ATTRIBUTE =
1 and the other ATTRIBUTE = 2, and I do a $aopqueryobject->setExpression(  "  (
[ATTRIBUTE] eq 1)  "  ) and then I QueryUsingPoint using a point withing the two
overlapping polygons, I get a map that highlights only the poly with ATTRIBUTE
equal to 1 (correct behavior) but when I examine the queryresultobject using
numresults, I see two items (the displayed one and the filtered one).

Should there be one or two items in the queryresult object in this case?  The
problem is even though the map is correct, when I iterate through the
resultobject to pull out attributes (and generate a list of highlighted items),
I get the masked item as well as the highlighted one.

....Or maybe I'm just doing something wrong (a good possibility, I'm a novice
coder).  The funny thing is that I only see the one polygon in the image (I'm
using method=selected in the mapfile), but I get two results in the result
object!!

Thanks again for your help....

David



     -----Original Message-----
     From: "Daniel Morissette" <morissette at dmsolutions.ca>@INTERNET
     Sent: Friday, June 22, 2001 10:27 AM
     To: David Kriske
     Cc: 'mapserver-users at lists.gis.umn.edu'
     Subject: Re: [mapserver-users] QueryObjects: What is displayed versus what
     is returned

     David Kriske wrote:

     >

     > Unfortunately, if there is a polygon that has been "masked out" due to
     its

     > attribute not satisfying the Expression set through the setExpression
     method but

     > the user clicks in the area where the polygon WOULD HAVE BEEN had it not
     been

     > excluded, the queryresultobject will still return it as a record, and
     thus my

     > PHP script will in turn generate a link to it.  Thus, while the excluded

     > polygons are not displayed, by clicking on the image and using
     QueryUsingPoint,

     > the poly is still returned in the result set.

     >

     > Is there any way around this issue?

     >

     Are you sure that you've set the same expression filter on the query

     object that you had on the class object?

     We use query expression filters with the PHP GMap demo in queriable

     layers (the cities layer) and it does work properly... so I can't see

     why it wouldn't work for you.

     --

     ------------------------------------------------------------

      Daniel Morissette               morissette at dmsolutions.ca

      DM Solutions Group              http://www.dmsolutions.ca/

     ------------------------------------------------------------

       Don't put for tomorrow what you can do today, because if

           you enjoy it today you can do it again tomorrow.







More information about the MapServer-users mailing list