[GRASS5] Rasterisation problem

Hamish hamish_nospam at yahoo.com
Tue Sep 9 19:52:05 EDT 2003


> > When we displayed these 3 files (.1,.2 & .3) as RGB overlays on a
> > monitor we could only see plain white screen. What was happening was
> > the 3 RGb overlays which were being created using r.in.gdal were
> > empty.
...
> > r.colors map=$FILE_NAME.1 col=grey
> > 
> > r.colors map=$FILE_NAME.2 col=grey
> > 
> > r.colors map=$FILE_NAME.3 col=grey
> 
> Using "col=grey" will map black/white to the lowest/highest values
> which actually occur in the data, which probably isn't correct (when
> dealing with R/G/B colour channels, it definitely isn't correct).
> 
> For images which store intensity values as bytes (i.e. 0 to 255, which
> is always the case for JPEG), you should use e.g.:
> 
> 	r.colors map=$FILE_NAME.1 col=rules <<EOF
> 	0 black
> 	255 white
> 	end
> 	EOF
> 	r.colors map=$FILE_NAME.2 rast=$FILE_NAME.1
> 	r.colors map=$FILE_NAME.3 rast=$FILE_NAME.1


FYI, yesterday I added to CVS the modification that allows d.legend to
extend to the limits of a raster map's colr file, even if the map
doesn't cover that whole range. By default it only draws to the limits of
the map's actual data.

e.g.  d.legend map=$FILE_NAME.1 range=0,255


Additionally, I added the use= option which lets you use discrete
categories/values in the legend. Works for both categorical & FP maps.

e.g.  d.legend map=$FILE_NAME.1 use=0,10,30,60,100,150,210


regards,
Hamish




More information about the grass-dev mailing list