[GRASS-SVN] r71682 - in grass-addons/grass7/raster: r.hants r.series.lwr
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Nov 12 03:42:02 PST 2017
Author: mmetz
Date: 2017-11-12 03:42:02 -0800 (Sun, 12 Nov 2017)
New Revision: 71682
Modified:
grass-addons/grass7/raster/r.hants/main.c
grass-addons/grass7/raster/r.series.lwr/main.c
Log:
r.hants - r.series.lwr: use unqualifyied input names when constructing output names
Modified: grass-addons/grass7/raster/r.hants/main.c
===================================================================
--- grass-addons/grass7/raster/r.hants/main.c 2017-11-12 11:02:39 UTC (rev 71681)
+++ grass-addons/grass7/raster/r.hants/main.c 2017-11-12 11:42:02 UTC (rev 71682)
@@ -26,8 +26,6 @@
#include <grass/glocale.h>
#include <grass/gmath.h>
-/* TODO: add option for amplitude and phase output */
-
struct input
{
const char *name;
@@ -393,10 +391,15 @@
for (i = 0; i < num_outputs; i++) {
struct output *out = &outputs[i];
+ char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
+ const char *uname;
char output_name[GNAME_MAX];
-
- sprintf(output_name, "%s%s", inputs[i].name, suffix);
+ uname = inputs[i].name;
+ if (G_name_is_fully_qualified(inputs[i].name, xname, xmapset))
+ uname = xname;
+ sprintf(output_name, "%s%s", uname, suffix);
+
out->name = G_store(output_name);
out->buf = Rast_allocate_d_buf();
out->fd = Rast_open_new(output_name, DCELL_TYPE);
Modified: grass-addons/grass7/raster/r.series.lwr/main.c
===================================================================
--- grass-addons/grass7/raster/r.series.lwr/main.c 2017-11-12 11:02:39 UTC (rev 71681)
+++ grass-addons/grass7/raster/r.series.lwr/main.c 2017-11-12 11:42:02 UTC (rev 71682)
@@ -515,10 +515,15 @@
for (i = 0; i < num_outputs; i++) {
struct output *out = &outputs[i];
+ char xname[GNAME_MAX], xmapset[GMAPSET_MAX];
+ const char *uname;
char output_name[GNAME_MAX];
-
- sprintf(output_name, "%s%s", inputs[i].name, suffix);
+ uname = inputs[i].name;
+ if (G_name_is_fully_qualified(inputs[i].name, xname, xmapset))
+ uname = xname;
+ sprintf(output_name, "%s%s", uname, suffix);
+
out->name = G_store(output_name);
out->buf = Rast_allocate_d_buf();
out->fd = Rast_open_new(output_name, DCELL_TYPE);
More information about the grass-commit
mailing list