Skip to content

Commit

Permalink
Fix #9665 (in memory raster not supported in raster calculator)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Feb 26, 2014
1 parent daf1e0b commit 238350f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/app/qgsrastercalcdialog.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -151,12 +151,22 @@ void QgsRasterCalcDialog::insertAvailableOutputFormats()
char** driverMetadata = GDALGetMetadata( driver, NULL ); char** driverMetadata = GDALGetMetadata( driver, NULL );
if ( CSLFetchBoolean( driverMetadata, GDAL_DCAP_CREATE, false ) ) 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 //store the driver shortnames and the corresponding extensions
//(just in case the user does not give an extension for the output file name) //(just in case the user does not give an extension for the output file name)
QString driverExtension = GDALGetMetadataItem( driver, GDAL_DMD_EXTENSION, NULL ); QString driverExtension = GDALGetMetadataItem( driver, GDAL_DMD_EXTENSION, NULL );
mDriverExtensionMap.insert( QString( GDALGetDriverShortName( driver ) ), driverExtension ); mDriverExtensionMap.insert( driverShortName, driverExtension );
} }
} }
} }
Expand Down

0 comments on commit 238350f

Please sign in to comment.