Class BarnesSurfaceProcess

  • All Implemented Interfaces:

    public class BarnesSurfaceProcess
    extends Object
    implements VectorProcess
    A Process that uses a BarnesSurfaceInterpolator to compute an interpolated surface over a set of irregular data points as a GridCoverage.

    The implementation allows limiting the radius of influence of observations, in order to prevent extrapolation into unsupported areas, and to increase performance (by reducing the number of observations considered).

    To improve performance, the surface grid can be computed at a lower resolution than the requested output image. The grid is upsampled to match the required image size. Upsampling uses Bilinear Interpolation to maintain visual quality. This gives a large improvement in performance, with minimal impact on visual quality for small cell sizes (for instance, 10 pixels or less).

    To ensure that the computed surface is stable (i.e. does not display obvious edge artifacts during zooming, panning and tiling), the data query extent should be expanded to be larger than the specified output extent. This includes "nearby" points which may affect the value of the surface. The expansion distance depends on the length scale, convergence factor, and data spacing in a complex way, so must be manually determined. It does NOT depend on the output window extent. (A good heuristic is to set it to expand by at least the size of the length scale.)

    To prevent excessive CPU consumption, the process allows limiting the number of data points to process. If the limit is exceeded the output is computed consuming and using only the maximum number of points specified.


    M = mandatory, O = optional

    • data (M) - the FeatureCollection containing the point observations
    • valueAttr (M)- the feature type attribute containing the observed surface value
    • dataLimit (O)- the maximum number of input points to process
    • scale (M) - the Length Scale for the interpolation. In units of the input data CRS.
    • convergence (O) - the convergence factor for refinement. Between 0 and 1 (values below 0.4 are safest). (Default = 0.3)
    • passes (O) - the number of passes to compute. 1 or greater. (Default = 2)
    • minObservations (O) - The minimum number of observations required to support a grid cell. (Default = 2)
    • maxObservationDistance (O) - The maximum distance to an observation for it to support a grid cell. 0 means all observations are used. In units of the input data CRS. (Default = 0)
    • noDataValue (O) - The NO_DATA value to use for unsupported grid cells in the output coverage. (Default = -999)
    • pixelsPerCell (O) - The pixels-per-cell value determines the resolution of the computed grid. Larger values improve performance, but may degrade appearance. (Default = 1)
    • queryBuffer (O) - The distance to expand the query envelope by. Larger values provide a more stable surface. In units of the input data CRS. (Default = 0)
    • outputBBOX (M) - The georeferenced bounding box of the output area
    • outputWidth (M) - The width of the output raster
    • outputHeight (M) - The height of the output raster
    The output of the process is a GridCoverage2D with a single band, with cell values in the same domain as the input observation field specified by valueAttr.

    Computation of the surface takes places in the CRS of the output. If the data CRS is geodetic and the output CRS is planar, or vice-versa, the input points are transformed into the output CRS. A simple technique is used to convert the surface distance parameters scale and maxObservationDistance into the output CRS units.

    Using the process as a Rendering Transformation

    This process can be used as a RenderingTransformation, since it implements the invertQuery(... Query, GridGeometry) method.

    When used as an Rendering Transformation the process rewrites data query to expand the query BBOX. This includes "nearby" data points to make the computed surface stable under panning and zooming. To support this the queryBuffer parameter should be specified to expand the query extent appropriately.

    The output raster parameters can be determined from the request extents, using the following SLD environment variables:

    • outputBBOX - env var = wms_bbox
    • outputWidth - env var = wms_width
    • outputHeight - env var = wms_height

    Martin Davis - OpenGeo
    • Constructor Detail

      • BarnesSurfaceProcess

        public BarnesSurfaceProcess()
    • Method Detail

      • invertQuery

        public Query invertQuery​(Double argQueryBuffer,
                                 Query targetQuery,
                                 GridGeometry targetGridGeometry)
                          throws ProcessException
        Given a target query and a target grid geometry returns the query to be used to read the input data of the process involved in rendering. In this process this method is used to:
        • determine the extent & CRS of the output grid
        • expand the query envelope to ensure stable surface generation
        • modify the query hints to ensure point features are returned
        Note that in order to pass validation, all parameters named here must also appear in the parameter list of the execute method, even if they are not used there.
        argQueryBuffer - the distance by which to expand the query window
        targetQuery - the query used against the data source
        targetGridGeometry - the grid geometry of the destination image
        The transformed query