[Mapserver-users] Querybyattribute and drawquery problem
Norbert Thieme
norbert.thieme at ilmenau.baw.de
Mon Jun 7 03:04:04 PDT 2004
Frank Broniewski schrieb:
> Hello List
>
> I want to query a shapefile by some attribute stored in the shapefiles
> .dbf. I thought using queryByAttribute() might be the right function to
> use. My problem now is getting my query drawn.
> As far as I understand, queryByAttribute returns an integer as a result
> of the query. I used the following code to draw the result but with no
> success:
>
> $mySearchLayer = $MapObj->getLayerByName("Toponyme");
> $result =
> $mySearchLayer->queryByAttributes("toponyme",$searchitem,MS_SINGLE);
> $myresultImg = $MapObj->drawQuery($result);
> echo "<div id=\"error\"><img src=\"".$myresultImg."\"></div>";
>
> I observed, that $myresultImg always is 0, nevertheless of the value of
> $searchitem. Even if I change $searchitem to a String like "Citie",
> querybyAttributes returns always 0.
Hi.
The QString must be exact the same in your table. Then you will get a
result. But there could be some kind of not printed character in your
dbf. You can use the PHP dbf functions or odbc functions to make a like
query or something and then use the mapscript function with this output.
I think you shouldn't put the result in the drawquery because the mapobj
draws the whole querycache.
Regards,
Norbert
> Then my next problem is: how do I draw the query? Is my method showed
> above correct, or what steps do I have to take? I already did some tests
> and the apache log showed me, that the number of parameters in the
> method drawQuery() is to small. When looking at the docs, I read
> imageObj image and I frankly have to admit, that I do not know, what to
> enter there.
>
> Many Thanks in Advance for any help offered
> And greetings from Luxembourg
>
> Frank Broniewski
> Musée National d'Histoire et d'Art
> Section Préhistoire / Projet EPC
>
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
>
>
More information about the MapServer-users
mailing list