Convert XYZ-Tiles to BoundingBox (EPSG:3857-BBOX: minx,miny,maxx,maxy) to receive Tilesets 256x256 px - similar to WhooTS: http://whoots.mapwarper.net Required: WMS-Server needs to support EPSG:3857 Calculation taken from: https://github.com/Tetramatrix/monstercurves/blob/master/GlobalMapTiles.php No images will be served from this server. The script just calculate the BBOX and redirect to the WMS-Request GetMap ------------------------------------ Example usage: You have a WMS to receive tiles in 256x256 size from for e.g. OsmAnd+ App 1. Get familiar with the GetCapabilites of the WMS https://services.bgr.de/arcgis/services/geologie/guek200/MapServer/WMSServer?request=GetCapabilities&service=WMS URL-MASK for OsmAnd+: https://xyz2bbox.kreidefossilien.de/?wms=https://services.bgr.de/arcgis/services/geologie/guek200/MapServer/WMSServer&z={0}&x={1}&y={2}&l=1,2,4&&f=image/png8&t=true&v=1.3.0&m= Parameter Description type remarks/example &wms url to the WMS url https://services.bgr.de/arcgis/services/geologie/guek200/MapServer/WMSServer &z zoomlevel integer {0} or {$z} -> 1 to 19 &x x-Tile integer {1} or {$x} -> e.g. 1103 &y y-Tile integer {2} or {$y} -> e.g. 687 &l layername(s) string see WMS-GetCapabilites, usually comma-separated list -> layer or 1,2,4 or layer1,layer2 &f format received string see WMS-GetCapabilites image/png8 or image/jpeg or image/png &t transparency boolean see WMS-GetCapabilites true/false (only usefull in combination with png or tiff) &v WMS-Version string see WMS-GetCapabilites 1.3.0 or 1.1.1 or 1.0.0 &m map string see WMS-GetCapabilites not needed for this example Result: The following Tile-URL https://xyz2bbox.kreidefossilien.de/?wms=https://services.bgr.de/arcgis/services/geologie/guek200/MapServer/WMSServer&z=11&x=1103&y=687&l=1,2,4&&f=image/png8&t=true&v=1.3.0&m= will redirect to this WMS-Response (Http-Header is set to "301, permanent moved") https://services.bgr.de/arcgis/services/geologie/guek200/MapServer/WMSServer?BBOX=1545862.4600394,6574807.4249777,1565430.3392804,6594375.3042187&format=image/png8&version=1.3.0&layers=1,2,4&map=&transparent=true&service=WMS&request=GetMap&crs=EPSG:3857&srs=EPSG:3857&width=256&height=256&styles= --------------- "debuging" with parameter &d=true (optional, default is false) ------------------------------------ ------------------------------------ More Examples for OsmAnd+ ------------------------------------ GK25 of Bavaria Legend: https://www.lfu.bayern.de/gdi/legende/geologie/dgk25/geoleinheit_dgk25.png Create a folder e.g. "GK25 Bayern" and put a file named ".metainfo" with the following content in: ------------------------------------ [url_template] https://xyz2bbox.kreidefossilien.de/?wms=https://www.lfu.bayern.de/gdi/wms/geologie/dgk25&z={0}&x={1}&y={2}&l=verfuegbarkeit_dgk25,geoleinheit_dgk25,strukturln_dgk25&f=image/png8&v=1.3.0&t=true [ext] .png [min_zoom] 12 [max_zoom] 16 [tile_size] 256 [img_density] 32 [avg_img_size] 20000 ------------------------------------ then copy the folder + .metainfo into ".../files/tiles/"-folder of the OsmAnd-App ------------------------------------ ------------------------------------ tbc