[Geoserver-devel] [JIRA] (GEOS-7698) Raster legend border colour ignored

Robert Ward created an issue

GeoServer / BugGEOS-7698

Raster legend border colour ignored

Issue Type:

BugBug

Affects Versions:

2.8.4, 2.9.1

Assignee:

Unassigned

Components:

WMS

Created:

24/Aug/16 3:08 PM

Environment:

Java 1.8 Windows 7

Labels:

wms legend raster

Priority:

MediumMedium

Reporter:

Robert Ward

Original Estimate:

1 hour

Remaining Estimate:

1 hour

The raster legend border colour is ignored.

In class org.geoserver.wms.legendgraphic.RasterLayerLegendHelper the method parseRequest() creates all the necessary objects with the correct legend configuration.

    private void parseRequest(final GetLegendGraphicRequest request,Style gt2Style,String ruleName) {

   ...
            // passing additional options
            cmapLegendBuilder.setAdditionalOptions(request.getLegendOptions());

...

            // adding the colormap entries
            final ColorMapEntry[] colorMapEntries = cmap.getColorMapEntries();
            ColorMapEntryLegendBuilder lastEntry = null;
            boolean first = true;
            for (ColorMapEntry ce : colorMapEntries) {
                if(ce == null) {
                    continue;
                }
                final Double qty = ce.getQuantity().evaluate(null, Double.class);
                if(cmap.getType() == ColorMap.TYPE_INTERVALS && first && qty < 0 && Double.isInfinite(qty)) {
                    continue;
                }
                lastEntry = cmapLegendBuilder.addColorMapEntry(ce);
                first = false;
            }
            if(lastEntry != null) {
                lastEntry.setLastRow();
            }

            // check the additional options before proceeding
            cmapLegendBuilder.checkAdditionalOptions();
}

The following line creates all the necessary raster legend with configuration:

                lastEntry = cmapLegendBuilder.addColorMapEntry(ce);

However the border colour is not available until the following line is called:

            cmapLegendBuilder.checkAdditionalOptions();

This is after the colour entry objects are created hence the border colours are always black.

Add Comment

Add Comment

This message was sent by Atlassian JIRA (v1000.283.1#100011-sha1:5d4a5be)

Atlassian logo