<div dir="ltr"><div>Elena</div><div><br></div><div>This appears to be a bug in wmts driver in gdal, I would suggest filing a issue</div><div><br></div><div>The below is from the OGC Two Dimensional Tile Matrix Set specs, section d2<br></div><div><a href="http://docs.opengeospatial.org/is/17-083r2/17-083r2.html">http://docs.opengeospatial.org/is/17-083r2/17-083r2.html</a></div><div>
<p>"NOTE4: Some implementers prefer to define this TileMatrixSet using 
the CRS <a href="http://www.opengis.net/def/crs/EPSG/0/4326">http://www.opengis.net/def/crs/EPSG/0/4326</a>. The definition is 
the same except that CRS coordinates are expressed in latitude, 
longitude order, affecting the TopLeftCorner and the BBox encoding only".</p></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, 12 Feb 2021 at 08:05, Elena Ruiz <<a href="mailto:eruiz@aplitop.com">eruiz@aplitop.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div style="overflow-wrap: break-word;" lang="ES">
<div class="gmail-m_963236780205924155WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hello, my goal is to obtain images of both WMS and WMTS web services using GDAL, with the CRS that each service provides, in the case of the example, how can I do then to obtain images
 in EPSG: 4326 or any other CRS that have changed axes? Should a parameter be added to the gdal_translate call? What would be the correct way to obtain this type of images using gdal applications like gadlinfo and gdaltranslate?<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I have found very little information about this on the web, many thanks and best regards<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>

<table style="font-family:Arial" width="100%" cellspacing="0" cellpadding="0" border="0">
  <colgroup style="font-family:Calibri"></colgroup><tbody><tr><td><font style="font-family:Calibri" color="#b77540">
  </font></td></tr></tbody><colgroup><col style="font-family:Calibri" width="90">
  <col style="font-family:Calibri"></colgroup>
  <tbody>
  <tr style="font-family:Calibri"><td><font style="font-family:Calibri" color="#b77540"></font></td></tr>
  <tr>
    <td valign="middle" align="left">
      <p style="font-size:10pt;font-family:Calibri;font-weight:bold;color:rgb(82,157,36);padding-bottom:7px;margin:0px"> </p>
      <p style="font-size:10pt;font-family:Calibri">
      </p><table style="height:254px;width:691px">
        <tbody>
        <tr>
          <td style="font-size:10pt;height:6px;font-family:Calibri;width:560px" colspan="2" valign="top"><span style="font-family:Calibri"></span><span style="font-size:10pt">
            <hr>
            </span></td></tr>
        <tr>
          <td style="font-size:10pt;height:0px;font-family:Calibri;width:330px" rowspan="2" valign="top">
            <p style="font-size:10pt;font-family:Calibri"><font style="font-size:12pt;font-family:Calibri"><strong style="font-family:Calibri"><font color="#000000">Elena Ruiz</font></strong></font> <br><br><img style="height: 55px; width: 166px;" src="https://www.aplitop.com/descargas/logo.png" width="166" height="55" border="0"><br>Sofware Development & Technical Support<br>Tel.: 
            +34 952 43 97 71<br><a href="mailto:eruiz@aplitop.com" target="_blank">eruiz@aplitop.com</a><br><strong><font color="#3a567e"><a href="http://www.aplitop.com" target="_blank">www.aplitop.com</a></font></strong></p>
            <p style="font-size:10pt;font-family:Calibri"> </p></td></tr></tbody></table><p></p>
      <p style="font-size:10pt;font-family:Calibri"><span style="font-family:Calibri"><span style="font-size:10pt"><span style="font-size:10pt"><span style="font-size:10pt"><span style="font-size:10pt"><span style="font-size:10pt"><span style="font-size:10pt"><span style="font-size:10pt"><a title="" href="http://www.aplitop.com/Product/es/6/5/tcptunnel" target="_blank"></a></span></span></span></span></span></span></span></span> </p></td></tr>
  <tr></tr></tbody></table>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
  <colgroup>
  <col></colgroup>
  <tbody>
  <tr>
    <td style="font-size:9px;font-family:Verdana;color:rgb(166,166,166);text-align:justify;padding-top:15px;line-height:11px" valign="top">
      <p style="font-size:9px;font-family:Verdana" align="left"><a title="" href="http://www.aplitop.com/New/es/281/mdt-75-a-la-venta" target="_blank"></a> </p>
      <p style="font-size:9px;font-family:Verdana"><br><br> </p></td></tr></tbody></table>
