[Mapserver-users] Tolerance Problem

Sam Choudry samuzzal at linux.net
Fri Apr 30 05:30:46 EDT 2004


    Thank you Thieme for your advice. But my problem is that 
querybypoint() itself is not working because of what I think
'Tolerance'. Can anybody put some light in this regard. I am
again attaching my previous mail.


Hi,

I am providing herewith the code I am using for querying 
a point layer.


..
$query_on = TRUE;
$map_height = $map->height;
$map_width  = $map->width;

$minX = $map->extent->minx;
$minY = $map->extent->miny;
$maxX = $map->extent->maxx;
$maxY = $map->extent->maxy;

$geo_x = Pix2Geo($x_pos,0,$map_width,$minX,$maxX,0);
$geo_y = Pix2Geo($y_pos,0,$map_height,$minY,$maxY,1);
$GeoPosition = ms_newPointObj();
$GeoPosition->setXY($geo_x, $geo_y);

echo "$geo_x,<br>";
echo "$geo_y<br>";

$Layer = $map->getlayerbyname("pt-barama");
//$Layer->toleranceunits = MS_PIXELS;
$result = $Layer->queryByPoint($GeoPosition,MS_SINGLE,-1);
echo "$result";
..



The portion of the Map file used is : 

..
LAYER 
    NAME "pt-barama" 
    DATA "pt-barama"
    TOLERANCEUNITS pixels
    TOLERANCE 10
    STATUS ON
    TYPE POINT
    CLASS 
      COLOR 100 100 100
      OUTLINECOLOR 0 0 0
      SYMBOL 'circle' 
  END # end of class object
END 
..


And the Error Message is : 

Warning: [MapServer Error]: msQueryByPoint(): No matching record(s) 
found. in c:\inetpub\wwwroot\php\nalbari\barama.php on line 81


I tested with different tolerence units and also tolerance values, 
but the problem remains. Can anybody show me the problem in coding?
regards,



							Samuzzal 

_____________________________________________________________
Linux.Net -->Open Source to everyone
Powered by Linare Corporation
http://www.linare.com/



More information about the mapserver-users mailing list