[Mapserver-dev] Rotated Map Rendering

Daniel Morissette dmorissette at dmsolutions.ca
Thu May 20 11:38:48 EDT 2004


Frank Warmerdam wrote:
> 
> What would the meaning of the extent be in the rotated case? I can imagine
> a few alternatives:
> 
>  1) The map view would computed as if it was the provided extent, but then
>     rotated around the center point by the desired amount.  Thus the user
>     provided extent would no be completely contained within the view, 
> nor would
>     it it be completely containing the view but it would be the same ground
>     size as the final view.
> 

I think I would go with #1: this way scale (and hence cellsize) is 
maintained and this seems like an important factor to me.

Another thing that needs to be specified (documented) is that the 
adjustment of the extents to fit the width/height aspect ratio of the 
image would be done *before* the rotation is applied. i.e. the extents 
value after the map draw would be the extents before rotation.

I may be missing something (this is all so confusing), but it seems to 
me that this would be simpler for applications than having to deal with 
a new definition of extents.

I think we should also provide a set of convenience functions in 
mapscript to convert between the pixel coordinate space and the 
geographic space. Those would be methods of the mapObj:

   pointObj pix2georef(pointObj in)
   pointObj georef2pix(pointObj in)


With those functions, applications shouldn't have to worry about special 
extent/rotation calculations.  These functions would also be handy to 
convert between pixel and georef even if you don't use rotation (we used 
to have some of those written in PHP in our apps).


About the location of the ROTATION parameter, it would seem to make 
sense to have it at the top-level in the map object together with the 
extents, but if others feel that it should be in the web object together 
with the min/max scale then I have no objection.

Daniel
-- 
------------------------------------------------------------
  Daniel Morissette               dmorissette at dmsolutions.ca
  DM Solutions Group              http://www.dmsolutions.ca/
------------------------------------------------------------




More information about the mapserver-dev mailing list