Skip to content

Commit 58e423a

Browse files
committed
GDAL overviews bug fix conditional < 1.9.2
1 parent 45fe0ec commit 58e423a

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/providers/gdal/qgsgdalprovider.cpp

+10-7
Original file line numberDiff line numberDiff line change
@@ -1448,11 +1448,6 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
14481448
QgsGdalProgress myProg;
14491449
myProg.type = ProgressPyramids;
14501450
myProg.provider = this;
1451-
// Observed problem: if a *.rrd file exists and GDALBuildOverviews() is called,
1452-
// the *.rrd is deleted and no overviews are created, if GDALBuildOverviews()
1453-
// is called next time, it crashes somewhere in GDAL:
1454-
// https://trac.osgeo.org/gdal/ticket/4831
1455-
// Crash can be avoided if dataset is reopened
14561451
myError = GDALBuildOverviews( mGdalBaseDataset, theMethod,
14571452
myOverviewLevelsVector.size(), myOverviewLevelsVector.data(),
14581453
0, NULL,
@@ -1492,8 +1487,16 @@ QString QgsGdalProvider::buildPyramids( QList<QgsRasterPyramid> const & theRaste
14921487

14931488
QgsDebugMsg( "Pyramid overviews built" );
14941489

1495-
// For now always reopen to avoid crash described above
1496-
if ( true || theFormat == PyramidsInternal )
1490+
// Observed problem: if a *.rrd file exists and GDALBuildOverviews() is called,
1491+
// the *.rrd is deleted and no overviews are created, if GDALBuildOverviews()
1492+
// is called next time, it crashes somewhere in GDAL:
1493+
// https://trac.osgeo.org/gdal/ticket/4831
1494+
// Crash can be avoided if dataset is reopened, fixed in GDAL 1.9.2
1495+
#if defined(GDAL_VERSION_NUM) && GDAL_VERSION_NUM >= 1920
1496+
if ( theFormat == PyramidsInternal )
1497+
#else
1498+
if ( true ) // GDAL #4831 fix
1499+
#endif
14971500
{
14981501
QgsDebugMsg( "Reopening dataset ..." );
14991502
//close the gdal dataset and reopen it in read only mode

src/providers/wcs/qgswcsprovider.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -687,6 +687,12 @@ void QgsWcsProvider::getCache( int bandNo, QgsRectangle const & viewExtent, int
687687
setQueryItem( url, "COVERAGE", mIdentifier );
688688
if ( !mTime.isEmpty() )
689689
{
690+
// It seems that Mmapserver (6.0.3) WCS 1.1 completely ignores
691+
// TemporalDomain. Some code (copy-pasted from 1.0) is commented in
692+
// msWCSDescribeCoverage_CoverageDescription11() and GetCoverage
693+
// TimeSequence param is not supported at all. If a coverage is defined
694+
// with timeposition in mapfile, the result of GetCoverage is empty
695+
// raster (all values 0).
690696
setQueryItem( url, "TIME", mTime );
691697
}
692698
setQueryItem( url, "BBOX", bbox );

0 commit comments

Comments
 (0)