Hamish wrote:
[...]
Luigi Ponti wrote:
The SVN conversion script is something I have tried to figure out for
a while: great! It always challenges me to find ways to dynamically
generate raster color maps.

I have understood that the algorithm is able to scale a 0-255 color map
to the 0-65535 range; I am not sure how it could be adapted to scale to
any range of data. Questions:

[...]

Thanks for the detailed description of your script. It keeps amazing me how many things an awk script can do in a couple of lines.

The goal would be to develop a script which would take the
data range of any raster and scale a 0-255 color rule to it.

scale 0-255 to 0-100 and add a % sign. r.colors will do the rest.

r=
g=
b=
RULE="`echo $EIGHTBIT | awk '{print $1 / 2.55}'`% $r:$g:$b"

 -> if $EIGHTBIT=255 then $RULE becomes "100% r:g:b"



Really a good tip -- will implement it right away.

Regards,

Luigi
_______________________________________________
grass-user mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-user

Reply via email to