hydromt.merge.merge#
- hydromt.merge.merge(data_arrays, dst_crs=None, dst_bounds=None, dst_res=None, align=True, mask=None, merge_method='first', **kwargs)[source]#
Merge multiple tiles to a single DataArray, if mismatching grid CRS or resolution, tiles are reprojected to match the output DataArray grid. If no destination grid is defined it is based on the first DataArray in the list.
Based on
rasterio.merge.merge()
.- Parameters:
data_arrays (list of xarray.DataArray) – Tiles to merge
dst_crs (pyproj.CRS, int) – CRS (or EPSG code) of destination grid
dst_bounds (list of float) – Bounding box [xmin, ymin, xmax, ymax] of destination grid
dst_res (float) – Resolution of destination grid
align (bool, optional) – If True, align grid with dst_res
mask (geopands.GeoDataFrame, optional) – Mask of destination area of interest. Used to determine dst_crs, dst_bounds and dst_res if missing.
merge_method ({'first','last','min','max','new'}, callable) –
Merge method:
first: reverse painting
last: paint valid new on top of existing
min: pixel-wise min of existing and new
max: pixel-wise max of existing and new
new: assert no pixel overlap
**kwargs – Key-word arguments passed to
reproject()
- Returns:
da_out – Merged tiles.
- Return type: