Created
November 9, 2020 14:23
-
-
Save dankkom/86521d3cd2300dad93da284930c8aae0 to your computer and use it in GitHub Desktop.
[Python] Convert geographic coordinates from UTM to latitude/longitude
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Tuple | |
from pyproj import Proj | |
def convert_utm_to_longlat(x: int, y: int, zone: int, south: bool = False) -> Tuple[float, float]: | |
longlat_proj = Proj(proj="utm", zone=zone, ellps="WGS84", south=south) | |
long, lat = longlat_proj(x, y, inverse=True) | |
return long, lat |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment