Skip to main content
`Ctrl`+`K`

# RasterBand

Class for defining a spatial grid: structure de données un peu plus évoluée

  qu’un tableau 2x2.

class tracklib.core.RasterBand.RasterBand(bb, resolution=None, margin=0.05, novalue=-9999, name='grid', verbose=True)
  __init__(bb, resolution=None, margin=0.05, novalue=-9999, name='grid', verbose=True)

    Grid constructor. :param bbox: Bouding box :param resolution: Grid resolution :type margin: `float` :param margin: relative float. Default value is +5% :type novalue: `float` :param novalue: value that is regarded as “missing” or “not applicable”; :type verbose: `bool` :param verbose: Verbose creation

  bbox()
  setName(name)
  getName()
  setNoDataValue(noDataValue)
  getNoDataValue()
  isIn(coord)

    Return true if coord is in spatial grid, false else.

    ## Parameters

    coordUnion[ENUCoords]

      coordinate of the position to test the contain.

    ## Returns

    bool

      true if contains, false else.

  __str__()

    Return str(self).

  summary()
  bandStatistics()
  getCell(coord)

    Normalized coordinates of coord

    (x,) -> (i,j) with:

    > - i = (x-xmin)/(xmax-xmin)*nb_cols

    > - j = (y-ymin)/(ymax-ymin)*nb_rows

    Parameters

      coord (`Union`[`ENUCoords`, `ECEFCoords`, `GeoCoords`]) – Coordinates

    Return type

      `Optional`[`tuple`[`float`, `float`]]

    Returns

      Cell for give coordinates (or None if out of grid)

  plotAsGraphic(backgroundcolor='lightcyan', bordercolor='lightgray')

    Plot grid

  plotAsImage(axe=None, figure=None, color1=(0, 0, 0), color2=(255, 255, 255), novaluecolor='white')

    Plot as image