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:

data (str, dict or None) – the file or dictionary to get the info from; If None (default), an object with default values for an empty raster file is returned

Examples

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

write object to an ENVI header file

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

write ENVI header files

Parameters:
  • data (str or dict) – the file or dictionary to get the info from

  • filename (str) – the HDR file to write