[GRASS-dev] RE: [GRASS-user] Errors applying color rules and -g flags in r.colors

Patton, Eric epatton at nrcan.gc.ca
Thu Apr 19 15:16:35 EDT 2007

Logarithmic scaling isn't critical for my work, so I'll just avoid the -g flag, or rescale my z-values in the case that I do need this feature. 

I've updated my cvs to include your latest fix to color_rules.c, and while I'm not receiving the error message I did before, there is still some puzzling behavior occurring.

The color tables aspectcolr, evi, ndvi, population, and slope still display an all-white raster when invoked with no flags. However, applying the -e flag to each of these color tables creates a full-color, histogram-equalized color table as requested. I'm using the same floating-point raster as I did previously. Is this expected given the types of color tables being used? I'm not familiar with what 'evi' or 'ndvi' mean and for what types of data they are best suited.

~ Eric.

-----Original Message-----
From: Glynn Clements [mailto:glynn at gclements.plus.com]
Sent: Thu 4/19/2007 4:03 PM
To: Patton, Eric
Cc: grassuser at grass.itc.it; grass-dev at grass.itc.it
Subject: RE: [GRASS-user] Errors applying color rules and -g flags in r.colors

Patton, Eric wrote:

> >> I'm having trouble getting the new r.color -g flag to do anything. Or,
> >> more correctly, maybe it's working properly, but I just can't tell if
> >> it's doing anything or not.
> >> 
> >> Running r.colors -g produces a blank display in gis.m on an ordinary raster dataset:
> >> 
> >> ~ >g.region rast=IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT
> >> ~ >
> >> ~ >r.colors -g map=IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT color=rainbow
> >> Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to rainbow
> >> ~ >
> Glynn:
> >Can you provide details of the map, specifically whether it is integer
> >or FP, and the range?
> Yes, the raster is floating point; r.info -r gives:
> r.info -r IsaacsHarbour_HDCS_1m_grd_fill
> min=-16.806999
> max=-1.215008

Ah. Logarithmic scaling doesn't work on negative values.

It wouldn't be much effort to add a check for the case where both min
and max are negative, although I'm not sure whether that should go
into the library function (G_log_colors()) or r.colors. Or even
whether it's a good idea.

In the case where the range includes zero, there's no realistic

Glynn Clements <glynn at gclements.plus.com>

More information about the grass-dev mailing list