Dear Devin,

when I had trouble with external legend images in the styles directory (I always got NullPointerException when trying to set the image name from web UI) I figured out that I can just edit the styles XML configuration file and then reload the catalog to apply changes. Somehow, it works for me.


The XML file of your style has the same name as the SLD file, just different extension. See below for an example configuration with the legend.png file in the styles directory:


<style>
<id>StyleInfoImpl-41238c1:157e2c81df1:-2db4</id>
  <name>my_style</name>
  <format>sld</format>
  <languageVersion>
    <version>1.0.0</version>
  </languageVersion>
  <filename>my_style.sld</filename>
  <legend>
    <width>159</width>
    <height>435</height>
    <format>image/png;charset=UTF-8</format>
<onlineResource>legend.png</onlineResource>
  </legend>
</style>


Cheers,


Peter


On 22. 11. 2016 17:55, Devin Eyre wrote:

Yesterday, the windbarbs began working on the new server. The error below is actually for the legend.

I have uploaded legend graphics to the styles directory on the server, but a call to getLegendGraphic does not return them. Is there a different format other than just an image file that's needed for this to work?

------------------------------------------------------------------------
*From:* Devin Eyre
*Sent:* Monday, November 21, 2016 9:19 AM
*To:* geoserver-users@lists.sourceforge.net
*Subject:* [Geoserver-users] Windbarbs not working in geoserver 2.9.2

We had them working in version 2.9.0. We installed 2.9.2 on a new server (Ubuntu 16.04), and they haven't worked on this server. Is there a plugin that's required to make these work?

Below is the error from geoserver's log:


ERROR [geoserver.ows] -
java.lang.IllegalArgumentException: The specified mark strConcat([strConcat([windbarbs://default(], [magnitude])], [)[mph]]) was not found! at org.geotools.renderer.style.SLDStyleFactory.createMarkStyle(SLDStyleFactory.java:713) at org.geotools.renderer.style.SLDStyleFactory.createPointStyle(SLDStyleFactory.java:676) at org.geotools.renderer.style.SLDStyleFactory.createPointStyle(SLDStyleFactory.java:543) at org.geotools.renderer.style.SLDStyleFactory.createStyleInternal(SLDStyleFactory.java:378) at org.geotools.renderer.style.SLDStyleFactory.createStyle(SLDStyleFactory.java:325) at org.geoserver.wms.legendgraphic.BufferedImageLegendGraphicBuilder.buildLegendGraphic(BufferedImageLegendGraphicBuilder.java:413) at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:41) at org.geoserver.wms.legendgraphic.PNGLegendOutputFormat.produceLegendGraphic(PNGLegendOutputFormat.java:22) at org.geoserver.wms.GetLegendGraphic.run(GetLegendGraphic.java:49) at org.geoserver.wms.DefaultWebMapService.getLegendGraphic(DefaultWebMapService.java:349)
        at sun.reflect.GeneratedMethodAccessor412.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.geoserver.kml.WebMapServiceKmlInterceptor.invoke(WebMapServiceKmlInterceptor.java:34) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.geoserver.ows.util.RequestObjectLogger.invoke(RequestObjectLogger.java:55) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)



------------------------------------------------------------------------------


_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

--
Peter Kovac
IMS Programmer
MicroStep-MIS
peter.ko...@microstep-mis.com

------------------------------------------------------------------------------
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to