Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MRF: Allow open of MRF-in-TAR as MRF #10331

Merged
merged 8 commits into from
Jun 30, 2024
Merged

Conversation

lucianpls
Copy link
Contributor

What does this PR do?

Allow the use of a tar file containing a single MRF directly as an MRF.

It has always been possible to open an MRF (as any other gdal format) inside a tar file by using a vsitar path.
This change allows a tar file that starts with the MRF metadata file to be directly recognized and opened for reading without having to use the vsitar path. This makes an MRF inside a TAR file act as a single file raster format, making it easier to share. All the MRF files have to be inside the tar, with the main metadata (.mrf) being the first.

The identification of such an MRF-in-TAR candidate is done by directly inspecting the tar header and the beginning of the first file inside the tar, without invoking using /vsitar.

This change does not interfere with the use of any other file inside the tar using the normal /vsitar path. The only difference is that gdalinfo on such a mrf-in-tar file will return the MRF information, as opposed to listing the tar content as it does now.

The last file extension has to be .tar to be correctly opened by vsitar internally, the recommended file name for an MRF-in-TAR will be filename.mrf.tar

Copy link
Member

@rouault rouault left a comment

Choose a reason for hiding this comment

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

test ?

autotest/gdrivers/mrf.py Outdated Show resolved Hide resolved
@rouault rouault added this to the 3.10.0 milestone Jun 30, 2024
@rouault rouault merged commit 6445593 into OSGeo:master Jun 30, 2024
35 checks passed
@lucianpls lucianpls deleted the MRF_insidetar branch September 12, 2024 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants