[Benchmarking] Scale and pixel resolution formulas

Andrea Aime aaime at opengeo.org
Thu Aug 12 07:02:27 EDT 2010


Hi,
scale computation this year is going to make a difference
in tests so I'd like to make sure we're all on the same page,
otherwise servers will do a different amount of work.

The SLD spec suggests the following formulas for scale
denominator computation:

sd_non_geographic = (bbox_width / image_width) * (DPI / 0.0254)
sd_geographic = (bbox_width / OGC_DEG_TO_METER) * (DPI / 0.0.254)
DPI = 25.4 / 0.28  --> 90.714
OGC_DEG_TO_METER = 6378137.0 * 2.0 * PI / 360

The above are actually the formulas used by GeoServer.
As far as I know OpenLayers and MapServer use the same, but with
DPI=75.
To get the servers make the same work we all need to have a similar
scale computation setup. Are we? :-)


Also, Frank W. tool likes to work using pixel resolutions instead
of scale denominators, so I used the above formulas, along
with (resolution = image_width / bbox_width)
to get to a formula that converts the scales we agreed upon
to pixel resolutions:

res_non_geographic = scale_den * 0.28 / 1000
res_geographic = scale_den * 0.28 / (1000  * OGC_DEG_TO_METER)

Would be nice if someone could double check the above

Cheers
Andrea

-- 
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.



More information about the Benchmarking mailing list