[mapserver-users] setRotation problem

Frank Warmerdam warmerdam at pobox.com
Mon Jun 6 13:28:49 EDT 2011


On 11-06-03 10:07 AM, wyan at ciimar.up.pt wrote:
> HI,
>
> I wanna use the mapserver's rotation fuction with php script,
> but when i used this function the map view rectangle rotated strangely,
> I cannot find the rotation regular rules,
> enclosed with my simplised php code,
> attachments are pics of the results.
> appriciate it if you can tell me what's the problems.
>
> regards
> william
>
>
> codes are following
>
>
> <?php
> dl('php_mapscript.dll');
>
> $map=ms_newMapObj("C:/OSGeo4W/apache/htdocs/xxxx.map");
>
> //$roate=$map->setRotation(90);
> $roate=$map->setRotation(0.00000001);
>
> //************** here you see, even with a small angle, the map could not
> rotated as expection
> //echo $roate;
>
> $image=$map->draw();
> $image_url=$image->saveWebImage();

Wyan,

Map rotation forces use of the resampling api which requires proper
coordinate system information attached to everything (layers and map).
Is it possible this is not the case?

If you can boil this down to a sufficiently simple case to demonstrate the
problem, and provide it to me perhaps I can look into the issue.

Note that you can also set rotation in a mapfile.  You might want to see
if setting the ANGLE keyword in your mapfile seems to work properly.  There
is a test case for map rotation in the autotest suite which still seems to
work fine at:

   http://svn.osgeo.org/mapserver/trunk/msautotest/gdal/rot_out.map

It is possible there is an issue with the PHP binding for setRotation()
(which I am sure is very rarely used) or perhaps the issue is something
about your map configuration.

Best regards,
-- 
---------------------------------------+--------------------------------------
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent



More information about the mapserver-users mailing list