Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-dev] WMS rendering and dpi

Hi list,

Currently there is a problem with the WMS rendering: The server-side scale rules in SLDs are not applied properly. 
This is because the scale calculation in uDig differs from the scale calculation in WMS server.
The difference is the DPI setting.  In uDig it is usually 96 (depending on desktop settings).
But in WMS servers the default is rather 90 or 72 or something different.
The result is that the image coming from the server to uDig is not correctly styled.

Let's say that you view a wms layer in scale 1:20000 in uDig. 
And in the SLD on the server (Geoserver) you have a rule with maximum scale denominator 19999 for some labels. So, normally you should not see the labels in the result image. 
But the labels do appear. Because the scale denominator in the server is calculated with its default dpi value of 90. And results in something lower thean 20000

To the rescue comes the GetMapRequest.setVendorSpecificParameter(String name, String value)

So, to resolve this I modified the WMS renderer (BasicWMSRenderer2) to supply vendor specific parameters to send the correct dpi on the server  (out of the wms spec). See my comment in related JIRA bug:
http://jira.codehaus.org/browse/UDIG-1734

Furthermore I needed to supply some other vendor specific parameters for each layer separately, namely "maxfeatures".
I modified the  WMS renderer and the WMS metrics (BasicWMSMetrics2) to query these parameters from the layer's IGeoResource persistent properties.
I set some persistent properties per layer when I create the IService (like  IGeoResource.getPersistentProperties().put("wms:maxfeatures", 1000).

The result works fine and all server styles are rendered properly in any uDig dpi/scale.

If you think that's a good solution I can make a patch.
I'm just kind of lost atm with the versions/branches.

Regards,
Panagiotis

Back to the top