[mapserver-users] extents of the map, query in php mapscript

Stephen Woodbridge woodbri at swoodbridge.com
Tue Apr 9 15:22:38 EDT 2002


Pushkar,

It is very important that you match the aspect ratio of your map extents
to the aspect ratio of the image. For example on my map at
http://swoodbridge.com/web2/nmap which has the whole world displayed
which everyone knows is EXTENT -180 -90 180 90 and my image is 600X600
so what to we have:

360         600
---  is to  ---  or 2 to 1 this is BAD
180         600

the aspect ratio need to match! so I changed my map to
EXTENT -180 -180 180 180 so

360         600
---  is to  --- or 1 to 1 this is GOOD
360         600

This also has implications if you want to allow your user to change the
size of the image and they don't maintain the aspect ratio match.

There is code in the RectObj in phpmapscript to help manage this. Or you
can write your own rescaling code like I did before I found the the
$oRect->fit($width, $hieght) method.

-Steve

Pushkar Pradhan wrote:
> 
> Hi all,
> I am trying to query my maps using php/mapscript. I am using the function
> GMapPix2Geo to convert the mouse coords. clicked to georef. coords.
> However the conv. coordinates of the locn. clicked is different from those
> shown in arcview.
> How do I choose the extent of the map, I searched the archives but didn't
> find any. Right now I go to arcview and put my mouse on the farthest
> positions of the shapefile, and write down the values arcview displays on
> the top right.
> Thanks,
> 
> -Pushkar S. Pradhan



More information about the mapserver-users mailing list