Create standard options for map or file base name (prefix)
|Reported by:||wenzeslaus||Owned by:|
|Keywords:||base name, prefix, basename||Cc:|
A lot of modules creates several map while the input is only one name and the actual map names are combined from the name provided by user, separator and some additional information. For example:
r.mystats out=elevation_stats # produces: elevation_stats_mean elevation_stats_stddev elevation_stats_variance
Example modules are r.texture, i.pca, some import tools and probably some others. With the temporal data we can expect more and more modules outputting something like
water_level_13, ... (correction: we do not expect, it is already happening).
Name provided by user is usually referred as prefix by older modules or base name (base_name or basename) by newer modules. The other possibilities are just a name such as output and using input name as a base name for output.
I consider the last two possibilities as confusing. I don't like prefix because it is not a prefix. In my point of view we are suffixing the analyses name or state description, not prefixing the name of map to it. I prefer basename because it is what it is. Although it is longer then prefix and there is an issue with different spellings. I prefer basename over base_name because it can be used in both text and as parameter although my spell checker does not like it.
The general way would be to let user choose the separator (e.g. by not putting there any) but it is not practical. We are using now both the dot (usually older modules) and underscore (usually newer modules). My choice is the underscore because it works for both rasters and vectors and moreover, it is more practical for files.
We need to create standard options for this and use it in the modules. It will improve standardization in module interfaces, enable parser in adding overwrite flag and it will provide a general way to GUI to generate the form correctly.