[Geoserver-users] BarnesSurface with elevation data

Hi,

I am using HGT data to serve raster elevation tiles. My aim is to serve
smooth over-sampled raster thanks to BarnesSurface transform.

Why BarnesSurfaces?
I've tried to set "Publishing > Interpolation Methods > Default
Interpolation Method" at layer level to bilinear or bicubic but this
parameter seams to be always ignored. So I tried to set "Raster Rendering
Options > Default Interpolation" at WMS level to bilinear or bicubic but
this generate interpolation grid artifacts as you can see:
<http://osgeo-org.1560.x6.nabble.com/file/n5067021/bicubic_artifacts.png&gt;
And this is without considering the fact that it is not an acceptable
solution for me to set interpolation method on all WMS layers to
bilinear/bicubic. (By the way if someone knows a workaround to achieve that,
please share it!)

So last chance for me to reach my goal is to use Barnes surface in order to
interpolate fixed resolution elevation data to a beautiful smooth surface.
Or if you can see another alternative, I will appreciate every suggestion.

The problem is that I can't make working my BarnesSurface transform SLD with
my layer of elevation data.
What I've done:
- Create an ImageMosaic store with some HGT files.
- Create an SLD style.
- Publish a layer from this store with this style.

I use last GeoServer 2.3.3 stable release.
The style I use (found in another post):

When I try to render my layer I get this error in GeoServer log:
geoserver.log
<http://osgeo-org.1560.x6.nabble.com/file/n5067021/geoserver.log&gt;
In short:

Am I right to set "valueAttr" to GRAY_INDEX for HGT layer? I can't figure
out my mistake, there is not so much resources about Barnes surface.

Can someone help?

