<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.Shkpostityyli18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 2.0cm 70.85pt 2.0cm;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="FI" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="mso-fareast-language:EN-US">Hi,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">There is not so much wrong, you should just read
<a href="https://gdal.org/drivers/raster/wms.html">https://gdal.org/drivers/raster/wms.html</a> more carefully and write server URL this way:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"> <ServerUrl>https://tiles.wmflabs.org/osm-no-labels/${z}/${x}/${y}.png</ServerUrl><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US">-Jukka Rahkonen-<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b>Lähettäjä:</b> gdal-dev <gdal-dev-bounces@lists.osgeo.org>
<b>Puolesta </b>andy<br>
<b>Lähetetty:</b> tiistai 5. lokakuuta 2021 16.42<br>
<b>Vastaanottaja:</b> gdal-dev@lists.osgeo.org<br>
<b>Aihe:</b> [gdal-dev] Not able to use gdal_translate and a TMS source<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Hi,<o:p></o:p></p>
<div>
<p class="MsoNormal">in QGIS I have set this XYZ source: <a href="https://tiles.wmflabs.org/osm-no-labels/%7bz%7d/%7bx%7d/%7by%7d.png">https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">QGIS renders it properly.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I have created this GDAL source<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><GDAL_WMS><br>
<Service name="TMS"><br>
<ServerUrl><a href="https://tiles.wmflabs.org/osm-no-labels/%7bz%7d/%7bx%7d/%7by%7d.png">https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png</a></ServerUrl><br>
</Service><br>
<DataWindow><br>
<UpperLeftX>-20037508.34</UpperLeftX><br>
<UpperLeftY>20037508.34</UpperLeftY><br>
<LowerRightX>20037508.34</LowerRightX><br>
<LowerRightY>-20037508.34</LowerRightY><br>
<TileLevel>18</TileLevel><br>
<TileCountX>1</TileCountX><br>
<TileCountY>1</TileCountY><br>
<YOrigin>top</YOrigin><br>
</DataWindow><br>
<Projection>EPSG:900913</Projection><br>
<BlockSizeX>256</BlockSizeX><br>
<BlockSizeY>256</BlockSizeY><br>
<BandsCount>3</BandsCount><br>
<Cache /><br>
<ZeroBlockHttpCodes>204,404</ZeroBlockHttpCodes><br>
</GDAL_WMS><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">But if run<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">gdal_translate --debug ON -of PNG -projwin 5203413 2847209 5221042 2829459 -outsize 512 512 osm-no-labels.xml openstreetmap.png<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I have a black PNG. <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">The debug shows me a wrong HTTP call (the below one), but I do not know how to modify my xml source to be able to run right requests.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">HTTP: Request [1] <a href="https://tiles.wmflabs.org/osm-no-labels/%7bz%7d/%7bx%7d/%7by%7d.png/1.0.0/12/2580/1758.jpg">
https://tiles.wmflabs.org/osm-no-labels/{z}/{x}/{y}.png/1.0.0//12/2580/1758.jpg</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">What's wrong in my settings?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Thank you<o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<p class="MsoNormal">-- <o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt">___________________</span><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Andrea Borruso<br>
website: <a href="https://medium.com/tantotanto" target="_blank">https://medium.com/tantotanto</a><br>
38° 7' 48" N, 13° 21' 9" E, EPSG:4326<br>
<span style="font-size:12.0pt">___________________</span><br>
<br>
"cercare e saper riconoscere chi e cosa,<br>
in mezzo all’inferno, non è inferno, <br>
e farlo durare, e dargli spazio"<br>
<br>
Italo Calvino<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>