[Geoserver-devel] [JIRA] (GEOS-8760) rule based sld error while publishing geopacakge

Sebastián Vázquez Cascales created an issue

GeoServer / BugGEOS-8760

rule based sld error while publishing geopacakge

Issue Type:

BugBug

Affects Versions:

2.13.0

Assignee:

Unassigned

Components:

geopackage, styling

Created:

25/May/18 4:19 PM

Environment:

Geoserver 2.13.0 deployed on Tomcat 9.0.7 + JRE 8u172. Windows server 2016

Priority:

MediumMedium

Reporter:

Sebastián Vázquez Cascales

Hi all,

When publishing a layer from geopackage, and the SLD contains a rule, then it may raise an exception while rendering. This happens randomly. I’ve found this behaviour with line and polygon layers so far.

The same sld works perfectly when publishing the equivalent table from other datasources, such as sql server.

Sample rule:

<ogc:PropertyIsEqualTo>
<ogc:PropertyName>DESCRIPTIO</ogc:PropertyName>
<ogc:Literal>UNDIFFERENTIATED FAULT</ogc:Literal>
</ogc:PropertyIsEqualTo>

Exception raised:

2018-05-24 16:19:42,773 TRACE [org.geotools.util] - Error applying the converter class org.geotools.util.GeometryConverterFactory$1 on (UNDIFFERENTIATED FAULT,class com.vividsolutions.jts.geom.MultiLineString)
com.vividsolutions.jts.io.ParseException: Unknown geometry type: UNDIFFERENTIATED
at org.geotools.geometry.jts.WKTReader2.readGeometryTaggedText(WKTReader2.java:422)
at org.geotools.geometry.jts.WKTReader2.read(WKTReader2.java:151)
at org.geotools.geometry.jts.WKTReader2.read(WKTReader2.java:120)
at org.geotools.util.GeometryConverterFactory$1.convert(GeometryConverterFactory.java:56)
at org.geotools.util.Converters.convert(Converters.java:168)
at org.geotools.util.Converters.convert(Converters.java:129)
at org.geotools.feature.FeatureBuilder.convert(FeatureBuilder.java:65)

Looking at the code:

private Geometry readGeometryTaggedText() throws IOException, ParseException {
String type = null;

try{ type = getNextWord(); }catch(IOException e){ return null; }catch(ParseException e){ return null; }

if (type.equalsIgnoreCase(“POINT”)) { return readPointText(); }
else if (type.equalsIgnoreCase(“LINESTRING”)) { return readLineStringText(); }
else if (type.equalsIgnoreCase(“LINEARRING”)) { return readLinearRingText(); }
else if (type.equalsIgnoreCase(“POLYGON”)) { return readPolygonText(); }
else if (type.equalsIgnoreCase(“MULTIPOINT”)) { return readMultiPointText(); }
else if (type.equalsIgnoreCase(“MULTILINESTRING”)) { return readMultiLineStringText(); }
else if (type.equalsIgnoreCase(“MULTIPOLYGON”)) { return readMultiPolygonText(); }
else if (type.equalsIgnoreCase(“GEOMETRYCOLLECTION”)) { return readGeometryCollectionText(); }
throw new ParseException("Unknown geometry type: " + type);
}

In conclusion, it seems that somehow the function is being given the data value related to the rule instead the geometry type.

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#100086-sha1:7fad139)

Atlassian logo