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

lib: Add new SRTM_percent color table #4608

Merged
merged 9 commits into from
Nov 1, 2024
Merged

lib: Add new SRTM_percent color table #4608

merged 9 commits into from
Nov 1, 2024

Conversation

cmbarton
Copy link
Contributor

@cmbarton cmbarton commented Oct 28, 2024

This color table uses the color ramp from the srtm_plus color table for terrain to create colors for relative elevation (spread over the range of elevations in a raster map) rather than absolute elevation in meters. This applies srtm colors in a way similar to the way the elevation color table applies them. This color table is especially useful in creating nice looking elevation maps and shading relief maps.

If this seems useful, it could be backported to 8.4.x and 7.8

This color table uses the color ramp from the srtm_plus color table for terrain to create colors for relative elevation (spread over the range of elevations in a raster map) rather than absolute elevation in meters. This applies srtm colors in a way similar to the way the elevation color table applies them. This color table is especially useful in creating nice looking elevation maps and shading relief maps.
@cmbarton cmbarton added enhancement New feature or request raster Related to raster data processing labels Oct 28, 2024
@cmbarton cmbarton added this to the 8.5.0 milestone Oct 28, 2024
@neteler
Copy link
Member

neteler commented Oct 28, 2024

Would you mind to add a screenshot here? (simply pasting works)

@cmbarton
Copy link
Contributor Author

Would you mind to add a screenshot here? (simply pasting works)

Here are 2 from the new Flagstaff, AZ demo data set (NC does not have much relief). An SRTM DEM and a color-shaded relief map of the same area.

flagstaff_dem
flagstaff_relief

@cmbarton
Copy link
Contributor Author

Following up creating an image for Markus, I'd like to make a slight change in this. What is the best way to do it? Modify the PR or submit a new one?

@neteler
Copy link
Member

neteler commented Oct 28, 2024

Please modify this pull request.

A slight tweak in the color ramp to have smoother changes of color with relative elevation change. Looks good in both low relief and high relief landscapes.
@cmbarton
Copy link
Contributor Author

Please modify this pull request.

done. Added a new image too

@neteler
Copy link
Member

neteler commented Oct 28, 2024

For full integration of the new color table, it also needs to be added to https://github.com/OSGeo/grass/blob/main/lib/gis/colors.desc (otherwise it won't show up in r.colors, v.colors, etc.).

@cmbarton
Copy link
Contributor Author

cmbarton commented Oct 28, 2024 via email

@neteler
Copy link
Member

neteler commented Oct 28, 2024

OK. Thanks. Just put a 2nd copy there?

Essentially you edit the file here in your branch and commit/push it to this branch.

@cmbarton
Copy link
Contributor Author

I'll do that after class today. I guess that will make a 2nd PR

@echoix
Copy link
Member

echoix commented Oct 29, 2024

Since we normally squash-merge PRs, up until this PR is merged, you can add more commits, merge main into, do anything you'd like, and we can edit the final merge message once done

Copy link
Member

@wenzeslaus wenzeslaus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ds store modification to gitignore needs to be universal to all directories. That might the thing which is better handled in a separate PR.

@nilason
Copy link
Contributor

nilason commented Oct 29, 2024

The ds store modification to gitignore needs to be universal to all directories. That might the thing which is better handled in a separate PR.

Yes, that should go into a separate PR. Note that the pattern ".DS_Store" is enough.

It is also good to have this in the global git config:

echo .DS_Store >> ~/.gitignore
git config --global core.excludesfile ~/.gitignore

cmbarton and others added 2 commits October 29, 2024 12:42
Add strm_pct and short description to list of colors in colors.desc
lib/gis/colors.desc Outdated Show resolved Hide resolved
Copy link
Contributor

@petrasovaa petrasovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not fond of the name "srtm_pct", how about srtm_percent or srtm_relative?

