<div dir="ltr">Ah, great! That fixed it :-)<div><br></div><div>Is there an official 1.11.3 release in the works? It's a bit of hassle for me to integrate it into our build system here, so if there's a new official version out soon I probably won't bother to integrate the current snapshot.</div><div><br></div><div>Thanks so much for your help, Even!</div><div><br></div><div>- Thomas</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jun 15, 2015 at 4:06 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"><span class="">Le lundi 15 juin 2015 15:51:37, Thomas Sevaldrud a écrit :<br>
> When using the same image in GeoTIFF with overviews, it works correctly,<br>
> which may indicate something with the ECW drivers. I suppose it must be<br>
> something triggered by something weird I'm doing though, or else I would<br>
> think that other people would have the same problem.<br>
<br>
</span>It is sometimes surprising that some bugs remain unreported for long!<br>
<span class=""><br>
><br>
> The weird thing is that if I simply add an extra band to the VRT it works<br>
> with ECW as well... This extra band is never used for anything and has no<br>
> source, but with it, I get the correct image.<br>
<br>
</span>Interesting. My guess is that you must hit<br>
<a href="https://trac.osgeo.org/gdal/ticket/5954" rel="noreferrer" target="_blank">https://trac.osgeo.org/gdal/ticket/5954</a><br>
<span class=""><br>
><br>
> I can't switch to GDAL 2.0 yet, but I'll try to isolate the code from the<br>
> GDALOverviewDataset class and use that instead of the VRT approach, and see<br>
> if that makes any difference.<br>
<br>
</span>Latest code from 1.11 branch has the fix for the above ticket.<br>
<div class="HOEnZb"><div class="h5"><br>
><br>
> - Thomas<br>
><br>
><br>
> On Mon, Jun 15, 2015 at 12:19 PM, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>><br>
><br>
> wrote:<br>
> > Thomas,<br>
> ><br>
> > 2 suggestions to help narrowing down the issue :<br>
> > - try gdalwarp of GDAL 2.0 that can select the most appropriate overview<br>
> > given the target resolution / raster size<br>
> > - try with the ECW translated as a GeoTIFF to check if it isn't an issue<br>
> > with<br>
> > the ECW driver itself.<br>
> ><br>
> > Even<br>
> ><br>
> > > Hi,<br>
> > ><br>
> > > I am having a bit of trouble with warping a dataset (an ECW file) with<br>
> > > multiple overviews. The base file is huge, so I am selecting the<br>
> > > overview that matches closest to my output resolution and makes an<br>
> > > in-memory VRT<br>
> ><br>
> > of<br>
> ><br>
> > > this, consisting of the overview bands of the original image.<br>
> > ><br>
> > > This seems to only work for some overview levels, and not for others. I<br>
> ><br>
> > get<br>
> ><br>
> > > results that appear to be made from the correct sets of colors<br>
> > > basically, but way out of scale and postion. Some times it seems to<br>
> > > work nicely though, so I suspect that there is some memory overwriting<br>
> > > issue or something here.<br>
> > ><br>
> > > This is the part of the code that builds the overview VRT. The input<br>
> > > dataset is _ds, an<br>
> > ><br>
> > > // Create a VRT of the closest matching overlay<br>
> > > GDALDriver *vrtDriver = (GDALDriver *) GDALGetDriverByName( "VRT" );<br>
> > ><br>
> > > vrtDS = vrtDriver->Create("", ovrW, ovrH, _numBands, _dataType, NULL);<br>
> > > GDALSetProjection(vrtDS, _srcProjectionWKT.c_str());<br>
> > ><br>
> > >    ouble geoTransform[6]; _ds->GetGeoTransform(geoTransform); double<br>
> > ><br>
> > > basePixelSizeX = geoTransform[XFM_PIXEL_SIZE_EW]; double basePixelSizeY<br>
> > > = geoTransform[XFM_PIXEL_SIZE_NS];<br>
> > ><br>
> > > geoTransform[XFM_PIXEL_SIZE_EW] = scaleX*basePixelSizeX;<br>
> > > geoTransform[XFM_PIXEL_SIZE_NS] = scaleY*basePixelSizeY;<br>
> > > vrtDS->SetGeoTransform(geoTransform);<br>
> > ><br>
> > > for(int i = 1; i <= _numBands; i++)<br>
> > > {<br>
> > > GDALRasterBand* srcRootBand = _ds->GetRasterBand(i);<br>
> > > GDALRasterBand* srcBand = srcRootBand->GetOverview(overviewId);<br>
> > > VRTSourcedRasterBand* vrtBand =<br>
> > > (VRTSourcedRasterBand*)vrtDS->GetRasterBand(i);<br>
> > > vrtBand->AddSimpleSource(srcBand);<br>
> > > }<br>
> ><br>
> > --<br>
> > Spatialys - Geospatial professional services<br>
> > <a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
<br>
--<br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
</div></div></blockquote></div><br></div>