Package org.h2gis.functions.spatial.create

## Class GridRowSet

- java.lang.Object
- - org.h2gis.functions.spatial.create.GridRowSet

All Implemented Interfaces:
  `org.h2.tools.SimpleRowSource`

    public class GridRowSet
    extends Object
    implements org.h2.tools.SimpleRowSource

GridRowSet is used to populate a result set with all grid cells. A cell could be represented as a polygon or its center point.

Author:
  Erwan Bocher

### Constructor Summary

Constructors
`GridRowSet​(Connection connection, double deltaX, double deltaY, String tableName)` The grid will be computed according a table stored in the database
`GridRowSet​(Connection connection, double deltaX, double deltaY, org.locationtech.jts.geom.Geometry geometry)` The grid will be computed according the envelope of a geometry

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `close()`
`ResultSet` `getResultSet()` Give the regular grid
`boolean` `isCenterCell()` Return true is cell is represented as point, false as a polygon
`boolean` `isRowColumnNumber()` Return if the delta x and y must be expressed as number of columns and rows
`Object[]` `readRow()`
`void` `reset()`
`void` `setCenterCell​(boolean isCenterCell)` Set if the cell must be represented as a point or a polygon
`void` `setIsRowColumnNumber​(boolean isRowColumnNumber)` Set true to define the delta x and y as number of columns and rows
`void` `setUpperOrder​(boolean upperOrder)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### GridRowSet

    public GridRowSet​(Connection connection,
                      double deltaX,
                      double deltaY,
                      String tableName)

The grid will be computed according a table stored in the database

Parameters:
  `connection` - database
  `deltaX` - x size
  `deltaY` - y size
  `tableName` - table name

#### GridRowSet

    public GridRowSet​(Connection connection,
                      double deltaX,
                      double deltaY,
                      org.locationtech.jts.geom.Geometry geometry)

The grid will be computed according the envelope of a geometry

Parameters:
  `connection` - database
  `deltaX` - x size
  `deltaY` - y size
  `geometry` - `Geometry`

### Method Detail

#### readRow

    public Object[] readRow()
                     throws SQLException

Specified by:
  `readRow` in interface `org.h2.tools.SimpleRowSource`
Throws:
  `SQLException`

#### close

    public void close()

Specified by:
  `close` in interface `org.h2.tools.SimpleRowSource`

#### reset

    public void reset()
               throws SQLException

Specified by:
  `reset` in interface `org.h2.tools.SimpleRowSource`
Throws:
  `SQLException`

#### isCenterCell

    public boolean isCenterCell()

Return true is cell is represented as point, false as a polygon

Returns:
  trie if the grid is computed at center cell

#### setCenterCell

    public void setCenterCell​(boolean isCenterCell)

Set if the cell must be represented as a point or a polygon

Parameters:
  `isCenterCell` - true to compute on the center cell

#### setIsRowColumnNumber

    public void setIsRowColumnNumber​(boolean isRowColumnNumber)

Set true to define the delta x and y as number of columns and rows

Parameters:
  `isRowColumnNumber` - true if row/col number

#### isRowColumnNumber

    public boolean isRowColumnNumber()

Return if the delta x and y must be expressed as number of columns and rows

Returns:
  true is the number of row and columns are fixed

#### getResultSet

    public ResultSet getResultSet()
                           throws SQLException

Give the regular grid

Returns:
  ResultSet
Throws:
  `SQLException`

#### setUpperOrder

    public void setUpperOrder​(boolean upperOrder)