ThinkGeo.com    |     Documentation    |     Premium Support

WMS White tiles in cache since Core.13.2.0.beta049

I use an WMS aerial photo as background and cache the tiles.
Since Core 13.2.0.beta049 tiles are not loaded anymore and are stored as white tiles in the cache.
Cached tiles are ok, but new tiles are all white (zooming in on parts of the country I’ve not looked at before).

Is this a bug or are there breaking changes I need to update in my code ?

Kind regards,
Guido van den Boom

hi @G_Vandenboom,

We recently did a round of refactoring and enhancements to our WMS, I suspect your issue was caused by this. Could you please share a code snippet or a sample to help us pinpoint the problem? Your assistance would be appreciated.

Thanks,
Leo

Hi @Leo_Liu,

Below is part of a function in which the aerial photo is set as a wmsrasterlayer.
I enclosed also the sub which turns on the cache.
I hope this code helps you to solve this.

Regars,
Guido van den Boom

Dim PDOK As New WmsRasterLayer
With PDOK
	.Uri = New Uri("https://service.pdok.nl/hwh/luchtfotorgb/wms/v1_0?&request=GetCapabilities&service=wms?")
	.Crs = "EPSG:3857"
	.ActiveLayerNames.Add("PDOK_2023")
	.Name = "2023_orthoHR"
End With

MapBackgroundPDOKOverlay.Layers.Add(PDOK)

MapBackgroundPDOKOverlay.CacheOn

Public Sub CacheOn(ByVal OverlayToChache As Overlay)
If TypeOf (OverlayToChache) Is WmsOverlay OrElse TypeOf (OverlayToChache) Is LayerOverlay OrElse TypeOf (OverlayToChache) Is WmtsTiledOverlay Then

        Dim OverlayObject As Object = OverlayToChache
        Try
            If IsNothing(OverlayObject.Name) Then OverlayObject.Name = Guid.NewGuid.ToString
            OverlayObject.TileCache = New FileRasterTileCache(CacheDirectory, OverlayObject.Name, RasterTileFormat.Png)
        Catch ex As Exception

        End Try
    End If
End Sub

Hi @G_Vandenboom,

Thanks for your code snippet. I reproduced the issue you mentioned and it turns out that it was caused by recent changes on our end.

I’ve fixed it and the new package(ThinkGeo.Core 13.2.0-beta054) should be available in a few hours. Please feel free to give it a try.

Thanks,
Leo

Hi @Leo_Liu,

The aerial photo is working fine now, but some other WMS layers still fail, for example this one.

                     .ServerUri = "https://service.pdok.nl/rws/digitaaltopografischbestand/wms/v1_0?request=GetCapabilities?SERVICE=WMS",
                     .layers = "vlakken",
                     .styles = "dtb_vlakken",
                     .Exceptions = "INIMAGE",
                     .transparent = True,
                     .Projection = "EPSG:3857",
                     .Tilecache = True}) 

Kind regards,
Guido van den Boom

hi @G_Vandenboom ,

There seems to be something wrong with https://service.pdok.nl/rws/digitaaltopografischbestand/wms/v1_0, it doesn’t show up on QGIS also.

I tried the URL: https://service.pdok.nl/rws/digitaaltopografischbestand/wms/v1_0?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&BBOX=50.39116742874108468,2.841790801662708699,55.72120000000000317,7.374030000000000307&CRS=EPSG:4326&WIDTH=661&HEIGHT=776&LAYERS=vlakken&STYLES=&FORMAT=image/png&DPI=96&MAP_RESOLUTION=96&FORMAT_OPTIONS=dpi:96&TRANSPARENT=TRUE , it shows up a blank page.

Thanks,
Leo

Hi @Leo_Liu,

I think I found the right URL now and this one also works with the latest Beta of ThinkGeo.
https://service.pdok.nl/rws/digitaaltopografischbestand/wms/v1_0?request=GetCapabilities&service=WMS

I did some research again and I think it has got something to do with the extra ‘&’ at the end of the URL.
https://service.pdok.nl/cbs/gebiedsindelingen/2023/wms/v1_0?request=GetCapabilities&service=WMS&

In the previous version of Core the URL needed the extra ‘&’, but in the latest version this extra ‘&’ results in an exception.
At random moments some WMS layers seem to work sometimes just fine and something crash.

When I can pinpoint what causes the crashes I’ll come back to you.

Kind regards,
Guido van den Boom

hi @G_Vandenboom,

I tried the URL with the following code in the latest beta of ThinkGeo, it worked good.

The request for image looks good also: https://service.pdok.nl/cbs/gebiedsindelingen/2023/wms/v1_0?REQUEST=GetMap&BBOX=486276.900374273,6786479.27666514,838498.724755578,7024351.30736709&WIDTH=576&HEIGHT=389&LAYERS=buurt_labelpoint,arbeidsmarktregio_gegeneraliseerd&STYLES=&FORMAT=image/png&CRS=EPSG:3857&VERSION=1.3.0&SERVICE=WMS

var wmsLayer = new WmsRasterLayer();
wmsLayer.Uri = new Uri("https://service.pdok.nl/cbs/gebiedsindelingen/2023/wms/v1_0?request=GetCapabilities&service=WMS&");
wmsLayer.Crs = "EPSG:3857";
wmsLayer.ActiveLayerNames.Add("buurt_labelpoint");
wmsLayer.ActiveLayerNames.Add("arbeidsmarktregio_gegeneraliseerd");

Thanks,
Leo