sentinelhub.io_utils
Utility functions to read/write image data from/to file
- sentinelhub.io_utils.read_data(filename, data_format=None)[source]
Read image data from file
This function reads input data from file. The format of the file can be specified in
data_format
. If not specified, the format is guessed from the extension of the filename.
- sentinelhub.io_utils.write_data(filename, data, data_format=None, compress=False, add=False)[source]
Write image data to file
Function to write image data to specified file. If file format is not provided explicitly, it is guessed from the filename extension. If format is TIFF, geo information and compression can be optionally added.
- Parameters:
filename (str) – name of file to write data to
data (Any) – image data to write to file
data_format (MimeType | None) – format of output file. Default is None
compress (bool) – whether to compress data or not. Default is False
add (bool) – whether to append to existing file or not. Only supported for TXT. Default is False
- Raises:
exception if numpy format is not supported or file cannot be written
- Return type:
None