[GRASS5] saving metadata

Markus Neteler neteler at itc.it
Sat May 31 11:42:43 EDT 2003


On Sat, May 31, 2003 at 09:09:16PM +1200, H Bowman wrote:
> Currently several modules, such as s.surf.rst and r.mapcalc write to the
> hist meta-data file. This is good.
> 
> Unfortunatly running r.mapcalc or another processing module overwrites
> instead of appends to the hist file, destroying possibly important
> meta-data (such as s.surf.rst parameters).
> 
> 
> I understand that the hist file code may need a bit of work, and it is a
> mine-field of relevance, which hist to keep in event of a map
> merge, etc., but that might be better than just throwing all the old
> data away?
> 
> In lieu of modifying the hist library functions to allow append, a hack
> might be to read in the hist file to memory, append the new string and
> write the whole thing back?
> 
> better ideas?

Good idea! There should be a function to append text to the GRASS history
file. This function should be able to break long lines etc.

If such a function were available in GIS lib, we could use
G_recreate_command() to store cmd line paramters in the
history file (desired for r.sunmask, r.texture, ...).
Once I tried to write such function, but it is not complete,
(strings seem to be too complicated for me) :-)

Markus




More information about the grass-dev mailing list