Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
NaN value when no color for MapTiler WMS Interpretation converter
  • Loading branch information
vcloarec authored and wonder-sk committed Jan 24, 2022
1 parent 4fd2f04 commit e0474b7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -4924,7 +4924,14 @@ void QgsWmsInterpretationConverterMapTilerTerrainRGB::convert( const QRgb &color
int G = qGreen( color );
int B = qBlue( color );

*converted = -10000 + ( ( R * 256 * 256 + G * 256 + B ) ) * 0.1;
if ( qAlpha( color ) == 255 )
{
*converted = -10000 + ( ( R * 256 * 256 + G * 256 + B ) ) * 0.1;
}
else
{
*converted = std::numeric_limits<float>::quiet_NaN();
}
}

QgsRasterBandStats QgsWmsInterpretationConverterMapTilerTerrainRGB::statistics( int, int, const QgsRectangle &, int, QgsRasterBlockFeedback * ) const
Expand Down

0 comments on commit e0474b7

Please sign in to comment.