xy_to_lonlat#

geowombat.xy_to_lonlat(x, y, dst_crs)#

Converts from native map coordinates to longitude and latitude.

Parameters:
  • x (float) – The x coordinate to convert.

  • y (float) – The y coordinate to convert.

  • dst_crs (str, object, or DataArray) – The CRS to transform to. It can be provided as a string, a CRS instance (e.g., pyproj.crs.CRS), or a geowombat.DataArray.

Returns:

(longitude, latitude)

Return type:

tuple

Example

>>> import geowombat as gw
>>> from geowombat.core import xy_to_lonlat
>>>
>>> x, y = 643944.6956113526, 7183104.984484519
>>>
>>> with gw.open('image.tif') as src:
>>>     lon, lat = xy_to_lonlat(x, y, src)