[GRASS-dev] [GRASS GIS] #1801: r3.in.ascii fails in GRASS6.4.3

#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: raster3d import | Platform: MacOSX
      Cpu: OSX/Intel |
-----------------------------+----------------------------------------------
r3.in.ascii produces the following error in GRASS6.4.3svn compiled today

GRASS 6.4.3svn (nc_spm_05):~ > r3.in.ascii JR_7408MR_2m3dtest.asci
out=testr3inasci
Loading data ... (570x594x8)
ERROR: asciiToG3d: read failed

running r3.info on the created (but broken) 3d raster shows that following
command was used:
r3.in.ascii input="JR_7408MR_2m3dtest.asci" output="testin3d" nv="no\ |
  | ne" type="default" precision="default" compression="default"
tiledim\ |
  | ension="default"

and running r3.in.ascii --help also shows that default value is the string
default
rather than a valid number. I tried to run it with some reasonable numbers
but I got

ERROR: Error getting standard parameters

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801&gt;
GRASS GIS <http://grass.osgeo.org>

#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 |
------------------------------------------+---------------------------------
Changes (by martinl):

  * keywords: raster3d import => r3.in.ascii, raster3d import

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#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 |
------------------------------------------+---------------------------------
Description changed by neteler:

Old description:

r3.in.ascii produces the following error in GRASS6.4.3svn compiled today

GRASS 6.4.3svn (nc_spm_05):~ > r3.in.ascii JR_7408MR_2m3dtest.asci
out=testr3inasci
Loading data ... (570x594x8)
ERROR: asciiToG3d: read failed

running r3.info on the created (but broken) 3d raster shows that
following command was used:
r3.in.ascii input="JR_7408MR_2m3dtest.asci" output="testin3d" nv="no\ |
| ne" type="default" precision="default" compression="default"
tiledim\ |
| ension="default"

and running r3.in.ascii --help also shows that default value is the
string default
rather than a valid number. I tried to run it with some reasonable
numbers but I got

ERROR: Error getting standard parameters

New description:

r3.in.ascii produces the following error in GRASS6.4.3svn compiled today

{{{
GRASS 6.4.3svn (nc_spm_05):~ > r3.in.ascii JR_7408MR_2m3dtest.asci
out=testr3inasci
Loading data ... (570x594x8)
ERROR: asciiToG3d: read failed

running r3.info on the created (but broken) 3d raster shows that following
command was used:
r3.in.ascii input="JR_7408MR_2m3dtest.asci" output="testin3d" nv="no\ |
  | ne" type="default" precision="default" compression="default"
tiledim\ |
  | ension="default"
}}}

and running r3.in.ascii --help also shows that default value is the string
default
rather than a valid number. I tried to run it with some reasonable numbers
but I got

ERROR: Error getting standard parameters

--

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#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 neteler):

(This also applies to GRASS 7)

The default:default looks confusing and useless to me:
{{{
              nv String representing NULL value data cell (use 'none' if
no such value)
                   default: none
            type Data type used in the output file
                   options: default,double,float
                   default: default
       precision Precision used in the output file (default, max, or 0 to
52)
                   default: default
     compression The compression method used in the output file
                   options: default,rle,none
                   default: default
   tiledimension The dimensions of the tiles used in the output file
                   default: default
}}}

Bad initialization in lib/g3d/g3dparam.c I suppose.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#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&gt;
GRASS GIS <http://grass.osgeo.org>

#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 mmetz):

Replying to [comment:4 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)

Fixed for relbr64 and devbr6 in r54862-3. Trunk was not affected. I have
also changed the default nv answer to "*", as in trunk.

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#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 mmetz):

Replying to [comment:3 neteler]:
> (This also applies to GRASS 7)
>
> The default:default looks confusing and useless to me:
{{{
              nv String representing NULL value data cell (use 'none' if
no such value)
                   default: none
            type Data type used in the output file
                   options: default,double,float
                   default: default
       precision Precision used in the output file (default, max, or 0 to
52)
                   default: default
     compression The compression method used in the output file
                   options: default,rle,none
                   default: default
   tiledimension The dimensions of the tiles used in the output file
                   default: default
}}}
>
> Bad initialization in lib/g3d/g3dparam.c I suppose.

In trunk, the defaults are read from environment variables. If the
corresponding variables are not set, internal defaults are used. With
regard to the affected options, I would suggest to remove the default
answer, i.e. have
{{{
              nv String representing NULL value data cell (use 'none' if
no such value)
                   default: none
            type Data type used in the output file
                   options: double,float
       precision Precision used in the output file (max, or 0 to 52)
     compression The compression method used in the output file
                   options: rle,none
   tiledimension The dimensions of the tiles used in the output file
}}}

If no answer is given to these options, use internal defaults. OK?

Markus M

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#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 hellik):

Replying to [ticket:1801 helena]:
> r3.in.ascii produces the following error in GRASS6.4.3svn compiled today

tested with test data mentioned here

http://lists.osgeo.org/pipermail/grass-dev/2013-February/061990.html

with the lastest osgeo4w-wingrass6.4.3svn nightly build, it works.

Helmut

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#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 hamish):

Hi,

fyi there's a 'vox' demo data here to try as another data point:
  http://grasswiki.osgeo.org/wiki/Help_with_3D#Examples

I got as far as adding iso surfaces in NVIZ, it wouldn't let me enter a
value for a New Constant and left it as 0.00000.
But that's for another bug report I guess..

Hamish

ps- I guess backwards compatibility is not an issue here, since "=default"
wouldn't have worked?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1801#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1801: r3.in.ascii fails in GRASS6.4.3
-----------------------+----------------------------------------------------
  Reporter: helena | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: critical | Milestone: 6.4.3
Component: Raster3D | Version: svn-releasebranch64
Resolution: fixed | Keywords: r3.in.ascii, raster3d import
  Platform: MacOSX | Cpu: OSX/Intel
-----------------------+----------------------------------------------------
Changes (by hamish):

  * status: new => closed
  * resolution: => fixed

Comment:

Replying to [comment:7 hellik]:
> tested with test data mentioned here
> http://lists.osgeo.org/pipermail/grass-dev/2013-February/061990.html
> with the lastest osgeo4w-wingrass6.4.3svn nightly build, it works.

ok, thanks. closing ticket.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1801#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>