Turbo87 / utm

Bidirectional UTM-WGS84 converter for python
http://pypi.python.org/pypi/utm
MIT License
493 stars 101 forks source link

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

Open zplett opened 6 years ago

zplett commented 6 years ago

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[bot] commented 6 years ago

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%) :arrow_down:

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.