[Benchmarking] Scale and pixel resolution formulas
Dane Springmeyer
dane at dbsgeo.com
Thu Aug 12 11:04:22 EDT 2010
Andrea,
Thanks for these details. As far as I know Mapnik sticks fully to SLD for the scale calculations, using the OGC assumed PIXEL size that you describe below.
http://trac.mapnik.org/browser/trunk/src/scale_denominator.cpp#L32
Dane
On Aug 12, 2010, at 4:02 AM, Andrea Aime wrote:
> 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.
>
> _______________________________________________
> Benchmarking mailing list
> Benchmarking at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/benchmarking
More information about the Benchmarking
mailing list