<div dir="ltr"><div><div>Here shortened version of the code...</div><div><br></div><div><div>  VSIFCloseL(VSIFileFromMemBuffer((*vsifile1).c_str(),</div><div>                                  buf1, FALSE));  // buf1 = RGB JPEG</div><div>  GDALDatasetH hsrc1_ds = GDALOpenInternal((*vsifile1).c_str(), GA_ReadOnly,</div><div>                           kGdalAllowedDrivers);</div></div><div><div> VSIFCloseL(VSIFileFromMemBuffer((*vsifile2).c_str(),<br></div><div>                                  buf2, FALSE));  // buf2 = RGB JPEG</div><div> GDALDatasetH hsrc2_ds = GDALOpenInternal((*vsifile2).c_str(), GA_ReadOnly,</div><div>                           kGdalAllowedDrivers);</div></div><div>....  // initialize geo_transform, gdal_warp</div></div><div>gdal_warp->hSrcDS = hsrc1_ds;<br></div>VRTWarpedDataset *hdst_ds =  (VRTWarpedDataset*)(GDALCreateWarpedVRT(<div><div>      hsrc1_ds, XSize, YSize, &dst_geo_transform[0], gdal_warp));</div></div><div><div>gdal_warp->hDstDS = hdst_ds;</div></div><div><div>gdal_warp->hSrcDS = hsrc2_ds;<br></div><div>CPLErr eErr = warp_operation.ChunkAndWarpImage(0, 0, GDALGetRasterXSize(hdst_ds),</div><div>                                            GDALGetRasterYSize(hdst_ds));</div></div><div>GDALClose((GDALDatasetH)hdst_ds);   // "<span style="font-family:arial,sans-serif;font-size:13px">ERROR 6: WriteBlock() not supported for this dataset." /band</span><br></div><div>... // Close Source Datasets etc..</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 3:41 PM, David Olson <span dir="ltr"><<a href="mailto:olsond@google.com" target="_blank">olsond@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Evan, <div>  The source and destination data are 3-band RGB so I don't believe that is the problem...</div><div>  However I did define GdalWarp->nDstAlphaBand = 0 with the same result. Basically getting three </div><div>  erorrs - one for each band:</div><div><div><br></div><div>ERROR 6: WriteBlock() not supported for this dataset.</div><div>ERROR 6: WriteBlock() not supported for this dataset.</div><div>ERROR 6: WriteBlock() not supported for this dataset.</div></div><div>   </div><div>Thanks, David</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 27, 2014 at 3:21 PM, Even Rouault <span dir="ltr"><<a href="mailto:even.rouault@spatialys.com" target="_blank">even.rouault@spatialys.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le lundi 27 octobre 2014 22:42:11, David Olson a écrit :<br>
<span>> Hi,<br>
>   I've set up a c++ code which creates a VRTWarpedDataset from a source<br>
> image then uses ChunkAndWarpImage to warp additional source images and<br>
> create a mosaic with the VRTWarpedDataset destination (hdst_ds).<br>
>  The code is tested and runs fine without memory leak.<br>
>  However I do get an error upon calling GDALClose(hdst_ds) :<br>
</span>>       *ERROR 6: WriteBlock() not supported for this dataset*.<br>
<span>>  GDALClose calls FlushCache which calls WriteBlock.<br>
>  Just wanting to get some insight on this error. And possibly how to avoid<br>
> it.<br>
<br>
</span>David,<br>
<br>
Difficult to tell without a reproducable snippet. But my guess is that you have<br>
an issue with setting up alpha band. Perhaps you have not defined nDstAlphaBand<br>
in the warping options ?<br>
<span><font color="#888888"><br>
Even<br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a><br>
</font></span></blockquote></div><br></div>
</div></div></blockquote></div><br></div>