<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
<p>Matt,</p>
<p>this is likely a rounding bug somewhere, but I couldn't reproduce
with what you provided (with GDAL master and 3.3.2 on Linux). I
had to fix a few hardcoded paths in the VRTs and create
SPOT7_FiftyMileCkSixtyMileR_321_150cm_19Jun2015_utm7.tif and
SPOT7_FiftyMileCkSixtyMileR_432_150cm_19Jun2015_utm7.tif with</p>
<p>gdal_create
SPOT7_FiftyMileCkSixtyMileR_321_150cm_19Jun2015_utm7.tif -outsize
31918 34252 -bands 4 -co tiled=yes -co sparse_ok=yes<br>
gdaladdo SPOT7_FiftyMileCkSixtyMileR_321_150cm_19Jun2015_utm7.tif
--config SPARSE_OK_OVERVIEW YES # SPARSE_OK_OVERVIEW only
taken into account with GDAL master<br>
</p>
<p>I also create a .vrt.msk file with</p>
<p> gdal_create
SPOT7_FiftyMileCkSixtyMileR_321_150cm_19Jun2015_utm7.vrt.msk
-outsize 31912 34252 -co sparse_ok=yes -mo INTERNAL_MASK_FLAGS_1=2
-of gtiff<br>
gdaladdo
SPOT7_FiftyMileCkSixtyMileR_321_150cm_19Jun2015_utm7.vrt.msk
--config SPARSE_OK_OVERVIEW YES</p>
<p>I may have missed something. It would help if your reproducer was
self contained.</p>
<p>Even<br>
</p>
<div class="moz-cite-prefix">Le 08/12/2021 à 18:35,
<a class="moz-txt-link-abbreviated" href="mailto:Matt.Wilkie@yukon.ca">Matt.Wilkie@yukon.ca</a> a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:af517a4f309c41ad8b265fec6927a35d@yukon.ca">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<div class="WordSection1">
<p class="MsoNormal">Hello,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Why is gdal off by one for the access
window? I’m using standard utilities, no custom code. This is
only happening (so far) on one file out of dozens.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">```</p>
<p class="MsoNormal"><span>$ gdal_translate -co compress=zstd
-co predictor=yes -co level=17 ^</span></p>
<p class="MsoNormal"><span> -co bigtiff=yes -of cog
INFILE.rgb-nir.vrt OUTFILE.tif</span></p>
<p class="MsoNormal"><span>Input file size is 31918, 34252</span></p>
<p class="MsoNormal"><span>0.ERROR 5: Access window out of range
in RasterIO(). Requested</span></p>
<p class="MsoNormal"><span>(0,0) of size 250x268 on raster of
249x267.</span></p>
<p class="MsoNormal">```</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">This is one step of a process where I’m
taking two 3-band jpeg-in-geotiff images, defining a nodata
mask, and creating a final 4-band cloud geotiff. Preceding
steps to this one are:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span>gdal_translate -b 1 RGB.tif
b-red.vrt</span></p>
<p class="MsoNormal"><span>gdal_translate -b 2 RGB.tif
b-grn.vrt</span></p>
<p class="MsoNormal"><span>gdal_translate -b 3 RGB.tif
b-blu.vrt</span></p>
<p class="MsoNormal"><span>gdal_translate -b 1 432.tif
b-nir.vrt</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>gdalbuildvrt -separate
INFILE.rgb-nir.vrt ^</span></p>
<p class="MsoNormal"><span> b-red.vrt b-grn.vrt b-blu.vrt
b-nir.vrt</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>gdal_translate INFILE.rgb-nir.vrt
xx-to-mask.tif</span></p>
<p class="MsoNormal"><span>nearblack –setmask xx-to-mask.tif</span></p>
<p class="MsoNormal"><span>move xx-mask.tif.msk
INFILE.rgb-nir.vrt.msk</span></p>
<p class="MsoNormal"><span>del xx-mask.tif</span></p>
<p class="MsoNormal"><span> </span></p>
<p class="MsoNormal"><span>gdal_translate INFILE.rgb-nir.vrt
OUTFILE.tif</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">(Edited for legibility, options used are
left out)</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Gdalinfo reports the size of each image are
the same:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><span>$ findstr "Size" *.gdal-info</span></p>
<p class="MsoNormal"><span>RGB.b-blu.vrt.gdal-info:Size is
31918, 34252</span></p>
<p class="MsoNormal"><span>RGB.b-blu.vrt.gdal-info:Pixel Size =
(1.500000000000000,-1.500000000000000)</span></p>
<p class="MsoNormal"><span>RGB.b-grn.vrt.gdal-info:Size is
31918, 34252</span></p>
<p class="MsoNormal"><span>RGB.b-grn.vrt.gdal-info:Pixel Size =
(1.500000000000000,-1.500000000000000)</span></p>
<p class="MsoNormal"><span>RGB.b-red.vrt.gdal-info:Size is
31918, 34252</span></p>
<p class="MsoNormal"><span>RGB.b-red.vrt.gdal-info:Pixel Size =
(1.500000000000000,-1.500000000000000)</span></p>
<p class="MsoNormal"><span>432.b-nir.vrt.gdal-info:Size is
31918, 34252</span></p>
<p class="MsoNormal"><span>432.b-nir.vrt.gdal-info:Pixel Size =
(1.500000000000000,-1.500000000000000)</span></p>
<p class="MsoNormal"><span>INFILE.rgb-nir.vrt.gdal-info:Size is
31918, 34252</span></p>
<p class="MsoNormal"><span>INFILE.rgb-nir.vrt.gdal-info:Pixel
Size = (1.500000000000000,-1.500000000000000)</span></p>
<p class="MsoNormal"><span>INFILE.rgb-nir.vrt.msk.gdal-info:Size
is 31918, 34252</span></p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">The source VRT and gdalinfo reports are
attached.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">GDAL 3.3.2, released 2021/09/01 via Qgis
3.22 on Windows 10.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">
<b><span lang="EN-US">Matt Wilkie</span></b><span lang="EN-US"></span></p>
<p class="MsoNormal"><span lang="EN-US">Geomatics Developer
& Administrator</span></p>
<p class="MsoNormal"><span lang="EN-US">Environment
<span>|</span> Technology, Innovation and Mapping</span></p>
<p class="MsoNormal"><span lang="EN-US">T 867-667-8133
<span>|</span> </span><u><span><a href="http://yukon.ca/"
moz-do-not-send="true"><span lang="EN-US">Yukon.ca</span></a></span></u></p>
<p class="MsoNormal"><i><span>Hours: 08:30-16:30, Mon-Wed:
Office, Thu: Remote, Fri: Away.</span></i></p>
<p class="MsoNormal"> </p>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>