@maplibre/mlt 0.0.1-alpha.9 → 1.1.0
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/{encodings → decoding}/decodingUtils.js +18 -33
- package/dist/decoding/decodingUtils.js.map +1 -0
- package/dist/decoding/decodingUtils.spec.d.ts +1 -0
- package/dist/decoding/decodingUtils.spec.js +125 -0
- package/dist/decoding/decodingUtils.spec.js.map +1 -0
- package/dist/{encodings → decoding}/fsstDecoder.js +1 -4
- package/dist/decoding/fsstDecoder.js.map +1 -0
- package/dist/decoding/fsstDecoder.spec.d.ts +1 -0
- package/dist/decoding/fsstDecoder.spec.js +36 -0
- package/dist/decoding/fsstDecoder.spec.js.map +1 -0
- package/dist/{encodings → decoding}/geometryDecoder.js +65 -71
- package/dist/decoding/geometryDecoder.js.map +1 -0
- package/dist/decoding/geometryDecoder.spec.d.ts +1 -0
- package/dist/decoding/geometryDecoder.spec.js +5 -0
- package/dist/decoding/geometryDecoder.spec.js.map +1 -0
- package/dist/decoding/geometryScaling.js +2 -0
- package/dist/decoding/geometryScaling.js.map +1 -0
- package/dist/{encodings → decoding}/intWrapper.js +2 -4
- package/dist/decoding/intWrapper.js.map +1 -0
- package/dist/{encodings → decoding}/integerDecodingUtils.d.ts +13 -0
- package/dist/{encodings → decoding}/integerDecodingUtils.js +89 -88
- package/dist/decoding/integerDecodingUtils.js.map +1 -0
- package/dist/decoding/integerDecodingUtils.spec.d.ts +1 -0
- package/dist/decoding/integerDecodingUtils.spec.js +194 -0
- package/dist/decoding/integerDecodingUtils.spec.js.map +1 -0
- package/dist/{encodings → decoding}/integerStreamDecoder.d.ts +1 -1
- package/dist/decoding/integerStreamDecoder.js +266 -0
- package/dist/decoding/integerStreamDecoder.js.map +1 -0
- package/dist/decoding/integerStreamDecoder.spec.d.ts +1 -0
- package/dist/decoding/integerStreamDecoder.spec.js +125 -0
- package/dist/decoding/integerStreamDecoder.spec.js.map +1 -0
- package/dist/{encodings → decoding}/propertyDecoder.d.ts +1 -1
- package/dist/decoding/propertyDecoder.js +140 -0
- package/dist/decoding/propertyDecoder.js.map +1 -0
- package/dist/decoding/propertyDecoder.spec.d.ts +1 -0
- package/dist/decoding/propertyDecoder.spec.js +682 -0
- package/dist/decoding/propertyDecoder.spec.js.map +1 -0
- package/dist/{encodings → decoding}/stringDecoder.d.ts +4 -1
- package/dist/decoding/stringDecoder.js +191 -0
- package/dist/decoding/stringDecoder.js.map +1 -0
- package/dist/decoding/stringDecoder.spec.d.ts +1 -0
- package/dist/decoding/stringDecoder.spec.js +356 -0
- package/dist/decoding/stringDecoder.spec.js.map +1 -0
- package/dist/index.d.ts +2 -4
- package/dist/index.js +5 -20
- package/dist/index.js.map +1 -1
- package/dist/metadata/tile/dictionaryType.js +2 -5
- package/dist/metadata/tile/dictionaryType.js.map +1 -1
- package/dist/metadata/tile/lengthType.js +2 -5
- package/dist/metadata/tile/lengthType.js.map +1 -1
- package/dist/metadata/tile/logicalLevelTechnique.js +2 -5
- package/dist/metadata/tile/logicalLevelTechnique.js.map +1 -1
- package/dist/metadata/tile/logicalStreamType.js +4 -5
- package/dist/metadata/tile/logicalStreamType.js.map +1 -1
- package/dist/metadata/tile/mortonEncodedStreamMetadata.d.ts +1 -1
- package/dist/metadata/tile/mortonEncodedStreamMetadata.js +8 -10
- package/dist/metadata/tile/mortonEncodedStreamMetadata.js.map +1 -1
- package/dist/metadata/tile/offsetType.js +2 -5
- package/dist/metadata/tile/offsetType.js.map +1 -1
- package/dist/metadata/tile/physicalLevelTechnique.js +2 -5
- package/dist/metadata/tile/physicalLevelTechnique.js.map +1 -1
- package/dist/metadata/tile/physicalStreamType.js +2 -5
- package/dist/metadata/tile/physicalStreamType.js.map +1 -1
- package/dist/metadata/tile/rleEncodedStreamMetadata.d.ts +5 -1
- package/dist/metadata/tile/rleEncodedStreamMetadata.js +14 -10
- package/dist/metadata/tile/rleEncodedStreamMetadata.js.map +1 -1
- package/dist/metadata/tile/scalarType.js +2 -5
- package/dist/metadata/tile/scalarType.js.map +1 -1
- package/dist/metadata/tile/streamMetadata.d.ts +7 -1
- package/dist/metadata/tile/streamMetadata.js +35 -24
- package/dist/metadata/tile/streamMetadata.js.map +1 -1
- package/dist/metadata/tile/streamMetadataDecoder.d.ts +1 -1
- package/dist/metadata/tile/streamMetadataDecoder.js +13 -17
- package/dist/metadata/tile/streamMetadataDecoder.js.map +1 -1
- package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.d.ts +2 -2
- package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.js +40 -32
- package/dist/metadata/tileset/embeddedTilesetMetadataDecoder.js.map +1 -1
- package/dist/metadata/tileset/tilesetMetadata.d.ts +80 -0
- package/dist/metadata/tileset/tilesetMetadata.js +29 -0
- package/dist/metadata/tileset/tilesetMetadata.js.map +1 -0
- package/dist/metadata/tileset/typeMap.d.ts +1 -1
- package/dist/metadata/tileset/typeMap.js +63 -59
- package/dist/metadata/tileset/typeMap.js.map +1 -1
- package/dist/mltDecoder.d.ts +2 -2
- package/dist/mltDecoder.js +69 -65
- package/dist/mltDecoder.js.map +1 -1
- package/dist/mltDecoder.spec.d.ts +1 -0
- package/dist/mltDecoder.spec.js +152 -0
- package/dist/mltDecoder.spec.js.map +1 -0
- package/dist/mltMetadata.js +4 -7
- package/dist/mltMetadata.js.map +1 -1
- package/dist/vector/constant/intConstVector.d.ts +0 -13
- package/dist/vector/constant/intConstVector.js +2 -82
- package/dist/vector/constant/intConstVector.js.map +1 -1
- package/dist/vector/constant/longConstVector.d.ts +0 -13
- package/dist/vector/constant/longConstVector.js +2 -80
- package/dist/vector/constant/longConstVector.js.map +1 -1
- package/dist/vector/dictionary/stringDictionaryVector.d.ts +0 -14
- package/dist/vector/dictionary/stringDictionaryVector.js +6 -178
- package/dist/vector/dictionary/stringDictionaryVector.js.map +1 -1
- package/dist/vector/featureTable.d.ts +7 -2
- package/dist/vector/featureTable.js +45 -11
- package/dist/vector/featureTable.js.map +1 -1
- package/dist/vector/fixedSizeVector.js +2 -9
- package/dist/vector/fixedSizeVector.js.map +1 -1
- package/dist/vector/flat/bitVector.js +3 -4
- package/dist/vector/flat/bitVector.js.map +1 -1
- package/dist/vector/flat/booleanFlatVector.d.ts +0 -13
- package/dist/vector/flat/booleanFlatVector.js +3 -45
- package/dist/vector/flat/booleanFlatVector.js.map +1 -1
- package/dist/vector/flat/doubleFlatVector.d.ts +0 -13
- package/dist/vector/flat/doubleFlatVector.js +2 -104
- package/dist/vector/flat/doubleFlatVector.js.map +1 -1
- package/dist/vector/flat/floatFlatVector.d.ts +0 -13
- package/dist/vector/flat/floatFlatVector.js +2 -104
- package/dist/vector/flat/floatFlatVector.js.map +1 -1
- package/dist/vector/flat/floatFlatVector.spec.d.ts +1 -0
- package/dist/vector/flat/floatFlatVector.spec.js +14 -0
- package/dist/vector/flat/floatFlatVector.spec.js.map +1 -0
- package/dist/vector/flat/intFlatVector.d.ts +0 -13
- package/dist/vector/flat/intFlatVector.js +2 -117
- package/dist/vector/flat/intFlatVector.js.map +1 -1
- package/dist/vector/flat/intFlatVector.spec.d.ts +1 -0
- package/dist/vector/flat/intFlatVector.spec.js +15 -0
- package/dist/vector/flat/intFlatVector.spec.js.map +1 -0
- package/dist/vector/flat/longFlatVector.d.ts +0 -13
- package/dist/vector/flat/longFlatVector.js +2 -118
- package/dist/vector/flat/longFlatVector.js.map +1 -1
- package/dist/vector/flat/longFlatVector.spec.d.ts +1 -0
- package/dist/vector/flat/longFlatVector.spec.js +14 -0
- package/dist/vector/flat/longFlatVector.spec.js.map +1 -0
- package/dist/vector/flat/stringFlatVector.d.ts +0 -13
- package/dist/vector/flat/stringFlatVector.js +5 -166
- package/dist/vector/flat/stringFlatVector.js.map +1 -1
- package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.d.ts +0 -13
- package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js +14 -51
- package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.js.map +1 -1
- package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.spec.d.ts +1 -0
- package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.spec.js +28 -0
- package/dist/vector/fsst-dictionary/stringFsstDictionaryVector.spec.js.map +1 -0
- package/dist/vector/geometry/constGeometryVector.d.ts +0 -4
- package/dist/vector/geometry/constGeometryVector.js +9 -30
- package/dist/vector/geometry/constGeometryVector.js.map +1 -1
- package/dist/vector/geometry/constGpuVector.d.ts +0 -4
- package/dist/vector/geometry/constGpuVector.js +4 -25
- package/dist/vector/geometry/constGpuVector.js.map +1 -1
- package/dist/vector/geometry/flatGeometryVector.d.ts +0 -4
- package/dist/vector/geometry/flatGeometryVector.js +8 -35
- package/dist/vector/geometry/flatGeometryVector.js.map +1 -1
- package/dist/vector/geometry/flatGpuVector.d.ts +0 -4
- package/dist/vector/geometry/flatGpuVector.js +3 -29
- package/dist/vector/geometry/flatGpuVector.js.map +1 -1
- package/dist/vector/geometry/geometryType.js +4 -7
- package/dist/vector/geometry/geometryType.js.map +1 -1
- package/dist/vector/geometry/geometryVector.d.ts +2 -5
- package/dist/vector/geometry/geometryVector.js +11 -13
- package/dist/vector/geometry/geometryVector.js.map +1 -1
- package/dist/vector/geometry/geometryVectorConverter.js +28 -34
- package/dist/vector/geometry/geometryVectorConverter.js.map +1 -1
- package/dist/vector/geometry/gpuVector.d.ts +5 -4
- package/dist/vector/geometry/gpuVector.js +89 -5
- package/dist/vector/geometry/gpuVector.js.map +1 -1
- package/dist/vector/geometry/spaceFillingCurve.js +6 -4
- package/dist/vector/geometry/spaceFillingCurve.js.map +1 -1
- package/dist/vector/geometry/topologyVector.js +4 -4
- package/dist/vector/geometry/topologyVector.js.map +1 -1
- package/dist/vector/geometry/vertexBufferType.js +2 -5
- package/dist/vector/geometry/vertexBufferType.js.map +1 -1
- package/dist/vector/geometry/zOrderCurve.js +2 -8
- package/dist/vector/geometry/zOrderCurve.js.map +1 -1
- package/dist/vector/geometry/zOrderCurve.spec.d.ts +1 -0
- package/dist/vector/geometry/zOrderCurve.spec.js +14 -0
- package/dist/vector/geometry/zOrderCurve.spec.js.map +1 -0
- package/dist/vector/intVector.js +1 -2
- package/dist/vector/sequence/intSequenceVector.d.ts +0 -13
- package/dist/vector/sequence/intSequenceVector.js +2 -64
- package/dist/vector/sequence/intSequenceVector.js.map +1 -1
- package/dist/vector/sequence/longSequenceVector.d.ts +0 -13
- package/dist/vector/sequence/longSequenceVector.js +2 -49
- package/dist/vector/sequence/longSequenceVector.js.map +1 -1
- package/dist/vector/sequence/longSequenceVektor.spec.d.ts +1 -0
- package/dist/vector/sequence/longSequenceVektor.spec.js +11 -0
- package/dist/vector/sequence/longSequenceVektor.spec.js.map +1 -0
- package/dist/vector/sequence/sequenceVector.js +3 -9
- package/dist/vector/sequence/sequenceVector.js.map +1 -1
- package/dist/vector/variableSizeVector.js +3 -9
- package/dist/vector/variableSizeVector.js.map +1 -1
- package/dist/vector/vector.d.ts +0 -17
- package/dist/vector/vector.js +5 -47
- package/dist/vector/vector.js.map +1 -1
- package/dist/vector/vectorType.js +2 -5
- package/dist/vector/vectorType.js.map +1 -1
- package/package.json +12 -33
- package/dist/encodings/decodingUtils.js.map +0 -1
- package/dist/encodings/doubleDecoder.d.ts +0 -4
- package/dist/encodings/doubleDecoder.js +0 -22
- package/dist/encodings/doubleDecoder.js.map +0 -1
- package/dist/encodings/fastpfor/bitpacking.d.ts +0 -51
- package/dist/encodings/fastpfor/bitpacking.js +0 -3930
- package/dist/encodings/fastpfor/bitpacking.js.map +0 -1
- package/dist/encodings/fastpfor/codec.d.ts +0 -19
- package/dist/encodings/fastpfor/codec.js +0 -3
- package/dist/encodings/fastpfor/codec.js.map +0 -1
- package/dist/encodings/fastpfor/fastpfor.d.ts +0 -38
- package/dist/encodings/fastpfor/fastpfor.js +0 -146
- package/dist/encodings/fastpfor/fastpfor.js.map +0 -1
- package/dist/encodings/fastpfor/index.d.ts +0 -20
- package/dist/encodings/fastpfor/index.js +0 -47
- package/dist/encodings/fastpfor/index.js.map +0 -1
- package/dist/encodings/fastpfor/util.d.ts +0 -2
- package/dist/encodings/fastpfor/util.js +0 -16
- package/dist/encodings/fastpfor/util.js.map +0 -1
- package/dist/encodings/fastpfor/varint.d.ts +0 -18
- package/dist/encodings/fastpfor/varint.js +0 -125
- package/dist/encodings/fastpfor/varint.js.map +0 -1
- package/dist/encodings/fsstDecoder.js.map +0 -1
- package/dist/encodings/geometryDecoder.js.map +0 -1
- package/dist/encodings/geometryScaling.js +0 -3
- package/dist/encodings/geometryScaling.js.map +0 -1
- package/dist/encodings/intWrapper.js.map +0 -1
- package/dist/encodings/integerDecodingUtils.js.map +0 -1
- package/dist/encodings/integerStreamDecoder.js +0 -249
- package/dist/encodings/integerStreamDecoder.js.map +0 -1
- package/dist/encodings/propertyDecoder.js +0 -146
- package/dist/encodings/propertyDecoder.js.map +0 -1
- package/dist/encodings/stringDecoder.js +0 -149
- package/dist/encodings/stringDecoder.js.map +0 -1
- package/dist/metadata/tileset/tilesetMetadata.g.d.ts +0 -418
- package/dist/metadata/tileset/tilesetMetadata.g.js +0 -476
- package/dist/metadata/tileset/tilesetMetadata.g.js.map +0 -1
- package/dist/vector/filter/constSelectionVector.d.ts +0 -0
- package/dist/vector/filter/constSelectionVector.js +0 -1
- package/dist/vector/filter/constSelectionVector.js.map +0 -1
- package/dist/vector/filter/flatSelectionVector.d.ts +0 -16
- package/dist/vector/filter/flatSelectionVector.js +0 -42
- package/dist/vector/filter/flatSelectionVector.js.map +0 -1
- package/dist/vector/filter/selectionVector.d.ts +0 -8
- package/dist/vector/filter/selectionVector.js +0 -3
- package/dist/vector/filter/selectionVector.js.map +0 -1
- package/dist/vector/filter/selectionVectorUtils.d.ts +0 -7
- package/dist/vector/filter/selectionVectorUtils.js +0 -44
- package/dist/vector/filter/selectionVectorUtils.js.map +0 -1
- package/dist/vector/filter/sequenceSelectionVector.d.ts +0 -0
- package/dist/vector/filter/sequenceSelectionVector.js +0 -1
- package/dist/vector/filter/sequenceSelectionVector.js.map +0 -1
- package/dist/vector/geometry/point.d.ts +0 -195
- package/dist/vector/geometry/point.js +0 -308
- package/dist/vector/geometry/point.js.map +0 -1
- /package/dist/{encodings → decoding}/decodingUtils.d.ts +0 -0
- /package/dist/{encodings → decoding}/fsstDecoder.d.ts +0 -0
- /package/dist/{encodings → decoding}/geometryDecoder.d.ts +0 -0
- /package/dist/{encodings → decoding}/geometryScaling.d.ts +0 -0
- /package/dist/{encodings → decoding}/intWrapper.d.ts +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { describe, it, expect } from "vitest";
|
|
2
|
+
import { LongFlatVector } from "./longFlatVector";
|
|
3
|
+
describe("LongFlatVector", () => {
|
|
4
|
+
it("should construct and return values correctly", () => {
|
|
5
|
+
const data = new BigInt64Array([10n, 20n, 30n, 40n, 50n]);
|
|
6
|
+
const vec = new LongFlatVector("test", data, data.length);
|
|
7
|
+
expect(vec.name).toBe("test");
|
|
8
|
+
expect(vec.size).toBe(5);
|
|
9
|
+
expect(vec.getValue(0)).toBe(10n);
|
|
10
|
+
expect(vec.getValue(2)).toBe(30n);
|
|
11
|
+
expect(vec.getValue(4)).toBe(50n);
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=longFlatVector.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"longFlatVector.spec.js","sourceRoot":"","sources":["../../../src/vector/flat/longFlatVector.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC5B,EAAE,CAAC,8CAA8C,EAAE,GAAG,EAAE;QACpD,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;QAC1D,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;QAE1D,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC9B,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACzB,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACtC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { VariableSizeVector } from "../variableSizeVector";
|
|
2
2
|
import type BitVector from "./bitVector";
|
|
3
|
-
import { type SelectionVector } from "../filter/selectionVector";
|
|
4
3
|
export declare class StringFlatVector extends VariableSizeVector<Uint8Array, string> {
|
|
5
4
|
private readonly textEncoder;
|
|
6
5
|
constructor(name: string, offsetBuffer: Int32Array, dataBuffer: Uint8Array, nullabilityBuffer?: BitVector);
|
|
7
6
|
protected getValueFromBuffer(index: number): string;
|
|
8
|
-
filter(testValue: string): SelectionVector;
|
|
9
|
-
match(testValues: string[]): SelectionVector;
|
|
10
|
-
filterSelected(value: string, selectionVector: SelectionVector): void;
|
|
11
|
-
matchSelected(values: string[], selectionVector: SelectionVector): void;
|
|
12
|
-
filterNotEqual(testValue: string): SelectionVector;
|
|
13
|
-
filterNotEqualSelected(value: string, selectionVector: SelectionVector): void;
|
|
14
|
-
noneMatch(testValues: string[]): SelectionVector;
|
|
15
|
-
noneMatchSelected(values: string[], selectionVector: SelectionVector): void;
|
|
16
|
-
greaterThanOrEqualTo(value: string): SelectionVector;
|
|
17
|
-
greaterThanOrEqualToSelected(value: string, selectionVector: SelectionVector): void;
|
|
18
|
-
smallerThanOrEqualTo(value: string): SelectionVector;
|
|
19
|
-
smallerThanOrEqualToSelected(value: string, selectionVector: SelectionVector): void;
|
|
20
7
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const decodingUtils_1 = require("../../encodings/decodingUtils");
|
|
6
|
-
const flatSelectionVector_1 = require("../filter/flatSelectionVector");
|
|
7
|
-
class StringFlatVector extends variableSizeVector_1.VariableSizeVector {
|
|
1
|
+
import { VariableSizeVector } from "../variableSizeVector";
|
|
2
|
+
import { decodeString } from "../../decoding/decodingUtils";
|
|
3
|
+
export class StringFlatVector extends VariableSizeVector {
|
|
4
|
+
textEncoder;
|
|
8
5
|
constructor(name, offsetBuffer, dataBuffer, nullabilityBuffer) {
|
|
9
6
|
super(name, offsetBuffer, dataBuffer, nullabilityBuffer ?? offsetBuffer.length - 1);
|
|
10
7
|
this.textEncoder = new TextEncoder();
|
|
@@ -12,165 +9,7 @@ class StringFlatVector extends variableSizeVector_1.VariableSizeVector {
|
|
|
12
9
|
getValueFromBuffer(index) {
|
|
13
10
|
const start = this.offsetBuffer[index];
|
|
14
11
|
const end = this.offsetBuffer[index + 1];
|
|
15
|
-
return
|
|
16
|
-
}
|
|
17
|
-
filter(testValue) {
|
|
18
|
-
const selectionVector = [];
|
|
19
|
-
const predicateUtf8 = this.textEncoder.encode(testValue);
|
|
20
|
-
for (let i = 0; i < this.size - 1; i++) {
|
|
21
|
-
const length = this.offsetBuffer[i + 1] - this.offsetBuffer[i];
|
|
22
|
-
//TODO: get rid of every
|
|
23
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
24
|
-
length === predicateUtf8.length &&
|
|
25
|
-
this.dataBuffer
|
|
26
|
-
.subarray(this.offsetBuffer[i], this.offsetBuffer[i + 1])
|
|
27
|
-
.every((val, idx) => val === predicateUtf8[idx])) {
|
|
28
|
-
selectionVector.push(i);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
return new flatSelectionVector_1.FlatSelectionVector(selectionVector);
|
|
32
|
-
}
|
|
33
|
-
match(testValues) {
|
|
34
|
-
const selectionVector = [];
|
|
35
|
-
const numPredicates = testValues.length;
|
|
36
|
-
const testValuesUtf8 = testValues.map((v) => this.textEncoder.encode(v));
|
|
37
|
-
for (let i = 0; i < this.size - 1; i++) {
|
|
38
|
-
const valueLength = this.offsetBuffer[i + 1] - this.offsetBuffer[i];
|
|
39
|
-
const valueUtf8 = this.dataBuffer.subarray(this.offsetBuffer[i], this.offsetBuffer[i + 1]);
|
|
40
|
-
for (let j = 0; j < numPredicates; j++) {
|
|
41
|
-
//TODO: get rid of every
|
|
42
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
43
|
-
valueLength === testValuesUtf8[j].length &&
|
|
44
|
-
valueUtf8.every((val, idx) => val === testValuesUtf8[j][idx])) {
|
|
45
|
-
selectionVector.push(i);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return new flatSelectionVector_1.FlatSelectionVector(selectionVector);
|
|
50
|
-
}
|
|
51
|
-
filterSelected(value, selectionVector) {
|
|
52
|
-
const predicateUtf8 = this.textEncoder.encode(value);
|
|
53
|
-
const vector = selectionVector.selectionValues();
|
|
54
|
-
let limit = 0;
|
|
55
|
-
for (let i = 0; i < selectionVector.limit; i++) {
|
|
56
|
-
const index = selectionVector[i];
|
|
57
|
-
const length = this.offsetBuffer[index + 1] - this.offsetBuffer[index];
|
|
58
|
-
//TODO: get rid of every
|
|
59
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
60
|
-
length === predicateUtf8.length &&
|
|
61
|
-
this.dataBuffer
|
|
62
|
-
.subarray(this.offsetBuffer[index], this.offsetBuffer[index + 1])
|
|
63
|
-
.every((val, idx) => val === predicateUtf8[idx])) {
|
|
64
|
-
vector[limit++] = index;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
selectionVector.setLimit(limit);
|
|
68
|
-
}
|
|
69
|
-
matchSelected(values, selectionVector) {
|
|
70
|
-
//TODO: get rid of map?
|
|
71
|
-
const testValuesUtf8 = values.map((v) => this.textEncoder.encode(v));
|
|
72
|
-
//TODO: sort and use binary search?
|
|
73
|
-
const vector = selectionVector.selectionValues();
|
|
74
|
-
let limit = 0;
|
|
75
|
-
for (let i = 0; i < selectionVector.limit; i++) {
|
|
76
|
-
const index = selectionVector[i];
|
|
77
|
-
const value = this.dataBuffer.subarray(this.offsetBuffer[index], this.offsetBuffer[index + 1]);
|
|
78
|
-
for (const testValue of testValuesUtf8) {
|
|
79
|
-
//TODO: get rid of every
|
|
80
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
81
|
-
value.length === testValue.length &&
|
|
82
|
-
value.every((val, idx) => val === testValue[idx])) {
|
|
83
|
-
vector[limit++] = index;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
selectionVector.setLimit(limit);
|
|
89
|
-
}
|
|
90
|
-
filterNotEqual(testValue) {
|
|
91
|
-
const selectionVector = [];
|
|
92
|
-
const predicateUtf8 = this.textEncoder.encode(testValue);
|
|
93
|
-
for (let i = 0; i < this.size - 1; i++) {
|
|
94
|
-
const length = this.offsetBuffer[i + 1] - this.offsetBuffer[i];
|
|
95
|
-
//TODO: get rid of every
|
|
96
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
97
|
-
(length !== predicateUtf8.length ||
|
|
98
|
-
!this.dataBuffer
|
|
99
|
-
.subarray(this.offsetBuffer[i], this.offsetBuffer[i + 1])
|
|
100
|
-
.every((val, idx) => val === predicateUtf8[idx]))) {
|
|
101
|
-
selectionVector.push(i);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
return new flatSelectionVector_1.FlatSelectionVector(selectionVector);
|
|
105
|
-
}
|
|
106
|
-
filterNotEqualSelected(value, selectionVector) {
|
|
107
|
-
const predicateUtf8 = this.textEncoder.encode(value);
|
|
108
|
-
const vector = selectionVector.selectionValues();
|
|
109
|
-
let limit = 0;
|
|
110
|
-
for (let i = 0; i < selectionVector.limit; i++) {
|
|
111
|
-
const index = selectionVector[i];
|
|
112
|
-
const length = this.offsetBuffer[index + 1] - this.offsetBuffer[index];
|
|
113
|
-
//TODO: get rid of every
|
|
114
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
115
|
-
(length !== predicateUtf8.length ||
|
|
116
|
-
!this.dataBuffer
|
|
117
|
-
.subarray(this.offsetBuffer[i], this.offsetBuffer[i + 1])
|
|
118
|
-
.every((val, idx) => val === predicateUtf8[idx]))) {
|
|
119
|
-
vector[limit++] = index;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
selectionVector.setLimit(limit);
|
|
123
|
-
}
|
|
124
|
-
noneMatch(testValues) {
|
|
125
|
-
const selectionVector = [];
|
|
126
|
-
const numPredicates = testValues.length;
|
|
127
|
-
const testValuesUtf8 = testValues.map((v) => this.textEncoder.encode(v));
|
|
128
|
-
for (let i = 0; i < this.size - 1; i++) {
|
|
129
|
-
const valueLength = this.offsetBuffer[i + 1] - this.offsetBuffer[i];
|
|
130
|
-
const valueUtf8 = this.dataBuffer.subarray(this.offsetBuffer[i], this.offsetBuffer[i + 1]);
|
|
131
|
-
for (let j = 0; j < numPredicates; j++) {
|
|
132
|
-
//TODO: get rid of every
|
|
133
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
134
|
-
(valueLength !== testValuesUtf8[j].length ||
|
|
135
|
-
!valueUtf8.every((val, idx) => val === testValuesUtf8[j][idx]))) {
|
|
136
|
-
selectionVector.push(i);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
return new flatSelectionVector_1.FlatSelectionVector(selectionVector);
|
|
141
|
-
}
|
|
142
|
-
noneMatchSelected(values, selectionVector) {
|
|
143
|
-
//TODO: get rid of map?
|
|
144
|
-
const testValuesUtf8 = values.map((v) => this.textEncoder.encode(v));
|
|
145
|
-
//TODO: sort and use binary search?
|
|
146
|
-
const vector = selectionVector.selectionValues();
|
|
147
|
-
let limit = 0;
|
|
148
|
-
for (let i = 0; i < selectionVector.limit; i++) {
|
|
149
|
-
const index = selectionVector[i];
|
|
150
|
-
const value = this.dataBuffer.subarray(this.offsetBuffer[index], this.offsetBuffer[index + 1]);
|
|
151
|
-
for (const testValue of testValuesUtf8) {
|
|
152
|
-
//TODO: get rid of every
|
|
153
|
-
if ((!this.nullabilityBuffer || this.nullabilityBuffer.get(i)) &&
|
|
154
|
-
(value.length !== testValue.length || !value.every((val, idx) => val === testValue[idx]))) {
|
|
155
|
-
vector[limit++] = index;
|
|
156
|
-
break;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
selectionVector.setLimit(limit);
|
|
161
|
-
}
|
|
162
|
-
greaterThanOrEqualTo(value) {
|
|
163
|
-
throw new Error("Not implemented yet.");
|
|
164
|
-
}
|
|
165
|
-
greaterThanOrEqualToSelected(value, selectionVector) {
|
|
166
|
-
throw new Error("Not implemented yet.");
|
|
167
|
-
}
|
|
168
|
-
smallerThanOrEqualTo(value) {
|
|
169
|
-
throw new Error("Not implemented yet.");
|
|
170
|
-
}
|
|
171
|
-
smallerThanOrEqualToSelected(value, selectionVector) {
|
|
172
|
-
throw new Error("Not implemented yet.");
|
|
12
|
+
return decodeString(this.dataBuffer, start, end);
|
|
173
13
|
}
|
|
174
14
|
}
|
|
175
|
-
exports.StringFlatVector = StringFlatVector;
|
|
176
15
|
//# sourceMappingURL=stringFlatVector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringFlatVector.js","sourceRoot":"","sources":["../../../src/vector/flat/stringFlatVector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stringFlatVector.js","sourceRoot":"","sources":["../../../src/vector/flat/stringFlatVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,OAAO,gBAAiB,SAAQ,kBAAsC;IACvD,WAAW,CAAc;IAE1C,YAAY,IAAY,EAAE,YAAwB,EAAE,UAAsB,EAAE,iBAA6B;QACrG,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,iBAAiB,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpF,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACzC,CAAC;IAES,kBAAkB,CAAC,KAAa;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;QACzC,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IACrD,CAAC;CACJ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { VariableSizeVector } from "../variableSizeVector";
|
|
2
2
|
import type BitVector from "../flat/bitVector";
|
|
3
|
-
import { type SelectionVector } from "../filter/selectionVector";
|
|
4
3
|
export declare class StringFsstDictionaryVector extends VariableSizeVector<Uint8Array, string> {
|
|
5
4
|
private readonly indexBuffer;
|
|
6
5
|
private readonly symbolOffsetBuffer;
|
|
@@ -10,18 +9,6 @@ export declare class StringFsstDictionaryVector extends VariableSizeVector<Uint8
|
|
|
10
9
|
private lengthBuffer;
|
|
11
10
|
private decodedDictionary;
|
|
12
11
|
constructor(name: string, indexBuffer: Int32Array, offsetBuffer: Int32Array, dictionaryBuffer: Uint8Array, symbolOffsetBuffer: Int32Array, symbolTableBuffer: Uint8Array, nullabilityBuffer: BitVector);
|
|
13
|
-
filter(value: string): SelectionVector;
|
|
14
|
-
match(values: string[]): SelectionVector;
|
|
15
|
-
filterSelected(value: string, selectionVector: SelectionVector): void;
|
|
16
|
-
matchSelected(values: string[], selectionVector: SelectionVector): void;
|
|
17
12
|
protected getValueFromBuffer(index: number): string;
|
|
18
13
|
private offsetToLengthBuffer;
|
|
19
|
-
filterNotEqual(value: string): SelectionVector;
|
|
20
|
-
filterNotEqualSelected(value: string, selectionVector: SelectionVector): void;
|
|
21
|
-
greaterThanOrEqualTo(value: string): SelectionVector;
|
|
22
|
-
greaterThanOrEqualToSelected(value: string, selectionVector: SelectionVector): void;
|
|
23
|
-
noneMatch(values: string[]): SelectionVector;
|
|
24
|
-
noneMatchSelected(values: string[], selectionVector: SelectionVector): void;
|
|
25
|
-
smallerThanOrEqualTo(value: string): SelectionVector;
|
|
26
|
-
smallerThanOrEqualToSelected(value: string, selectionVector: SelectionVector): void;
|
|
27
14
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { VariableSizeVector } from "../variableSizeVector";
|
|
2
|
+
import { decodeFsst } from "../../decoding/fsstDecoder";
|
|
3
|
+
import { decodeString } from "../../decoding/decodingUtils";
|
|
4
|
+
export class StringFsstDictionaryVector extends VariableSizeVector {
|
|
5
|
+
indexBuffer;
|
|
6
|
+
symbolOffsetBuffer;
|
|
7
|
+
symbolTableBuffer;
|
|
8
|
+
textEncoder;
|
|
9
|
+
// TODO: extend from StringVector
|
|
10
|
+
symbolLengthBuffer;
|
|
11
|
+
lengthBuffer;
|
|
12
|
+
decodedDictionary;
|
|
8
13
|
constructor(name, indexBuffer, offsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, nullabilityBuffer) {
|
|
9
14
|
super(name, offsetBuffer, dictionaryBuffer, nullabilityBuffer);
|
|
10
15
|
this.indexBuffer = indexBuffer;
|
|
@@ -12,23 +17,6 @@ class StringFsstDictionaryVector extends variableSizeVector_1.VariableSizeVector
|
|
|
12
17
|
this.symbolTableBuffer = symbolTableBuffer;
|
|
13
18
|
this.textEncoder = new TextEncoder();
|
|
14
19
|
}
|
|
15
|
-
filter(value) {
|
|
16
|
-
/*
|
|
17
|
-
* -> create utf-8 buffer from value
|
|
18
|
-
* -> convert utf-8 buffer to fsst compressed corpus
|
|
19
|
-
* -> replace utf-8 character with index of SymbolTable
|
|
20
|
-
* */
|
|
21
|
-
throw new Error("Not implemented yet.");
|
|
22
|
-
}
|
|
23
|
-
match(values) {
|
|
24
|
-
throw new Error("Not implemented yet.");
|
|
25
|
-
}
|
|
26
|
-
filterSelected(value, selectionVector) {
|
|
27
|
-
throw new Error("Not implemented yet.");
|
|
28
|
-
}
|
|
29
|
-
matchSelected(values, selectionVector) {
|
|
30
|
-
throw new Error("Not implemented yet.");
|
|
31
|
-
}
|
|
32
20
|
getValueFromBuffer(index) {
|
|
33
21
|
//if (this.decodedValues == null) {
|
|
34
22
|
/*if (this.decodedDictionary == null) {
|
|
@@ -68,12 +56,12 @@ class StringFsstDictionaryVector extends variableSizeVector_1.VariableSizeVector
|
|
|
68
56
|
this.symbolLengthBuffer = this.offsetToLengthBuffer(this.symbolOffsetBuffer);
|
|
69
57
|
this.lengthBuffer = this.offsetToLengthBuffer(this.offsetBuffer);
|
|
70
58
|
}
|
|
71
|
-
this.decodedDictionary =
|
|
59
|
+
this.decodedDictionary = decodeFsst(this.symbolTableBuffer, this.symbolLengthBuffer, this.dataBuffer);
|
|
72
60
|
}
|
|
73
61
|
const offset = this.indexBuffer[index];
|
|
74
62
|
const start = this.offsetBuffer[offset];
|
|
75
63
|
const end = this.offsetBuffer[offset + 1];
|
|
76
|
-
return
|
|
64
|
+
return decodeString(this.decodedDictionary, start, end);
|
|
77
65
|
}
|
|
78
66
|
// TODO: get rid of that conversion
|
|
79
67
|
offsetToLengthBuffer(offsetBuffer) {
|
|
@@ -86,30 +74,5 @@ class StringFsstDictionaryVector extends variableSizeVector_1.VariableSizeVector
|
|
|
86
74
|
}
|
|
87
75
|
return lengthBuffer;
|
|
88
76
|
}
|
|
89
|
-
filterNotEqual(value) {
|
|
90
|
-
throw new Error("Not implemented yet.");
|
|
91
|
-
}
|
|
92
|
-
filterNotEqualSelected(value, selectionVector) {
|
|
93
|
-
throw new Error("Not implemented yet.");
|
|
94
|
-
}
|
|
95
|
-
greaterThanOrEqualTo(value) {
|
|
96
|
-
throw new Error("Not implemented yet.");
|
|
97
|
-
}
|
|
98
|
-
greaterThanOrEqualToSelected(value, selectionVector) {
|
|
99
|
-
throw new Error("Not implemented yet.");
|
|
100
|
-
}
|
|
101
|
-
noneMatch(values) {
|
|
102
|
-
throw new Error("Not implemented yet.");
|
|
103
|
-
}
|
|
104
|
-
noneMatchSelected(values, selectionVector) {
|
|
105
|
-
throw new Error("Not implemented yet.");
|
|
106
|
-
}
|
|
107
|
-
smallerThanOrEqualTo(value) {
|
|
108
|
-
throw new Error("Not implemented yet.");
|
|
109
|
-
}
|
|
110
|
-
smallerThanOrEqualToSelected(value, selectionVector) {
|
|
111
|
-
throw new Error("Not implemented yet.");
|
|
112
|
-
}
|
|
113
77
|
}
|
|
114
|
-
exports.StringFsstDictionaryVector = StringFsstDictionaryVector;
|
|
115
78
|
//# sourceMappingURL=stringFsstDictionaryVector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringFsstDictionaryVector.js","sourceRoot":"","sources":["../../../src/vector/fsst-dictionary/stringFsstDictionaryVector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"stringFsstDictionaryVector.js","sourceRoot":"","sources":["../../../src/vector/fsst-dictionary/stringFsstDictionaryVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,MAAM,OAAO,0BAA2B,SAAQ,kBAAsC;IAU7D;IAGA;IACA;IAbJ,WAAW,CAAc;IAE1C,iCAAiC;IACzB,kBAAkB,CAAc;IAChC,YAAY,CAAc;IAC1B,iBAAiB,CAAa;IAEtC,YACI,IAAY,EACK,WAAuB,EACxC,YAAwB,EACxB,gBAA4B,EACX,kBAA8B,EAC9B,iBAA6B,EAC9C,iBAA4B;QAE5B,KAAK,CAAC,IAAI,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;QAP9C,gBAAW,GAAX,WAAW,CAAY;QAGvB,uBAAkB,GAAlB,kBAAkB,CAAY;QAC9B,sBAAiB,GAAjB,iBAAiB,CAAY;QAI9C,IAAI,CAAC,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;IACzC,CAAC;IAES,kBAAkB,CAAC,KAAa;QACtC,mCAAmC;QACnC;;;;;;;;;;;;;;;;;;;;;;;;WAwBG;QACH;;;;;eAKO;QAEP,IAAI,IAAI,CAAC,iBAAiB,IAAI,IAAI,EAAE,CAAC;YACjC,IAAI,IAAI,CAAC,kBAAkB,IAAI,IAAI,EAAE,CAAC;gBAClC,2FAA2F;gBAC3F,IAAI,CAAC,kBAAkB,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;gBAC7E,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACrE,CAAC;YAED,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC1G,CAAC;QAED,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QACvC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxC,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1C,OAAO,YAAY,CAAC,IAAI,CAAC,iBAAiB,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC5D,CAAC;IAED,mCAAmC;IAC3B,oBAAoB,CAAC,YAAwB;QACjD,MAAM,YAAY,GAAG,IAAI,WAAW,CAAC,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC9D,IAAI,cAAc,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;QACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAC3C,MAAM,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC;YAC/B,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,MAAM,GAAG,cAAc,CAAC;YAC9C,cAAc,GAAG,MAAM,CAAC;QAC5B,CAAC;QAED,OAAO,YAAY,CAAC;IACxB,CAAC;CACJ"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it, expect, beforeEach } from "vitest";
|
|
2
|
+
import BitVector from "../flat/bitVector";
|
|
3
|
+
import { StringFsstDictionaryVector } from "./stringFsstDictionaryVector";
|
|
4
|
+
describe("StringFsstDictionaryVector", () => {
|
|
5
|
+
let indexBuffer;
|
|
6
|
+
let offsetBuffer;
|
|
7
|
+
let dictionaryBuffer;
|
|
8
|
+
let symbolOffsetBuffer;
|
|
9
|
+
let symbolTableBuffer;
|
|
10
|
+
let nullabilityBuffer;
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
indexBuffer = new Int32Array([0, 1, 2]);
|
|
13
|
+
offsetBuffer = new Int32Array([0, 5, 10]);
|
|
14
|
+
dictionaryBuffer = new Uint8Array([
|
|
15
|
+
/* mock data */
|
|
16
|
+
]);
|
|
17
|
+
symbolOffsetBuffer = new Int32Array([0, 3, 6]);
|
|
18
|
+
symbolTableBuffer = new Uint8Array([
|
|
19
|
+
/* mock data */
|
|
20
|
+
]);
|
|
21
|
+
nullabilityBuffer = new BitVector(new Uint8Array([0b00000001]), 2);
|
|
22
|
+
});
|
|
23
|
+
it("should create an instance of StringFsstDictionaryVector", () => {
|
|
24
|
+
const vector = new StringFsstDictionaryVector("testVector", indexBuffer, offsetBuffer, dictionaryBuffer, symbolOffsetBuffer, symbolTableBuffer, nullabilityBuffer);
|
|
25
|
+
expect(vector).toBeInstanceOf(StringFsstDictionaryVector);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
//# sourceMappingURL=stringFsstDictionaryVector.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stringFsstDictionaryVector.spec.js","sourceRoot":"","sources":["../../../src/vector/fsst-dictionary/stringFsstDictionaryVector.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAC1D,OAAO,SAAS,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACxC,IAAI,WAAuB,CAAC;IAC5B,IAAI,YAAwB,CAAC;IAC7B,IAAI,gBAA4B,CAAC;IACjC,IAAI,kBAA8B,CAAC;IACnC,IAAI,iBAA6B,CAAC;IAClC,IAAI,iBAA4B,CAAC;IAEjC,UAAU,CAAC,GAAG,EAAE;QACZ,WAAW,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QACxC,YAAY,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;QAC1C,gBAAgB,GAAG,IAAI,UAAU,CAAC;QAC9B,eAAe;SAClB,CAAC,CAAC;QACH,kBAAkB,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC/C,iBAAiB,GAAG,IAAI,UAAU,CAAC;QAC/B,eAAe;SAClB,CAAC,CAAC;QACH,iBAAiB,GAAG,IAAI,SAAS,CAAC,IAAI,UAAU,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,yDAAyD,EAAE,GAAG,EAAE;QAC/D,MAAM,MAAM,GAAG,IAAI,0BAA0B,CACzC,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,iBAAiB,CACpB,CAAC;QACF,MAAM,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC,0BAA0B,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { GeometryVector, type MortonSettings } from "./geometryVector";
|
|
2
2
|
import type TopologyVector from "../../vector/geometry/topologyVector";
|
|
3
|
-
import { type SelectionVector } from "../filter/selectionVector";
|
|
4
|
-
import { type SINGLE_PART_GEOMETRY_TYPE } from "./geometryType";
|
|
5
3
|
import { VertexBufferType } from "./vertexBufferType";
|
|
6
4
|
export declare class ConstGeometryVector extends GeometryVector {
|
|
7
5
|
private readonly _numGeometries;
|
|
@@ -12,7 +10,5 @@ export declare class ConstGeometryVector extends GeometryVector {
|
|
|
12
10
|
geometryType(index: number): number;
|
|
13
11
|
get numGeometries(): number;
|
|
14
12
|
containsPolygonGeometry(): boolean;
|
|
15
|
-
filter(geometryType: SINGLE_PART_GEOMETRY_TYPE): SelectionVector;
|
|
16
|
-
filterSelected(geometryType: SINGLE_PART_GEOMETRY_TYPE, selectionVector: SelectionVector): void;
|
|
17
13
|
containsSingleGeometryType(): boolean;
|
|
18
14
|
}
|
|
@@ -1,21 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const vertexBufferType_1 = require("./vertexBufferType");
|
|
8
|
-
class ConstGeometryVector extends geometryVector_1.GeometryVector {
|
|
1
|
+
import { GeometryVector } from "./geometryVector";
|
|
2
|
+
import { GEOMETRY_TYPE } from "./geometryType";
|
|
3
|
+
import { VertexBufferType } from "./vertexBufferType";
|
|
4
|
+
export class ConstGeometryVector extends GeometryVector {
|
|
5
|
+
_numGeometries;
|
|
6
|
+
_geometryType;
|
|
9
7
|
constructor(_numGeometries, _geometryType, vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings) {
|
|
10
8
|
super(vertexBufferType, topologyVector, vertexOffsets, vertexBuffer, mortonSettings);
|
|
11
9
|
this._numGeometries = _numGeometries;
|
|
12
10
|
this._geometryType = _geometryType;
|
|
13
11
|
}
|
|
14
12
|
static createMortonEncoded(numGeometries, geometryType, topologyVector, vertexOffsets, vertexBuffer, mortonInfo) {
|
|
15
|
-
return new ConstGeometryVector(numGeometries, geometryType,
|
|
13
|
+
return new ConstGeometryVector(numGeometries, geometryType, VertexBufferType.MORTON, topologyVector, vertexOffsets, vertexBuffer, mortonInfo);
|
|
16
14
|
}
|
|
17
15
|
static create(numGeometries, geometryType, topologyVector, vertexOffsets, vertexBuffer) {
|
|
18
|
-
return new ConstGeometryVector(numGeometries, geometryType,
|
|
16
|
+
return new ConstGeometryVector(numGeometries, geometryType, VertexBufferType.VEC_2, topologyVector, vertexOffsets, vertexBuffer);
|
|
19
17
|
}
|
|
20
18
|
geometryType(index) {
|
|
21
19
|
return this._geometryType;
|
|
@@ -24,29 +22,10 @@ class ConstGeometryVector extends geometryVector_1.GeometryVector {
|
|
|
24
22
|
return this._numGeometries;
|
|
25
23
|
}
|
|
26
24
|
containsPolygonGeometry() {
|
|
27
|
-
return this._geometryType ===
|
|
28
|
-
}
|
|
29
|
-
//TODO: refactor -> quick and dirty -> let a multi part geometry be equal to a single part geometry
|
|
30
|
-
//to produce the same results as with MVT and the existing styles
|
|
31
|
-
filter(geometryType) {
|
|
32
|
-
if (geometryType !== this._geometryType && geometryType + 3 !== this._geometryType) {
|
|
33
|
-
return new flatSelectionVector_1.FlatSelectionVector([]);
|
|
34
|
-
}
|
|
35
|
-
//TODO: use ConstSelectionVector
|
|
36
|
-
const selectionVector = new Array(this.numGeometries);
|
|
37
|
-
for (let i = 0; i < this.numGeometries; i++) {
|
|
38
|
-
selectionVector[i] = i;
|
|
39
|
-
}
|
|
40
|
-
return new flatSelectionVector_1.FlatSelectionVector(selectionVector);
|
|
41
|
-
}
|
|
42
|
-
filterSelected(geometryType, selectionVector) {
|
|
43
|
-
if (geometryType !== this._geometryType && geometryType + 3 !== this._geometryType) {
|
|
44
|
-
selectionVector.setLimit(0);
|
|
45
|
-
}
|
|
25
|
+
return this._geometryType === GEOMETRY_TYPE.POLYGON || this._geometryType === GEOMETRY_TYPE.MULTIPOLYGON;
|
|
46
26
|
}
|
|
47
27
|
containsSingleGeometryType() {
|
|
48
28
|
return true;
|
|
49
29
|
}
|
|
50
30
|
}
|
|
51
|
-
exports.ConstGeometryVector = ConstGeometryVector;
|
|
52
31
|
//# sourceMappingURL=constGeometryVector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constGeometryVector.js","sourceRoot":"","sources":["../../../src/vector/geometry/constGeometryVector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constGeometryVector.js","sourceRoot":"","sources":["../../../src/vector/geometry/constGeometryVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAC;AAEvE,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEtD,MAAM,OAAO,mBAAoB,SAAQ,cAAc;IAE9B;IACA;IAFrB,YACqB,cAAsB,EACtB,aAAqB,EACtC,gBAAkC,EAClC,cAA8B,EAC9B,aAAyB,EACzB,YAAwB,EACxB,cAA+B;QAE/B,KAAK,CAAC,gBAAgB,EAAE,cAAc,EAAE,aAAa,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;QARpE,mBAAc,GAAd,cAAc,CAAQ;QACtB,kBAAa,GAAb,aAAa,CAAQ;IAQ1C,CAAC;IAED,MAAM,CAAC,mBAAmB,CACtB,aAAqB,EACrB,YAAoB,EACpB,cAA8B,EAC9B,aAAyB,EACzB,YAAwB,EACxB,UAA0B;QAE1B,OAAO,IAAI,mBAAmB,CAC1B,aAAa,EACb,YAAY,EACZ,gBAAgB,CAAC,MAAM,EACvB,cAAc,EACd,aAAa,EACb,YAAY,EACZ,UAAU,CACb,CAAC;IACN,CAAC;IAED,MAAM,CAAC,MAAM,CACT,aAAqB,EACrB,YAAoB,EACpB,cAA8B,EAC9B,aAAyB,EACzB,YAAwB;QAExB,OAAO,IAAI,mBAAmB,CAC1B,aAAa,EACb,YAAY,EACZ,gBAAgB,CAAC,KAAK,EACtB,cAAc,EACd,aAAa,EACb,YAAY,CACf,CAAC;IACN,CAAC;IAED,YAAY,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,uBAAuB;QACnB,OAAO,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,OAAO,IAAI,IAAI,CAAC,aAAa,KAAK,aAAa,CAAC,YAAY,CAAC;IAC7G,CAAC;IAED,0BAA0B;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { type SelectionVector } from "../filter/selectionVector";
|
|
2
1
|
import { GpuVector } from "./gpuVector";
|
|
3
|
-
import { type SINGLE_PART_GEOMETRY_TYPE } from "./geometryType";
|
|
4
2
|
import type TopologyVector from "./topologyVector";
|
|
5
3
|
export declare class ConstGpuVector extends GpuVector {
|
|
6
4
|
private readonly _numGeometries;
|
|
@@ -9,7 +7,5 @@ export declare class ConstGpuVector extends GpuVector {
|
|
|
9
7
|
static create(numGeometries: number, geometryType: number, triangleOffsets: Int32Array, indexBuffer: Int32Array, vertexBuffer: Int32Array, topologyVector?: TopologyVector | null): GpuVector;
|
|
10
8
|
geometryType(index: number): number;
|
|
11
9
|
get numGeometries(): number;
|
|
12
|
-
filter(geometryType: SINGLE_PART_GEOMETRY_TYPE): SelectionVector;
|
|
13
|
-
filterSelected(geometryType: SINGLE_PART_GEOMETRY_TYPE, selectionVector: SelectionVector): void;
|
|
14
10
|
containsSingleGeometryType(): boolean;
|
|
15
11
|
}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ConstGpuVector = void 0;
|
|
4
|
-
const flatSelectionVector_1 = require("../filter/flatSelectionVector");
|
|
5
|
-
const gpuVector_1 = require("./gpuVector");
|
|
1
|
+
import { GpuVector } from "./gpuVector";
|
|
6
2
|
//TODO: extend from GeometryVector -> make topology vector optional
|
|
7
|
-
class ConstGpuVector extends
|
|
3
|
+
export class ConstGpuVector extends GpuVector {
|
|
4
|
+
_numGeometries;
|
|
5
|
+
_geometryType;
|
|
8
6
|
constructor(_numGeometries, _geometryType, triangleOffsets, indexBuffer, vertexBuffer, topologyVector) {
|
|
9
7
|
super(triangleOffsets, indexBuffer, vertexBuffer, topologyVector);
|
|
10
8
|
this._numGeometries = _numGeometries;
|
|
@@ -40,27 +38,8 @@ class ConstGpuVector extends gpuVector_1.GpuVector {
|
|
|
40
38
|
get numGeometries() {
|
|
41
39
|
return this._numGeometries;
|
|
42
40
|
}
|
|
43
|
-
//TODO: refactor -> quick and dirty -> let a multi part geometry be equal to a single part geometry
|
|
44
|
-
//to produce the same results as with MVT and the existing styles
|
|
45
|
-
filter(geometryType) {
|
|
46
|
-
if (geometryType !== this._geometryType && geometryType + 3 !== this._geometryType) {
|
|
47
|
-
return new flatSelectionVector_1.FlatSelectionVector([]);
|
|
48
|
-
}
|
|
49
|
-
//TODO: use ConstSelectionVector
|
|
50
|
-
const selectionVector = new Array(this.numGeometries);
|
|
51
|
-
for (let i = 0; i < this.numGeometries; i++) {
|
|
52
|
-
selectionVector[i] = i;
|
|
53
|
-
}
|
|
54
|
-
return new flatSelectionVector_1.FlatSelectionVector(selectionVector);
|
|
55
|
-
}
|
|
56
|
-
filterSelected(geometryType, selectionVector) {
|
|
57
|
-
if (geometryType !== this._geometryType && geometryType + 3 !== this._geometryType) {
|
|
58
|
-
selectionVector.setLimit(0);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
41
|
containsSingleGeometryType() {
|
|
62
42
|
return true;
|
|
63
43
|
}
|
|
64
44
|
}
|
|
65
|
-
exports.ConstGpuVector = ConstGpuVector;
|
|
66
45
|
//# sourceMappingURL=constGpuVector.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constGpuVector.js","sourceRoot":"","sources":["../../../src/vector/geometry/constGpuVector.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constGpuVector.js","sourceRoot":"","sources":["../../../src/vector/geometry/constGpuVector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,mEAAmE;AACnE,MAAM,OAAO,cAAe,SAAQ,SAAS;IAEpB;IACA;IAFrB,YACqB,cAAsB,EACtB,aAAqB,EACtC,eAA2B,EAC3B,WAAuB,EACvB,YAAwB,EACxB,cAAsC;QAEtC,KAAK,CAAC,eAAe,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,CAAC,CAAC;QAPjD,mBAAc,GAAd,cAAc,CAAQ;QACtB,kBAAa,GAAb,aAAa,CAAQ;IAO1C,CAAC;IAED,MAAM,CAAC,MAAM,CACT,aAAqB,EACrB,YAAoB,EACpB,eAA2B,EAC3B,WAAuB,EACvB,YAAwB,EACxB,cAAsC;QAEtC,OAAO,IAAI,cAAc,CACrB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,cAAc,CACjB,CAAC;IACN,CAAC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IAEH,YAAY,CAAC,KAAa;QACtB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED,0BAA0B;QACtB,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { GeometryVector, type MortonSettings } from "./geometryVector";
|
|
2
2
|
import type TopologyVector from "../../vector/geometry/topologyVector";
|
|
3
|
-
import { type SelectionVector } from "../filter/selectionVector";
|
|
4
|
-
import { type SINGLE_PART_GEOMETRY_TYPE } from "./geometryType";
|
|
5
3
|
import { VertexBufferType } from "./vertexBufferType";
|
|
6
4
|
export declare class FlatGeometryVector extends GeometryVector {
|
|
7
5
|
private readonly _geometryTypes;
|
|
@@ -11,7 +9,5 @@ export declare class FlatGeometryVector extends GeometryVector {
|
|
|
11
9
|
geometryType(index: number): number;
|
|
12
10
|
get numGeometries(): number;
|
|
13
11
|
containsPolygonGeometry(): boolean;
|
|
14
|
-
filter(geometryType: SINGLE_PART_GEOMETRY_TYPE): SelectionVector;
|
|
15
|
-
filterSelected(predicateGeometryType: SINGLE_PART_GEOMETRY_TYPE, selectionVector: SelectionVector): void;
|
|
16
12
|
containsSingleGeometryType(): boolean;
|
|
17
13
|
}
|