Skip to content
Snippets Groups Projects
Commit ca9730df authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Added a utility function to mosaic rasters.

parent ce8878e1
No related branches found
No related tags found
No related merge requests found
......@@ -2451,3 +2451,18 @@ def gdb2shp(src_ds, feature=''):
# call the osgeo ogr2ogr system utility
subprocess.run('ogr2ogr -f "ESRI Shapefile" {} {} {}'.format(
src_ds, src_ds.parent, feature))
def merge_tifs(trg_ds, tifs):
"""Mosaic a set of images.
Parameters
----------
trg_ds : `str` or :py:class:`pathlib.Path`
Path to the output GeoTiff file.
tifs : `list` [`str` or :py:class:`pathlib.Path`]
List of paths to the GeoTiffs to mosaic.
"""
LOGGER.info('Creating mosaic: {}'.format(trg_ds))
gdal.Warp(str(trg_ds), [str(tif) for tif in tifs])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment