MapSuite Team,
Recently I implemented tile caching in my WMS Server. During development extensive testing was done with no issues found. Today the WMS Server was deployed to our live production environment and incorrect imagery began to appear on several of our client workstations forcing us to backout caching after several hours of operation.
You may want to note that in nearly three hours of live operations the system had accumulated 71,889 total cached tiles comprising 16GB. A fairly busy system.
In some cases sections of any given map extent would appear black. In some cases the imagery that appeared was at the wrong ZoomLevel even though the SQL Lite and Shape File Feature Layers were correct. Without caching these issues never existed.
I’ve discovered a few interesting things.
First, there are cached tiles that are only 384 bytes in size. They have what appears to only be a header. These might correspond to the imagery on the map that appear black. An example of this tile is attached.
Second, there are cached tiles that appear to have partial data. The normal tiles show a 256x256 pixel area, but these tiles are 256 high with width less than 256. These tile examples are attached. These tiles are also zoomed way out when they should not be. These tiles may also account for black imagery within a map extent.
Third, there are tiles that are of the wrong zoom level. They are zoomed way out. For this example two tiles, of the same identifying file name, are attached. One is zoomed out and one is correct.
Below is a list of the tile example files. All times are EST.
Also shown below are the example tiles in one screen capture. Each individual tile is also attached.
My code to setup caching:
string TheCachedTileDirectory;
TimeSpan TheTimeSpan;
FileBitmapTileCache TheTileCache;
TheTimeSpan = new TimeSpan(6, 0, 0);
TheTileCache = new FileBitmapTileCache();
TheCachedTileDirectory = string.Format("{0}\\{1}", "C:\\MapCachedTilesWms", "TheWmsServerCache");
TheTileCache.CacheDirectory = TheCachedTileDirectory;
TheTileCache.CacheId = "MyLayerName";
TheTileCache.ExpirationTime = TheTimeSpan;
TheTileCache.TileAccessMode = TileAccessMode.ReadAddDelete;
oWmsLayerActive.MapConfiguration.TileCache = TheTileCache;
I am running WmsServerEdition V9.0.0.1103.
Also please note that the tiles being cached emanate from an external WMS Server (nearmap).
Your thoughts?
Regards,
Dennis
The following cached tiles are under the directory …\2256.99444\6507784
07/11/2018 09:45 PM 262,144 6477528-ThisTileIsCorrect.png
07/11/2018 11:12 AM 262,144 6477528-ThisTileIsNotCorrect.png
07/11/2018 11:12 AM 262,144 6477557-ThisTilePartialSize.png
07/11/2018 11:12 AM 131,072 6477558-ThisTilePartialSize.png
07/11/2018 11:12 AM 53,843 6477559-ThisTilePartialSize.png
07/11/2018 11:12 AM 384 6477560-ThisTileIsEmpty.png
These two tiles have the same file name (6477528.png) but one is at the proper ZoomLevel while the other is zoomed way out. The correct one is from the development server while the one zoomed out is a cached tile on the production server.
This tile here appears white, but appears black in the first image above as well as on the map extent below.
These tiles are example of height 256 pixels, but smaller than 256 width.
This is an example of black areas within the extent and the imagery zoomed way out while the feature layers are at the proper ZoomLevel.
Here’s an example of a map extent that has the correct imagery, blacked-out area and imagery that is zoomed out when it should not be zoomed out.
Here’s another interesting map extent. Notice how on the left, bottom, and right the imagery is correct. The remaining area is not only zoomed too far out it is repeating the imagery in that area. Notice that the buildings are repeating.
Below is how the above area should look.