Trouble with queryby...
Lowell Filak
lfilak at MEDINACO.ORG
Wed Oct 6 05:16:20 PDT 2004
The following message was sent by Frank Broniewski
<Frank.Broniewski at MNHA.ETAT.LU> on Wed, 6 Oct 2004 14:07:01 +0200.
> 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 late> r
> dynamically. It is displayed correctly in my map. I use the rosa appl>
et 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 w>
on't
> work with this workaround.
>
> My question is now: How do I get my queries working with the $map Map>
object?
> 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 OUTPU> T=WBMP
> OUTPUT=PDF OUTPUT=SWF SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORT>
S=WMS_SERVER
> SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT INP>
UT=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,
Do you have a "template" set for the layer?
Lowell
More information about the MapServer-users
mailing list