coordinates
coordinates
Coordinate system detection and transformation utilities.
coordinates.detect_and_transform_coords
detect_and_transform_coords(
coords: list[tuple[float, ...]], source_crs: str | None = None
) -> list[tuple[float, float]]
Detect coordinate system and transform to WGS84 if necessary.
Auto-detects RD New (EPSG:28992) based on coordinate ranges.
Parameters:
-
coords(list[tuple[float, ...]]) –Input coordinate tuples as
(x, y). -
source_crs(str | None, default:None) –Explicit source CRS (e.g.
"EPSG:28992"). Auto-detects ifNone.
Returns:
-
list[tuple[float, float]]–Coordinates in WGS84
(longitude, latitude).
Source code in mapyta/coordinates.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
coordinates.transform_geometry
transform_geometry(
geom: BaseGeometry, source_crs: str | None = None
) -> BaseGeometry
Transform a Shapely geometry to WGS84.
Parameters:
-
geom(BaseGeometry) –Input geometry in any supported CRS.
-
source_crs(str | None, default:None) –Source CRS. If
None, auto-detection is attempted.
Returns:
-
BaseGeometry–Geometry in WGS84 coordinates.
Source code in mapyta/coordinates.py
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |