[postgis-users] querybypoint a postgis db with php mapscript
Pascal Lavorel
pascal at artelabs.ch
Fri Jul 16 01:36:24 PDT 2004
hello,
there is my code (as simple as i could do it):
$check=@$my_layer->queryByPoint($my_point, MS_SINGLE, 200);
if($check == MS_FAILURE){
echo "<font size=4 color=red>There were no results</font>";
}else if( $check == MS_SUCCESS){
$result = $my_layer->getResult(0);
$my_layer->open();
$shape = $my_layer->getShape($result->shapeindex,$result->tileindex);
//$result = $my_layer->getResult(0); //not sure i must put this line
$value=$shape->values["gid"];
$my_layer->close;
}
echo $value;
when i click on my points i get "MS_SUCCESS". But i always get 1 as gid
no matter which point i click on (but i am sure the data come from my
database)
I must be wrong somewere!
any idea?
thanks
Pascal Lavorel
ArteLabs.com
20 Bd Georges-Favon
CH-1204 Genève
Tel. + 41 22 8003035
pascal at artelabs.ch
More information about the postgis-users
mailing list