[mapserver-users] queryByPoint problem - rien ne va plus

Stefan Schwarzer stefan.schwarzer at grid.unep.ch
Tue Jul 8 04:00:28 EDT 2008


Hi there,

I have a script to query my layers by point or rectangle, which used  
to run smoothly. But now, don't know what happened... I updated from  
an old mapserver version to a recent one. Is it that? I have no idea.

Here is the code which I use. When it reaches the bottom part with the  
queryByPoint it stalls...

Thanks for any help!

Stef


		//Get the Layer being queried
		$Layer = $map -> GetLayerByName($lyr_name);

		//Set the layers status ON (b/c it might not be...)
		$Layer -> set("status", 1);

		$ImgWidth = $map -> width;
		$ImgHeight = $map -> height;
		$x = (($ptX / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
		$y = $ext4 - (($ptY / $ImgHeight) * ($ext4 - $ext2));

		$x1 = (($extent_px0 / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
		$y1 = $ext4 - (($extent_px1 / $ImgHeight) * ($ext4 - $ext2));
		$x2 = (($extent_px2 / $ImgWidth) * ($ext3 - $ext1)) + $ext1;
		$y2 = $ext4 - (($extent_px3 / $ImgHeight) * ($ext4 - $ext2));

		$click_pt = ms_newPointObj();
		$click_pt -> setXY($x, $y);
	
		$click_rt = ms_newRectObj();
		$click_rt -> setextent($x1, $y2, $x2, $y1);
		

		//Query the Map at the point clicked
		if (!$imgbox)
			$a = $map -> queryByPoint($click_pt, MS_MULTIPLE, -1);
		else
			$a = $map -> queryByRect($click_rt);


More information about the mapserver-users mailing list