[GRASS-user] Errors applying color rules and -g flags in r.colors
Patton, Eric
epatton at nrcan.gc.ca
Thu Apr 19 11:28:38 EDT 2007
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
~ >
Am I using the flag correctly, or does it also require the use of the 'rules' parameter? r.colors -ge on the input raster also fails to produce anything on the gis.m map window. r.colors -e works nicely on its own.
I'm also getting errors applying several of the new-ish predefined color tables. I've ran a script to apply each color table in turn to the same input raster. Output pasted below (warning, it's long):
for COLOR in `r.colors -l` ; do
echo -e "\n\nApplying color rule $COLOR to input raster...\n"
r.colors map=IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT color=$COLOR
done
Applying color rule aspect to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to aspect
Applying color rule aspectcolr to input raster...
ERROR: bad rule (percentage not in range 0-100): 180 cyan
Applying color rule bcyr to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to bcyr
Applying color rule byg to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to byg
Applying color rule byr to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to byr
Applying color rule curvature to input raster...
ERROR: bad rule (percentage not in range 0-100): -0.01 blue
Applying color rule differences to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to
differences
Applying color rule elevation to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to elevation
Applying color rule etopo2 to input raster...
ERROR: bad rule (percentage not in range 0-100): -11000 0 0 0
Applying color rule evi to input raster...
ERROR: bad rule (percentage not in range 0-100): -1.0000 white
Applying color rule grey to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to grey
Applying color rule gyr to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to gyr
Applying color rule ndvi to input raster...
ERROR: bad rule (percentage not in range 0-100): -1.0000 white
Applying color rule population to input raster...
ERROR: bad rule (percentage not in range 0-100): 1000 255 218 164
Applying color rule rainbow to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to rainbow
Applying color rule ramp to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to ramp
Applying color rule ryb to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to ryb
Applying color rule ryg to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to ryg
Applying color rule slope to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to slope
Applying color rule srtm to input raster...
ERROR: bad rule (percentage not in range 0-100): -500 0 0 10
Applying color rule terrain to input raster...
ERROR: bad rule (percentage not in range 0-100): -11000 0 0 0
Applying color rule wave to input raster...
Color table for [IsaacsHarbour_HDCS_1m_grd_fill at PERMANENT] set to wave
So in sum, there are problems applying the aspectcolr, curvature, etopo2, evi, ndvi, population, srtm, and terrain color tables. It seems that r.colors will only accept a percentage color range and not a standard Grass color name or RGB value.
~ Eric.
More information about the grass-user
mailing list