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

Fixed mishandling of conversion to utm when forcing a zone letter #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zplett
Copy link

@zplett zplett commented Aug 9, 2018

Prior to this change, when converting from latitude and longitude to utm, if the coordinate's native utm zone is on one hand of the equator and the user tried to force it into a utm zone across the equator, the library wasn't adding 10000000 to the northing value as it should since it was only doing that for negative latitude values. Similarly if a coordinate started in the southern hemisphere in latitude and longitude, and was coerced to the northern hemisphere, the northing would have 10000000 added to its value which isn't what should happen. Fixed this issue by changing:
elif negative(latitude): northing += 10000000
to:
elif zone_letter <= "M": northing += 10000000

@codecov
Copy link

codecov bot commented Aug 9, 2018

Codecov Report

Merging #35 into master will decrease coverage by 1.87%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #35      +/-   ##
==========================================
- Coverage      95%   93.12%   -1.88%     
==========================================
  Files           3        3              
  Lines         160      160              
==========================================
- Hits          152      149       -3     
- Misses          8       11       +3
Impacted Files Coverage Δ
utm/conversion.py 92.94% <100%> (-1.93%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update efdd46a...b6c1f9f. Read the comment docs.

@SteveAlexander SteveAlexander mentioned this pull request Jul 6, 2019
sdhiscocks added a commit to sdhiscocks/utm that referenced this pull request Mar 28, 2020
Logic in from_latlon has been changed to be similar to to_latlon,
including adding a force_northern option to mirror northern option in
to_latlon. This resolves the issue with northing coordinate incorrectly
being set when pasing in -ve or +ve latitude when forcing northern or
southern zone respectively.

Closes Turbo87#35 - alternative fix for issue.
sdhiscocks added a commit to sdhiscocks/utm that referenced this pull request Aug 23, 2020
Logic in from_latlon has been changed to be similar to to_latlon,
including adding a force_northern option to mirror northern option in
to_latlon. This resolves the issue with northing coordinate incorrectly
being set when pasing in -ve or +ve latitude when forcing northern or
southern zone respectively.

Closes Turbo87#35 - alternative fix for issue.
sdhiscocks added a commit to sdhiscocks/utm that referenced this pull request Nov 10, 2020
Logic in from_latlon has been changed to be similar to to_latlon,
including adding a force_northern option to mirror northern option in
to_latlon. This resolves the issue with northing coordinate incorrectly
being set when pasing in -ve or +ve latitude when forcing northern or
southern zone respectively.

Closes Turbo87#35 - alternative fix for issue.
sdhiscocks added a commit to sdhiscocks/utm that referenced this pull request Feb 15, 2021
Logic in from_latlon has been changed to be similar to to_latlon,
including adding a force_northern option to mirror northern option in
to_latlon. This resolves the issue with northing coordinate incorrectly
being set when pasing in -ve or +ve latitude when forcing northern or
southern zone respectively.

Closes Turbo87#35 - alternative fix for issue.
heathhenley pushed a commit to heathhenley/utm that referenced this pull request Oct 21, 2024
Logic in from_latlon has been changed to be similar to to_latlon,
including adding a force_northern option to mirror northern option in
to_latlon. This resolves the issue with northing coordinate incorrectly
being set when pasing in -ve or +ve latitude when forcing northern or
southern zone respectively.

Closes Turbo87#35 - alternative fix for issue.
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.

1 participant