Skip to content
Permalink
Browse files

Fix raster paletted ramp order

Fixes #41747
  • Loading branch information
elpaso committed Feb 23, 2021
1 parent 6cbb9d2 commit 80a00443125bf10fbf2566a36522f38654a2209d
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 80a0044

Please sign in to comment.