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

Fix for raster resolution #5412

Merged
merged 6 commits into from
Oct 2, 2023
Merged

Conversation

teunbrand
Copy link
Collaborator

@teunbrand teunbrand commented Sep 8, 2023

This PR aims to fix #2516 and fix #5411.

Briefly, it adds a small tolerance to resolution() to prevent tiny resolutions, and hence enormous values, due to rounding errors. The tolerance's value is the same as in all.equal().
In addition, it computes the cell positions before coord transformation to prevent some rounding errors in the first place. This doesn't affect the computation as non-linear coordinates aren't compatible with geom_raster().

@thomasp85 thomasp85 self-requested a review September 12, 2023 09:17
Copy link
Member

@thomasp85 thomasp85 left a comment

Choose a reason for hiding this comment

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

LGTM

@teunbrand teunbrand merged commit fd35a9e into tidyverse:main Oct 2, 2023
11 of 12 checks passed
@teunbrand teunbrand deleted the raster_resolution branch October 2, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants