[Mapserver-users] Point Query Problem

Sam Choudry samuzzal at linux.net
Fri Apr 30 00:17:35 PDT 2004


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 = GMapPix2Geo($x_pos,0,$map_width,$minX,$maxX,0);
$geo_y = GMapPix2Geo($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 have 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