[mapserver-users] Min/max pixelsize vs. min/max scaledenom

Rahkonen Jukka jukka.rahkonen at mmmtike.fi
Tue Aug 27 03:49:52 PDT 2013


Hi,

Frank Broniewski wrote the following question to the Mapnik users list a few hours ago and I started to think that I would like to have such min/max pixelsize setting in Mapserver.  I can simply get the native pixel size of our maps with gdalinfo or something and I can estimate that when I am showing a topographic map with 1 m native pixel size on the screen the texts are readable and map looks good approximately at resolutions between 0.75 - 1.5 m/pixel. Now it would be nice to write into mapfile the scale range as
MINPIXELSIZE "0.75"
MAXPIXELSIZE "1.5"

I know that scale in Mapserver is based on a resolution on 72 dots per inch and that inch is 0.0254 meters and I can calculate that the native resolution of the map expressed as "one image pixel drawn as one dot on the 72 DPI screen" means scale of 1:2836.65 and that I can write my good resolution range in a mapfile as
MINSCALEDENOM "2126"
MAXSCALEDENOM "4252".

However, as Frank Broniewski writes, OpenLayers and tile cache programs like MapCaceh, MapProxy and GeoWebcache are configured by using "units per pixel".  Why not to let Mapserver users use the same system in mapfile as an alternative for minscaledenom/maxscaledemon?

And this is what Frank wrote

" Hi all,

is it possible to use a resolution parameter (meter / pixel, that what map.scale() outputs) instead of Min/Maxscaledenominator? That would be really helpful in order to arrange map styles between different software.

Let's say I'm creating a map with a number of zoom levels and on each zoom level I'm changing the map, doing generalization or displaying more detail. The map is planned to be used in a web context with the Javascript OpenLayers Map library. Inbetween there is a proxy software like Mapproxy. Both OpenLayers and Mapproxy understand the principle of resolutions, ie natural distances per pixel. So I can define my map in OpenLayers with a list of resolutions like [500, 200, 100, etc.]. I can continue to use this list in Mapproxy so that each resolution matches a certain map layout. Unfortunately this breaks now because Mapnik uses scales in correlation with the dpi setting."

-Jukka Rahkonen-


More information about the mapserver-users mailing list