[Geoserver-devel] [JIRA] (GEOS-8346) MBStyle line-gap produces strange results

Torben Barsballe created an issue

GeoServer / BugGEOS-8346

MBStyle line-gap produces strange results

Issue Type:

BugBug

Assignee:

Unassigned

Attachments:

Screen Shot 2017-10-16 at 9.49.43 AM.png

Created:

16/Oct/17 7:05 PM

Priority:

MediumMedium

Reporter:

Torben Barsballe

The line-gap property for MBStyle produces unexpected results.

MBStyle:

"type": "line",
"paint": {
    "line-color": "#FFCC00",
    "line-width": 4,
    "line-cap": "round"
}

Generated SLD:

<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
	<sld:Stroke>
		<sld:CssParameter name="stroke-linejoin">mitre</sld:CssParameter>
		<sld:CssParameter name="stroke-width">
		<ogc:Add>
			<ogc:Literal>8</ogc:Literal>
			<ogc:Literal>4</ogc:Literal>
		</ogc:Add>
		</sld:CssParameter>
	</sld:Stroke>
	<sld:PerpendicularOffset>0</sld:PerpendicularOffset>
</sld:LineSymbolizer>
<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
	<sld:Stroke>
		<sld:CssParameter name="stroke">#FFFFFF</sld:CssParameter>
		<sld:CssParameter name="stroke-linejoin">mitre</sld:CssParameter>
		<sld:CssParameter name="stroke-width">
		<ogc:Sub>
			<ogc:Add>
				<ogc:Literal>8</ogc:Literal>
				<ogc:Literal>4</ogc:Literal>
			</ogc:Add>
			<ogc:Literal>1</ogc:Literal>
		</ogc:Sub>
		</sld:CssParameter>
	</sld:Stroke>
	<sld:PerpendicularOffset>0</sld:PerpendicularOffset>
</sld:LineSymbolizer>
<sld:LineSymbolizer uom="http://www.opengeospatial.org/se/units/pixel">
	<sld:Stroke>
		<sld:CssParameter name="stroke-linejoin">mitre</sld:CssParameter>
		<sld:CssParameter name="stroke-width">8</sld:CssParameter>
	</sld:Stroke>
	<sld:PerpendicularOffset>0</sld:PerpendicularOffset>
</sld:LineSymbolizer>

This produces: A black stroke of width 12, a white stroke of width 11, and a black stroke of width 8.

What I would expect - Either:

  • Two black strokes (width 8), one with a perpendicularOffset of -6, the other with a perpendicularOffset of 6 (6 = 1/2 (width + gap) = 8+4 / 2).
  • One black stroke of width 20, one white stroke of width 4 (only as a workaround if the former doesn’t work)

Resulting visuals attached (There is some other styling on that screenshot, only the big black line is the issue here)

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#100065-sha1:effcae0)

Atlassian logo