[mapserver-users]: wrong results querybypoint
Peter
blackmail at snafu.de
Tue Mar 26 02:53:07 PST 2002
Hi Listers,
doing a querybypoint the zoom to the queried polygon is doing well, but
the information is wrong. It gives the wrong result. Here's the code:
Thanks a lot
Peter
$queryresult = @$map -> queryByPoint ($querypoint, MS_SINGLE, -1);
if ($queryresult == MS_SUCCESS) {
/* Bei einem Erfolg: Ergebnisse aus dem gewünschten Layer holen*/
$resultlayer = $map -> getLayerByName ('objekte');
/* Uns interessiert nur das erste (i.e. nullte) Resultat */
$theresult = $resultlayer -> getResult (0);
$shapefile = ms_newShapefileObj ('C:\Programme\Apache
Group\Apache\htdocs\immogis3w\code\data\objekte', -1);
$resultshape = $shapefile -> getShape ($theresult -> shapeindex);
$resultbounds = $resultshape -> bounds;
/* Karte auf diese Extents zoomen */
$map -> setExtent ($resultbounds -> minx-80, $resultbounds ->
miny-80,$resultbounds -> maxx+80, $resultbounds -> maxy+80); = CORRECT
ZOOM!!!
$resultlayer = $map -> getLayerByName ('objekte');
$numresults = $resultlayer -> getNumResults ();
$theresult = $resultlayer -> getResult (0);
$resultclass = $resultlayer -> getClass (0);
$dbasefile = dbase_open ("C:\Programme\Apache
Group\Apache\htdocs\immogis3w\code\data\objekte.dbf", 0);
$dbrecord = dbase_get_record_with_names ($dbasefile, $theresult ->
shapeindex);
$Dummy = $dbrecord['ID'];
printf ("%f<br>", $Dummy); = WRONG RESULT!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20020326/9c6052f8/attachment.htm>
More information about the MapServer-users
mailing list