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

Glynn Clements glynn at gclements.plus.com
Thu Apr 19 15:03:47 EDT 2007


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
solution.

-- 
Glynn Clements <glynn at gclements.plus.com>




More information about the grass-user mailing list