LCCObject::prj2Ecef
Converts projection coordinates to ECEF (Earth-Centered, Earth-Fixed) coordinates.
The ellipsoid is WGS84. For projection coordinate system information, refer to the getProjectionCoordinateSystemInfos method.
Version Requirement
SDK v0.4.1+
Engine Support
CesiumJS
API
LCCObject::prj2Ecef(prjCoord: Cesium.Cartesian3, isOffset?: boolean): Cesium.Cartesian3
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
prjCoord | Cesium.Cartesian3 | Yes | - | Projection coordinates. |
isOffset | boolean | No | true | Whether coordinates are offset-based relative to the LCC model's origin. |
Return Value
Cesium.Cartesian3 — ECEF world coordinates.
Usage Example
Using Offset Coordinates
let isOffset = true;
let prjCoord = new Cesium.Cartesian3(5, 10, 20);
const worldPos = lccObject.prj2Ecef(prjCoord, isOffset);
console.log('world Pos: ', worldPos);
Using Full Projection Coordinates
const pcsInfos = lccObject.getProjectionCoordinateSystemInfos();
const { epsg, offset } = pcsInfos;
let prjCoord = new Cesium.Cartesian3(5, 10, 20);
prjCoord.x += offset[0];
prjCoord.y += offset[1];
prjCoord.z += offset[2];
const worldPos = lccObject.prj2Ecef(prjCoord, false);
console.log('world Pos: ', worldPos);
Notes
- This method must be called after the success callback of
LCCRender.load()has been triggered.
Related APIs
LCCObject::ecef2Prj()LCCObject::getProjectionCoordinateSystemInfos()