#2136: Create standard options for map or file base name (prefix)
-----------------------------------------+----------------------------------
Reporter: wenzeslaus | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Parser | Version: svn-releasebranch64
Keywords: base name, prefix, basename | Platform: All
Cpu: All |
-----------------------------------------+----------------------------------
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_12`, `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.
See also [http://lists.osgeo.org/pipermail/grass-
dev/2013-November/066392.html GRASS-dev i.pca doesn't have the '--o'
flag].
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2136>
GRASS GIS <http://grass.osgeo.org>