GeoWebCache/geowebcache — Issue #88: Can't use two GridSets for the same CRS on a single layer
Author: groldan
Created: 2011-12-12 19:04:07+00:00
State: open

If two different GridSubsets are configured for a layer, for two different GridSets but where the GridSets use the same coordinate reference system, only one of them will be actually used by the TileLayer.

The reason is that the WMSService figures out which GridSubset is being used by calling TileLayer.getGridSubsetForSRS(srs), which in turn returns the first of its GridSubsets for the given CRS.

So if you configure a TileLayer for both EPSG:4326 and GlobalCRS84Scale, for example, only tiles for one of them will be generated, as both tile matrix sets use the same crs, despite using different resolutions.

A better approach would be to figure out the gridset based on not only on the requested CRS but also on the requested image dimension and bounds, in order to get the one with the closest match to a tile.