[Geoserver-devel] [JIRA] (GEOS-10688) OGC function dateFormat will make the legen preview builder fail

Karsten D. created an issue

GeoServer / BugGEOS-10688

OGC function dateFormat will make the legen preview builder fail

Issue Type:

BugBug

Affects Versions:

2.20.4

Assignee:

Unassigned

Attachments:

image-20221003-093609.png, image-20221003-093654.png

Components:

styling

Created:

03/Oct/22 11:43 AM

Environment:

Windows Server 2019

Tomcat 9.0.62

Priority:

MediumMedium

Reporter:

Karsten D.

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

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#100207-sha1:bddf6e1)

Atlassian logo