All Products
Search
Document Center

PolarDB:ST_ECEFToENU

Last Updated:Mar 28, 2026

Converts a meshgeom object from Earth-centered Earth-fixed (ECEF) coordinates to east-north-up (ENU) coordinates, using a specified reference point as the local coordinate origin.

Syntax

meshgeom ST_ECEFToENU(meshgeom geom, geometry center);

Return type: meshgeom

Parameters

ParameterTypeDescription
geommeshgeomThe input mesh geometry in ECEF coordinates.
centergeometryThe origin of the ENU coordinate system. Must be a Point3D value in EPSG:4326 format: SRID=4326;POINT(longitude latitude altitude), where altitude is in meters.

Description

ECEF is a Cartesian coordinate system fixed to the Earth, with its origin at the Earth's center of mass. ENU is a local coordinate system where the axes point east, north, and up relative to a surface reference point.

ST_ECEFToENU projects the input meshgeom from the global ECEF frame into the local ENU frame. The center parameter defines the reference point — the origin of the ENU frame — and must use EPSG:4326 (WGS 84).

For example, 'SRID=4326;POINT(0 0 0)' sets the ENU origin at longitude 0°, latitude 0°, altitude 0 m.

Example

The following example converts a point on the ECEF X-axis (Earth's equatorial radius, 6,378,137 m) to ENU coordinates, using a reference point at longitude 0°, latitude 0°, altitude 100 m.

SELECT ST_AsText(ST_ECEFToENU(
  'MESHGEOM(PATCH(POINT(6378137 0 0)))',
  'SRID=4326;POINT(0 0 100)'
));

Output:

MESHGEOM(PATCH(POINT Z (0 0 -100)))

The input point POINT(6378137 0 0) lies exactly on the Earth's surface at the ECEF origin (0° longitude, 0° latitude, 0 m altitude). Because the ENU reference point is at 100 m altitude above the same surface location, the input point is 100 m below the reference — so its ENU Z value (up) is -100.