Understanding coordinate conversion
Coordinate conversion allows you to convert point coordinates between different coordinate systems. When you start working with multiple datasets, you’ll inevitably end up with data in different coordinate systems and projections. You can convert back and forth between two of the most common coordinate systems, UTM and geographic coordinates (latitude and longitude), using a pure Python module called utm
. The utm
module isn’t part of the Anaconda repository, so you can just install it with pip
:
pip install utm
The utm
module is straightforward to use. To convert from UTM into latitude and longitude, you can use the following code:
import utm y = 479747.0453210057 x = 5377685.825323031 zone = 32 band = 'U' print(utm.to_latlon(y, x, zone, band))
The code should output (48.55199390882121, 8.725555729071763)
representing the coordinates converted to decimal degrees in latitude and longitude.
The UTM zones are numbered...