• GeoWebCache Bounding Box to Tile Conversion Not Working Properly (EPSG:4326)
• I am working on loading TMS and XYZ tiles from GeoServer into an OpenLayers 3 map using the EPSG:4326 projection. My implementation works with EPSG:900913 (Web Mercator), but when I switch to EPSG:4326 (WGS 84), the tiles do not display.
• The tiles for zoom levels 0-15 were generated using the gdal2tiles command, following a directory structure format of zoomLevel/xTile/yTile.png. These tiles work fine when loaded directly into OpenLayers 3. However, I encounter issues when trying to display the GeoServer TMS layer tiles.
Problem Details:
• Requesting tiles using EPSG:900913 works as expected in GeoServer.
• Requesting tiles using EPSG:4326 does not display the tiles (i.e /5/21/17.png,7/91/73.png,...), and it seems like the tile requests are targeting incorrect zoom levels or tile indices.
Layer extent is : 67.9999999892922062,6.7500084218887384 97.4152926721475438,35.5000646459131772
• I would prefer to display the map using EPSG:4326 since my data is in that projection. However, the TMS tiles from GeoServer fail to load in this projection. It seems there may be issues with coordinate transformations or the way OpenLayers 3 requests the tiles.
Sample code :
var epsg_projection = ‘4326’;
var layerCity = ‘cite:layername’;
var epsg_projection2 = ‘EPSG:’ + epsg_projection;
var testlayer = new ol.layer.Tile({
source: new ol.source.XYZ({
url: ‘http://localhost:8080/geoserver/gwc/service/tms/1.0.0/’ + layerCity + ‘@EPSG%3A’ + epsg_projection +‘@png/{z}/{x}/{-y}.png’,
minZoom: 0,
maxZoom: 15
})
});
My Questions:
• Is there a way to instruct GeoServer to generate tiles with the XYZ structure (zoom/x/y) for EPSG:4326?
• How can I configure OpenLayers 3 to request the TMS tiles correctly from GeoServer for EPSG:4326?
• Is there a better approach to handle TMS with EPSG:4326 in GeoWebCache?
Any guidance or insights on resolving this issue would be highly appreciated!
Reference link:
https://docs.geoserver.org/main/en/user/geowebcache/webadmin/blobstores.html
https://docs.geoserver.org/main/en/user/geowebcache/webadmin/layers.html