Skip to content

Fixing Albers projection bounds checking for southern hemisphere CRS's. #337

Merged
juliohm merged 2 commits intoJuliaEarth:mainfrom
souma4:main
Jan 2, 2026
Merged

Fixing Albers projection bounds checking for southern hemisphere CRS's. #337
juliohm merged 2 commits intoJuliaEarth:mainfrom
souma4:main

Conversation

@souma4
Copy link
Copy Markdown
Member

@souma4 souma4 commented Jan 1, 2026

Updated albers.jl based on #336 renamed ambers to albers. refactored _albersρ to first compute ρ^2. If ρ^2 < 0, inbounds returns false. otherwise, we compute through. AFAIK Proj.jl always go through inbounds before computing forward or backward functions, so explicitly throwing an error earlier is uneeded.

…o first compute ρ^2. If ρ^2 < 0, inbounds returns false. otherwise, we compute through. AFAIK Proj.jl checks always go through inbounds, so explicitly throwing an error is uneeded.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 1, 2026

Codecov Report

❌ Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.15%. Comparing base (e65f137) to head (8f5ff44).

Files with missing lines Patch % Lines
src/crs/projected/albers.jl 82.35% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #337   +/-   ##
=======================================
  Coverage   92.15%   92.15%           
=======================================
  Files          40       40           
  Lines        1809     1810    +1     
=======================================
+ Hits         1667     1668    +1     
  Misses        142      142           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@juliohm
Copy link
Copy Markdown
Member

juliohm commented Jan 1, 2026

so explicitly throwing an error earlier is uneeded.

We throw errors in other projections like

if abs(Bden) < atol(λ)
throw(ArgumentError("coordinates outside of the projection domain"))
end

so I think it would be safer to still throw the error in this PR, release a patch, and look into this issue later.

@juliohm
Copy link
Copy Markdown
Member

juliohm commented Jan 2, 2026

Thank you @souma4 ! 🎉

@juliohm juliohm merged commit 18fc4f1 into JuliaEarth:main Jan 2, 2026
12 checks passed
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

Successfully merging this pull request may close these issues.

3 participants