Skip to content

Commit

Permalink
GDAL overviews bug fix conditional < 1.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed Oct 2, 2012
1 parent 45fe0ec commit 58e423a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/providers/gdal/qgsgdalprovider.cpp
Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions src/providers/wcs/qgswcsprovider.cpp
Expand Up @@ -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 );
Expand Down

0 comments on commit 58e423a

Please sign in to comment.