Skip to content
Permalink
Browse files

Merge pull request #41769 from elpaso/bugfix-gh41747-paletted-float-r…

…amp-order

Fix raster paletted ramp order
  • Loading branch information
elpaso committed Feb 23, 2021
2 parents 6cbb9d2 + 80a0044 commit a341543b715816e9c3a999222e5ce49751539ce4
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/core/raster/qgspalettedrasterrenderer.cpp
@@ -566,6 +566,11 @@ QgsPalettedRasterRenderer::ClassData QgsPalettedRasterRenderer::classDataFromRas
}
}
}
// must be sorted
std::sort( data.begin(), data.end(), []( const Class & a, const Class & b ) -> bool
{
return a.value < b.value;
} );
}
else
{
@@ -600,7 +605,7 @@ QgsPalettedRasterRenderer::ClassData QgsPalettedRasterRenderer::classDataFromRas
}

// assign colors from ramp
if ( ramp )
if ( ramp && numClasses > 0 )
{
int i = 0;

0 comments on commit a341543

Please sign in to comment.