We are encountering pixelation of WmsRasterLayer at ZoomLevel19 (Scale 563) and ZoomLevel20 (Scale 282). This only occurs when caching is enabled. If caching is disabled the imagery is rendered properly. Below are screen captures of a pixelated and non-pixelated example.
The client application does not use the standard default ZoomLevelSet values. Attached is a text file which has the ZoomLevelSet that is used (Detail) and the default (Standard).
You may recall that our environment is such that all the clients make WmsRasterLayer requests via a local central server (running ThinkGeo.MapSuite.WmsServer). The local server, in turn, passes said requests to a third-party WMS Provider (nearmap). The versions of WmsServer DLL’s being used are:
Below is a screen capture of the WmsServer Cached Directory Structure. Notice that the directory naming does not exactly match the scales being used. Instead of 1128, 2256, and 4513 we have ZoomLevelSet values of
ZoomLevel18 - 1126
ZoomLevel17 - 1900
ZoomLevel16 - 4505
Also notice there are no directories for ZoomLevel19 (563) and ZoomLevel20 (282) even though the map was zoomed to those levels.
Below is code from WmsServer showing FileBitmapTileCache properties.
It seems to me that WmsServer Caching is not handling non-standard ZoomLevelSet.
Would you please provide more clarification on following
Your client application (WmsRasterLayer) using V12 or V10?
You mentioned when caching is enabled, the imagery getting pixelated, do you mean enable caching on WmsRasterLayer(client side) or on WmsServer (server side)? I am a little confuse here because you are attaching WmsServer caching code in the post as well.
Does the screen captures of a pixelated and non-pixelated example image taken from client side or WmsServer?
You mentioned “It seems to me that WmsServer Caching is not handling non-standard ZoomLevelSet”. I am uncertain about this, if the WmsRasterLayer(client side) renders image properly when RasterLayer cache (client side cache) disabled, which means WmsServer is handing the image properly even in non-standard zoomlevel set.
Regarding no directories for ZoomLevel19 (563) and ZoomLevel20 (282) on WmsServer Cache directory – my assumption is that the data provider does not provide imagery above scale 1126 (zoom 18), and WmsServer is stretching image for client request scale 563 (zoom 19) and scale 282 (zoom 20).
I think the root cause of the issue was due to ZoomLevel19 (Scale 563) and ZoomLevel20 (Scale 282) cache image not been generated. When WmsServer cache turned on, there is a bug that cache files only been generated up to scale 1126 (zoom18 in your case). WmsServer response Zoom 19 (Scale 563) and Zoom 20(Scale 282) requests by fetching cached image from zoom 18 file cache, instead of fetching from raster data provider.
To fix the issue we will need a new property on the mapConfiguration object, to pass-in custom ZoomLevelSet for caching, that we can properly cache customized zoomLevelSet images.
The code change been pushed, and will be available in NuGet later today (afternoon), please check out package: ThinkGeo.MapSuite.WmsServer V11.0.0-beta007 and above.
Here’s a code snippet of change needed on WmsServer side (TheMapConfiguration.ZoomLevelSet)
TheMapConfiguration.TileCache = TheFileBitmapTileCache;
// Create a ZoomLevelSet object matching with your application
ZoomLevelSet zoomLevelSet = new ZoomLevelSet();
zoomLevelSet.CustomZoomLevels.Clear();
double scale = 147647947;
// Add 20 zoomLevels, and first zoomlevel scale is 147647947
for (int i = 0; i < 20; i++)
{
zoomLevelSet.CustomZoomLevels.Add(new ZoomLevel(scale / Math.Pow(2, i)));
}
TheMapConfiguration.ZoomLevelSet = zoomLevelSet;
Please give a try and let us know how it works.
Thanks,
Jack
Hi Dennis,
Can you send your WmsLayerPlugin code to support@thinkgeo.com, would like to go over the code to find out why the server doesn’t response zoom 19 and 20 properly.
Thanks,
Jack
Thanks for the hint by asking for the code as I wanted to first review before passing it on to you. After doing a review it appears that I have overlooked how I’m setting up MapConfiguration. I need to look this over and I will get back to you.