/usr/share/javascript/proj4/lib/datum.js is in libjs-proj4 2.3.17+ds-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | var PJD_3PARAM = 1;
var PJD_7PARAM = 2;
var PJD_WGS84 = 4; // WGS84 or equivalent
var PJD_NODATUM = 5; // WGS84 or equivalent
var SEC_TO_RAD = 4.84813681109535993589914102357e-6;
function datum(datumCode, datum_params, a, b, es, ep2) {
var out = {};
out.datum_type = PJD_WGS84; //default setting
if (datumCode && datumCode === 'none') {
out.datum_type = PJD_NODATUM;
}
if (datum_params) {
out.datum_params = datum_params.map(parseFloat);
if (out.datum_params[0] !== 0 || out.datum_params[1] !== 0 || out.datum_params[2] !== 0) {
out.datum_type = PJD_3PARAM;
}
if (out.datum_params.length > 3) {
if (out.datum_params[3] !== 0 || out.datum_params[4] !== 0 || out.datum_params[5] !== 0 || out.datum_params[6] !== 0) {
out.datum_type = PJD_7PARAM;
out.datum_params[3] *= SEC_TO_RAD;
out.datum_params[4] *= SEC_TO_RAD;
out.datum_params[5] *= SEC_TO_RAD;
out.datum_params[6] = (out.datum_params[6] / 1000000.0) + 1.0;
}
}
}
out.a = a; //datum object also uses these values
out.b = b;
out.es = es;
out.ep2 = ep2;
return out;
}
module.exports = datum;
|