queryByPoint on a Postgis layer...

Philippe Gondek philippe.gondek at GMAIL.COM
Thu Jun 16 04:29:29 EDT 2005


Hi list,

I have a problem. I want to use the function queryByPoint in Mapscript
to know the item I clicked.

	      	$qx = $HTTP_POST_VARS["mapa_x"];
		$qy = $HTTP_POST_VARS["mapa_y"];
		$point = ms_newpointOBj();
		$point->setXY($qx, $qy);
		$layerq = $map->getLayerByName("communes");
		$data = $layerq->queryByPoint($point, MS_SINGLE, -1);

       >>>>>>>>>> I have no result... maybe I must do the connection
to Postgis by myself... any suggestions???

		echo nl2br("\n data : $datadata_val");
		$result = $layerq->getResult(0);
		echo nl2br("\n result : $result");
		$layerq->open();
		$items = $layerq->getitems();
		echo nl2br("\n items : $items");
		$shape =$layerq->getShape($result->tileindex, $result->shapeindex);
		$layerq->close();
		$data_val = $shape->values;
		echo nl2br("\n data_val : $data_val");

Thanks and have a nice day...

Philippe



More information about the mapserver-users mailing list