[mapserver-users] pix2geo

ramya srinivasan hellomps at gmail.com
Fri Aug 22 04:20:06 PDT 2008


hello,
iam new to mapservers and iam trying to display the selected point in  terms
of lat-long. i get errors in the code which i tried to implement
if ( isset($HTTP_POST_VARS["mapa_x"]) && isset($HTTP_POST_VARS["mapa_y"])
       ) {
      $my_point = ms_newpointObj();
      $my_point->setXY($HTTP_POST_VARS["mapa_x"],$HTTP_POST_VARS["mapa_y"]);

      $reference_click = pix2geo($mapa_x,$mapa_y,$map->extent,
            $map->width,$mapobj->height);

function pix2geo($pix_x,$pix_y,$extent,$width,$height) {

$pix_x_geo_x = ($extent->maxx - $extent->minx)
                 / ($width - 1);
$pix_x_geo_y = ($extent->maxy - $extent->miny)
                / ($height - 1);
$geo_x = $extent->minx + $pix_x_geo_x*$pix_x;
$geo_y = $extent->maxy - $pix_x_geo_y*$pix_y;
$my_point = ms_newPointObj();
$my_point->setXY($geo_x,$geo_y);
return $my_point;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20080822/9097eb26/attachment.htm>


More information about the MapServer-users mailing list