<p style="font-size:10pt;font-family:Arial"></p>
<p style="font-size:10pt;font-family:Arial"></p><div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm">
<p class="MsoNormal"><b>De:</b> Travis Kirstine <<a href="mailto:traviskirstine@gmail.com" target="_blank">traviskirstine@gmail.com</a>> <br>
<b>Enviado el:</b> jueves, 11 de febrero de 2021 20:20<br>
<b>Para:</b> Elena Ruiz <<a href="mailto:eruiz@aplitop.com" target="_blank">eruiz@aplitop.com</a>><br>
<b>CC:</b> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<b>Asunto:</b> Re: [gdal-dev] WMTS services error<u></u><u></u></p>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">Elena,<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">I'm not exactly sure what is causing the issue but if you look at the capabilities of the 4326 tilematrixset compared to the InspireCRS84Quad the topleftcorner coordinates are reversed.  My guess gdal is expecting a X Y order.
<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><TileMatrixSet><br>
<ows:Identifier>InspireCRS84Quad</ows:Identifier><br>
<ows:SupportedCRS><a href="http://www.opengis.net/def/crs/OGC/1.3/CRS84" target="_blank">http://www.opengis.net/def/crs/OGC/1.3/CRS84</a></ows:SupportedCRS><br>
<TileMatrix><br>
<ows:Identifier>0</ows:Identifier><br>
<ScaleDenominator>2.79541132014358E8</ScaleDenominator><br>
<TopLeftCorner>-180.0 90.0</TopLeftCorner><br>
<TileWidth>256</TileWidth><br>
<TileHeight>256</TileHeight><br>
<MatrixWidth>2</MatrixWidth><br>
<MatrixHeight>1</MatrixHeight><br>
</TileMatrix><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"><TileMatrixSet><br>
<ows:Identifier>EPSG:4326</ows:Identifier><br>
<ows:SupportedCRS>EPSG:4326</ows:SupportedCRS><br>
<!--  crs="urn:ogc:def:crs:EPSG::4326"  --><br>
<TileMatrix><br>
<ows:Identifier>EPSG:4326:0</ows:Identifier><br>
<ScaleDenominator>2.795411320143589E8</ScaleDenominator><br>
<TopLeftCorner>90.0 -180.0</TopLeftCorner><br>
<TileWidth>256</TileWidth><br>
<TileHeight>256</TileHeight><br>
<MatrixWidth>2</MatrixWidth><br>
<MatrixHeight>1</MatrixHeight><br>
</TileMatrix><u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<div>
<p class="MsoNormal">On Thu, 11 Feb 2021 at 11:51, Elena Ruiz <<a href="mailto:eruiz@aplitop.com" target="_blank">eruiz@aplitop.com</a>> wrote:<u></u><u></u></p>
</div>
<blockquote style="border-color:currentcolor currentcolor currentcolor rgb(204,204,204);border-style:none none none solid;border-width:medium medium medium 1pt;padding:0cm 0cm 0cm 6pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span lang="EN-GB">Hello, I´m trying call web services (WMTS and WMS) using GDAL 3.0.2, but I have a problem with this example:</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">gdal_translate "WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:4326" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:4326</a>"
 d://wmts_bm.xml -of WMTS</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">ERROR 1: Invalid dataset dimensions : -135056383 x -167901439</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">gdal_translate "WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:25830" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:25830</a>"
 d://wmts_bm.xml -of WMTS</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Input file size is 20616192, 26817505</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">In this server
