[GRASS5] Re: [GRASS-CVS] hamish: grass/src/tcltkgrass/module s.in.ascii,1.1.1.1,1.2

On Sat, Mar 01, 2003 at 05:21:01AM +0100, grass@intevation.de wrote:

Author: hamish

Update of /grassrepository/grass/src/tcltkgrass/module
In directory doto:/tmp/cvs-serv28849

Modified Files:
  s.in.ascii
Log Message:
Added d= option for number of dimensions. [bug 1564]
I didn't add the missing date= option as I don't know the correct usage.

Hamish,

it works the same as for r.timestamp. In fact a related note should
be added to
s.in.ascii.html and
s.in.dbf.html

Markus

> Update of /grassrepository/grass/src/tcltkgrass/module
> Modified Files:
> s.in.ascii
> Log Message:
> I didn't add the missing date= option as I don't know the correct
> usage.

it works the same as for r.timestamp. In fact a related note should
be added to
s.in.ascii.html and
s.in.dbf.html

Right, that makes more sense then. But before I fix them up, some questions:

The [r|v].timestamp html pages seem to need updating too, as the example
for date range:
v.timestamp map=soils date='15 sep 1987,20 feb 1988'
  doesn't work. What does seem to work is:
v.timestamp map=soils date='15 sep 1987/20 feb 1988'

Is that correct?

What's more, [r|v].timestamp will write a bad timestamp string to the file
without question; you get the error when you try to display the timestamp:
"WARNING: Invalid timestamp file for raster map ..."

I assume this is wrong; the following patch makes it right..
[This is against r.timestamp, but v.timestamp is almost the same, and
  s.in.ascii & s.in.dbf's G_scan_timestamp() calls should probably get
  the same test as well.]

Should this be applied?
Is G_fatal_error() more appropriate than exit(1)?

--- src/raster/r.timestamp/main.c.CVS 2003-03-02 15:48:12.000000000 +1300
+++ src/raster/r.timestamp/main.c 2003-03-02 16:05:30.000000000 +1300
@@ -62,8 +62,16 @@
   G_remove_raster_timestamp(name);
   exit(0);
     }
-
- G_scan_timestamp (&ts, date->answer);
- G_write_raster_timestamp(name, &ts);
- exit(0);
+
+ if(1 == G_scan_timestamp (&ts, date->answer))
+ {
+ G_write_raster_timestamp(name, &ts);
+ exit(0);
+ }
+ else
+ {
+ fprintf (stderr, "ERROR: Invalid timestamp\n");
+ exit(1);
+ }
+ return(1);
}