Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

When the input is a scalar time series the average value for a certain polygon in the output will be calculated by finding the points in the input time series which are within the area of the polygon and calculate the average value of these points. When the input is a time series with a grid (regular or irregular) the transformation will determine which cells of the input time series have an overlap with the output polygon and the average value of these cells will be calculated. The average value will be a weighted average. The weight of each input cell wil be based on how much area of the input polygon input cell covers a certain part of the output polygon. This is done by the next algorithm:

  1. find smallest sub grid that contains the whole polygon
  2. quadruple the number of grid cells until the sub grid contains at least 10000 (sub) cells, this it to detect that a cell is partially inside the polygon
  3. create an image with the same number of pixels as the refined sub grid
  4. convert the polygon coordinates to grid coordinates, coordinates are floating points so not only at cell centers
  5. draw the polygon at the image in black using Java2D
  6. analyze the image pixels. The number of black pixels per grid cell determines the weight of the grid cell for calculating the polygon sum or average

The output time series can be a output time series with polygons or a irregular/regular grid. However it is expected to have a slow performance with large grids because this transformation is optimized for output time series based on polygons.

...

Optional element defining the maximum value of the input time series. If the output value is higher than the configured maximum value the output value will be equal to the configured maximum value. 

Example

Code Block
xml
xml

<interpolationSpatial>
  <average>
    <minimumValue>0</minimumValue>
    <maximumValue>20000</maximumValue>
    <inputVariable>
      <variableId>input</variableId>
    </inputVariable>
    <outputVariable>
      <variableId>output</variableId>
    </outputVariable>
  </average>
</interpolationSpatial>

...

Related items

transformationModule.xsd