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

Question about the colors #1

Open
georgbachmann opened this issue Feb 22, 2024 · 1 comment
Open

Question about the colors #1

georgbachmann opened this issue Feb 22, 2024 · 1 comment

Comments

@georgbachmann
Copy link

I found this repo cause I am currently also trying to create RGB dem tiles and they also have some strange spikes in them.
I followed an other tutorial first where i created the RGB dem using rio rgbify but here I've seen that you simply use gdal and the color-mapping.

I wonder how that works though?!?

3590 68 1 84
8890 253 231 37

where as the formula should be

height = -10000 + ((R * 256 * 256 + G * 256 + B) * 0.1)

but if I enter your values, this does not add up? So I am wondering how your color-mapping works?
Would be awesome if you could explain that.

@jebowe3
Copy link
Owner

jebowe3 commented Feb 22, 2024

You just need to determine a range of elevations that encompasses your DEM data. In this case, all of the raster values fall between 3590 meters and 8890 meters. The color range is expressed as RGB values from rgb (68, 1, 84) at 3590 meters to rgb (253, 231, 37) at 8890 meters. Each included meter is assigned a color within this RGB range. This is simply a two-entry version of the techniques for hypsometric tinting presented on websites like Bjørn Sandvik's "Creating color relief and slope shading with gdaldem" and Robert Simmon's "A Gentle Introduction to GDAL Part 5: Shaded Relief."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants