Add two new bundle types.

Of which 0xa is not actually used and 0xc is used for geometric
comparison data ([ line, point, δi, δj ]).
This commit is contained in:
D. Berge
2025-08-18 14:05:26 +02:00
parent fd94b3b6f4
commit c054e63325

View File

@@ -38,7 +38,7 @@ function bundle (json, opts = {}) {
return encode.sequential(json, el => el.sailline, el => el.point, deltas, values, type)
} if (type == 1) {
} else if (type == 1) {
/* Preplot information source line points
*
* elem 0: Float32Array Longitude
@@ -273,6 +273,88 @@ function bundle (json, opts = {}) {
});
return encode.sequential(json, el => el.sequence, el => el.point, deltas, values, type)
} else if (type == 0xa) {
/* 4D comparison data:
*
* elem0: i differences
* elem1: j differences
*
* Note that line/point may not be unique.
*
*/
/*
deltas.push({
key: el => el.baseTStamp,
baseType: BigUint64Array,
incrType: Int32Array
});
deltas.push({
key: el => el.monTStamp,
baseType: BigUint64Array,
incrType: Int32Array
})
*/
values.push({
key: el => el[2],
type: Float32Array
});
values.push({
key: el => el[3],
type: Float32Array
});
/*
values.push({
key: el => el.baseSeq,
type: Uint16Array
});
values.push({
key: el => el.monSeq,
type: Uint16Array
});
*/
return encode.sequential(json, el => el[0], el => el[1], deltas, values, type)
} else if (type == 0xc) {
/* 4D comparison data (reduced sample)
*
* Input is comparison records, i.e.:
* [ [ line, point, δi, δj ], … ]
*
* elem0: line
* elem1: point
* elem2: δi
* elem3: δj
*
* Note that the chunk's `i` and `j` values are not used
*/
values.push({
key: el => el[0],
type: Uint16Array
});
values.push({
key: el => el[1],
type: Uint16Array
});
values.push({
key: el => el[2],
type: Float32Array
});
values.push({
key: el => el[3],
type: Float32Array
});
return encode.sequential(json, el => 0, el => 0, deltas, values, type)
}
}