Transform 3D positions between reference frames#
Choose a transform from what the ordinates represent, then check an admitted pair or profile before applying it to the survey.
Choose a route#
Input and task |
Transformer |
Inspect |
|---|---|---|
Longitude, latitude and ellipsoidal height to Earth-centred Cartesian XYZ |
|
The admitted CRS pair |
Registered datum or frame shift |
|
The position-vector or coordinate-frame convention |
Registered composition of projected positions and a frame change |
|
The selected stages |
Find the exact admitted pair or profile in Supported coordinate operations.
Check a geocentric control#
For this candidate, EPSG:4979 supplies longitude, latitude and ellipsoidal height, and EPSG:4978 supplies Earth-centred XYZ. The control is on the equator and prime meridian, 100 metres above the ellipsoid.
import numpy as np
from cugeo.proj import GeocentricTransformer
longitude = np.array([0.0])
latitude = np.array([0.0])
height = np.array([100.0])
transformer = GeocentricTransformer.from_crs("EPSG:4979", "EPSG:4978")
try:
print("route:", transformer.explain())
x, y, z, status = transformer.transform(
longitude, latitude, height, return_status=True
)
print("status:", status[0])
print("XYZ (m):", x[0], y[0], z[0])
finally:
transformer.close()
Check for OK and agreement with (6378237, 0, 0) metres within the admitted profile’s qualified tolerance. Only explicitly promoted 2D profiles supply zero height. If the survey height is orthometric, transform heights using a local grid before treating it as ellipsoidal height.
Apply a frame shift#
For a Helmert shift, use the epoch inputs admitted by the registered profile. A dynamic typed profile can take per-row coordinate epochs, while a CRS definition epoch applies across the batch. On the CUDA Helmert route, retain the returned execution and call wait for XYZ and status before checking the control.
Use array columns for these typed transforms. Their Python entry points reject N-D Arrow Device input.