[Mapserver-users] How can queryByPoint and getShape mapscript functions work with PostGIS.

wanalena at engr.orst.edu wanalena at engr.orst.edu
Sun Mar 2 22:19:41 EST 2003


Hi,
  I am now implementing a Map application that
has a Point layer from PostGIS. The problem is
whenever I try to use queryByPoint on this layer
it will return MS_SUCCESS.
 
 
$nClickGeoX = GMapPix2Geo($nClickPixX, 0, $dfWidthPix,
                                             $dfMinX, $dfMaxX, 0);
$nClickGeoY = GMapPix2Geo($nClickPixY, 0, $dfHeightPix,
                                             $dfMinY, $dfMaxY, 1);
$oClickGeo = ms_newPointObj();
$oClickGeo->setXY($nClickGeoX, $nClickGeoY);
 
$layer = $gpoMap->getLayer(7);
$err = @$layer->queryByPoint($oClickGeo, MS_SINGLE, -20);    //  <-- I have 
tried both MapUnit (positive) and Pixel (negative)
 
if($err == MS_FAILURE)
{
       echo "<font size=4 color=red>There were no results found, try zooming in 
closer.</font>";
}

^^^^^^^^ $err will always return MS_FAILURE ^^^^^^^^^^^
 
else if( $err == MS_SUCCESS)
{ ....

Does anybody has experience with that?
 
--Naroot Wanalertlak
 



More information about the mapserver-users mailing list