Skip to content
ebiiii edited this page Oct 27, 2014 · 1 revision

Grid Model

This processing class builds a grid from a model attached to a modelling virtual sensor. It has the following parameters:

  • model_VS this is the name of the modelling virtual sensor that contains the model.
  • model_index this is the index of the model in the modelling virtual sensor (not mandatory, default is 0).
  • field this is the name of the field to use for building the grid. It can be a double, an integer or a boolean and it is converted to double in the grid.
  • grid_size the number of cells of a side of the square grid
  • cell_size the size of a square cell in meter
  • x_bottomLeft the bottom-left corner longitude coordinate in degree
  • y_bottomLeft the bottom-left corner latitude coordinate in degree

As the virtual sensor will query the model for each cell of the grid, it may be slow to generate the grid. Also, if the grid is too large (geographically) some distortion may appear.

Sample code:

<virtual-sensor name="gridmodel_example" priority="10">
    <processing-class>
        <class-name>gsn.vsensor.GridModelVS</class-name>
        <init-params>
            <param name="model_VS">myModellingVS</param> 
            <param name="model_index">0</param>
            <param name="field">value</param>
            <param name="x_bottomLeft">8.51</param>
            <param name="y_bottomLeft">47.35</param>
            <param name="grid_size">400</param>
            <param name="cell_size">15</param>
        </init-params>
        <output-structure>
            <field name="ncols" type="int"/>
            <field name="nrows" type="int"/>
            <field name="xllcorner" type="double"/>
            <field name="yllcorner" type="double"/>
            <field name="cellsize" type="double"/>
            <field name="nodata_value" type="double"/>
            <field name="grid" type="binary"/>
        </output-structure>
    </processing-class>
        ...
Clone this wiki locally