Skip to content

Commit 70b68be

Browse files
committed
WCS / OWS select format fix
1 parent 988a7da commit 70b68be

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/gui/qgsowssourceselect.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ void QgsOWSSourceSelect::populateFormats()
158158
}
159159

160160
// selectedLayersFormats may come in various forms:
161-
// image/tiff, GTiff, GeoTIFF, TIFF, PNG, GTOPO30, ARCGRID, IMAGEMOSAIC ...
161+
// image/tiff, GTiff, GeoTIFF, TIFF, geotiff_int16, geotiff_rgb,
162+
// PNG, GTOPO30, ARCGRID, IMAGEMOSAIC,
162163
QMap<QString, QString> formatsMap;
163164
formatsMap.insert( "geotiff", "tiff" );
164165
formatsMap.insert( "gtiff", "tiff" );
@@ -176,7 +177,7 @@ void QgsOWSSourceSelect::populateFormats()
176177
{
177178
QString format = layersFormats.value( i );
178179
QgsDebugMsg( "server format = " + format );
179-
QString simpleFormat = format.toLower().replace( "image/", "" );
180+
QString simpleFormat = format.toLower().replace( "image/", "" ).replace( QRegExp( "_.*" ), "" );
180181
QgsDebugMsg( "server simpleFormat = " + simpleFormat );
181182
QString mimeFormat = "image/" + formatsMap.value( simpleFormat );
182183
QgsDebugMsg( "server mimeFormat = " + mimeFormat );

src/providers/gdal/qgswcssourceselect.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,10 @@ void QgsWCSSourceSelect::addClicked( )
137137
}
138138

139139
QgsDebugMsg( "selectedFormat = " + selectedFormat() );
140-
uri.setParam( "format", selectedFormat() );
140+
if ( !selectedFormat().isEmpty() )
141+
{
142+
uri.setParam( "format", selectedFormat() );
143+
}
141144

142145
emit addRasterLayer( uri.encodedUri(), identifier, "gdal" );
143146
}

0 commit comments

Comments
 (0)