We are experiencing that the ogc function dateFormat is making the legend builder fail, there is no problem if we do not use this function, but then we of cause do not get a formattet date out.
In our case is it in a TextSymbolizer label (See example below), we are getting the following message when we want to preview the legend:
The validation is reporting that all is good:
We ale get a lot of noice in our log because of the problem:
2022-10-03 11:39:23,943 WARN [web.data] - Failed to build legend preview
java.lang.NullPointerException
This is an example of the style:
<?xml version="1.0" encoding="Windows-1252"?>
<StyledLayerDescriptor xmlns:xlink="http://www.w3.org/1999/xlink" version="1.0.0" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc">
<NamedLayer>
<Name>Test</Name>
<UserStyle>
<Title>PlotGraphics</Title>
<FeatureTypeStyle>
<Title>text</Title>
<Rule>
<Title>Example</Title>
<MaxScaleDenominator>6001</MaxScaleDenominator>
<TextSymbolizer>
<Label>
<ogc:Function name="dateFormat">
<ogc:Literal>dd.MM.yyyy</ogc:Literal>
<ogc:PropertyName>DateProperty</ogc:PropertyName>
</ogc:Function>
</Label>
<Font>
<CssParameter name="font-family">Verdana</CssParameter>
<CssParameter name="font-size">11.25</CssParameter>
<CssParameter name="font-style">bold</CssParameter>
</Font>
<LabelPlacement>
<PointPlacement>
<AnchorPoint>
<AnchorPointX>0</AnchorPointX>
<AnchorPointY>1</AnchorPointY>
</AnchorPoint>
<Displacement>
<DisplacementX>8</DisplacementX>
<DisplacementY>-8</DisplacementY>
</Displacement>
</PointPlacement>
</LabelPlacement>
<Halo>
<Radius>1</Radius>
<Fill>
<CssParameter name="fill">#ffffff</CssParameter>
<CssParameter name="fill-opacity">1</CssParameter>
</Fill>
</Halo>
<Fill>
<CssParameter name="fill">#000000</CssParameter>
</Fill>
<VendorOption name="autoWrap">100</VendorOption>
<VendorOption name="spaceAround">-100</VendorOption>
</TextSymbolizer>
</Rule>
</FeatureTypeStyle>
</UserStyle>
</NamedLayer>
</StyledLayerDescriptor>
Best regards
Karsten
|