[Geoserver-devel] [JIRA] (GEOS-8885) YSLD styling breaks Google Earth KML Output formats

Jody Garnett created an issue

GeoServer / BugGEOS-8885

YSLD styling breaks Google Earth KML Output formats

Issue Type:

BugBug

Affects Versions:

2.12.4

Assignee:

Unassigned

Components:

Google Earth KML Output, YSLD

Created:

10/Aug/18 7:39 PM

Priority:

MediumMedium

Reporter:

Jody Garnett

YSLD creates styling object with only the user supplied values. Here is an example where fill-color is provided:

title: color-green
symbolizers:
 - line:
    stroke-width: 2.0
    stroke-color: '#008000'
- text:
    label: ${LineNumber}
    font-size: 8
    font-family: Arial Black
    font-style: normal
    fill-color: Black

The KML Output formats were designed and tested with SLD 1.0 in mind (and assume the parser will fill in default values for anything not supplied by the user).

As an example PlacemarkStyleDecorator assumes fill opacity is always defined:

            if (fill != null) {
                Double opacity = fill.getOpacity().evaluate(feature, Double.class);
                if (opacity == null || Double.isNaN(opacity)) {
                    opacity = 1.0;
                }
                Color color = fill.getColor().evaluate(feature, Color.class);
                ls.setColor(colorToHex(color, opacity));
            } else {
                ls.setColor("ffffffff");
            }

This code fails with a style produced by YSLD:

Caused by: java.lang.NullPointerException
	at org.geoserver.kml.decorator.PlacemarkStyleDecoratorFactory$PlacemarkStyleDecorator.setLabelStyle(PlacemarkStyleDecoratorFactory.java:290)
	at org.geoserver.kml.decorator.PlacemarkStyleDecoratorFactory$PlacemarkStyleDecorator.decorate(PlacemarkStyleDecoratorFactory.java:115)
	at org.geoserver.kml.sequence.FeatureSequenceFactory$FeatureGenerator.next(FeatureSequenceFactory.java:137)

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:88b65a0)

Atlassian logo