[GRASS-dev] [GRASS GIS] #1801: r3.in.ascii fails in GRASS6.4.3
GRASS GIS
trac at osgeo.org
Sat Dec 29 21:11:43 PST 2012
#1801: r3.in.ascii fails in GRASS6.4.3
------------------------------------------+---------------------------------
Reporter: helena | Owner: grass-dev@…
Type: defect | Status: new
Priority: critical | Milestone: 6.4.3
Component: Raster3D | Version: svn-releasebranch64
Keywords: r3.in.ascii, raster3d import | Platform: MacOSX
Cpu: OSX/Intel |
------------------------------------------+---------------------------------
Comment(by helena):
I found that r3.in.ascii fails when there is nulls exported as * in the
ascii file
GRASS 6.4.3svn (nc_spm_05):~/grassdata/indata/test3d > r3.in.ascii
hatelevnull3d.asci out=test3d_importfpnull
Loading data ... (484x654x10)
ERROR: asciiToG3d: read failed
if I replace * with 0 it reads the file OK
GRASS 6.4.3svn (nc_spm_05):~/grassdata/indata/test3d > r3.in.ascii
hatelev_test3d.asci out=test3d_importfp0
Loading data ... (484x654x10)
r3.in.ascii complete.
but as mentioned above, the initialization of the parameters has bugs, for
example, if I try to define null as *
(which is the default for r3.out.ascii) I get error
GRASS 6.4.3svn (nc_spm_05):~/grassdata/indata/test3d > r3.in.ascii
hatelevnull3d.asci out=test3d_importfpnull nv=* --o
ERROR: getParams: NULL-value value invalid
(nv="*" does not help)
perhaps because it expects number instead of string in main.c ?
param.nv = G_define_option();
param.nv->key = "nv";
param.nv->type = TYPE_STRING;
param.nv->required = NO;
param.nv->multiple = NO;
param.nv->answer = "none";
param.nv->description =
_("String representing NULL value data cell (use 'none' if no such
value)");
}
/*---------------------------------------------------------------------------*/
static void
getParams(char **input, char **output, int *convertNull, double
*nullValue)
{
*input = param.input->answer;
*output = param.output->answer;
*convertNull = (strcmp(param.nv->answer, "none") != 0);
if (*convertNull)
if (sscanf(param.nv->answer, "%lf", nullValue) != 1)
fatalError("getParams: NULL-value value invalid");
G_debug(3, "getParams: input: %s, output: %s", *input, *output);
}
The default,default issue seems to be indeed in g3dparam.c -for example,
I think the answer should be float instead of default here:
param->type->answer = "default";
param->type->options = "default,double,float";
param->type->description = _("Data type used in the output file");
It is supposed to get value described in G3D Defaults, but it does not.
--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:4>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list