Trouble with queryby...

Frank Broniewski Frank.Broniewski at MNHA.ETAT.LU
Wed Oct 6 08:07:01 EDT 2004


Hello

I am experiencing problems with the query-methods of phpmapscript. I always
get the errormessage: "Error in msQueryByPoint(): No matching record(s)
found."

My querycode is: 
  $MapObj->queryByRect($myPixelRectObj);
     and
  $MapObj->queryByPoint($myPointObj, MS_SINGLE, 0);

I controlled already the coordinates of $myPixelRectObj which are ok. The
layer which I query is default off in the mapfile, but turned on later
dynamically. It is displayed correctly in my map. I use the rosa applet to
interact with the user.

When I change my code for the pointquery to the following:
    $myLayer = $MapObj->getLayerByName("Points");
    $myLayer->set("status",1);
    $myLayer->queryByPoint($myPointObj, MS_SINGLE, 0);
I get a result. But if I comment out the line $myLayer->set("status",1); I
get also the above mentioned error. The query with queryByRect just won't
work with this workaround.

My question is now: How do I get my queries working with the $map Mapobject?
Does anyone see a reason, why the layerquery works for point, but not for
rect? Is there a particular order in building the map when I want to query?
Like first draw the map then query? Make layers active (status = on) then
query? But they are already drawn on the queried map?! Why can I not query
the mapobject but  a single layer?

I work with Apache 2.0.50 on Windows XP Home and php 4.3.8.
Mapserver Version:
MapServer version 4.2.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INPUT=POSTGIS
INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE

MapScript version:
($Revision: 1.194.2.4 $ $Date: 2004/07/07 19:37:19 $)

Many Thanks for any tipps which shed light on my problem
                                                      
Frank Broniewski
Musée National d'Histoire et d'Art
Section Préhistoire / Projet EPC
241, Rue de Luxembourg
L-8077 Bertrange



More information about the mapserver-users mailing list