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