[mapserver-dev] Better resolution handling for printing

Bob Basques Bob.Basques at ci.stpaul.mn.us
Wed Feb 11 16:53:11 EST 2009


Daniel,

We've experimented quite a bit with this aspect of printing.  I've often wondered about going the type setting route, where all output measurements are explicitly related to final presented size of things (not necessarily pixels).

The crunching would occur inside of MapServer (similar to your description) but the output measurements would be in inches or some such based on a resolution setting.

The request needs to describe the end use somehow, 

RESOLUTION=STD_SCREEN(72DPI)
RESOLUTION=ASIZE_SHEET(300DPI)

All the manipulation of the scaling should occur automagically in my mind.  If really just comes down to the DPI desired, but having MapServer do the heavy lifting of scaling the symbols accordingly in an automatic way would be what I would shoot for.

bobb



>>> Daniel Morissette <dmorissette at mapgears.com> 02/11/09 2:58 PM >>>
Dev's,

When using MapServer to generate a printable map at higher resolution 
than the default screen resolution, say 300dpi instead of 72dpi, it is 
not sufficient to update the map->resolution setting since all the label 
and symbol sizes as well as line widths also need updating if you want 
to maintain the same map appearance.

This issue has been discussed a few times before and I even think some 
have worked on this at their end. We have a client who needs a fix for 
this so I'd like to open a discussion on this before we go ahead and 
prepare a RFC.

The approach I was thinking of using is to add a new map->defresolution 
(better names welcome) that would be the default resolution of a given 
mapfile, that is the reference resolution for which all sizes in labels, 
classes and styles are set.

In normal web browsing operation, map->defresolution should be set to 
the same value as map->resolution (e.g. 72dpi). When you want to print a 
300dpi map, then you'd set map->resolution=300, and MapServer would 
automagically apply a factor of map->resolution/map->defresolution to 
all size values in the mapfile before rendering. For instance, if your 
mapfile is set for a defresolution of 72dpi and you request a output 
resolution of 300dpi, all size values would be multiplied by 300/72=4.16 
and labels, lines and symbols on the resulting map would have the 
same/expected relative sizes.

I think I've read suggestions of setting resolution as an outputformat 
option before, but this may not work well with remote (e.g. WMS) 
services, we need something better integrated and with the proposed 
approach just passing a new vendor-specific resolution param in the WMS 
GetMap URL could do the trick.

Does my explanation make sense? Has anyone worked on this problem 
already? Any thoughts on this before we start working on a RFC?

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/
_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev



More information about the mapserver-dev mailing list