Skip to content
Permalink
Browse files
[Server] Enhance WCS mapLayerFromCoverage
  • Loading branch information
rldhont committed Mar 20, 2017
1 parent 1ec067e commit 58bd0e14bd16a0ec2aa94b9271d0b07d2a31cc95
Showing with 15 additions and 11 deletions.
  1. +15 −11 src/server/qgswcsprojectparser.cpp
@@ -435,20 +435,24 @@ QList<QgsMapLayer*> QgsWCSProjectParser::mapLayerFromCoverage( const QString& cN
QString type = elem.attribute( "type" );
if ( type == "raster" )
{
QString id = mProjectParser->layerId( elem );
if ( !wcsLayersId.contains( id ) )
continue;

QString coveName = mProjectParser->layerShortName( elem );
if ( coveName.isEmpty() )
coveName = mProjectParser->layerName( elem );
coveName = coveName.replace( " ", "_" );

if ( coveName != cName )
continue;

QgsMapLayer *mLayer = mProjectParser->createLayerFromElement( elem, useCache );
QgsRasterLayer* layer = qobject_cast<QgsRasterLayer*>( mLayer );
if ( !layer || !wcsLayersId.contains( layer->id() ) )
return layerList;
if ( !layer )
continue;

QString coveName = layer->name();
if ( !layer->shortName().isEmpty() )
coveName = layer->shortName();
coveName = coveName.replace( " ", "_" );
if ( cName == coveName )
{
layerList.push_back( mLayer );
return layerList;
}
layerList.push_back( mLayer );
}
}
return layerList;

0 comments on commit 58bd0e1

Please sign in to comment.