@idm-plugin/geo 1.5.9 → 1.6.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.
@@ -31,7 +31,7 @@ export interface AISRecord {
31
31
  export declare class AisHelper {
32
32
  static json2Str(json: AISRecord): string;
33
33
  static str2Json(str: string): AISRecord;
34
- inspectStoppages(rows: AISRecord[], threshold?: number): Promise<{
34
+ static inspectStoppages(rows: AISRecord[], threshold?: number): {
35
35
  start: {
36
36
  lat: any;
37
37
  lng: any;
@@ -49,5 +49,5 @@ export declare class AisHelper {
49
49
  duration: number;
50
50
  distance: number;
51
51
  avgSog: number;
52
- }[]>;
52
+ }[];
53
53
  }
package/dist/index.js CHANGED
@@ -2242,21 +2242,24 @@ class t0 {
2242
2242
  deleted: i === "true"
2243
2243
  };
2244
2244
  }
2245
- async inspectStoppages(M, z = 1) {
2245
+ static inspectStoppages(M, z = 1) {
2246
2246
  const p = [];
2247
2247
  for (let O = 0; O < M.length - 1; O++) {
2248
2248
  const A = M[O];
2249
2249
  if (A.sog = A.sog || 0, A.sog < z) {
2250
2250
  const b = A;
2251
- let W;
2251
+ let W = M.at(-1);
2252
2252
  for (let q = O + 1; q < M.length; q++) {
2253
2253
  const o = M[q];
2254
- if (o.sog = o.sog || 0, !(o.sog <= z)) {
2255
- W = M[q - 1];
2254
+ if (o.sog = o.sog || 0, o.sog <= z) {
2255
+ O = q;
2256
+ continue;
2257
+ } else {
2258
+ O = q - 1, W = M[q - 1];
2256
2259
  break;
2257
2260
  }
2258
2261
  }
2259
- if (W) {
2262
+ if (W.positionTime != b.positionTime) {
2260
2263
  const q = {
2261
2264
  start: {
2262
2265
  lat: b.lat,