[Geoserver-users] NullPointerException at a specific resolution using VendorOption graphic-resize

Hi,

Anyone have an alternative to fix this?

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&quot;&gt;
    <Label>
      <ogc:PropertyName>NAME</ogc:PropertyName>
    </Label>
    
      <CssParameter name="font-size">
        <ogc:Literal>2</ogc:Literal>
      </CssParameter>
    
    <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

Thank you,
Tiago Vieira

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html

That looks like a bug, can you create one at https://osgeo-org.atlassian.net/projects/GEOT/issues including the information as to how to recreate it.

Ian

···

Ian Turton

Thanks Ian

I've already open the issue at Geoserver JIRA.
(https://osgeo-org.atlassian.net/browse/GEOS-9359)
I'll open it on Geotools too, pointing linking to Geoserver.

Tiago Vieira

--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoServer-User-f3786390.html