Geoserver Geocache TMS blank tiles

The Geoserver at Open Development Cambodia was configured to serve TMS tiles but it didn’t seem to work, here were the steps taken to debug and resolve the issue.The starting point was at the TMS endpoint (http://geoserver.opendevelopmentcambodia.net:8181/geoserver/gwc/service/tms/1.0.0/) which gave information about all the layers that were present in the server, the first task was to find a layer that is confirmed to work so browsing through an ideal candidate is “cambodia_geo_relief“. Next step is to plug the WMS layer into JOSM just to see what happens.

Java_OpenStreetMap_Editor_and_Using_TMS_with_Geoserver_—_Evernote_Premium_and_Capturing_from_Ethernet__en0_and_FireWire__fw0

Well and good. Next, TMS is not handled natively in Geoserver but rather by an extension called Geo Web Cache which the document specifies exposes URLs in the format

http://servername/contextpath/service/tms/1.0.0/layername/z/x/y.formatExtension
or
http://servername/contextpath/service/tms/1.0.0/layername@grisetId@formatExtension/z/x/y.formatExtension
 Which means the URL that we specify for JOSM should be
http://geoserver.opendevelopmentcambodia.net:8181/geoserver/gwc/service/tms/1.0.0/based_maps%3Acambodia_geo_relief@EPSG%3A900913@png/{zoom}/{x}/{y}.png

Which doesn’t quite work, now there are issues in regards to TMS and the Y axis so  one way to resolve this is to figure out if the problem is in the URL scheme or not. One tile server that works for sure is demo.opengeo.org which serves up the Blue Marble with the following result:

Java_OpenStreetMap_Editor

So there is an issue with the Y axis after all, this was resolved by using an /{zoom}/{x}/{-y}.jpg URL scheme, with the following result:

Java_OpenStreetMap_Editor_and_Using_TMS_with_Geoserver_—_Evernote_Premium_and_Capturing_from_Ethernet__en0
Next, let’s use the same scheme for our current TMS tiles:

Java_OpenStreetMap_Editor_and_Using_TMS_with_Geoserver_—_Evernote_Premium

So there is a problem with the Geocache instance on the current server. One thing that can be done is to try clearing the resource cache:

GeoServer__Server_Status

That seems to solve the problem of the blank TMS tiles.

 

 

 

 

Share

Leave a Reply

Your email address will not be published. Required fields are marked *