Hello,
Making some random GetMap requests to WMS GeoServer with Apache JMeter, I have found a problem regarding the scale of display of the different layers: in SLD archives I have defined the corresponding MaxScaleDenominator and MinScaleDenominator for each layer. E.g: In the SLD of a certain featuretype, I decided that the MaxScaleDenominator is 2001, then I tested that at the denominator scale 2000 that layer is not shown –but should be- and it is shown a layer whose MinScaleDenominator is 2001 –that should not be shown. Is the parameter “Max/MinScaleDenominator” approximated or precise? Has anybody checked the precision of this parameter?
Thank you very much,
José Miguel Rubio
José Miguel Rubio Iglesias
Subdirección General de Aplicaciones Geográficas
Instituto Geográfico Nacional
C/General Ibáñez de Ibero, 3 28003 MADRID
Despacho: A 0002 Teléfono: 91 597 97 51
E-mail: jmrubio@anonymised.com
Rubio Iglesias José Miguel wrote:
Making some random GetMap requests to WMS GeoServer with Apache JMeter, I have found a problem regarding the scale of display of the different layers: in SLD archives I have defined the corresponding MaxScaleDenominator and MinScaleDenominator for each layer. E.g: In the SLD of a certain featuretype, I decided that the MaxScaleDenominator is 2001, then I tested that at the denominator scale 2000 that layer is not shown –but should be- and it is shown a layer whose MinScaleDenominator is 2001 –that should not be shown. Is the parameter “Max/MinScaleDenominator” approximated or precise? Has anybody checked the precision of this parameter?
First off, the very concept of scale in web gis cannot be precise.
The reason is simple, dpi varies depending on the client and the
hardware it has at his disposal, so the real size of n pixels on
the screen varies between clients (and thus the real scale).
The SLD 1.0 standard specifically defines the rules for computing a
scale in the specification, and at least for the geographic case,
the formula has nothing to do with a real scale computation, it's
a simplified method instead. See:
http://www.opengeospatial.org/standards/sld
download the 1.0 specification (not the 1.1) and go to page 28
and you'll see the official formulas.
Just to make you a few examples of what can go wrong:
- geoserver computes the scale by the WMS spec recommendation,
by the letter
- openlayers uses the same formulas as the sld spec recommendation,
but uses a different dpi setting, resulting in a different
scale being computed. Even correcting it (the GeoServer map preview
does), I noticed differences, which _may_ be accounted to numerical
errors, thought I never had time to investigate this further
- uDig tries to do a real world scale computation, that never gets
back the same result as GeoServer or OpenLayers
Hope this helps
Cheers
Andrea