Skip to content
Permalink
Browse files

Fix #9665 (in memory raster not supported in raster calculator)

  • Loading branch information
wonder-sk committed Feb 26, 2014
1 parent daf1e0b commit 238350ff494277c2c2abb696ec745e97fdafd677
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/app/qgsrastercalcdialog.cpp
@@ -151,12 +151,22 @@ void QgsRasterCalcDialog::insertAvailableOutputFormats()
char** driverMetadata = GDALGetMetadata( driver, NULL );
if ( CSLFetchBoolean( driverMetadata, GDAL_DCAP_CREATE, false ) )
{
mOutputFormatComboBox->addItem( GDALGetDriverLongName( driver ), QVariant( GDALGetDriverShortName( driver ) ) );
QString driverShortName = GDALGetDriverShortName( driver );
QString driverLongName = GDALGetDriverLongName( driver );
if ( driverShortName == "MEM" )
{
// in memory rasters are not (yet) supported because the GDAL dataset handle
// would need to be passed directly to QgsRasterLayer (it is not possible to
// close it in raster calculator and reopen the dataset again in raster layer)
continue;
}

mOutputFormatComboBox->addItem( driverLongName, driverShortName );

//store the driver shortnames and the corresponding extensions
//(just in case the user does not give an extension for the output file name)
QString driverExtension = GDALGetMetadataItem( driver, GDAL_DMD_EXTENSION, NULL );
mDriverExtensionMap.insert( QString( GDALGetDriverShortName( driver ) ), driverExtension );
mDriverExtensionMap.insert( driverShortName, driverExtension );
}
}
}

0 comments on commit 238350f

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