Skip to content

Weighted spatial filtering

Description

The transformation allows users to select only a subset of the spatial domain for further processing. In case of gridded data, the result of the filter is again a grid (the envelope/bounding box of the input geometry is applied) with all cells outside the filter geometry set to NoData value.

In general this transformation should be applicable to models that contain spatially referenced data.

The transformation enrich the model with calculated weight for each spatial element, that can be used in next step of transformation. The raw data values are not changed stay same. The weight of an element completely within the filter geometry is 1.0, the weight of an element that is only 50% within the filter geometry is 0.5 and so on.

Combination of WeightedSpatialFilterTransformation and AggregationTransformation can be used for example to derive Dfs0 file with time series that are a result of mean area aggregated over a user defined polygon.

Example

This request to /api/conversion/upload-convert

{
  "readerName": "<reader name>",
  "writerName": "<writer name>",
    ...
  "transformations": [
    {
        type: "WeightedSpatialFilterTransformation",
        spatialFilter: {
            geometry: '<wkt of a geometry>'
        }
    }
  ]
}

will only select the sub-grid or mesh elements that are contained within the specified geometry.