vec:BarnesSurface in SLD for Geoserver

290 views Asked by At

I have raindata as a point shapefile in WGS84:

Raindata

The distance between the points is 11km en the boundingbox of the data is 450*300km.

I want to visualize this data in Geoserver, not as a point but as interpolated polygons. This can be done using vec:BarnesSurface in the SLD.
More info about this at https://docs.boundlessgeo.com/suite/1.1.0/cartography/rt/barnes.html

I'm having trouble figuring out what values to use in the SLD. I can't find much documentation about this.

With my data, what is are logical values for scale, maxObservationDistance or pixelsPerCell?

This is my SLD:

<?xml version="1.0" encoding="ISO-8859-1"?>
<StyledLayerDescriptor version="1.0.0"  xsi:schemaLocation="http://www.opengis.net/sld StyledLayerDescriptor.xsd" xmlns="http://www.opengis.net/sld" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <NamedLayer>
    <Name>Barnes surface</Name>
    <UserStyle>
      <Title>Barnes Surface</Title>
      <Abstract>A style that produces a Barnes surface using a rendering transformation</Abstract>
      <FeatureTypeStyle>
   <Transformation>
     <ogc:Function name="vec:BarnesSurface">
       <ogc:Function name="parameter">
         <ogc:Literal>data</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>valueAttr</ogc:Literal>
         <ogc:Literal>rain</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>scale</ogc:Literal>
         <ogc:Literal>0.05</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>convergence</ogc:Literal>
         <ogc:Literal>0.3</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>passes</ogc:Literal>
         <ogc:Literal>2</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>minObservations</ogc:Literal>
         <ogc:Literal>1</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>maxObservationDistance</ogc:Literal>
         <ogc:Literal>0.2</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>pixelsPerCell</ogc:Literal>
         <ogc:Literal>50</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>queryBuffer</ogc:Literal>
         <ogc:Literal>0</ogc:Literal>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>outputBBOX</ogc:Literal>
         <ogc:Function name="env">
            <ogc:Literal>wms_bbox</ogc:Literal>
         </ogc:Function>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>outputWidth</ogc:Literal>
         <ogc:Function name="env">
            <ogc:Literal>wms_width</ogc:Literal>
         </ogc:Function>
       </ogc:Function>
       <ogc:Function name="parameter">
         <ogc:Literal>outputHeight</ogc:Literal>
         <ogc:Function name="env">
            <ogc:Literal>wms_height</ogc:Literal>
         </ogc:Function>
       </ogc:Function>
     </ogc:Function>
   </Transformation>
   <Rule>
     <RasterSymbolizer>
       <!-- specify geometry attribute of input to pass validation -->
       <Geometry><ogc:PropertyName>geom</ogc:PropertyName></Geometry>
       <Opacity>0.8</Opacity>
       <ColorMap type="ramp" >
         <ColorMapEntry color="#FF0000" quantity="0" label="0" opacity="0" />
         <ColorMapEntry color="#EBFBFF" quantity="0.1" label="0.1" />
         <ColorMapEntry color="#0000FF" quantity="300" label="300" />
       </ColorMap>
     </RasterSymbolizer>
    </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

This SLD does not give the expected result and also the layer preview is painfully slow.

I tried altering scale and/or maxObservationDistance but I'm not sure what would be logical values.

0

There are 0 answers