[Geoserver-devel] [JIRA] (GEOS-9359) NullPointerException at a specific resolution using VendorOption graphic-resize

Tiago Vieira created an issue

GeoServer / BugGEOS-9359

NullPointerException at a specific resolution using VendorOption graphic-resize

Issue Type:

BugBug

Affects Versions:

2.15.0

Assignee:

Unassigned

Created:

07/Oct/19 4:12 PM

Priority:

MediumMedium

Reporter:

Tiago Vieira

Using the default geoserver DATA folder, and putting a square around a label of a point it throws an error on scale 1:8k.
It only happens at 1:8k with this font-size (2). If we change the font-size it happens at another scale.

How to replicate:
On point.sld add the following rule:

<Rule>
	<TextSymbolizer uom="http://www.opengeospatial.org/se/units/metre">
		<Label>
			<ogc:PropertyName>NAME</ogc:PropertyName>
		</Label>
		<Font>
			<CssParameter name="font-size">
				<ogc:Literal>2</ogc:Literal>
			</CssParameter>
		</Font>
		<Graphic>
			<Mark>
				<WellKnownName>square</WellKnownName>
				<Stroke>
					<CssParameter name="stroke">#ff0000</CssParameter>
					<CssParameter name="stroke-width">0.5</CssParameter>
				</Stroke>
			</Mark>
		</Graphic>
		<VendorOption name="spaceAround">-1</VendorOption>
		<VendorOption name="graphic-resize">stretch</VendorOption>
		<VendorOption name="graphic-margin">1</VendorOption>
	</TextSymbolizer>
</Rule>

Open the Layer Preview of Geoserver web to test or put the URL in the browser:
http://localhost/geoserver/tiger/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=tiger%3Apoi&exceptions=application%2Fvnd.ogc.se_inimage&STYLES=point&SRS=EPSG%3A4326&WIDTH=1001&HEIGHT=501&BBOX=-74.01942026886464%2C40.70413100448132%2C-73.9979623529005%2C40.71486008438587

Got the error:

Caused by: java.lang.NullPointerException
	at org.geotools.renderer.label.LabelPainter.paintStraightLabel(LabelPainter.java:371)
	at org.geotools.renderer.label.LabelCacheImpl.paintPointLabelInternal(LabelCacheImpl.java:1457)
	at org.geotools.renderer.label.LabelCacheImpl.paintPointLabel(LabelCacheImpl.java:1299)
	at org.geotools.renderer.label.LabelCacheImpl.paintLabel(LabelCacheImpl.java:556)
	at org.geotools.renderer.label.LabelCacheImpl.paintLabels(LabelCacheImpl.java:517)
	at org.geotools.renderer.label.LabelCacheImpl.end(LabelCacheImpl.java:465)
	at org.geotools.renderer.lite.StreamingRenderer.paint(StreamingRenderer.java:940)
	at org.geoserver.wms.map.RenderedImageMapOutputFormat.produceMap(RenderedImageMapOutputFormat.java:594)
	... 129 more

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#100111-sha1:38bf748)

Atlassian logo