[mapserver-users]: SUM wrong results querybypoint

Peter blackmail at snafu.de
Tue Mar 26 08:37:23 EST 2002


  Hi Lowell,

that was that!

the code working is:
$dbrecord = dbase_get_record_with_names ($dbasefile, $theresult -> 
shapeindex+1);


The list rocks!!! Thanks a lot!


Peter



Lowell.Filak wrote:

>Try adding 1 to the result during the dbase query. The shape index starts
>at 0 but the dbase file records start at 1. Hopefully that should give you
>the correct result.
>Lowell F.
>
> On Tue, 26 Mar 2002, Peter wrote:
>
>>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 */
>>    $ma
>>p -> 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/42174857/attachment.html


More information about the mapserver-users mailing list