kealib.extrat

Module that contains helpers for accessing kealib features not available from GDAL

def IsFakeGDAL(unknown):

IsFakeGDAL() -> bool

def getNeighbours(unknown):

getNeighbours(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, startfid: typing.SupportsInt | typing.SupportsIndex, length: typing.SupportsInt | typing.SupportsIndex) -> object

Return all the neighbours for the given dataset and band from startfid returing length features. Returned value is an awkward array

def setNeighbours(unknown):

setNeighbours(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, startfid: typing.SupportsInt | typing.SupportsIndex, neighbours: object) -> None

Set the neighbours for the given dataset band from startfid. neighbours should be an awkward array

def addField(unknown):

addField(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, 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.

def getNumFields(unknown):

getNumFields(dataset: object, band: typing.SupportsInt | typing.SupportsIndex) -> int

Get the total number of fields

def getFieldByName(unknown):

getFieldByName(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, name: str) -> object

Return the named field

def getFieldByIdx(unknown):

getFieldByIdx(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, idx: typing.SupportsInt | typing.SupportsIndex) -> object

Return the named index

def getSize(unknown):

getSize(dataset: object, band: typing.SupportsInt | typing.SupportsIndex) -> int

Get the size of the RAT

def addRows(unknown):

addRows(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, nrows: typing.SupportsInt | typing.SupportsIndex) -> None

Add rows to the RAT

def getField(unknown):

getField(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, field: kealib::KEAATTField, startfid: typing.SupportsInt | typing.SupportsIndex, len: typing.SupportsInt | typing.SupportsIndex) -> object

Read rows of a column

def setField(unknown):

setField(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, field: kealib::KEAATTField, startfid: typing.SupportsInt | typing.SupportsIndex, data: object) -> None

Write rows of a column

def getSpatialInfo(unknown):

getSpatialInfo(dataset: object) -> object

Get the KEAImageSpatialInfo object for the image

def getImageBandDataType(unknown):

getImageBandDataType(dataset: object, band: typing.SupportsInt | typing.SupportsIndex) -> kealib::KEADataType

Get the datatype of the band

def getNumOfImageBands(unknown):

getNumOfImageBands(dataset: object) -> int

def getNoDataValue(unknown):

getNoDataValue(dataset: object, band: typing.SupportsInt | typing.SupportsIndex) -> float

def getImageBlock(unknown):

getImageBlock(dataset: object, band: typing.SupportsInt | typing.SupportsIndex, col: typing.SupportsInt | typing.SupportsIndex, row: typing.SupportsInt | typing.SupportsIndex, xsize: typing.SupportsInt | typing.SupportsIndex, ysize: typing.SupportsInt | typing.SupportsIndex) -> object

Get a block of data from the band

class NeighbourAccumulator(pybind11_builtins.pybind11_object):
NeighbourAccumulator()

__init__(*args, **kwargs) Overloaded function.

  1. __init__(self: kealib.extrat.NeighbourAccumulator, hist: numpy.ndarray, dataset: object, band: typing.SupportsInt | typing.SupportsIndex) -> 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.

  1. __init__(self: kealib.extrat.NeighbourAccumulator, hist: numpy.ndarray, dataset: object, band: typing.SupportsInt | typing.SupportsIndex, fourConnected: bool) -> None

Like the other constructor, but fourConnected controls whether there are 4 or 8 neighbours for a pixel.

def addArray(unknown):

addArray(self: kealib.extrat.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.

class KEAATTField(pybind11_builtins.pybind11_object):
KEAATTField()

__init__(self: kealib.extrat.KEAATTField) -> None

name
dataType

(self: kealib.extrat.KEAATTField) -> kealib::KEAFieldDataType

idx
usage
colNum
class KEAFieldDataType(pybind11_builtins.pybind11_object):

Members:

NA

Bool

Int

Float

String

KEAFieldDataType()

__init__(self: kealib.extrat.KEAFieldDataType, value: typing.SupportsInt | typing.SupportsIndex) -> None

name

name(self: object, /) -> str

value
Bool = <KEAFieldDataType.Bool: 1>
Float = <KEAFieldDataType.Float: 3>
String = <KEAFieldDataType.String: 4>
Bool = <KEAFieldDataType.Bool: 1>
Float = <KEAFieldDataType.Float: 3>
String = <KEAFieldDataType.String: 4>
class KEADataType(pybind11_builtins.pybind11_object):

Members:

undefined

t8int

t16int

t32int

t64int

t8uint

t16uint

t32uint

t64uint

t32float

t64float

KEADataType()

__init__(self: kealib.extrat.KEADataType, value: typing.SupportsInt | typing.SupportsIndex) -> None

name

name(self: object, /) -> str

value
undefined = <KEADataType.undefined: 0>
t8int = <KEADataType.t8int: 1>
t16int = <KEADataType.t16int: 2>
t32int = <KEADataType.t32int: 3>
t64int = <KEADataType.t64int: 4>
t8uint = <KEADataType.t8uint: 5>
t16uint = <KEADataType.t16uint: 6>
t32uint = <KEADataType.t32uint: 7>
t64uint = <KEADataType.t64uint: 8>
t32float = <KEADataType.t32float: 9>
t64float = <KEADataType.t64float: 10>
undefined = <KEADataType.undefined: 0>
t8int = <KEADataType.t8int: 1>
t16int = <KEADataType.t16int: 2>
t32int = <KEADataType.t32int: 3>
t64int = <KEADataType.t64int: 4>
t8uint = <KEADataType.t8uint: 5>
t16uint = <KEADataType.t16uint: 6>
t32uint = <KEADataType.t32uint: 7>
t64uint = <KEADataType.t64uint: 8>
t32float = <KEADataType.t32float: 9>
t64float = <KEADataType.t64float: 10>
class KEAImageSpatialInfo(pybind11_builtins.pybind11_object):
KEAImageSpatialInfo()

__init__(self: kealib.extrat.KEAImageSpatialInfo) -> None

wktString
tlX
tlY
xRes
yRes
xRot
yRot
xSize
ySize
class KeaLibException(builtins.Exception):

Common base class for all non-exit exceptions.