Initial commit
This commit is contained in:
8
node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.d.ts
generated
vendored
Normal file
8
node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export declare enum DictionaryType {
|
||||
NONE = "NONE",
|
||||
SINGLE = "SINGLE",
|
||||
SHARED = "SHARED",
|
||||
VERTEX = "VERTEX",
|
||||
MORTON = "MORTON",
|
||||
FSST = "FSST"
|
||||
}
|
||||
10
node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js
generated
vendored
Normal file
10
node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
export var DictionaryType;
|
||||
(function (DictionaryType) {
|
||||
DictionaryType["NONE"] = "NONE";
|
||||
DictionaryType["SINGLE"] = "SINGLE";
|
||||
DictionaryType["SHARED"] = "SHARED";
|
||||
DictionaryType["VERTEX"] = "VERTEX";
|
||||
DictionaryType["MORTON"] = "MORTON";
|
||||
DictionaryType["FSST"] = "FSST";
|
||||
})(DictionaryType || (DictionaryType = {}));
|
||||
//# sourceMappingURL=dictionaryType.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/dictionaryType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"dictionaryType.js","sourceRoot":"","sources":["../../../src/metadata/tile/dictionaryType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,cAOX;AAPD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,mCAAiB,CAAA;IACjB,+BAAa,CAAA;AACjB,CAAC,EAPW,cAAc,KAAd,cAAc,QAOzB","sourcesContent":["export enum DictionaryType {\n NONE = \"NONE\",\n SINGLE = \"SINGLE\",\n SHARED = \"SHARED\",\n VERTEX = \"VERTEX\",\n MORTON = \"MORTON\",\n FSST = \"FSST\",\n}\n"]}
|
||||
9
node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.d.ts
generated
vendored
Normal file
9
node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
export declare enum LengthType {
|
||||
VAR_BINARY = "VAR_BINARY",
|
||||
GEOMETRIES = "GEOMETRIES",
|
||||
PARTS = "PARTS",
|
||||
RINGS = "RINGS",
|
||||
TRIANGLES = "TRIANGLES",
|
||||
SYMBOL = "SYMBOL",
|
||||
DICTIONARY = "DICTIONARY"
|
||||
}
|
||||
11
node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js
generated
vendored
Normal file
11
node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
export var LengthType;
|
||||
(function (LengthType) {
|
||||
LengthType["VAR_BINARY"] = "VAR_BINARY";
|
||||
LengthType["GEOMETRIES"] = "GEOMETRIES";
|
||||
LengthType["PARTS"] = "PARTS";
|
||||
LengthType["RINGS"] = "RINGS";
|
||||
LengthType["TRIANGLES"] = "TRIANGLES";
|
||||
LengthType["SYMBOL"] = "SYMBOL";
|
||||
LengthType["DICTIONARY"] = "DICTIONARY";
|
||||
})(LengthType || (LengthType = {}));
|
||||
//# sourceMappingURL=lengthType.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/lengthType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"lengthType.js","sourceRoot":"","sources":["../../../src/metadata/tile/lengthType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAQX;AARD,WAAY,UAAU;IAClB,uCAAyB,CAAA;IACzB,uCAAyB,CAAA;IACzB,6BAAe,CAAA;IACf,6BAAe,CAAA;IACf,qCAAuB,CAAA;IACvB,+BAAiB,CAAA;IACjB,uCAAyB,CAAA;AAC7B,CAAC,EARW,UAAU,KAAV,UAAU,QAQrB","sourcesContent":["export enum LengthType {\n VAR_BINARY = \"VAR_BINARY\",\n GEOMETRIES = \"GEOMETRIES\",\n PARTS = \"PARTS\",\n RINGS = \"RINGS\",\n TRIANGLES = \"TRIANGLES\",\n SYMBOL = \"SYMBOL\",\n DICTIONARY = \"DICTIONARY\",\n}\n"]}
|
||||
8
node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.d.ts
generated
vendored
Normal file
8
node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export declare enum LogicalLevelTechnique {
|
||||
NONE = "NONE",
|
||||
DELTA = "DELTA",
|
||||
COMPONENTWISE_DELTA = "COMPONENTWISE_DELTA",
|
||||
RLE = "RLE",
|
||||
MORTON = "MORTON",
|
||||
PDE = "PDE"
|
||||
}
|
||||
12
node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js
generated
vendored
Normal file
12
node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export var LogicalLevelTechnique;
|
||||
(function (LogicalLevelTechnique) {
|
||||
LogicalLevelTechnique["NONE"] = "NONE";
|
||||
LogicalLevelTechnique["DELTA"] = "DELTA";
|
||||
LogicalLevelTechnique["COMPONENTWISE_DELTA"] = "COMPONENTWISE_DELTA";
|
||||
LogicalLevelTechnique["RLE"] = "RLE";
|
||||
LogicalLevelTechnique["MORTON"] = "MORTON";
|
||||
// Pseudodecimal Encoding of floats -> only for the exponent integer part an additional logical level technique is used.
|
||||
// Both exponent and significant parts are encoded with the same physical level technique
|
||||
LogicalLevelTechnique["PDE"] = "PDE";
|
||||
})(LogicalLevelTechnique || (LogicalLevelTechnique = {}));
|
||||
//# sourceMappingURL=logicalLevelTechnique.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/logicalLevelTechnique.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"logicalLevelTechnique.js","sourceRoot":"","sources":["../../../src/metadata/tile/logicalLevelTechnique.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,qBASX;AATD,WAAY,qBAAqB;IAC7B,sCAAa,CAAA;IACb,wCAAe,CAAA;IACf,oEAA2C,CAAA;IAC3C,oCAAW,CAAA;IACX,0CAAiB,CAAA;IACjB,wHAAwH;IACxH,yFAAyF;IACzF,oCAAW,CAAA;AACf,CAAC,EATW,qBAAqB,KAArB,qBAAqB,QAShC","sourcesContent":["export enum LogicalLevelTechnique {\n NONE = \"NONE\",\n DELTA = \"DELTA\",\n COMPONENTWISE_DELTA = \"COMPONENTWISE_DELTA\",\n RLE = \"RLE\",\n MORTON = \"MORTON\",\n // Pseudodecimal Encoding of floats -> only for the exponent integer part an additional logical level technique is used.\n // Both exponent and significant parts are encoded with the same physical level technique\n PDE = \"PDE\",\n}\n"]}
|
||||
8
node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.d.ts
generated
vendored
Normal file
8
node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { DictionaryType } from "./dictionaryType";
|
||||
import type { OffsetType } from "./offsetType";
|
||||
import type { LengthType } from "./lengthType";
|
||||
export type LogicalStreamType = {
|
||||
readonly dictionaryType?: DictionaryType;
|
||||
readonly offsetType?: OffsetType;
|
||||
readonly lengthType?: LengthType;
|
||||
};
|
||||
2
node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.js
generated
vendored
Normal file
2
node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
export {};
|
||||
//# sourceMappingURL=logicalStreamType.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/logicalStreamType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"logicalStreamType.js","sourceRoot":"","sources":["../../../src/metadata/tile/logicalStreamType.ts"],"names":[],"mappings":"","sourcesContent":["import type { DictionaryType } from \"./dictionaryType\";\nimport type { OffsetType } from \"./offsetType\";\nimport type { LengthType } from \"./lengthType\";\n\nexport type LogicalStreamType = {\n readonly dictionaryType?: DictionaryType;\n readonly offsetType?: OffsetType;\n readonly lengthType?: LengthType;\n};\n"]}
|
||||
6
node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.d.ts
generated
vendored
Normal file
6
node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare enum OffsetType {
|
||||
VERTEX = "VERTEX",
|
||||
INDEX = "INDEX",
|
||||
STRING = "STRING",
|
||||
KEY = "KEY"
|
||||
}
|
||||
8
node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js
generated
vendored
Normal file
8
node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export var OffsetType;
|
||||
(function (OffsetType) {
|
||||
OffsetType["VERTEX"] = "VERTEX";
|
||||
OffsetType["INDEX"] = "INDEX";
|
||||
OffsetType["STRING"] = "STRING";
|
||||
OffsetType["KEY"] = "KEY";
|
||||
})(OffsetType || (OffsetType = {}));
|
||||
//# sourceMappingURL=offsetType.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/offsetType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"offsetType.js","sourceRoot":"","sources":["../../../src/metadata/tile/offsetType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,+BAAiB,CAAA;IACjB,6BAAe,CAAA;IACf,+BAAiB,CAAA;IACjB,yBAAW,CAAA;AACf,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB","sourcesContent":["export enum OffsetType {\n VERTEX = \"VERTEX\",\n INDEX = \"INDEX\",\n STRING = \"STRING\",\n KEY = \"KEY\",\n}\n"]}
|
||||
17
node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.d.ts
generated
vendored
Normal file
17
node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.d.ts
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export declare enum PhysicalLevelTechnique {
|
||||
NONE = "NONE",
|
||||
/**
|
||||
* Preferred option, tends to produce the best compression ratio and decoding performance.
|
||||
* But currently only limited to 32 bit integer.
|
||||
*/
|
||||
FAST_PFOR = "FAST_PFOR",
|
||||
/**
|
||||
* Can produce better results in combination with a heavyweight compression scheme like Gzip.
|
||||
* Simple compression scheme where the decoder are easier to implement compared to FastPfor.
|
||||
*/
|
||||
VARINT = "VARINT",
|
||||
/**
|
||||
* Adaptive Lossless floating-Point Compression
|
||||
*/
|
||||
ALP = "ALP"
|
||||
}
|
||||
19
node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js
generated
vendored
Normal file
19
node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
export var PhysicalLevelTechnique;
|
||||
(function (PhysicalLevelTechnique) {
|
||||
PhysicalLevelTechnique["NONE"] = "NONE";
|
||||
/**
|
||||
* Preferred option, tends to produce the best compression ratio and decoding performance.
|
||||
* But currently only limited to 32 bit integer.
|
||||
*/
|
||||
PhysicalLevelTechnique["FAST_PFOR"] = "FAST_PFOR";
|
||||
/**
|
||||
* Can produce better results in combination with a heavyweight compression scheme like Gzip.
|
||||
* Simple compression scheme where the decoder are easier to implement compared to FastPfor.
|
||||
*/
|
||||
PhysicalLevelTechnique["VARINT"] = "VARINT";
|
||||
/**
|
||||
* Adaptive Lossless floating-Point Compression
|
||||
*/
|
||||
PhysicalLevelTechnique["ALP"] = "ALP";
|
||||
})(PhysicalLevelTechnique || (PhysicalLevelTechnique = {}));
|
||||
//# sourceMappingURL=physicalLevelTechnique.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/physicalLevelTechnique.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"physicalLevelTechnique.js","sourceRoot":"","sources":["../../../src/metadata/tile/physicalLevelTechnique.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,sBAgBX;AAhBD,WAAY,sBAAsB;IAC9B,uCAAa,CAAA;IACb;;;OAGG;IACH,iDAAuB,CAAA;IACvB;;;OAGG;IACH,2CAAiB,CAAA;IACjB;;OAEG;IACH,qCAAW,CAAA;AACf,CAAC,EAhBW,sBAAsB,KAAtB,sBAAsB,QAgBjC","sourcesContent":["export enum PhysicalLevelTechnique {\n NONE = \"NONE\",\n /**\n * Preferred option, tends to produce the best compression ratio and decoding performance.\n * But currently only limited to 32 bit integer.\n */\n FAST_PFOR = \"FAST_PFOR\",\n /**\n * Can produce better results in combination with a heavyweight compression scheme like Gzip.\n * Simple compression scheme where the decoder are easier to implement compared to FastPfor.\n */\n VARINT = \"VARINT\",\n /**\n * Adaptive Lossless floating-Point Compression\n */\n ALP = \"ALP\",\n}\n"]}
|
||||
6
node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.d.ts
generated
vendored
Normal file
6
node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
export declare enum PhysicalStreamType {
|
||||
PRESENT = "PRESENT",
|
||||
DATA = "DATA",
|
||||
OFFSET = "OFFSET",
|
||||
LENGTH = "LENGTH"
|
||||
}
|
||||
8
node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js
generated
vendored
Normal file
8
node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
export var PhysicalStreamType;
|
||||
(function (PhysicalStreamType) {
|
||||
PhysicalStreamType["PRESENT"] = "PRESENT";
|
||||
PhysicalStreamType["DATA"] = "DATA";
|
||||
PhysicalStreamType["OFFSET"] = "OFFSET";
|
||||
PhysicalStreamType["LENGTH"] = "LENGTH";
|
||||
})(PhysicalStreamType || (PhysicalStreamType = {}));
|
||||
//# sourceMappingURL=physicalStreamType.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/physicalStreamType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"physicalStreamType.js","sourceRoot":"","sources":["../../../src/metadata/tile/physicalStreamType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC1B,yCAAmB,CAAA;IACnB,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;AACrB,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B","sourcesContent":["export enum PhysicalStreamType {\n PRESENT = \"PRESENT\",\n DATA = \"DATA\",\n OFFSET = \"OFFSET\",\n LENGTH = \"LENGTH\",\n}\n"]}
|
||||
12
node_modules/@maplibre/mlt/dist/metadata/tile/scalarType.d.ts
generated
vendored
Normal file
12
node_modules/@maplibre/mlt/dist/metadata/tile/scalarType.d.ts
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
export declare enum ScalarType {
|
||||
BOOLEAN = 0,
|
||||
INT_8 = 1,
|
||||
UINT_8 = 2,
|
||||
INT_32 = 3,
|
||||
UINT_32 = 4,
|
||||
INT_64 = 5,
|
||||
UINT_64 = 6,
|
||||
FLOAT = 7,
|
||||
DOUBLE = 8,
|
||||
STRING = 9
|
||||
}
|
||||
14
node_modules/@maplibre/mlt/dist/metadata/tile/scalarType.js
generated
vendored
Normal file
14
node_modules/@maplibre/mlt/dist/metadata/tile/scalarType.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export var ScalarType;
|
||||
(function (ScalarType) {
|
||||
ScalarType[ScalarType["BOOLEAN"] = 0] = "BOOLEAN";
|
||||
ScalarType[ScalarType["INT_8"] = 1] = "INT_8";
|
||||
ScalarType[ScalarType["UINT_8"] = 2] = "UINT_8";
|
||||
ScalarType[ScalarType["INT_32"] = 3] = "INT_32";
|
||||
ScalarType[ScalarType["UINT_32"] = 4] = "UINT_32";
|
||||
ScalarType[ScalarType["INT_64"] = 5] = "INT_64";
|
||||
ScalarType[ScalarType["UINT_64"] = 6] = "UINT_64";
|
||||
ScalarType[ScalarType["FLOAT"] = 7] = "FLOAT";
|
||||
ScalarType[ScalarType["DOUBLE"] = 8] = "DOUBLE";
|
||||
ScalarType[ScalarType["STRING"] = 9] = "STRING";
|
||||
})(ScalarType || (ScalarType = {}));
|
||||
//# sourceMappingURL=scalarType.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/scalarType.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/scalarType.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"scalarType.js","sourceRoot":"","sources":["../../../src/metadata/tile/scalarType.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UAWX;AAXD,WAAY,UAAU;IAClB,iDAAW,CAAA;IACX,6CAAS,CAAA;IACT,+CAAU,CAAA;IACV,+CAAU,CAAA;IACV,iDAAW,CAAA;IACX,+CAAU,CAAA;IACV,iDAAW,CAAA;IACX,6CAAS,CAAA;IACT,+CAAU,CAAA;IACV,+CAAU,CAAA;AACd,CAAC,EAXW,UAAU,KAAV,UAAU,QAWrB","sourcesContent":["export enum ScalarType {\n BOOLEAN = 0,\n INT_8 = 1,\n UINT_8 = 2,\n INT_32 = 3,\n UINT_32 = 4,\n INT_64 = 5,\n UINT_64 = 6,\n FLOAT = 7,\n DOUBLE = 8,\n STRING = 9,\n}\n"]}
|
||||
29
node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.d.ts
generated
vendored
Normal file
29
node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.d.ts
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import { LogicalLevelTechnique } from "./logicalLevelTechnique";
|
||||
import { PhysicalLevelTechnique } from "./physicalLevelTechnique";
|
||||
import { PhysicalStreamType } from "./physicalStreamType";
|
||||
import type { LogicalStreamType } from "./logicalStreamType";
|
||||
import type IntWrapper from "../../decoding/intWrapper";
|
||||
export type StreamMetadata = {
|
||||
readonly physicalStreamType: PhysicalStreamType;
|
||||
readonly logicalStreamType: LogicalStreamType;
|
||||
readonly logicalLevelTechnique1: LogicalLevelTechnique;
|
||||
readonly logicalLevelTechnique2: LogicalLevelTechnique;
|
||||
readonly physicalLevelTechnique: PhysicalLevelTechnique;
|
||||
readonly numValues: number;
|
||||
readonly byteLength: number;
|
||||
/**
|
||||
* Returns the number of decompressed values.
|
||||
* For non-RLE streams, this is the same as numValues.
|
||||
* For RLE streams, this is overridden to return numRleValues.
|
||||
*/
|
||||
readonly decompressedCount: number;
|
||||
};
|
||||
export type MortonEncodedStreamMetadata = StreamMetadata & {
|
||||
readonly numBits: number;
|
||||
readonly coordinateShift: number;
|
||||
};
|
||||
export type RleEncodedStreamMetadata = StreamMetadata & {
|
||||
readonly runs: number;
|
||||
readonly numRleValues: number;
|
||||
};
|
||||
export declare function decodeStreamMetadata(tile: Uint8Array, offset: IntWrapper): StreamMetadata;
|
||||
91
node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js
generated
vendored
Normal file
91
node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js
generated
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
import { LogicalLevelTechnique } from "./logicalLevelTechnique";
|
||||
import { PhysicalLevelTechnique } from "./physicalLevelTechnique";
|
||||
import { decodeVarintInt32 } from "../../decoding/integerDecodingUtils";
|
||||
import { PhysicalStreamType } from "./physicalStreamType";
|
||||
import { DictionaryType } from "./dictionaryType";
|
||||
import { OffsetType } from "./offsetType";
|
||||
import { LengthType } from "./lengthType";
|
||||
export function decodeStreamMetadata(tile, offset) {
|
||||
const streamMetadata = decodeStreamMetadataInternal(tile, offset);
|
||||
if (streamMetadata.logicalLevelTechnique1 === LogicalLevelTechnique.MORTON) {
|
||||
return decodePartialMortonEncodedStreamMetadata(streamMetadata, tile, offset);
|
||||
}
|
||||
if ((LogicalLevelTechnique.RLE === streamMetadata.logicalLevelTechnique1 ||
|
||||
LogicalLevelTechnique.RLE === streamMetadata.logicalLevelTechnique2) &&
|
||||
PhysicalLevelTechnique.NONE !== streamMetadata.physicalLevelTechnique) {
|
||||
return decodePartialRleEncodedStreamMetadata(streamMetadata, tile, offset);
|
||||
}
|
||||
return streamMetadata;
|
||||
}
|
||||
function decodePartialMortonEncodedStreamMetadata(streamMetadata, tile, offset) {
|
||||
const mortonInfo = decodeVarintInt32(tile, offset, 2);
|
||||
return {
|
||||
physicalStreamType: streamMetadata.physicalStreamType,
|
||||
logicalStreamType: streamMetadata.logicalStreamType,
|
||||
logicalLevelTechnique1: streamMetadata.logicalLevelTechnique1,
|
||||
logicalLevelTechnique2: streamMetadata.logicalLevelTechnique2,
|
||||
physicalLevelTechnique: streamMetadata.physicalLevelTechnique,
|
||||
numValues: streamMetadata.numValues,
|
||||
byteLength: streamMetadata.byteLength,
|
||||
decompressedCount: streamMetadata.decompressedCount,
|
||||
numBits: mortonInfo[0],
|
||||
coordinateShift: mortonInfo[1],
|
||||
};
|
||||
}
|
||||
function decodePartialRleEncodedStreamMetadata(streamMetadata, tile, offset) {
|
||||
const rleInfo = decodeVarintInt32(tile, offset, 2);
|
||||
return {
|
||||
physicalStreamType: streamMetadata.physicalStreamType,
|
||||
logicalStreamType: streamMetadata.logicalStreamType,
|
||||
logicalLevelTechnique1: streamMetadata.logicalLevelTechnique1,
|
||||
logicalLevelTechnique2: streamMetadata.logicalLevelTechnique2,
|
||||
physicalLevelTechnique: streamMetadata.physicalLevelTechnique,
|
||||
numValues: streamMetadata.numValues,
|
||||
byteLength: streamMetadata.byteLength,
|
||||
decompressedCount: rleInfo[1],
|
||||
runs: rleInfo[0],
|
||||
numRleValues: rleInfo[1],
|
||||
};
|
||||
}
|
||||
function decodeStreamMetadataInternal(tile, offset) {
|
||||
const stream_type = tile[offset.get()];
|
||||
const physicalStreamType = Object.values(PhysicalStreamType)[stream_type >> 4];
|
||||
let logicalStreamType = null;
|
||||
switch (physicalStreamType) {
|
||||
case PhysicalStreamType.DATA:
|
||||
logicalStreamType = {
|
||||
dictionaryType: Object.values(DictionaryType)[stream_type & 0xf],
|
||||
};
|
||||
break;
|
||||
case PhysicalStreamType.OFFSET:
|
||||
logicalStreamType = {
|
||||
offsetType: Object.values(OffsetType)[stream_type & 0xf],
|
||||
};
|
||||
break;
|
||||
case PhysicalStreamType.LENGTH:
|
||||
logicalStreamType = {
|
||||
lengthType: Object.values(LengthType)[stream_type & 0xf],
|
||||
};
|
||||
break;
|
||||
}
|
||||
offset.increment();
|
||||
const encodings_header = tile[offset.get()];
|
||||
const llt1 = Object.values(LogicalLevelTechnique)[encodings_header >> 5];
|
||||
const llt2 = Object.values(LogicalLevelTechnique)[(encodings_header >> 2) & 0x7];
|
||||
const plt = Object.values(PhysicalLevelTechnique)[encodings_header & 0x3];
|
||||
offset.increment();
|
||||
const sizeInfo = decodeVarintInt32(tile, offset, 2);
|
||||
const numValues = sizeInfo[0];
|
||||
const byteLength = sizeInfo[1];
|
||||
return {
|
||||
physicalStreamType,
|
||||
logicalStreamType,
|
||||
logicalLevelTechnique1: llt1,
|
||||
logicalLevelTechnique2: llt2,
|
||||
physicalLevelTechnique: plt,
|
||||
numValues,
|
||||
byteLength,
|
||||
decompressedCount: numValues,
|
||||
};
|
||||
}
|
||||
//# sourceMappingURL=streamMetadataDecoder.js.map
|
||||
1
node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js.map
generated
vendored
Normal file
1
node_modules/@maplibre/mlt/dist/metadata/tile/streamMetadataDecoder.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user