[Mapserver-users] Querybyattribute and drawquery problem

Frank Broniewski Frank.Broniewski at mnha.etat.lu
Mon Jun 7 04:58:27 EDT 2004


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





More information about the mapserver-users mailing list