@cmbarton
Copy link
Contributor Author

  1. I'm fine with shortening the description and will see about the suggested alternative. Any guidelines on how short/long?
  2. I originally had srtm_rel or srtm_relative but thought that was not clear. srtm_percent is fine. I was trying to keep it short.
  3. I don't want my .gitignore update to be in the PR. I did not intend for it to be there. So I am happy to take it out. How to do that? I'd like to set it for any future commits but don't understand how to set it for me and not have it go into grass/main. This is not a huge issue but suggestions would be welcome.
  4. Is 1 fork = 1 PR? Perhaps this is where I am confused. I was assuming that I could use my fork for >1 PR. Which is correct?
  5. What do you recommend I do at this point?
  • If there a way to delete the .gitignore part, is the new color table AND description already in the PR?
  • Or is the color.desc part still waiting to create a new PR?
  • It both parts (color table and description) is already in the PR, can I just rename the color table and modify the description locally, commit and push?
  • Do I have to do something else?

@echoix
Copy link
Member

echoix commented Oct 30, 2024

  1. Is 1 fork = 1 PR? Perhaps this is where I am confused. I was assuming that I could use my fork for >1 PR. Which is correct?

1 branch (of your fork) = 1 PR. You can continue changing the branch, and each commit pushed once the PR is opened shows up here. You can use your fork for creating multiple PRs, each in a branch.

@cmbarton
Copy link
Contributor Author

  1. Is 1 fork = 1 PR? Perhaps this is where I am confused. I was assuming that I could use my fork for >1 PR. Which is correct?

1 branch (of your fork) = 1 PR. You can continue changing the branch, and each commit pushed once the PR is opened shows up here. You can use your fork for creating multiple PRs, each in a branch.

Thanks much. This explains a lot. So I can make any updates, commit and push, and it will update the PR. Good to know.

Changed the name of the color table from srtm_pct to srtm_percent, and shortened the description of the color table in colors.desc
@cmbarton
Copy link
Contributor Author

I made the recommended changes in the PR. I am happy to remove the .gitignore commit if someone can tell me how. Can/should I just delete it in my fork/branch and commit/push?

@echoix
Copy link
Member

echoix commented Oct 30, 2024

I made the recommended changes in the PR. I am happy to remove the .gitignore commit if someone can tell me how. Can/should I just delete it in my fork/branch and commit/push?

That would do it. It's better a new commit (rather than rebase+force push) as there are already some review comments. After a force-push, it's hard to follow the comments that were made on commits that don't exist anymore in the PR.

@cmbarton
Copy link
Contributor Author

I made the recommended changes in the PR. I am happy to remove the .gitignore commit if someone can tell me how. Can/should I just delete it in my fork/branch and commit/push?

That would do it. It's better a new commit (rather than rebase+force push) as there are already some review comments. After a force-push, it's hard to follow the comments that were made on commits that don't exist anymore in the PR.

Thanks. Done.

@wenzeslaus
Copy link
Member

The goal is to remove the changes, not file file. Try git checkout upstream/main -- path/to/file. Upstream may be called differently depending on how you set up your local repo, check git remote -v.

@cmbarton
Copy link
Contributor Author

The goal is to remove the changes, not file file. Try git checkout upstream/main -- path/to/file. Upstream may be called differently depending on how you set up your local repo, check git remote -v.

I can always get this back locally. I just want this PR to go through

@wenzeslaus
Copy link
Member

The deletion is included in the PR. See the Files tab. That's why the file needs to be restored with checkout.

@petrasovaa petrasovaa changed the title Add new SRTM_pct color table lib: Add new SRTM_percent color table Oct 31, 2024
@petrasovaa
Copy link
Contributor

Also, I just modified the PR title, see the instructions:
https://github.com/OSGeo/grass/blob/main/doc/development/github_guide.md#pr-title

checked out from main
@petrasovaa petrasovaa merged commit 4385b26 into OSGeo:main Nov 1, 2024
26 checks passed
@a0x8o a0x8o mentioned this pull request Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request libraries raster Related to raster data processing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants