[GIS] Generate MaxScaleDenominator in geoserver

geoservergeowebcachewms

My geoserver is providing few overlayers with specific informations such as poi's or fire-hydrants. I'm using scale dependent styling, so it's not rendering this features above specified scale, but it still tries to render it and returns empty tiles. I've found WMS 1.3.0 includes MaxScaleDenominator and MinScaleDenominator tags, which can be provided in the getCapabilities result to show the optimum visualization ranges for each layer. I want to use it to learn my application not to ask about tiles above specified scale (cause they're empty there) so it will improve performance and reduce bandwidth usage.

I searched all geoserver properties (general, layer, caching) and I was not able to find any place to set this feature up, so I don't think there is some place in web-gui (or there is??), but maybe there is some resolution to write it somewhere in configuration files?

This is some link to my geoserver, e.g. layer is osm:Hydranty_active

After some investigation I've found that in layer osm:Hydranty_active served by WMS this information is included, but the same layer served via gwc don't have it, so trouble will be with GWC not Geoserver

Best Answer

The scale limits which are used in SLD should be converted automatically into MinScaleDenominator/MaxScaleDenominator with WMS 1.3.0 and into ScaleHint in WMS 1.1.1. You can read examples from this demo server:

http://demo.opengeo.org/geoserver/wms?service=WMS&request=GetCapabilities&version=1.3.0

http://demo.opengeo.org/geoserver/wms?service=WMS&request=GetCapabilities&version=1.1.1

Scale range hints are per layer and they are included into the document if there is some scale range that does not display a layer with any style that is attached to the layer. If you have a special rule for fire hydrants on a general poi layer (draw capitals at all scales but use MaxScaleDenominator=20000 for fire hydrants) it is not possible to read the fire hydrant's scale range from GetCapabilities. However, it is possible to get that information by downloading the whole SLD with the GetStyles request

http://demo.opengeo.org/geoserver/wms?service=WMS&request=GetStyles&version=1.1.1&layers=osm:water_lines_low_zoom

Some background about GeoServer and scale hints is in http://jira.codehaus.org/browse/GEOS-5830.

Related Question