gnss-js 1.45.0 → 1.45.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-XYCECWWS.js → chunk-ST22ULND.js} +13 -2
- package/dist/index.cjs +13 -2
- package/dist/index.js +1 -1
- package/dist/positioning.cjs +13 -2
- package/dist/positioning.js +1 -1
- package/package.json +1 -1
|
@@ -1102,12 +1102,23 @@ var RtkFloatEngine = class {
|
|
|
1102
1102
|
|
|
1103
1103
|
// src/positioning/rtk-postprocess.ts
|
|
1104
1104
|
var epochsOf = (o) => Array.isArray(o) ? o : o.epochs;
|
|
1105
|
+
function medianIntervalMs(epochs) {
|
|
1106
|
+
const times = [...new Set(epochs.map((e) => e.timeMs))].sort((a, b) => a - b);
|
|
1107
|
+
if (times.length < 2) return null;
|
|
1108
|
+
const gaps = [];
|
|
1109
|
+
for (let i = 1; i < times.length; i++) gaps.push(times[i] - times[i - 1]);
|
|
1110
|
+
gaps.sort((a, b) => a - b);
|
|
1111
|
+
return gaps[Math.floor(gaps.length / 2)];
|
|
1112
|
+
}
|
|
1105
1113
|
function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
1106
1114
|
const tol = opts.pairToleranceMs ?? 500;
|
|
1107
1115
|
const round = (ms) => Math.round(ms / 1e3) * 1e3;
|
|
1116
|
+
const roverEpochs = epochsOf(rover);
|
|
1117
|
+
const interval = medianIntervalMs(roverEpochs);
|
|
1118
|
+
const engineOpts = opts.maxGapMs != null || interval == null ? opts : { ...opts, maxGapMs: Math.max(1e4, Math.round(interval * 2.5)) };
|
|
1108
1119
|
const baseByT = /* @__PURE__ */ new Map();
|
|
1109
1120
|
for (const e of epochsOf(base)) baseByT.set(round(e.timeMs), e);
|
|
1110
|
-
const engine = new RtkFloatEngine(baseEcef, ephemerides,
|
|
1121
|
+
const engine = new RtkFloatEngine(baseEcef, ephemerides, engineOpts);
|
|
1111
1122
|
const [bLat, bLon] = ecefToGeodetic(baseEcef[0], baseEcef[1], baseEcef[2]);
|
|
1112
1123
|
const [sLat, cLat, sLon, cLon] = [
|
|
1113
1124
|
Math.sin(bLat),
|
|
@@ -1130,7 +1141,7 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
1130
1141
|
let solved = 0;
|
|
1131
1142
|
let unmatched = 0;
|
|
1132
1143
|
let fixed = 0;
|
|
1133
|
-
const sorted = [...
|
|
1144
|
+
const sorted = [...roverEpochs].sort((a, b) => a.timeMs - b.timeMs);
|
|
1134
1145
|
for (const rEp of sorted) {
|
|
1135
1146
|
if (seen.has(rEp.timeMs)) continue;
|
|
1136
1147
|
seen.add(rEp.timeMs);
|
package/dist/index.cjs
CHANGED
|
@@ -13035,12 +13035,23 @@ var RtkFloatEngine = class {
|
|
|
13035
13035
|
|
|
13036
13036
|
// src/positioning/rtk-postprocess.ts
|
|
13037
13037
|
var epochsOf = (o) => Array.isArray(o) ? o : o.epochs;
|
|
13038
|
+
function medianIntervalMs(epochs) {
|
|
13039
|
+
const times = [...new Set(epochs.map((e) => e.timeMs))].sort((a, b) => a - b);
|
|
13040
|
+
if (times.length < 2) return null;
|
|
13041
|
+
const gaps = [];
|
|
13042
|
+
for (let i = 1; i < times.length; i++) gaps.push(times[i] - times[i - 1]);
|
|
13043
|
+
gaps.sort((a, b) => a - b);
|
|
13044
|
+
return gaps[Math.floor(gaps.length / 2)];
|
|
13045
|
+
}
|
|
13038
13046
|
function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
13039
13047
|
const tol = opts.pairToleranceMs ?? 500;
|
|
13040
13048
|
const round = (ms) => Math.round(ms / 1e3) * 1e3;
|
|
13049
|
+
const roverEpochs = epochsOf(rover);
|
|
13050
|
+
const interval = medianIntervalMs(roverEpochs);
|
|
13051
|
+
const engineOpts = opts.maxGapMs != null || interval == null ? opts : { ...opts, maxGapMs: Math.max(1e4, Math.round(interval * 2.5)) };
|
|
13041
13052
|
const baseByT = /* @__PURE__ */ new Map();
|
|
13042
13053
|
for (const e of epochsOf(base)) baseByT.set(round(e.timeMs), e);
|
|
13043
|
-
const engine = new RtkFloatEngine(baseEcef, ephemerides,
|
|
13054
|
+
const engine = new RtkFloatEngine(baseEcef, ephemerides, engineOpts);
|
|
13044
13055
|
const [bLat, bLon] = ecefToGeodetic(baseEcef[0], baseEcef[1], baseEcef[2]);
|
|
13045
13056
|
const [sLat, cLat, sLon, cLon] = [
|
|
13046
13057
|
Math.sin(bLat),
|
|
@@ -13063,7 +13074,7 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
13063
13074
|
let solved = 0;
|
|
13064
13075
|
let unmatched = 0;
|
|
13065
13076
|
let fixed = 0;
|
|
13066
|
-
const sorted = [...
|
|
13077
|
+
const sorted = [...roverEpochs].sort((a, b) => a.timeMs - b.timeMs);
|
|
13067
13078
|
for (const rEp of sorted) {
|
|
13068
13079
|
if (seen.has(rEp.timeMs)) continue;
|
|
13069
13080
|
seen.add(rEp.timeMs);
|
package/dist/index.js
CHANGED
package/dist/positioning.cjs
CHANGED
|
@@ -1558,12 +1558,23 @@ var RtkFloatEngine = class {
|
|
|
1558
1558
|
|
|
1559
1559
|
// src/positioning/rtk-postprocess.ts
|
|
1560
1560
|
var epochsOf = (o) => Array.isArray(o) ? o : o.epochs;
|
|
1561
|
+
function medianIntervalMs(epochs) {
|
|
1562
|
+
const times = [...new Set(epochs.map((e) => e.timeMs))].sort((a, b) => a - b);
|
|
1563
|
+
if (times.length < 2) return null;
|
|
1564
|
+
const gaps = [];
|
|
1565
|
+
for (let i = 1; i < times.length; i++) gaps.push(times[i] - times[i - 1]);
|
|
1566
|
+
gaps.sort((a, b) => a - b);
|
|
1567
|
+
return gaps[Math.floor(gaps.length / 2)];
|
|
1568
|
+
}
|
|
1561
1569
|
function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
1562
1570
|
const tol = opts.pairToleranceMs ?? 500;
|
|
1563
1571
|
const round = (ms) => Math.round(ms / 1e3) * 1e3;
|
|
1572
|
+
const roverEpochs = epochsOf(rover);
|
|
1573
|
+
const interval = medianIntervalMs(roverEpochs);
|
|
1574
|
+
const engineOpts = opts.maxGapMs != null || interval == null ? opts : { ...opts, maxGapMs: Math.max(1e4, Math.round(interval * 2.5)) };
|
|
1564
1575
|
const baseByT = /* @__PURE__ */ new Map();
|
|
1565
1576
|
for (const e of epochsOf(base)) baseByT.set(round(e.timeMs), e);
|
|
1566
|
-
const engine = new RtkFloatEngine(baseEcef, ephemerides,
|
|
1577
|
+
const engine = new RtkFloatEngine(baseEcef, ephemerides, engineOpts);
|
|
1567
1578
|
const [bLat, bLon] = ecefToGeodetic(baseEcef[0], baseEcef[1], baseEcef[2]);
|
|
1568
1579
|
const [sLat, cLat, sLon, cLon] = [
|
|
1569
1580
|
Math.sin(bLat),
|
|
@@ -1586,7 +1597,7 @@ function postProcessRtk(base, rover, ephemerides, baseEcef, opts = {}) {
|
|
|
1586
1597
|
let solved = 0;
|
|
1587
1598
|
let unmatched = 0;
|
|
1588
1599
|
let fixed = 0;
|
|
1589
|
-
const sorted = [...
|
|
1600
|
+
const sorted = [...roverEpochs].sort((a, b) => a.timeMs - b.timeMs);
|
|
1590
1601
|
for (const rEp of sorted) {
|
|
1591
1602
|
if (seen.has(rEp.timeMs)) continue;
|
|
1592
1603
|
seen.add(rEp.timeMs);
|
package/dist/positioning.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gnss-js",
|
|
3
|
-
"version": "1.45.
|
|
3
|
+
"version": "1.45.1",
|
|
4
4
|
"description": "Comprehensive GNSS library for JavaScript — time scales, coordinates, RINEX parsing, RTCM3 decoding, orbit computation, and signal analysis",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|