mapsize
Stephen Lime
steve.lime at dnr.state.mn.us
Mon Mar 20 08:24:29 PST 2000
Hmmm. I wrote a nice detailed response to this on Friday. Looks like it never made
it to the list. Probably a DNR problem. Anyway, here's the skinny...
First of all I understand the problem. That said everyone must understand that the
MapServer was written (initially) to support interactive mapping. That is, interfaces
where the user would pan/zoom repeatedly. In that scenario image size needs to
be constant. You could change it (i.e. via mapsize=) but once set it was fixed and
the extent was massaged to fit the image size perfectly. When acting as an image
engine for other apps I can certainly see the value of supporting 1. as defined by
Frank below. Trouble is how to do that. An extent is not enough. In addition to the
extent you need either:
- one image dimension, the other can be calculated
- an image resolution, cellsize for which both image dimensions can calculated
Me thinks both should/can be supported. For case one I propose adding a new
mapfile parameter, something like FIT which would have to possible values- IMAGE
and EXTENT with the default being EXTENT. You'd still define a SIZE but only one
dimension would be used depending on how things are oriented. This is just like extents
are handled now. For case two i'd propose adding a new CGI parameter (cellsize) that
would be used with mapext in generating image size.
I can make these changes in 3.3.010 if it's seems ok to folks. These changes would
have no impact on existing apps.
There of course other alternatives:
- you can use mapscript to generate image sizes based on extent yourself
- the client application can do it
It should be noted that the assumtion that 'the result should exactly fit in the bbox' will almost
never be true even with the modifications discussed. The is because image sizes are integral
and computations often result in fractional (i.e. 525.345) results. However, with the changes
suggested about errors will be less than half a pixel which is as good as one could expect unless
you do work in the client application to ensure a perfect fit.
Steve
Stephen Lime
Internet Applications Analyst
Minnesota DNR
500 Lafayette Road
St. Paul, MN 55155
651-297-2937
>>> Frank Lochter <marco at gfz-potsdam.de> 03/17/00 09:14AM >>>
Hi Steve,
I have a small problem and would like to discuss this here.
1. When I specify a bbox (lat, lon), then the result map should fit exactly within this BBox.
2. When I specify a width and height, the result bitmap should have this width and height.
3. What is when I specify bbox and width and height? Then something is over defined!
- I assume, the result should exactly fit in the bbox AND the bitmap should fit exactly in one
dimension width or height and the other dimension of the bitmap should be calculated on
the fly!
- I get something unexpected when the map server extracts the bbox, especially when I
like to integrate the bitmap into an other application and assume, that the bitmap has
the bbox, that I used to generate it.
Is there any way to get what I assume in 3. !
Sincerely
Frank Lochter
Stephen Lime wrote:
> Yup, the extent is recaclulated based on the shape of the extent and the window
> size/shape. You are gauranteed to see the whole extent plus a bit more. The
> algorithm fits your requested extent in either x or y dimension (whichever fits
> best) and then pads the other dimension as needed. This has to be done in
> order to get the right map to image transformation. You wouldn't necessarily
> have to actually display data outside the actual requested extent but that would
> result in a great deal of blank space in the resulting image, so the computed extent
> is used to select/clip data.
>
> Steve
>
> Stephen Lime
> Internet Applications Analyst
>
> Minnesota DNR
> 500 Lafayette Road
> St. Paul, MN 55155
> 651-297-2937
>
> >>> Ralf Puchert <puchert at gfz-potsdam.de> 03/16/00 10:33AM >>>
> Hello,
>
> When we use
>
> http://130.11.52.178/cgi-bin/mapserv?mode=map&layer=elevation&mapext=
> -180+-10+180+90&map=/var/mapserver/global/global.map&mapsize=500+250
>
> the outputmap has the wrong southernmost latitude.
> It seems to be that something is overdefined.
> Will the produced map whithin geographic coordinates expanded
> to the width and height values of the bitmap or
> will the geographic bounding box be recalculated ?
>
> Sincerely
>
> Ralf Puchert
--
Dr. Frank Lochter
Data Centre
GFZ Potsdam
Telegrafenberg A3
14473 Potsdam
fon. +49-331-288-1701
fax. +49-331-288-1703
url http://www.gfz-potsdam.de/~marco
More information about the MapServer-users
mailing list