[Mapserver-dev] Rotated Map Rendering

Steve Lime steve.lime at dnr.state.mn.us
Wed May 19 14:53:09 EDT 2004

```You're right, I was thinking EXTENT and ROTATEDEXTENT. With your
explanation its
clear that just ROTATION makes no sense.

Clearer now. Why the switch from min/max to the alternative method? I
think that will
only lead to confusion. You could just use the normal extent and throw
rotation in using
a single parameter, e.g.

EXTENT ... as normal ...
ROTATION 45

Or even use ANGLE, then we don't have to add any keywords. Even if we
go with
ROTATEDEXTENT I'd prefer expressing the extent portion as minx, miny,
maxx,
maxy for consistancy.

Steve

>>> Frank Warmerdam <warmerdam at pobox.com> 5/19/2004 12:37:19 PM >>>
Steve Lime wrote:
> Hi Frank:
>
> I don't think ROTATEDEXTENT makes sense either. It's the extent
part
> that worries me. People are used to extents being 4 double min/max
> values and  thats not this at all. ROTATION says to me that entire
view
> is rotated n degrees, but I'm open to other ideas. I was wondering
also
> if all of the elements for the new parameter are necessary all the
time.
> Seems to me that most folks would rotate around the center of the
image.
> Also, how is with height/width here tied to the main SIZE? Wouldn't
they
> be the same most often or at least one computed from the other (i.e.
so
> the entire extent of the unrotated map fits in the rotated map,
rotated
> map would be generally larger). Folks, at least via the CGI, can
easily
> change the output map size.

Steve,

The suggested keyword is:

ROTATEDEXTENT <center_x> <center_y> <width> <height>
<rotation_angle>

Note that the width and height are in georeferenced coordinates,
meters
or decimal degrees as appropriate.

The value:

ROTATEDEXTENT 10000 50000 500 500 0

Would mean a 500m x 500m extent centered at 10000,50000 with a
rotation
of zero degrees.

So, the formulation provides exactly the number of parameters needed
to
define an extent and rotation angle.  Of course, the formulation of
the
extent is different than the EXTENT keyword because we can't
meaningful
define a rotated extent using the normal xmin/ymin/xmax/ymax format.

If the cellsize is to be square then the aspect ratio of width and
height
in the ROTATEDEXTENT need to match the aspect ratio of the SIZE
parameter
(final rendered image size).  This is similar to how we have do doctor
the requested EXTENT value to enforce a square cellsize now.

Now to specific questions...

Steve Lime wrote:
> Hi Frank:
>
> I don't think ROTATEDEXTENT makes sense either. It's the extent
part
> that worries me. People are used to extents being 4 double min/max
> values and  thats not this at all.

This is another way of defining an extent.  As noted above, the normal
min/max mechanism is not well defined in a rotated context but we
used the ROTATEDEXTENT in place of the regular extent and it is define
an extent rectangle that is rotated.

> ROTATION says to me that entire view
> is rotated n degrees, but I'm open to other ideas.

That would be fine if the only argument was the angle.

> I was wondering also
> if all of the elements for the new parameter are necessary all the
time.
> Seems to me that most folks would rotate around the center of the
image.

This is implicit in my defining the rotatedextent in terms of a center
and rotation.

> Also, how is with height/width here tied to the main SIZE? Wouldn't
they
> be the same most often or at least one computed from the other (i.e.
so
> the entire extent of the unrotated map fits in the rotated map,
rotated
> map would be generally larger). Folks, at least via the CGI, can
easily
> change the output map size.

I am starting to think that you expected maps to have both keywords.
My
intention is that a map could use *either* EXTENT or ROTATEDEXTENT but
not
both.

PS. Implementation is now underway.  Hopefully we won't change anything
too
fundamental about the approach. Of course, we can restructure the
keywords
in the mapfile as you feel necessary as long as the basic data is
communicated one way or another.

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

```