DOI-USGS / DOI-USGS/ISIS3

Have ISIS select output file format based on extension

Open
#6,099 4 comments 0 reactions 1 assignee Claimed by @acpaquette View on GitHub
enhancement
Dominant language
C++
Stars
245
Forks
181
Avg merge
1d 22h
Merged PRs (30d)
15

Description

**Description**
Currently in ISIS 10.0.0, the format of output files is unrelated to the extension of the filename given. This seems to be a continuation of how ISIS has historically just added a .cub extension if the user didn't include one (including on input files, at least for qview*), but unfortunately now you need to deal with multiple formats, and it's getting confusing.

*Aside: It looks like `qview a` will still open a.cub, but unfortunately not a.tif. I do like this feature, by the way, and think it should be extended to tiffs for qview specifically.

Currently, the output type seems to be linked to the input type, probably as an extension of the previous bit-depth propagation. This is usually fine, but gets ambiguous if you mix tiff and cube inputs, as it seems to be linked specifically to the "first" input (where I think "first" is defined as the first input keyword checked in the code, and seems to at least frequently be correlated to the keyword order shown with the `-h` flag). For something like fx, this is reasonably intuitive, but for, say, ratio, it can feel arbitrary: `ratio num=a.tif den=b.cub to=c.cub` will produce a GeoTIFF file named `c.cub.tif`, while `ratio den=a.tif num=b.cub to=c.cub` will produce a cube named `c.cub`.

It's possible to force the desired format with the `+tiled`, `+bsq`, or the undocumented new `+gtiff` suffixes, but doing so every time means ISIS has gone from having extensions being optional to effectively mandating *two* extensions in order to know what your file will be named.

**Actual Suggestion**
If an output filename ends in ".cub" (case-insensitive), output a cube, whatever the inputs may have been, unless there's a `+` suffix that says to do otherwise. If the output ends in ".tif", ".tiff", or ".gtiff" (or any other tiff extensions ISIS may recognize), output a GeoTiff. Otherwise, do what you do now.

*P.S. To be clear, I'm very impressed at the new GeoTiff support, plus all the additions you've made to the cube format in order to allow going back and forth between the two formats. Apart from this output-from-mixed-inputs thing, it seems completely seamless, and it's already revolutionized some of my workflows. Thanks for all the work that must have gone into implementing it!*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.