1

If you get a legend from a geoserver raster the minimum value will be on top, the maximum at the bottom.

<sld:ColorMapEntry color="#FFFFFF" quantity="0" opacity="0" label="0 mm"/>
<sld:ColorMapEntry color="#FFFF81" quantity="1" label="1 mm"/>
<sld:ColorMapEntry color="#B5F557" quantity="2" label="2 mm"/>
<sld:ColorMapEntry color="#6FEB36" quantity="3" label="3 mm"/>    
<sld:ColorMapEntry color="#3AD62D" quantity="4" label="4 mm"/>    
<sld:ColorMapEntry color="#3DB868" quantity="5" label="5 mm"/>
<sld:ColorMapEntry color="#299E98" quantity="6" label="6 mm"/>
<sld:ColorMapEntry color="#216D9E" quantity="7" label="7 mm"/>
<sld:ColorMapEntry color="#1F3F8C" quantity="8" label="8 mm"/>
<sld:ColorMapEntry color="#0D1079" quantity="9" label="9 mm"/>
<sld:ColorMapEntry color="#000351" quantity="10" label="10 mm"/>

enter image description here

But I would like to change the order and to display the maximum value on top of the legend. I tried to change the order of the sld:ColorMapEntrys but now all the values at the raster has a opacity of 0 and no color.

<sld:ColorMapEntry color="#FFFFFF" quantity="10" label="10 mm"/>
<sld:ColorMapEntry color="#FFFF81" quantity="9" label="9 mm"/>
<sld:ColorMapEntry color="#B5F557" quantity="8" label="8 mm"/>
<sld:ColorMapEntry color="#6FEB36" quantity="7" label="7 mm"/>    
<sld:ColorMapEntry color="#3AD62D" quantity="6" label="6 mm"/>        
<sld:ColorMapEntry color="#3DB868" quantity="5" label="5 mm"/>
<sld:ColorMapEntry color="#299E98" quantity="4" label="4 mm"/>
<sld:ColorMapEntry color="#216D9E" quantity="3" label="3 mm"/>
<sld:ColorMapEntry color="#1F3F8C" quantity="2" label="2 mm"/>
<sld:ColorMapEntry color="#0D1079" quantity="1" label="1 mm"/>    
<sld:ColorMapEntry color="#000351" quantity="0" opacity="0" label="0 mm"/>

enter image description here

Is there a solution to show the standard legend in a reverse order?

3

If memory serves me well, the SLD specification mandates that the colormap is to be provided in increasing values order. I'm not aware of options in GeoServer to change that. So I don't believe you either:

  • Ok, thank you. So I will try to build the legend by hand. – Katharina Mar 19 '17 at 11:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.