Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to interpolate between coordinates, as a step in that process I convert latlong to UTM so I can work in metric.

I don't get the expected latlong when converting back, reproduced below:

>>> import pyproj
>>> pyproj.__version__
>>> p = pyproj.Proj("+proj=utm +zone=33 +north +ellps=WGS84 +datum=WGS84 +units=m +no_defs")
>>> p(58.4, 15.6)
(5579373.890337878, 2328887.997220567)
>>> p(*p(58.4, 15.6), inverse=True) # Should return (58.4, 15.6)
(58.284316956873305, 15.63501250163002)

Is there a good explanation for this? How do I do what I want without this issue?

share|improve this question
up vote 7 down vote accepted

Your input coordinates are in the wrong order. Pyproj expects long, lat.

>>> import pyproj
>>> p = pyproj.Proj(init='epsg:32633')
>>> p(*p(15.6, 58.4), inverse=True)
(15.6, 58.399999999999991)
share|improve this answer
Subtle, thought it could be because projection/rounding errors, couldn't figure out how though. Thanks a lot! – Sebastian Jansson Jan 22 '13 at 17:33
Many transforms are only reversible within a restricted area. Check out the red strip in the map at Outside your UTM zone, the algorithm's robustness decreases. – sgillies Jan 22 '13 at 17:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.