Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

r.colors: add offset and scale #954

Merged
merged 1 commit into from
Sep 9, 2020
Merged

r.colors: add offset and scale #954

merged 1 commit into from
Sep 9, 2020

Conversation

metzm
Copy link
Contributor

@metzm metzm commented Sep 1, 2020

adding offset and scale enables r.colors to add e.g. the celsius rules to a raster map with units = Kelvin * 50

adding offset and scale enables r.colors to add e.g. the celsius rules to a map with units = Kelvin * 50
@metzm metzm added the enhancement New feature or request label Sep 1, 2020
@metzm metzm added this to the 8.0.0/7.10 milestone Sep 1, 2020
@metzm metzm requested a review from neteler September 1, 2020 20:10
@neteler
Copy link
Member

neteler commented Sep 7, 2020

Works nicely (I only tested the scale parameter):

# North Carolina sample dataset
g.region raster=lsat7_2002_40
RED=lsat7_2002_30
NIR=lsat7_2002_40

# scale NDVI with 100 and store as integer (CELL)
r.mapcalc "lsat7_2002_ndvi_int = round((float($NIR - $RED) / ($NIR + $RED) * 1.0) * 100)"

r.info -r lsat7_2002_ndvi_int
# apply NDVI color table, scaled:
r.colors lsat7_2002_ndvi_int color=ndvi scale=100

d.mon wx0
d.rast lsat7_2002_ndvi_int

image

@metzm metzm merged commit 9bbd20d into OSGeo:master Sep 9, 2020
@metzm metzm deleted the r_colors branch September 9, 2020 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants