Skip to content

Commit

Permalink
WCS / OWS select format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blazek committed May 2, 2012
1 parent 988a7da commit 70b68be
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/gui/qgsowssourceselect.cpp
Expand Up @@ -158,7 +158,8 @@ void QgsOWSSourceSelect::populateFormats()
}

// selectedLayersFormats may come in various forms:
// image/tiff, GTiff, GeoTIFF, TIFF, PNG, GTOPO30, ARCGRID, IMAGEMOSAIC ...
// image/tiff, GTiff, GeoTIFF, TIFF, geotiff_int16, geotiff_rgb,
// PNG, GTOPO30, ARCGRID, IMAGEMOSAIC,
QMap<QString, QString> formatsMap;
formatsMap.insert( "geotiff", "tiff" );
formatsMap.insert( "gtiff", "tiff" );
Expand All @@ -176,7 +177,7 @@ void QgsOWSSourceSelect::populateFormats()
{
QString format = layersFormats.value( i );
QgsDebugMsg( "server format = " + format );
QString simpleFormat = format.toLower().replace( "image/", "" );
QString simpleFormat = format.toLower().replace( "image/", "" ).replace( QRegExp( "_.*" ), "" );
QgsDebugMsg( "server simpleFormat = " + simpleFormat );
QString mimeFormat = "image/" + formatsMap.value( simpleFormat );
QgsDebugMsg( "server mimeFormat = " + mimeFormat );
Expand Down
5 changes: 4 additions & 1 deletion src/providers/gdal/qgswcssourceselect.cpp
Expand Up @@ -137,7 +137,10 @@ void QgsWCSSourceSelect::addClicked( )
}

QgsDebugMsg( "selectedFormat = " + selectedFormat() );
uri.setParam( "format", selectedFormat() );
if ( !selectedFormat().isEmpty() )
{
uri.setParam( "format", selectedFormat() );
}

emit addRasterLayer( uri.encodedUri(), identifier, "gdal" );
}
Expand Down

0 comments on commit 70b68be

Please sign in to comment.