ENVI HDR file manipulation

This module offers functionality for editing ENVI header files

class spatialist.envi.HDRobject(data=None)[source]

ENVI HDR info handler

Parameters:
  • (default) (The file or dictionary to get the info from. If None)

  • an

  • returned. (object with default values for an empty raster file is)

Examples

>>> from spatialist.envi import HDRobject
>>> with HDRobject('E:/test.hdr') as hdr:
>>>     hdr.band_names = ['one', 'two']
>>>     print(hdr)
>>>     hdr.write()
filename: str | None
write(filename='same')[source]

write object to an ENVI header file

Return type:

None

spatialist.envi.hdr(data, filename)[source]

write ENVI header files

Parameters:
  • data (str | dict[str, Any] | HDRobject) – the file or dictionary to get the info from

  • filename (str) – the HDR file to write

Return type:

None