signalk-to-noforeignland 0.1.12 → 0.1.14
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/index.js +10 -5
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -179,10 +179,15 @@ module.exports = function (app) {
|
|
|
179
179
|
let timestamp = update.timestamp;
|
|
180
180
|
for (value of update.values) {
|
|
181
181
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
182
|
+
|
|
183
|
+
if (
|
|
184
|
+
Math.abs(value.value.latitude) <= 0.01 &&
|
|
185
|
+
Math.abs(value.value.longitude) <= 0.01
|
|
186
|
+
) {
|
|
187
|
+
// Coordinates are within ±0.1 of (0,0)
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
|
|
186
191
|
// app.debug(`value:`, value);
|
|
187
192
|
|
|
188
193
|
if (!shouldDoLog) {
|
|
@@ -402,7 +407,7 @@ module.exports = function (app) {
|
|
|
402
407
|
try {
|
|
403
408
|
const point = JSON.parse(line);
|
|
404
409
|
if (isValidLatitude(point.lat) && isValidLongitude(point.lon)) {
|
|
405
|
-
track.push([point.
|
|
410
|
+
track.push([point.t,point.lat, point.lon])
|
|
406
411
|
lastTimestamp = point.t
|
|
407
412
|
}
|
|
408
413
|
} catch (error) {
|