@@ -530,9 +530,29 @@ void QgsProjectFileTransform::transform1800to1900()
530
530
531
531
// switch depending on mColorShadingAlgorithm
532
532
QString colorShadingAlgorithm = rasterPropertiesElem.firstChildElement ( " mColorShadingAlgorithm" ).text ();
533
- if ( colorShadingAlgorithm == " PseudoColorShader" )
533
+ if ( colorShadingAlgorithm == " PseudoColorShader" || colorShadingAlgorithm == " FreakOutShader " )
534
534
{
535
-
535
+ newColorRampShaderElem.setAttribute ( " colorRampType" , " INTERPOLATED" );
536
+
537
+ // get minmax from rasterlayer
538
+ QgsRasterBandStats rasterBandStats = rasterLayer.bandStatistics ( grayBand );
539
+ double minValue = rasterBandStats.minimumValue ;
540
+ double maxValue = rasterBandStats.maximumValue ;
541
+ double breakSize = ( maxValue - minValue ) / 3 ;
542
+
543
+ QStringList colorList;
544
+ colorList << " #0000ff" << " #00ffff" << " #ffff00" << " #ff0000" ;
545
+ QStringList::const_iterator colorIt = colorList.constBegin ();
546
+ double boundValue = minValue;
547
+ for ( ; colorIt != colorList.constEnd (); ++colorIt )
548
+ {
549
+ QDomElement newItemElem = mDom .createElement ( " item" );
550
+ newItemElem.setAttribute ( " value" , QString::number ( boundValue ) );
551
+ newItemElem.setAttribute ( " label" , QString::number ( boundValue ) );
552
+ newItemElem.setAttribute ( " color" , *colorIt );
553
+ newColorRampShaderElem.appendChild ( newItemElem );
554
+ boundValue += breakSize;
555
+ }
536
556
}
537
557
else if ( colorShadingAlgorithm == " ColorRampShader" )
538
558
{
0 commit comments