[GRASS-dev] Raster history: why not reclass

Markus Neteler neteler at osgeo.org
Sat Sep 24 05:05:53 EDT 2011


On Sat, Sep 24, 2011 at 10:54 AM, Paolo Cavallini <cavallini at faunalia.it> wrote:
> Hi all.
> The history of rasters is one of the very nice features of grass. I
> noticed that in reclassified rasters, however, the rules are not saved,
> so the user does not have a clue of how the raster have been
> reclassified.

I agree.

> Is there any special reason for this? Any plan to implement it?

The reason will be the limited space in the history structure. The code
is essentially there:

[neteler at north r.reclass]$ grep hist *
reclass.c:    struct History hist;
reclass.c:    G_short_history(new_name, "reclass", &hist);
reclass.c:    strcpy(hist.datsrc_1, "Reclassified map based on:");
reclass.c:    sprintf(hist.datsrc_2, "  Map [%s] in mapset [%s]",
new.name, new.mapset);
reclass.c:    G_write_history(new_name, &hist);

http://grass.osgeo.org/programming6/history_8c.html#aadc6b56dba0ade914f5ed0c94600fa2a
http://grass.osgeo.org/programming6/structHistory.html
using
#define RECORD_LEN   80

http://grass.osgeo.org/programming6/dist_8i686-pc-linux-gnu_2include_2grass_2gis_8h.html#a244dc84fb432bea62b1716f74f1eb335

Not too many rules will fit in this 80 chars space.

Ideas
- improve this in GRASS 7
- store the reclass file in the metadata space in the mapset and display
  it with r.info if file present (should be backward compatible like this)

Markus


More information about the grass-dev mailing list