Skip to content

Add 'gdal mdim mosaic'#13208

Merged
rouault merged 2 commits intoOSGeo:masterfrom
rouault:gdal_mdim_mosaic
Oct 15, 2025
Merged

Add 'gdal mdim mosaic'#13208
rouault merged 2 commits intoOSGeo:masterfrom
rouault:gdal_mdim_mosaic

Conversation

@rouault
Copy link
Copy Markdown
Member

@rouault rouault commented Oct 13, 2025

Fixes #12953

@rouault rouault added this to the 3.12.0 milestone Oct 13, 2025
@rouault rouault added enhancement funded through GSP Work funded through the GDAL Sponsorship Program gdal_cli Anything related to the new 3.11 "gdal" CLI frontend labels Oct 13, 2025
that can be either a virtual mosaic in the :ref:`Multidimensional VRT (Virtual Dataset) <vrt_multidimensional>` format,
or in a more conventional multidimensional format such as :ref:`raster.netcdf` or :ref:`raster.zarr`.

The array to mosaic in the input datasets must:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is unclear but I am not sure how to make it better.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rephrased the whole paragraph as

To create a mosaic from an array, certain structural constraints apply to all
contributing arrays from the input datasets:

- All contributing arrays must have the same array name and path (e.g. "/measurements/pressure")
- They must have the same data type and nodata value
- They must share the same number of dimensions, in the same order, and with the same names.
- each dimension of the array must have an associated one-dimensional numeric indexing variable.

@mdsumner
Copy link
Copy Markdown
Contributor

fwiw this is working nicely on my large use-case

https://gist.github.com/mdsumner/94e6697d7896d11e19a6e0328d1f6ead

Copy link
Copy Markdown
Member

@dbaston dbaston left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recently needed to use the CDO collgrind command to mosaic spatially tiled netCDFs with multiple variables (lon/lat/elevation, lon/lat/ice_thickness, etc). Could mdim mosaic create a new mdim dataset with all of the variables, instead of a single one?

@rouault
Copy link
Copy Markdown
Member Author

rouault commented Oct 14, 2025

Could mdim mosaic create a new mdim dataset with all of the variables, instead of a single one?

could indeed make sense to be able to specify one or several variable paths, and by default try all of them (with care regarding to avoid duplicating coordintate variables). Unlikely to be addressed in time for 3.12, so ticketed as #13218

@rouault rouault merged commit 767e0c5 into OSGeo:master Oct 15, 2025
37 of 38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement funded through GSP Work funded through the GDAL Sponsorship Program gdal_cli Anything related to the new 3.11 "gdal" CLI frontend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

mdim concat (feature wish)

4 participants