Skip to main content

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

We are all a bit lost with version branches; we have locationtech_rename building and it should return home shortly.

I find the WMS and DPI relationship to be difficult, we already did an calculation adjustment to fix relative font sizes due to difference between the two specs. We want DPI to mimic the screen (so that we get the correct line width and an support units of measure correctly); at the same time we want the font sizes calculated in "points" (which requires a guess at 72 DPI for java font metrics calculations).

So when you say "not correctly styled" can you be a bit more specific?

I would also like if you can try images in GeoServer by passing in a DPI setting; just so you can be sure what you are working with and compare how both systems handle the problem..

-- 
Jody Garnett

On 6 November 2013 at 1:45:54 am, Panagiotis Skintzos (p@xxxxxxxxxxxxx) wrote:

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
_______________________________________________
udig-dev mailing list
udig-dev@xxxxxxxxxxxxxxxx
https://locationtech.org/mailman/listinfo/udig-dev

Back to the top