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 projection in area plots #1170

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Conversation

JustinElms
Copy link
Contributor

@JustinElms JustinElms commented Nov 7, 2024

Background

We were notified of an issue that prevented area plots below -30 degrees latitude. After some digging I found that the Lambert Conformal projection used in the area plotter for areas within (-85, 85) deg latitude does not extend beyond this range. Switching to the Mercator projection allows all plots within this range. While testing I also found that the area boundary is not properly calculated for polar plots outside of this range, especially when the area intersected the north/south pole. To resolve this I opted to re-calculate the bounds and centroid in the plots own CRS to ensure that the plot was centered on the polygon.

Why did you take this approach?

Adopting the Mercator projection allows us to use the majority of the globe for standard plots.

Screenshot(s)

Comparisons of plots before/after changes:

image
image

image
image

image

Checks

  • I ran unit tests.
  • I've tested the relevant changes from a user POV.
  • I've formatted my Python code using black ..

Hint To run all python unit tests run the following command from the root repository directory:

bash run_python_tests.sh

@JustinElms JustinElms added Bugfix A fix for something broken. Python Priority: High Requiring immediate attention. High impact on users. labels Nov 7, 2024
@JustinElms JustinElms self-assigned this Nov 7, 2024
@JustinElms JustinElms merged commit f42b55a into master Nov 8, 2024
9 checks passed
@JustinElms JustinElms deleted the fix-proj-issue-in-area-plots branch November 8, 2024 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix A fix for something broken. Priority: High Requiring immediate attention. High impact on users. Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant