[Geoserver-devel] [JIRA] (GEOS-8889) IconProperties use of KML ABGR colorType

Jody Garnett created an issue

GeoServer / BugGEOS-8889

IconProperties use of KML ABGR colorType

Issue Type:

BugBug

Assignee:

Unassigned

Components:

Google Earth KML Output

Created:

13/Aug/18 7:37 PM

Priority:

MediumMedium

Reporter:

Jody Garnett

The PlacemarkStyleDecorator class contains a colorToHex function encoding in ABGR order.

The IconPropertyExtractor just evaluates a color to a string, resulting in RGB order:

            if (fill.getColor() != null && !isStatic(fill.getColor())) {
                props.put(prefix + COLOR, fill.getColor().evaluate(feature, String.class));
            }

This is both inconsistent and incorrect. Our code had been testing color encoding with shades of grey making this issue difficult to detect, changing the test case shows the incorrect order being encoded:

       Expression color = toExpression("if_then_else(equalTo(field, 1), '#8080C0', '#CC8030')");
       ...
       assertEquals(
                "0.0.0=&0.0.0.fill.color=%238080C0&0.0.0.name=&0.0.0.stroke.color=%238080C0",
                encode(s, fieldIs1));

Add Comment

Add Comment

Get Jira notifications on your phone! Download the Jira Cloud app for Android or iOS


This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100090-sha1:011120e)

Atlassian logo