<div dir="ltr">Sorry for incorrect sample commands in the last message.<div>I fixed it. The problem stays the same, because the problem was in email not in my tested code.<br><div><b>gdal_translate -srcwin 0 0 1073741760 1553779 -outsize 691 1 "WMTS:<a href="https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/1.0.0/WMTSCapabilities.xml,layer=USGSHydroCached,tilematrixset=default028mm">https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer/WMTS/1.0.0/WMTSCapabilities.xml,layer=USGSHydroCached,tilematrixset=default028mm</a>" tile.png</b><br></div></div><div><div><b><br></b></div><div><b>GDALDatasetRasterIO(<br></b></div><div><b>handle_to_wmts_subdataset,<br></b></div><div><b>eRWFlag=GF_Read,</b></div><div><b>nXOff=0,<br></b></div><div><b>nYOff=0,</b></div><div><b>nXSize=1073741760,<br></b></div><div><b>nYSize=1553779,</b></div><div><b>pBuffer - buffer for data,<br></b></div><div><b>nBufXSize=</b><b>691</b><b>,</b></div><div><b>nBufYSize=</b><b>1</b><b>,</b></div><div><b>eBufType=GDT_Byte,<br></b></div><div><b>nBandCount=4,<br></b></div><div><b>panBandMap=[bIndex ,gIndex, rIndex, aIndex],<br></b></div><div><b>nPixelSpace=4,<br></b></div><div><b>nLineSpace=0,<br></b></div><div><b>nBandSpace=1)</b></div></div><div><b><br></b></div><div><div>Can anyone help me to understand why gdal_translate works and generates output file, where GDALRasterIO raises error:</div><div><b>Requested (0,0) of size 1073741760x1553779 on raster of 1073741756x1347126255?</b></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">czw., 29 sie 2024 o 12:22 Michał Kowalczuk <<a href="mailto:michkowalczuk@gmail.com">michkowalczuk@gmail.com</a>> napisał(a):<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 dir="auto">I see. I will double check commands, fix and return to this.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">W dniu czw., 29.08.2024 o 12:20 Robert Coup <<a href="mailto:robert.coup@koordinates.com" target="_blank">robert.coup@koordinates.com</a>> napisał(a):<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 dir="ltr">Hi Michał,<div><br>In addition to Jukka's key point:<br><br> nBufXSize=1,<br> nBufYSize=691,<br><br>appears to be backwards wrt:</div><div><br> -outsize 691 1</div><div><br></div><div>Rob :)</div></div>
</blockquote></div></div>
</blockquote></div>