xy_to_lonlat
cellseg_gsontools.xy_to_lonlat(x, y)
¶
Converts x, y coordinates to lon, lat coordinates.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x |
Union[float, Sequence]
|
x coordinate(s). |
required |
y |
Union[float, Sequence]
|
y coordinate(s). |
required |
Returns:
Type | Description |
---|---|
Tuple[Union[float, Sequence], Union[float, Sequence]]
|
Tuple[Union[float, Sequence], Union[float, Sequence]]: lon, lat coordinates. |
Examples:
>>> from cellseg_gsontools import xy_to_lonlat
>>> from shapely.geometry import Polygon
>>> poly = Polygon([(0, 0), (0, 1), (1, 1)])
>>> x, y = poly.exterior.coords.xy
>>> lon, lat = xy_to_lonlat(x, y)
>>> lon, lat
(array('d', [10.511, 10.511, 10.511, 10.511]),
array('d', [0.0, 9.019e-06, 9.019e-06, 0.0]))