mirror of
https://github.com/jdejaegh/python-irceline.git
synced 2025-06-27 03:35:56 +02:00
15 lines
501 B
Python
15 lines
501 B
Python
from typing import Tuple
|
|
|
|
from pyproj import Transformer
|
|
|
|
_project_transform = Transformer.from_crs('EPSG:4326', 'EPSG:31370', always_xy=False)
|
|
|
|
|
|
def epsg_transform(position: Tuple[float, float]) -> Tuple[int, int]:
|
|
"""
|
|
Convert 'EPSG:4326' coordinates to 'EPSG:31370' coordinates
|
|
:param position: (x, y) coordinates
|
|
:return: tuple of int in the EPSG:31370 system
|
|
"""
|
|
result = _project_transform.transform(position[0], position[1])
|
|
return round(result[0]), round(result[1])
|