[OpenLayers-Users] DOTS_PER_INCH -> PIXEL_PER_INCH

Benoit PESTY tchule at hotmail.com
Wed Jul 18 03:48:12 EDT 2007


Hello,

Just a little note from a guy who seems to have nothing better to do (but 
should).

I was working with resolutions and scales and tilecache and I was trying to 
adjust everything to have a set of predefined levels corresponding to fixed 
scales (1 : 1M, 1 : 500 K, ...).

I seems that in fact it's better to works with resolutions instead of scales 
when using tilecache and that the base extend should correspond to 2x2 tiles 
at the max resolution.

I have a TIFF file in 3200 meters per pixel, I've had to adjust my EXTEND so 
that it correspond to 3200*512 to avoid rounding problems and missing tiles.

Now, the scale controller show a scale based on the following calculus :
3200 pixels/meter * 72 ppi * 39.3701 inch/m -->  1 : 9 M

The 72 ppi and 39.3701 inch/m values are defined in the Utils.js
72 ppi is the same value used by Mapserver by default.

I've made a some research on Internet to understand how it works and maybe 
we should add a little note on the OpenLayer site.

All this to say that if I understand well, we should rename the variable 
"DOTS_PER_INCH" of the Utils.js file into "PIXEL_PER_INCH" to be more 
correct (I know, I should have done more important things this morning ^^) .

http://www.scantips.com/no72dpi.html
http://en.wikipedia.org/wiki/Pixels_per_inch
http://en.wikipedia.org/wiki/Dots_per_inch

Tchule.

_________________________________________________________________
http://imagine-windowslive.com/hotmail/?locale=en-us&ocid=TXT_TAGHM_migration_HM_mini_2G_0507




More information about the Users mailing list