[Mapserver-users] Querybyattribute and drawquery problem

No dream more v0463 at n-koei.co.jp
Mon Jun 7 05:33:40 EDT 2004


You should do:

$mySearchLayer = $MapObj->getLayerByName("Toponyme");
if($mySearchLayer->queryByAttributes("toponyme",$searchitem,MS_SINGLE)==MS_S
UCCESS){
    $mySearchLayer->draw($myresultImg); file://Draw query map
      echo "<div id=\"error\"><img
src=\"".$myresultImg.saveWebImage()."\"></div>";
}

Hope it help you!.
Lam.



----- Original Message -----
From: "Frank Broniewski" <Frank.Broniewski at mnha.etat.lu>
To: <mapserver-users at lists.gis.umn.edu>
Sent: Monday, June 07, 2004 3:58 PM
Subject: [Mapserver-users] Querybyattribute and drawquery problem


> 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.
> 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