Skip to content

Instantly share code, notes, and snippets.

@dankkom
Created November 9, 2020 14:23
Show Gist options
  • Save dankkom/86521d3cd2300dad93da284930c8aae0 to your computer and use it in GitHub Desktop.
Save dankkom/86521d3cd2300dad93da284930c8aae0 to your computer and use it in GitHub Desktop.
[Python] Convert geographic coordinates from UTM to latitude/longitude
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