Skip to content
Permalink
Browse files

GDAL overviews bug fix conditional < 1.9.2

  • Loading branch information
blazek committed Oct 2, 2012
1 parent 45fe0ec commit 58e423a06d1308a09cbf67de13edc137efb9c43a
Showing with 16 additions and 7 deletions.
  1. +10 −7 src/providers/gdal/qgsgdalprovider.cpp
  2. +6 −0 src/providers/wcs/qgswcsprovider.cpp
@@ -1448,11 +1448,6 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
QgsGdalProgress myProg;
myProg.type = ProgressPyramids;
myProg.provider = this;
// Observed problem: if a *.rrd file exists and GDALBuildOverviews() is called,
// the *.rrd is deleted and no overviews are created, if GDALBuildOverviews()
// is called next time, it crashes somewhere in GDAL:
// https://trac.osgeo.org/gdal/ticket/4831
// Crash can be avoided if dataset is reopened
myError = GDALBuildOverviews( mGdalBaseDataset, theMethod,
myOverviewLevelsVector.size(), myOverviewLevelsVector.data(),
0, NULL,
@@ -1492,8 +1487,16 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste

QgsDebugMsg( "Pyramid overviews built" );

// For now always reopen to avoid crash described above
if ( true || theFormat == PyramidsInternal )
// Observed problem: if a *.rrd file exists and GDALBuildOverviews() is called,
// the *.rrd is deleted and no overviews are created, if GDALBuildOverviews()
// is called next time, it crashes somewhere in GDAL:
// https://trac.osgeo.org/gdal/ticket/4831
// Crash can be avoided if dataset is reopened, fixed in GDAL 1.9.2
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1920
if ( theFormat == PyramidsInternal )
#else
if ( true ) // GDAL #4831 fix
#endif
{
QgsDebugMsg( "Reopening dataset ..." );
//close the gdal dataset and reopen it in read only mode
@@ -687,6 +687,12 @@ void QgsWcsProvider::getCache( int bandNo, QgsRectangle const & viewExtent, int
setQueryItem( url, "COVERAGE", mIdentifier );
if ( !mTime.isEmpty() )
{
// It seems that Mmapserver (6.0.3) WCS 1.1 completely ignores
// TemporalDomain. Some code (copy-pasted from 1.0) is commented in
// msWCSDescribeCoverage_CoverageDescription11() and GetCoverage
// TimeSequence param is not supported at all. If a coverage is defined
// with timeposition in mapfile, the result of GetCoverage is empty
// raster (all values 0).
setQueryItem( url, "TIME", mTime );
}
setQueryItem( url, "BBOX", bbox );

0 comments on commit 58e423a

Please sign in to comment.
You can’t perform that action at this time.