[Mapserver-dev] Rotated Map Rendering

Stephen Woodbridge woodbri at swoodbridge.com
Thu May 20 11:21:27 EDT 2004


Sean,

Yes, I thought your idea was great. The camera model is described in all 
the standard reference books on computer graphics.

I'm not sure where the best place for the ROTATEIMAGE tag is. I picked 
OUTPUTFORMAT because you might want it to be rotated for say output to a 
PDF file but not when you output to the browser client, etc. I'm sure 
there are good and bad points about putting it in different places.

-Steve W.

Sean Gillies wrote:

> On May 20, 2004, at 7:06 AM, Stephen Woodbridge wrote:
> 
>> OK, I hate to jump into a thread late and into one that I have only 
>> half been following, but what the hey:
>>
>> The view model that I have always worked with in the CAD/CAM and 
>> graphics world is the standard camera model i.e.: world space -> 
>> projected space -> to clipped 2d space -> viewport space or device 
>> coordinates. OK so I know we are not trying to redesign the mapserver 
>> viewing pipeline.
>>
>> So I liked the idea that someone suggested about an output frame or 
>> view port definition that would describe a final transformation of the 
>> image. I was thinking that this could be defined to cause a simple 
>> image transform as the image is output. For now only allow ROTATION in 
>> increments of +-90 degrees. and this would be handled just before the 
>> OUTPUTFORMAT processor is invoked. May be like
>>
>> OUTPUTFORMAT
>>   ROTATEOUTPUT 90
>>   ...
>> END
>>
>> ALSO, If this is set then image.x and image.y are transformed on input 
>> so they align correctly with the internal image. If other parameters 
>> need to be adjusted to them at the same time. This keeps mapserver 
>> pretty much insulated from any of these changes.
>>
>> By limiting the transforms to +-90 degrees increments the transform 
>> becomes one of just swapping x/y values and/or min/max values which 
>> should be fast and the same for pixel outputs.
>>
>> So I probably have missed the whole point of this discussion and this 
>> is just extraneous noise so feel free to ignore it if it doesn't apply.
>>
>> -Steve W.
>>
> 
> Steve W., thanks for mentioning the camera model, that's what I was 
> trying to
> describe in my previous email.  Conceptual and programmatic separation
> between the map and the view model would be a good thing.  For example, in
> the real world when you take a map and rotate it -- it is the exact same
> map, still pointing north (in most common cases) -- only the the view of
> it has changed.  If we add rotation to the mapObj itself, we add complexity
> and make it less like a real-world object.  This could make it harder for
> users to understand.
> 
> I think that the WEB element is a more natural spot for the rotation stuff
> than the OUTPUTFORMAT.  We are already keeping view model-ish and
> application-specific parameters like MAXSCALE there.
> 
> Sean
> 
> -- 
> Sean Gillies
> sgillies at frii dot com
> http://users.frii.com/sgillies
> 
> 




More information about the mapserver-dev mailing list