forked from LK8000/LK8000
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[LK8000#1142] Fix Terrain Drawing for Altitude lower than 0 and great…
…er than 4095m land surface elevation range of earth are [-428m , 8848m], range of color ramp are [0, 255] currently we clip surface elevation to [0 - 4096], so all elevation bellow 0 are draw like sea (if topology doesn't include coast_area shape) and all elevation higher than 4096 are draw like invalid terrain (LCD Green). for fix this problem : 1 - calculate span of visible elevation 2 - shift elevation by min of this range ( result range is [0 - 9276] ) 3 - scale result to range [0 - 255] for speed reason, scaling is made using bit shift, ( power of 2 scaling factor). of course same algorithm are used for build color ramp.
- Loading branch information
Showing
2 changed files
with
76 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
94d7924
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure that DEM below zero is drawn as water? That was not was I made to solve the Netherland problem, the problem in Italy and Benelux, Uk etc.
See OpenCloseTopology. DEM TERRAIN can even be -500m without being water.
I did the fix long time ago, working fine.
94d7924
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes i'm sure, explained in commit comment :
94d7924
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.