in3Utils.geoTrans.getCellsAlongLine

getCellsAlongLine(header, lineDict, addBuffer=True)[source]

Find all raster cells crossed by the line line has to be entierly contained on the raster extend. If addBuffer is True, add neighbour cells to the result based on https://stackoverflow.com/a/35808540/15887086

Parameters
  • header (dict) – raster header

  • lineDict (dict) – line dictionary

  • addBuffer (boolean) – True to add a 1 cell buffer around the line

Returns

lineDict – line dictionary updated with the “cellsCrossed” 1D array (boolean array of 0 and 1 if the cell is crossed by the line or in its neigborhood)

Return type

dict