@loaders.gl/las 4.2.0-alpha.5 → 4.2.0-alpha.6
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/dist.dev.js +35 -23
- package/dist/dist.min.js +7 -7
- package/dist/index.cjs +36 -23
- package/dist/index.cjs.map +2 -2
- package/dist/las-loader.js +1 -1
- package/dist/las-worker.js +39 -25
- package/dist/lib/laslaz-decoder.js +34 -22
- package/package.json +6 -6
package/dist/las-loader.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
2
2
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
3
|
-
const VERSION = typeof "4.2.0-alpha.
|
|
3
|
+
const VERSION = typeof "4.2.0-alpha.5" !== 'undefined' ? "4.2.0-alpha.5" : 'latest';
|
|
4
4
|
/**
|
|
5
5
|
* Loader for the LAS (LASer) point cloud format
|
|
6
6
|
* @note Does not support LAS v1.4
|
package/dist/las-worker.js
CHANGED
|
@@ -76,7 +76,9 @@
|
|
|
76
76
|
}
|
|
77
77
|
getParentPort().then((parentPort2) => {
|
|
78
78
|
if (parentPort2) {
|
|
79
|
-
parentPort2.on("message",
|
|
79
|
+
parentPort2.on("message", (message) => {
|
|
80
|
+
handleMessage(message);
|
|
81
|
+
});
|
|
80
82
|
parentPort2.on("exit", () => console.debug("Node worker closing"));
|
|
81
83
|
} else {
|
|
82
84
|
globalThis.onmessage = handleMessage;
|
|
@@ -215,7 +217,7 @@
|
|
|
215
217
|
}
|
|
216
218
|
|
|
217
219
|
// src/las-loader.ts
|
|
218
|
-
var VERSION = true ? "4.2.0-alpha.
|
|
220
|
+
var VERSION = true ? "4.2.0-alpha.5" : "latest";
|
|
219
221
|
var LASLoader = {
|
|
220
222
|
name: "LAS",
|
|
221
223
|
id: "las",
|
|
@@ -19012,22 +19014,23 @@
|
|
|
19012
19014
|
return o;
|
|
19013
19015
|
}
|
|
19014
19016
|
var LASLoader2 = class {
|
|
19017
|
+
arraybuffer;
|
|
19018
|
+
readOffset = 0;
|
|
19019
|
+
header = {
|
|
19020
|
+
pointsOffset: 0,
|
|
19021
|
+
pointsFormatId: 0,
|
|
19022
|
+
pointsStructSize: 0,
|
|
19023
|
+
pointsCount: 0,
|
|
19024
|
+
scale: [0, 0, 0],
|
|
19025
|
+
offset: [0, 0, 0],
|
|
19026
|
+
maxs: [0],
|
|
19027
|
+
mins: [0],
|
|
19028
|
+
totalToRead: 0,
|
|
19029
|
+
totalRead: 0,
|
|
19030
|
+
versionAsString: "",
|
|
19031
|
+
isCompressed: true
|
|
19032
|
+
};
|
|
19015
19033
|
constructor(arraybuffer) {
|
|
19016
|
-
this.readOffset = 0;
|
|
19017
|
-
this.header = {
|
|
19018
|
-
pointsOffset: 0,
|
|
19019
|
-
pointsFormatId: 0,
|
|
19020
|
-
pointsStructSize: 0,
|
|
19021
|
-
pointsCount: 0,
|
|
19022
|
-
scale: [0, 0, 0],
|
|
19023
|
-
offset: [0, 0, 0],
|
|
19024
|
-
maxs: [0],
|
|
19025
|
-
mins: [0],
|
|
19026
|
-
totalToRead: 0,
|
|
19027
|
-
totalRead: 0,
|
|
19028
|
-
versionAsString: "",
|
|
19029
|
-
isCompressed: true
|
|
19030
|
-
};
|
|
19031
19034
|
this.arraybuffer = arraybuffer;
|
|
19032
19035
|
}
|
|
19033
19036
|
/**
|
|
@@ -19099,10 +19102,11 @@
|
|
|
19099
19102
|
}
|
|
19100
19103
|
};
|
|
19101
19104
|
var LAZLoader = class {
|
|
19105
|
+
arraybuffer;
|
|
19106
|
+
instance = null;
|
|
19107
|
+
// LASZip instance
|
|
19108
|
+
header = null;
|
|
19102
19109
|
constructor(arraybuffer) {
|
|
19103
|
-
this.instance = null;
|
|
19104
|
-
// LASZip instance
|
|
19105
|
-
this.header = null;
|
|
19106
19110
|
this.arraybuffer = arraybuffer;
|
|
19107
19111
|
if (!Module) {
|
|
19108
19112
|
Module = getModule();
|
|
@@ -19198,6 +19202,14 @@
|
|
|
19198
19202
|
}
|
|
19199
19203
|
};
|
|
19200
19204
|
var LASDecoder = class {
|
|
19205
|
+
arrayb;
|
|
19206
|
+
decoder;
|
|
19207
|
+
pointsCount;
|
|
19208
|
+
pointSize;
|
|
19209
|
+
scale;
|
|
19210
|
+
offset;
|
|
19211
|
+
mins;
|
|
19212
|
+
maxs;
|
|
19201
19213
|
constructor(buffer, len, header) {
|
|
19202
19214
|
this.arrayb = buffer;
|
|
19203
19215
|
this.decoder = POINT_FORMAT_READERS[header.pointsFormatId];
|
|
@@ -19222,12 +19234,14 @@
|
|
|
19222
19234
|
}
|
|
19223
19235
|
};
|
|
19224
19236
|
var LASFile = class {
|
|
19237
|
+
arraybuffer;
|
|
19238
|
+
formatId = 0;
|
|
19239
|
+
loader;
|
|
19240
|
+
isCompressed = true;
|
|
19241
|
+
isOpen = false;
|
|
19242
|
+
version = 0;
|
|
19243
|
+
versionAsString = "";
|
|
19225
19244
|
constructor(arraybuffer) {
|
|
19226
|
-
this.formatId = 0;
|
|
19227
|
-
this.isCompressed = true;
|
|
19228
|
-
this.isOpen = false;
|
|
19229
|
-
this.version = 0;
|
|
19230
|
-
this.versionAsString = "";
|
|
19231
19245
|
this.arraybuffer = arraybuffer;
|
|
19232
19246
|
if (this.determineVersion() > 13) {
|
|
19233
19247
|
throw new Error("Only file versions <= 1.3 are supported at this time");
|
|
@@ -80,22 +80,23 @@ function parseLASHeader(arraybuffer) {
|
|
|
80
80
|
// Loads uncompressed files
|
|
81
81
|
//
|
|
82
82
|
class LASLoader {
|
|
83
|
+
arraybuffer;
|
|
84
|
+
readOffset = 0;
|
|
85
|
+
header = {
|
|
86
|
+
pointsOffset: 0,
|
|
87
|
+
pointsFormatId: 0,
|
|
88
|
+
pointsStructSize: 0,
|
|
89
|
+
pointsCount: 0,
|
|
90
|
+
scale: [0, 0, 0],
|
|
91
|
+
offset: [0, 0, 0],
|
|
92
|
+
maxs: [0],
|
|
93
|
+
mins: [0],
|
|
94
|
+
totalToRead: 0,
|
|
95
|
+
totalRead: 0,
|
|
96
|
+
versionAsString: '',
|
|
97
|
+
isCompressed: true
|
|
98
|
+
};
|
|
83
99
|
constructor(arraybuffer) {
|
|
84
|
-
this.readOffset = 0;
|
|
85
|
-
this.header = {
|
|
86
|
-
pointsOffset: 0,
|
|
87
|
-
pointsFormatId: 0,
|
|
88
|
-
pointsStructSize: 0,
|
|
89
|
-
pointsCount: 0,
|
|
90
|
-
scale: [0, 0, 0],
|
|
91
|
-
offset: [0, 0, 0],
|
|
92
|
-
maxs: [0],
|
|
93
|
-
mins: [0],
|
|
94
|
-
totalToRead: 0,
|
|
95
|
-
totalRead: 0,
|
|
96
|
-
versionAsString: '',
|
|
97
|
-
isCompressed: true
|
|
98
|
-
};
|
|
99
100
|
this.arraybuffer = arraybuffer;
|
|
100
101
|
}
|
|
101
102
|
/**
|
|
@@ -173,9 +174,10 @@ class LASLoader {
|
|
|
173
174
|
* Uses NaCL module to load LAZ files
|
|
174
175
|
*/
|
|
175
176
|
class LAZLoader {
|
|
177
|
+
arraybuffer;
|
|
178
|
+
instance = null; // LASZip instance
|
|
179
|
+
header = null;
|
|
176
180
|
constructor(arraybuffer) {
|
|
177
|
-
this.instance = null; // LASZip instance
|
|
178
|
-
this.header = null;
|
|
179
181
|
this.arraybuffer = arraybuffer;
|
|
180
182
|
if (!Module) {
|
|
181
183
|
// Avoid executing laz-perf on import
|
|
@@ -277,6 +279,14 @@ class LAZLoader {
|
|
|
277
279
|
* Helper class: Decodes LAS records into points
|
|
278
280
|
*/
|
|
279
281
|
class LASDecoder {
|
|
282
|
+
arrayb;
|
|
283
|
+
decoder;
|
|
284
|
+
pointsCount;
|
|
285
|
+
pointSize;
|
|
286
|
+
scale;
|
|
287
|
+
offset;
|
|
288
|
+
mins;
|
|
289
|
+
maxs;
|
|
280
290
|
constructor(buffer, len, header) {
|
|
281
291
|
this.arrayb = buffer;
|
|
282
292
|
this.decoder = POINT_FORMAT_READERS[header.pointsFormatId];
|
|
@@ -304,12 +314,14 @@ class LASDecoder {
|
|
|
304
314
|
* A single consistent interface for loading LAS/LAZ files
|
|
305
315
|
*/
|
|
306
316
|
export class LASFile {
|
|
317
|
+
arraybuffer;
|
|
318
|
+
formatId = 0;
|
|
319
|
+
loader;
|
|
320
|
+
isCompressed = true;
|
|
321
|
+
isOpen = false;
|
|
322
|
+
version = 0;
|
|
323
|
+
versionAsString = '';
|
|
307
324
|
constructor(arraybuffer) {
|
|
308
|
-
this.formatId = 0;
|
|
309
|
-
this.isCompressed = true;
|
|
310
|
-
this.isOpen = false;
|
|
311
|
-
this.version = 0;
|
|
312
|
-
this.versionAsString = '';
|
|
313
325
|
this.arraybuffer = arraybuffer;
|
|
314
326
|
if (this.determineVersion() > 13) {
|
|
315
327
|
throw new Error('Only file versions <= 1.3 are supported at this time');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/las",
|
|
3
|
-
"version": "4.2.0-alpha.
|
|
3
|
+
"version": "4.2.0-alpha.6",
|
|
4
4
|
"description": "Framework-independent loader for the LAS and LAZ formats",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
},
|
|
33
33
|
"sideEffects": false,
|
|
34
34
|
"browser": {
|
|
35
|
+
"crypto": false,
|
|
35
36
|
"fs": false,
|
|
36
37
|
"path": false,
|
|
37
|
-
"ws": false
|
|
38
|
-
"crypto": false
|
|
38
|
+
"ws": false
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"src",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"build-worker": "esbuild src/workers/las-worker.ts --bundle --outfile=dist/las-worker.js --define:__VERSION__=\\\"$npm_package_version\\\""
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@loaders.gl/loader-utils": "4.2.0-alpha.
|
|
53
|
-
"@loaders.gl/schema": "4.2.0-alpha.
|
|
52
|
+
"@loaders.gl/loader-utils": "4.2.0-alpha.6",
|
|
53
|
+
"@loaders.gl/schema": "4.2.0-alpha.6",
|
|
54
54
|
"laz-perf": "^0.0.6"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
57
|
"@loaders.gl/core": "^4.0.0"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "37bd8ca71763529f18727ee4bf29dd176aa914ca"
|
|
60
60
|
}
|