[Mapserver-users] Querybyattribute and drawquery problem

AARON KONING aaronkoning at shaw.ca
Mon Jun 7 05:20:30 EDT 2004


I use drawquery with no arguments:
  $image = $mapObj->drawQuery();

Don't forget to create the image file after the draw:
  $imageUrl = $image->saveWebImage(MS_PNG,1,1,0))


Aaron


----- Original Message -----
From: Frank Broniewski <Frank.Broniewski at mnha.etat.lu>
Date: Monday, June 7, 2004 1:58 am
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 
> resultof 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 
> testsand 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