[GRASS-dev] color tables question

Hamish hamish_b at yahoo.com
Sun Jan 16 17:23:34 EST 2011


Michael wrote:
> Is there a way when you 1) reproject or 2) georectify a map
> to bring its color table with it into the target
> location/mapset?

I was under the impression that that happened already for both
scenarios.
 
> Or do you have to manually copy the color table from the
> original mapet to the new one?

I'm pretty sure that's not needed, both from memory and from
a quick grep of the code:

grass65/raster/r.proj$ grep color *
main.c:      orows, ocols, have_colors, /* Input map has a colour table */
main.c:    have_colors = G_read_colors(inmap->answer, setname, &colr);
main.c:    if (have_colors > 0) {
main.c: G_write_colors(mapname, G_mapset(), &colr);
main.c: G_free_colors(&colr);


grass65/imagery/i.rectify$ grep color *
exec.c:     colr_ok = G_read_colors(name, mapset, &colr) > 0;
exec.c:             G_write_colors(result, G_mapset(), &colr);
exec.c:             G_free_colors(&colr);



> If the latter, perhaps a nice enhancement to r.color would be
> the ability to copy a color table from ANY other map and not
> just those in the current location.

if you like, Glynn's new r.colors.out + 'r.colors rules=' will
do that outside of the automation.



Hamish



      


More information about the grass-dev mailing list