convert geodetic coordinates ([lat,lon, alt]) to ecef (cartesian [x,y,z]) and ecef (cartesian [x,y,z]) to geodetic coordinates ([lat,lon, alt])
var projector = require('ecef-projector');
var xyz = projector.project(37.8043722, -122.2708026, 0.0);
console.log(xyz);
var gps = projector.unproject(xyz[0], xyz[1], xyz[2]);
console.log(gps);
output:
$ node ecef.js
[ -2694044.4111565403, -4266368.805493665, 3888310.602276871 ]
[ 37.8043722, -122.27080260000001, 0.0 ]
var projector = require('ecef-projector')
Return an array xyz
of [x,y,z]
coordinates in meters from lat
, lon
and alt
where lat and lon are in degrees.
Return an array of [lat, lon, alt]
coordinates in degrees from x
, y
, and z
in meters
With npm do:
npm install ecef-projector
BSD-3