eogrow.utils.map
Module with utilities for creating maps
- eogrow.utils.map.cogify_inplace(tiff_file, blocksize=2048, nodata=None, dtype=None, resampling=None, quiet=True)[source]
Make the (geotiff) file a cog
- Parameters:
tiff_file (str) – .tiff file to cogify
blocksize (int) – block size of tiled COG
nodata (float | None) – value to be treated as nodata, default value is None
dtype (Literal[None, 'int8', 'int16', 'uint8', 'uint16', 'float32']) – output type of the in the resulting tiff, default is None
resampling (Literal[None, 'NEAREST', 'MODE', 'AVERAGE', 'BILINEAR', 'CUBIC', 'CUBICSPLINE', 'LANCZOS']) – The resampling method used to produce overviews. The defaults (when using None) are CUBIC for floats and NEAREST for integers.
quiet (bool) – The process does not produce logs.
- Return type:
None
- eogrow.utils.map.cogify(input_file, output_file, blocksize=1024, nodata=None, dtype=None, overwrite=True, resampling=None, quiet=True)[source]
Create a cloud optimized version of input file
- Parameters:
input_file (str) – File to cogify
output_file (str) – Resulting cog file
blocksize (int) – block size of tiled COG
nodata (float | None) – value to be treated as nodata, default value is None
dtype (Literal[None, 'int8', 'int16', 'uint8', 'uint16', 'float32']) – output type of the in the resulting tiff, default is None
overwrite (bool) – If True overwrite the output file if it exists.
resampling (Literal[None, 'NEAREST', 'MODE', 'AVERAGE', 'BILINEAR', 'CUBIC', 'CUBICSPLINE', 'LANCZOS']) – The resampling method used to produce overviews. The defaults (when using None) are CUBIC for floats and NEAREST for integers.
quiet (bool) – The process does not produce logs.
- Return type:
None
- eogrow.utils.map.merge_tiffs(input_filenames, merged_filename, *, overwrite=True, nodata=None, dtype=None, warp_resampling=None, quiet=True)[source]
Performs gdal_merge on a set of given geotiff images
- Parameters:
input_filenames (Iterable[str]) – A sequence of input tiff image filenames
merged_filename (str) – Filename of merged tiff image
overwrite (bool) – If True overwrite the output (merged) file if it exists
delete_input – If True input images will be deleted at the end
warp_resampling (Literal[None, 'near', 'bilinear', 'cubic', 'cubicspline', 'lanczos', 'average', 'rms', 'mode', 'max', 'min', 'med', 'q1', 'q3', 'sum']) – The resampling method used when warping, useful for pixel misalignment. Defaults to NEAREST.
quiet (bool) – The process does not produce logs.
nodata (float | None) –
dtype (Literal[None, 'int8', 'int16', 'uint8', 'uint16', 'float32']) –
- Return type:
None
- eogrow.utils.map.extract_bands(input_file, output_file, bands, overwrite=True, compress=False, quiet=True)[source]
Extract bands from given input file
- Parameters:
input_file (str) – File containing all bands
output_file (str) – Resulting file with extracted bands
bands (Iterable[int]) – Sequence of bands to extract. Indexation starts at 0.
overwrite (bool) – If True overwrite the output file if it exists.
quiet (bool) – The process does not produce logs.
compress (bool) –
- Return type:
None