<a href="http://www.ign.es/wmts/pnoa-ma" target="_blank">http://www.ign.es/wmts/pnoa-ma</a> have available the next SRS :</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">SUBDATASET_1_NAME=WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=InspireCRS84Quad" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=InspireCRS84Quad</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">SUBDATASET_2_NAME=WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:4326" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:4326</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">SUBDATASET_3_NAME=WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:4258" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:4258</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">SUBDATASET_4_NAME=WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:25830" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=EPSG:25830</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">SUBDATASET_5_NAME=WMTS:<a href="http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=GoogleMapsCompatible" target="_blank">http://www.ign.es/wmts/pnoa-ma?request=GetCapabilities&service=WMTS,layer=OI.OrthoimageCoverage,tilematrixset=GoogleMapsCompatible</a></span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">But when I want Know the information or download a image in certain coordinates  with EPSG:4326, it returns an error “ERROR 1: Invalid dataset dimensions : -135056383
 x -167901439”, with EPSG:25830 works fine. I don`t understand this error, someone could help me?</span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB"> </span><u></u><u></u></p>
<p class="MsoNormal"><span lang="EN-GB">Thank you and regards</span><u></u><u></u></p>
</div>
<div class="MsoNormal" style="text-align:center" align="center">
<hr width="100%" size="2" align="center">
</div>
<table style="width:354.75pt" width="473" cellpadding="0" border="0">
<tbody>
<tr style="height:18.75pt">
<td style="padding:0.75pt;height:18.75pt">
<p style="text-align:right" align="right"><span style="font-size:10pt;font-family:"Arial",sans-serif"><img style="width: 1.3229in; height: 1.177in;" id="gmail-m_963236780205924155_x0000_i1030" src="https://www.aplitop.com/descargas/firma1.jpg" width="127" height="113" border="0"></span><span style="font-size:10pt;font-family:"Arial",sans-serif"><u></u><u></u></span></p>
</td>
<td style="width:247.5pt;padding:0.75pt;height:18.75pt" width="330" valign="top">
<p class="MsoNormal" style="line-height:9.75pt"><strong><span style="font-size:9pt;font-family:"Myriad Pro",sans-serif">Elena Ruiz
</span></strong><span style="font-size:12pt;font-family:"Times New Roman",serif"><br>
</span><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif">Sofware Development & Technical Support<br>
Tel. +34 952 43 97 71 <br>
<a href="mailto:eruiz@aplitop.com" target="_blank">eruiz@aplitop.com</a><br>
Sumatra, 9 - 29190 Málaga (Spain)<br>
<strong><span style="font-family:"Myriad Pro",sans-serif"><a href="http://www.aplitop.com" target="_blank">www.aplitop.com</a></span></strong><b><br>
<br>
</b></span><a href="https://www.facebook.com/AplitopSL/" target="_blank"><b><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif;text-decoration:none"><img style="width: 0.1562in; height: 0.1562in;" id="gmail-m_963236780205924155Imagen_x0020_3" src="cid:17796664b165b006a1" width="15" height="15" border="0"></span></b></a><strong><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif">  
</span></strong><a href="https://twitter.com/aplitop" target="_blank"><b><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif;text-decoration:none"><img style="width: 0.1562in; height: 0.1562in;" id="gmail-m_963236780205924155Imagen_x0020_4" src="cid:17796664b17772f6c2" width="15" height="15" border="0"></span></b></a><strong><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif">  
</span></strong><a href="https://www.linkedin.com/company/aplitop" target="_blank"><b><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif;text-decoration:none"><img style="width: 0.1562in; height: 0.1562in;" id="gmail-m_963236780205924155Imagen_x0020_5" src="cid:17796664b18935e6e3" width="15" height="15" border="0"></span></b></a><strong><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif">  
</span></strong><a href="https://www.youtube.com/user/aplitop" target="_blank"><b><span style="font-size:7pt;font-family:"Myriad Pro",sans-serif;text-decoration:none"><img style="width: 0.1562in; height: 0.1562in;" id="gmail-m_963236780205924155Imagen_x0020_6" src="cid:17796664b18afa3b84" width="15" height="15" border="0"></span></b></a><span style="font-size:12pt;font-family:"Times New Roman",serif"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p style="margin-bottom:12pt"><span style="font-size:6pt;font-family:"Myriad Pro",sans-serif">In accordance with the provisions of the European Regulation of Data Protection 2016/679 (Reglamento Europeo de Protección de Datos 2016/679), we inform you that
 the data and the information you provide us through this medium will be used by APLITOP, S.L., with C.I.F. B-92543396 and with address at C / Sumatra, 9, Malaga, 29190, in order to answer your questions and inform you about our products. The data provided
 will be kept as long as it does not request its cessation and will not be transferred to third parties except in cases where there is a legal obligation. You have the right to access your personal data, correct inaccurate data or request its deletion when
 the data is no longer necessary for the purposes that were collected, as well as any rights recognized in the RGPD 2016/679<br>
<br>
<br>
</span><span style="font-size:10pt;font-family:"Arial",sans-serif"><u></u><u></u></span></p>
</div>
<p class="MsoNormal">_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><u></u><u></u></p>
</blockquote>
</div>
</div>
</div>

</blockquote></div>