Finding Latitude and Longitude of the 4 corners of a map using mapscript.

James Sohr jms4 at PO.CWRU.EDU
Tue Apr 26 16:57:29 EDT 2005


Yes, you can calculate the lat long of your current extent by using the
RectObj's project method. For instance:


   $latlong_rect = $map->extent;
   $latlong_rect->project( ms_newprojectionobj($map->getProjection),
ms_newprojectionobj("proj=latlong"));



Assuming $map is your map object, the latitudes and longitudes of the four
corners of your map are now stored in $latlong_rect->minx, $latlong_rect-
>miny, $latlong_rec->maxx, and $latlong_rect->maxy .



More information about the mapserver-users mailing list