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)[source]#
__init__(bb, resolution=None, margin=0.05, novalue=-9999, name='grid', verbose=True)[source]#

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()[source]#
setName(name)[source]#
getName()[source]#
setNoDataValue(noDataValue)[source]#
getNoDataValue()[source]#
isIn(coord)[source]#

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__()[source]#

Return str(self).

summary()[source]#
bandStatistics()[source]#
getCell(coord)[source]#

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')[source]#

Plot grid

plotAsImage(axe=None, figure=None, color1=(0, 0, 0), color2=(255, 255, 255), novaluecolor='white')[source]#

Plot as image