[mapserver-users] Scale calculation

Claude Philipona claude.philipona at skirando.ch
Wed Jul 11 04:51:58 EDT 2001


I don't quite understand how scale are calculated. I know that mapserver uses 72
pixel per inch to calculate the scale.

I've a tif raster map where 1 pixel = 2.5 meter. Here is the tfw file:
2.500
0.
0.
-2.500
558751.250
121998.750

I want to calculate the right scale to render 1 pixel in the original tif file
will give 1 pixel in the mpaserver map (no resizing)

-> size of 1 pixel on screen = 1/72 inch =  2.54/72 cm = 0.0352777777 cm (based
on constant used by mapserver, I don't care about the real size on the screen)

-> size of 1 pixel on tif raster map = 2.5 m = 250 cm

-> scale calculation to render one pixel from the raster map to one pixel to
mapservermap:
0.035277777 : 250 -> 1:7086.6

If I used this setting MINSACLE 7086 in .map file, I don't get the one to one
pixel ratio and the original map is resized by mapserver.

I've tried to empiracally set the scale and I found a scale of about 5300, which
would mean that the constant used by Mapserver is about 53.85 pixel per inch.

Even the behaviour of this scale factor is strange, the scalebar is perfectly
rendered (size of the scalebar corresponds to the size of the features on the
map)

What is wrong? Do you have any idea?

Claude Philipona




More information about the mapserver-users mailing list