kealib.extrat
Module that contains helpers for accessing kealib features not available from GDAL
IsFakeGDAL() -> bool
getNeighbours(dataset: object, band: int, startfid: int, length: int) -> object
Return all the neighbours for the given dataset and band from startfid returing length features. Returned value is an awkward array
setNeighbours(dataset: object, band: int, startfid: int, neighbours: object) -> None
Set the neighbours for the given dataset band from startfid. neighbours should be an awkward array
addField(dataset: object, band: int, name: str, type: kealib::KEAFieldDataType, initval: object, usage: str) -> None
Add a column for the given dataset band. GDAL doesn't support creation of boolean columns, but presents boolean columns as integers and allows you to read and write them converting to/from integers. You will have to re-open the dataset with GDAL to see the new column.
getNumFields(dataset: object, band: int) -> int
Get the total number of fields
getFieldByName(dataset: object, band: int, name: str) -> object
Return the named field
getFieldByIdx(dataset: object, band: int, idx: int) -> object
Return the named index
getSize(dataset: object, band: int) -> int
Get the size of the RAT
addRows(dataset: object, band: int, nrows: int) -> None
Add rows to the RAT
getField(dataset: object, band: int, field: kealib::KEAATTField, startfid: int, len: int) -> object
Read rows of a column
setField(dataset: object, band: int, field: kealib::KEAATTField, startfid: int, data: object) -> None
Write rows of a column
getSpatialInfo(dataset: object) -> object
Get the KEAImageSpatialInfo object for the image
getImageBandDataType(dataset: object, band: int) -> kealib::KEADataType
Get the datatype of the band
getNumOfImageBands(dataset: object) -> int
getNoDataValue(dataset: object, band: int) -> float
getImageBlock(dataset: object, band: int, col: int, row: int, xsize: int, ysize: int) -> object
Get a block of data from the band
__init__(args, *kwargs) Overloaded function.
- __init__(self: NeighbourAccumulator, hist: numpy.ndarray, dataset: object, band: int) -> None
Construct a NeighbourAccumulator to find all the neighbours of pixels of arrays passed to addArray(). hist should be a histogram of the imagery data. The neighbours are written to the RAT of the given band of the dataset.
- __init__(self: NeighbourAccumulator, hist: numpy.ndarray, dataset: object, band: int, fourConnected: bool) -> None
Like the other constructor, but fourConnected controls whether there are 4 or 8 neighbours for a pixel.
addArray(self: NeighbourAccumulator, array: numpy.ndarray) -> None
Process a 2D array (from an image) adding all neighbours found. Very important: a one pixel overlap should be given between multiple tiles. Around the outside of the image, the ignore value should be used to fill in.
Members:
NA
Bool
Int
Float
String
Members:
undefined
t8int
t16int
t32int
t64int
t8uint
t16uint
t32uint
t64uint
t32float
t64float
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
- add_note
- args