Skip to content
Permalink
Browse files
WCS / OWS select format fix
  • Loading branch information
blazek committed May 2, 2012
1 parent 988a7da commit 70b68be64628009d2683a3c36cfb125a3a4a2a88
Showing with 7 additions and 3 deletions.
  1. +3 −2 src/gui/qgsowssourceselect.cpp
  2. +4 −1 src/providers/gdal/qgswcssourceselect.cpp
@@ -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" );
@@ -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 );
@@ -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" );
}

0 comments on commit 70b68be

Please sign in to comment.