Thanks,
Jule.

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/BarnesSurface-with-elevation-data-tp5067021.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Just in case, I realize that posting raw text on forum interface does not
appear in the mails sent to the mailing list so for those who don't use the
link at the bottom (View this message in context:
http://osgeo-org.1560.x6.nabble.com/BarnesSurface-with-elevation-data-tp5067021.html)
I copy my SLD style and the error brief I get in plain text:

SLD style:
<?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&quot;
  xmlns:ogc="http://www.opengis.net/ogc&quot;
  xmlns:xlink="http://www.w3.org/1999/xlink&quot;
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance&quot;&gt;
   <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="gs:BarnesSurface">
             <ogc:Function name="parameter">
               <ogc:Literal>data</ogc:Literal>
             </ogc:Function>
             <ogc:Function name="parameter">
               <ogc:Literal>valueAttr</ogc:Literal>
               <ogc:Literal>GRAY_INDEX</ogc:Literal>
             </ogc:Function>
             <ogc:Function name="parameter">
               <ogc:Literal>scale</ogc:Literal>
               <ogc:Literal>10000</ogc:Literal>
             </ogc:Function>
             <ogc:Function name="parameter">
               <ogc:Literal>convergence</ogc:Literal>
               <ogc:Literal>0.5</ogc:Literal>
             </ogc:Function>
             <ogc:Function name="parameter">
               <ogc:Literal>passes</ogc:Literal>
               <ogc:Literal>3</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>70000</ogc:Literal>
             </ogc:Function>
             <ogc:Function name="parameter">
               <ogc:Literal>pixelsPerCell</ogc:Literal>
               <ogc:Literal>10</ogc:Literal>
             </ogc:Function>
             <ogc:Function name="parameter">
               <ogc:Literal>queryBuffer</ogc:Literal>
               <ogc:Literal>100000</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>
             
             <Geometry><ogc:PropertyName>point</ogc:PropertyName></Geometry>
             <Opacity>0.8</Opacity>
             <ColorMap type="ramp" >
               <ColorMapEntry color="#FFFFFF" quantity="-990" label="nodata"
opacity="0"/>
               <ColorMapEntry color="#2E4AC9" quantity="-6" label="nodata"/>
               <ColorMapEntry color="#41A0FC" quantity="-5" label="values"
/>
               <ColorMapEntry color="#58CCFB" quantity="-4" label="values"
/>
               <ColorMapEntry color="#76F9FC" quantity="-3" label="values"
/>
               <ColorMapEntry color="#6AC597" quantity="-2" label="values"
/>
               <ColorMapEntry color="#479364" quantity="-1" label="values"
/>
               <ColorMapEntry color="#2E6000" quantity="0" label="values" />
               <ColorMapEntry color="#579102" quantity="1" label="values" />
               <ColorMapEntry color="#9AF20C" quantity="2" label="values" />
               <ColorMapEntry color="#B7F318" quantity="3" label="values" />
               <ColorMapEntry color="#DBF525" quantity="4" label="values" />
               <ColorMapEntry color="#FAF833" quantity="5" label="values" />
               <ColorMapEntry color="#F9C933" quantity="6" label="values" />
               <ColorMapEntry color="#F19C33" quantity="7" label="values" />
               <ColorMapEntry color="#ED7233" quantity="8" label="values" />
               <ColorMapEntry color="#EA3F33" quantity="9" label="values" />
               <ColorMapEntry color="#BB3026" quantity="10" label="values"
/>
             </ColorMap>
           </RasterSymbolizer>
          </Rule>
       </FeatureTypeStyle>
     </UserStyle>
   </NamedLayer>
</StyledLayerDescriptor>

The error:
2013-07-17 12:36:34,257 ERROR [geotools.rendering] - Could not convert the
value GridCoverage2D["tmp_elevation", GeneralEnvelope[(56.26541666666667,
25.940416666666668), (56.297916666666666, 25.972916666666666)],
DefaultGeographicCRS["WGS 84"]]
? RenderedSampleDimension("GRAY_INDEX":[-32768.0 ... -32768.0])
? ? Category("Absence de données":[-32768.0 ... -32768.0])
? Image=RenderedOp["GTCrop"]
into the expected type interface
org.geotools.data.simple.SimpleFeatureCollection for parameter data
java.security.InvalidParameterException: Could not convert the value
GridCoverage2D["tmp_elevation", GeneralEnvelope[(56.26541666666667,
25.940416666666668), (56.297916666666666, 25.972916666666666)],
DefaultGeographicCRS["WGS 84"]]
? RenderedSampleDimension("GRAY_INDEX":[-32768.0 ... -32768.0])
? ? Category("Absence de données":[-32768.0 ... -32768.0])
? Image=RenderedOp["GTCrop"]
into the expected type interface
org.geotools.data.simple.SimpleFeatureCollection for parameter data
  at
org.geotools.process.function.ProcessFunction.evaluateInputs(ProcessFunction.java:203)

For the others sorry for the flood...

Thanks for reading,
Jule

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/BarnesSurface-with-elevation-data-tp5067021p5067285.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

After some investigations I discover one of my mistake. Adding ImageMosaic
store with HGT files converted to GeoTIFF is handled as a raster layer and
so cannot be interpreted as a vector data for gs:BarnesSurface.

So I intend to transform my raster data with gs:RasterAsPointCollection and
chain it with gs:BarnesSurface.

Unfortunately I get one more error:
"Failed to evaluate the process function, error is: Parameter data is
missing but has min multiplicity > 0"

I can't understand error message since there is actually a data parameter in
my SLD. The only delta from my previous SLD is:
...
<ogc:Function name="gs:BarnesSurface">
  <ogc:Function name="parameter">
    <ogc:Literal>data</ogc:Literal>
      <ogc:Function name="gs:RasterAsPointCollection">
        <ogc:Function name="parameter">
          <ogc:Literal>data</ogc:Literal>
        </ogc:Function>
      </ogc:Function>
    </ogc:Function>
    <ogc:Function name="parameter">
      <ogc:Literal>valueAttr</ogc:Literal>
        <ogc:Literal>GRAY_INDEX</ogc:Literal>
      </ogc:Function>
      ...

I am not very familiar with the chaining process, someone can tell me what
am I doing wrong?

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/BarnesSurface-with-elevation-data-tp5067021p5067326.html
Sent from the GeoServer - User mailing list archive at Nabble.com.