php3 and Point Query
peter.jacobs at javel.nl
peter.jacobs at javel.nl
Thu Oct 12 07:50:26 PDT 2000
Hello,
though I have read most of the previous mesages I'am not able to get a
point query working. Can someone help me?
-----------------------------------------------
ERROR message :
Points : 84463.618126601 447332.90091818
Warning: Using scalar variable $result as an array or object in test.php on
line 225
Result
-----------------------------------------------
Layer in Mapfile
LAYER
NAME cyclomedia
TYPE POINT
STATUS ON
DATA cyclomedia
TOLERANCE 10
QUERYITEM "naam"
QUERY
TEMPLATE "ttt"
END
CLASS
COLOR 255 130 140
TEXT ""
SYMBOL 'camera'
END
END
-----------------------------------------------
PHP Statement
$point=ms_newPointObj();
$input_coord=CreateDoubleArray($input_coord); //makes an array out
of a comma separated string
$input_coord[1]=$map->height-$input_coord[1]; //tranform
horizontally
$extent=$map->extent;
//calculate the georef extent of the point
$input_coord[0]=($input_coord[0]/$map->width)
*($extent->maxx-$extent->minx)+$extent->minx;
$input_coord[1]=($input_coord[1]/$map->height)
*($extent->maxy-$extent->miny)+$extent->miny;
$point->setXY($input_coord[0],$input_coord[1]);
echo("Points : $point->x $point->y"); //check works fine
$layer=$map->getLayerByName('cyclomedia');
$result =$layer->queryusingpoint($point,MS_SINGLE,-1);
echo("Result :$result->numresults"); //error!
$shapendx = $queryres->next();
More information about the MapServer-users
mailing list