las-laz-js 0.1.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -1,5 +1,60 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0 (2026-10-21)
4
+
5
+ Faster LAZ.
6
+
7
+ - LAZ chunks decode in parallel on a pool of workers (browser Workers, Node worker_threads; one
8
+ fewer than the cores, at most 16), with the next window decoding while the current one becomes
9
+ columns. A 10-million-point LAZ reads in about 0.6 s (3.9 s on one thread); a 1.2 GB,
10
+ 160-million-point LAZ in about 12 s (102 s in 0.2.0). Output is identical.
11
+ - `openLas(src, { threads })`: automatic by default (used from 4 chunks up); `threads: 1` decodes
12
+ on the calling thread. Falls back to one thread when workers cannot start.
13
+ - The decoder's hot loop does less: about 30% faster on one thread, same results.
14
+ - Demo: decodes in the background with a progress bar, then shows the cloud once; colour, ramp
15
+ and range recolour the points already read instead of reading the file again.
16
+
17
+ ## 0.2.0 (2026-10-21)
18
+
19
+ Reads LAZ.
20
+
21
+ - LAZ (LASzip) point formats 0–3 and 6–8 (item versions 2 and 3; version 4 unchecked), with extra bytes, are read by `openLas` /
22
+ `readPoints` / `chunks` / `readPointsToScratch` and the worker exactly as LAS is: each chunk
23
+ is decompressed into plain LAS records, then decoded by the same code, so every option works
24
+ the same. Plain JavaScript, translated from laz-rs (Apache-2.0); the package licence is now
25
+ `MIT AND Apache-2.0` (see `NOTICE`).
26
+ - Checked against an independent encoder: fixtures compressed by PDAL decode to exactly PDAL's own
27
+ decompression, and real files to exactly their LAS twins (1 M points), or to PDAL's decompression
28
+ (10 M points).
29
+ - `reader.laz` describes the compression. Wave-packet LAZ items, LASzip item version 1 and files
30
+ without a chunk table are `UNSUPPORTED`; a LAZ cut short is `TRUNCATED`. `COMPRESSED_LAZ` is
31
+ no longer thrown.
32
+ - Breaking: `strideFor` (deprecated in 0.1.1) is removed.
33
+ - Demo: reads LAZ, and shows its compression.
34
+
35
+ ## 0.1.1 (2026-10-21)
36
+
37
+ Fixes from the 0.1.0 review. No breaking changes.
38
+
39
+ - `maxPoints` keeps exactly that many of the points that pass the filters, spread over the whole
40
+ file. It used to keep only the start of a file, and with filters set could return nothing.
41
+ - Streamed chunks are coloured by one rule for the whole file, so windows no longer show seams
42
+ (new `createChunkColourizer`; `colourize` gains `eightBit`).
43
+ - Opening a LAS 1.4 file no longer reads its EVLRs to the end of the file: a big EVLR has
44
+ `bytes: null` until `readEvlrBytes(i)`. VLRs and EVLRs report `length`.
45
+ - Browser bundlers (esbuild, webpack, Vite) can bundle the package; the lazy Node import no
46
+ longer stops them.
47
+ - `readPoints` and `writeLas` peak near the size of what they return (a 69 MB read peaked at
48
+ 233 MB, now 74 MB); Node files are read into one reused window buffer.
49
+ - `dedupe` is about 7 times faster.
50
+ - `createLasWriter` works with OPFS scratch writers and Node file handles, and with
51
+ `writePoints` calls made without waiting.
52
+ - A custom `{ size, read }` source that returns a short read is `TRUNCATED`, never fewer points.
53
+ - Point formats 6–10 write their coordinate system as WKT, as LAS 1.4 requires; an EPSG code
54
+ alone is refused for them.
55
+ - `strideFor` is deprecated (the reader no longer uses it) and goes in 0.2.0; `countKept` is new.
56
+ - Demo: bounds, dedupe, colour range, return and intensity histograms; safe on big files.
57
+
3
58
  ## 0.1.0 (2026-10-21)
4
59
 
5
60
  First release: read and write ASPRS LAS.
package/LICENSE-APACHE ADDED
@@ -0,0 +1,51 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
37
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
38
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
39
+
40
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
41
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
42
+
43
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
44
+
45
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
46
+
47
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
48
+
49
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
50
+
51
+ END OF TERMS AND CONDITIONS
package/NOTICE ADDED
@@ -0,0 +1,14 @@
1
+ las-laz-js
2
+ Copyright (c) 2026 Brent Buffham (https://kirra-design.com). MIT licence (see LICENSE).
3
+
4
+ The LAZ decoder in src/laz/ is a JavaScript translation of laz-rs
5
+ (https://github.com/laz-rs/laz-rs), which is itself a Rust port of LASzip
6
+ (https://laszip.org) by rapidlasso. Those files are licensed under the
7
+ Apache License, Version 2.0 (see LICENSE-APACHE), not the MIT licence:
8
+
9
+ (c) 2007-2015, martin isenburg, rapidlasso - fast tools to catch reality
10
+ (c) 2014, Uday Verma, Hobu, Inc.
11
+ (c) 2019-2023, Thomas Montaigu
12
+
13
+ Changes: translated from Rust to JavaScript by Brent Buffham, 2026. Each
14
+ translated file names the laz-rs source it came from in its header.
package/README.md CHANGED
@@ -1,18 +1,22 @@
1
1
  # las-laz-js
2
2
 
3
- A JavaScript reader and writer for ASPRS **LAS** point clouds (LAZ to follow), published on npm
4
- as `las-laz-js`. Plain ES modules, no dependencies, runs in the browser and in Node — and built
5
- for files far larger than memory.
3
+ A JavaScript reader and writer for ASPRS **LAS** point clouds, and a reader for **LAZ**
4
+ (LASzip-compressed LAS), published on npm as `las-laz-js`. Plain ES modules, no dependencies,
5
+ runs in the browser and in Node — and built for files far larger than memory.
6
6
 
7
7
  **Status: early (0.x).** It works and is tested, but the API may still change before 1.0.
8
8
 
9
9
  - Working: `openLas` reads the header, VLRs / EVLRs and coordinate system of LAS 1.0–1.4;
10
10
  `readPoints` and `chunks` decode every point format (0–10) a window at a time, with filters
11
11
  and thinning; `colourize` colours points; `writeLas` writes LAS 1.0–1.4.
12
- - Big files: a 1.1 GB, 34-million-point cloud reads in about 2 seconds in Node, and is never held
13
- in memory whole.
14
- - Also: a ready-made module Worker (`las-laz-js/worker`) and a Three.js demo.
15
- - Not yet: reading LAZ (0.2.0) and writing LAZ (0.3.0).
12
+ - LAZ: point formats 0–3 and 6–8, with extra bytes, read exactly like LAS — the same calls, the
13
+ same options, decoded chunk by chunk in plain JavaScript (no WebAssembly).
14
+ - Big files: a 1.1 GB, 34-million-point LAS reads in under a second in Node, and a 10-million-point
15
+ LAZ decodes on every core (a 10-million-point file in about 0.6 s); neither is held in memory
16
+ whole (see LAZ below for the one exception).
17
+ - Also: a ready-made module Worker (`las-laz-js/worker`) and a
18
+ [Three.js demo](https://brentbuffham.github.io/las-laz-js/).
19
+ - Not yet: writing LAZ (0.3.0).
16
20
 
17
21
  ## Install
18
22
 
@@ -24,9 +28,14 @@ Node 22 or newer, or any current browser. No dependencies.
24
28
 
25
29
  ## Demo
26
30
 
27
- Drop a LAS file onto the page and it is read locally (never uploaded), in the library's Worker,
28
- and streamed into a Three.js viewer. The side panel runs every library function.
29
- Run it locally with `npm run demo`, then open http://localhost:8080/.
31
+ Try it in the browser: **https://brentbuffham.github.io/las-laz-js/**
32
+
33
+ Drop a LAS or LAZ file onto the page. It is read locally (never uploaded), decoded in the
34
+ library's Worker (LAZ on every core) behind a progress bar, then shown once in a Three.js viewer;
35
+ colour changes recolour the points already read, without reading the file again. The side panel shows the header, VLRs, coordinate
36
+ system and LAZ compression; reads with class, return, bounds, thinning and dedupe filters;
37
+ colours by RGB, intensity, elevation or class; lists point statistics; and saves the points back
38
+ out as LAS. To run it locally: `npm run demo`, then open http://localhost:8080/.
30
39
 
31
40
  ## Reading
32
41
 
@@ -37,7 +46,10 @@ var las = await openLas(file); // File / Blob, ArrayBuffer, Uint8Array
37
46
  las.header; // { versionMajor, versionMinor, pointFormat, pointCount, bounds, scale, offset,
38
47
  // software, systemId, creationDay, creationYear, pointsByReturn, compressed, ... }
39
48
  las.crs; // { kind: "geokeys" | "wkt" | null, epsg, wkt?, keys? } — parsed, never reprojected
40
- las.vlrs; // [{ userId, recordId, description, bytes }]
49
+ las.vlrs; // [{ userId, recordId, description, start, length, bytes }]
50
+ las.evlrs; // the same; an EVLR over 64 KiB (waveform data) has bytes: null until
51
+ // await las.readEvlrBytes(i) — opening never reads it
52
+ las.compressed; las.laz; // true for LAZ; its compressor, chunk size and items (else null)
41
53
 
42
54
  var pts = await las.readPoints({
43
55
  fields: ["x", "y", "z", "classification", "red", "green", "blue"],
@@ -60,12 +72,38 @@ red green blue nir`. Fields a point format does not hold are left out. `scanAngl
60
72
  degrees for every format.
61
73
 
62
74
  Filters run on the raw record before it is decoded, so a filtered-out point costs a byte read.
75
+ `maxPoints` keeps exactly that many of the points that pass the filters, spread evenly over
76
+ the whole file; with filters set it first counts the passing points, which reads the file twice.
77
+
78
+ ## LAZ
79
+
80
+ A LAZ file is opened and read with the same calls as LAS. Each LASzip chunk (50,000 points in
81
+ most files) is decompressed into the plain LAS records it holds, then decoded exactly as a LAS
82
+ window is — so every option above works the same, and reading a LAZ gives the same columns as
83
+ reading the LAS it was compressed from.
84
+
85
+ - Read: point formats 0–3 (LASzip point-wise, item version 2) and 6–8 (layered, item version 3),
86
+ with extra bytes. Item version 4 follows laz-rs but has not been checked against a real file
87
+ (it differs from 3 only with several scanner channels).
88
+ - Not read: wave-packet items (formats 4, 5, 9, 10 in LAZ), item version 1 (LASzip before 2011),
89
+ and files without a chunk table (an unfinished write). Each is refused with `UNSUPPORTED`,
90
+ naming what it found — never garbage points.
91
+ - A LAZ file cut short is `TRUNCATED`.
92
+
93
+ **Speed.** LAZ chunks are independent, so they are decoded on a pool of workers — browser
94
+ `Worker`s or Node `worker_threads`, one fewer than the cores (at most 16) — while the next window
95
+ is already decoding. A 10-million-point LAZ reads in about 0.6 s on a 24-core machine (about 4 s
96
+ on one core). Files under four chunks (200,000 points) stay on one thread, where starting workers
97
+ would cost more than it saves. `openLas(file, { threads: 1 })` decodes on the calling thread;
98
+ `threads: n` asks for n workers. If workers cannot start, it falls back to one thread.
63
99
 
64
100
  ## Files bigger than memory
65
101
 
66
- `openLas` reads only the header and the VLRs. Points are read in windows of whole records
67
- (64 MiB by default, `openLas(file, { windowSize })`), so memory holds one window plus what you
68
- keep.
102
+ `openLas` reads only the header and the VLRs. Points are read in windows (64 MiB of records by
103
+ default, `openLas(file, { windowSize })`; for LAZ, whole chunks adding up to about that much
104
+ decompressed), so memory holds one window plus what you keep. One exception: a LAZ written
105
+ point-wise without chunks (LASzip before 2.0, rare) is one chunk, so its window is the whole
106
+ decompressed file.
69
107
 
70
108
  ```js
71
109
  for await (var chunk of las.chunks({ fields: ["x", "y", "z"] })) {
@@ -87,23 +125,28 @@ Returns a `Uint8Array`, three bytes per point. LAS colour is 16-bit and is scale
87
125
  except in files that store 8-bit values in the 16-bit fields (a common writer bug), which are
88
126
  detected and used as they are instead of turning almost black. Elevation uses a blue → cyan →
89
127
  green → yellow → red ramp; intensity a greyscale over the 2nd–98th percentile; classification
90
- the usual LiDAR-viewer colours (ASPRS defines the codes, not colours).
128
+ the usual LiDAR-viewer colours (ASPRS defines the codes, not colours). For streamed chunks,
129
+ `createChunkColourizer` keeps one rule for the whole file, so windows match.
91
130
 
92
131
  ## Writing
93
132
 
94
133
  ```js
95
134
  import { writeLas, createLasWriter } from "las-laz-js";
96
135
 
97
- var bytes = await writeLas(pts, { version: "1.4", pointFormat: 7, crs: { epsg: 28350 } });
136
+ var bytes = await writeLas(pts, { version: "1.2", pointFormat: 3, crs: { epsg: 28350 } });
137
+ var v14 = await writeLas(pts, { version: "1.4", pointFormat: 7, crs: { wkt: las.crs.wkt } });
98
138
 
99
- var w = await createLasWriter(sink, { version: "1.2", pointFormat: 3, scale, offset }); // sink: { write(bytes, position) }
139
+ var w = await createLasWriter(sink, { version: "1.2", pointFormat: 3, scale, offset });
140
+ // sink: an OPFS writer from openScratchSyncWriter, a Node FileHandle, or any { write(bytes, position) }
100
141
  await w.writePoints(batch1); await w.writePoints(batch2);
101
142
  await w.close(); // patches the header totals
102
143
  ```
103
144
 
104
145
  A version and point format that do not go together (format 6 in LAS 1.2) are refused, never
105
146
  silently changed. Scale and offset are chosen from the bounds when not given. `crs.epsg`
106
- writes a GeoKey record; `crs.wkt` a WKT record.
147
+ writes a GeoKey record; `crs.wkt` a WKT record. Point formats 6–10 must carry WKT (LAS 1.4), so
148
+ an EPSG code alone is refused for them — the library has no projection database to turn a code
149
+ into WKT. Writing LAZ arrives in 0.3.0.
107
150
 
108
151
  ## In a Worker
109
152
 
@@ -117,24 +160,33 @@ worker.postMessage({ id: 2, type: "chunks", payload: { fields: ["x", "y", "z"],
117
160
  The protocol is documented in `src/workers/workerProtocol.js` and can be driven directly with
118
161
  `createWorkerHandler(post)`.
119
162
 
163
+ **Bundlers.** The worker entry and the LAZ decode workers are found through
164
+ `new Worker(new URL(..., import.meta.url))`, which Vite and webpack 5 follow. With Vite, keep the
165
+ package out of dependency pre-bundling (`optimizeDeps: { exclude: ["las-laz-js"] }`), so the
166
+ worker files stay next to the module that loads them.
167
+
120
168
  ## Errors
121
169
 
122
170
  Every failure is a `LasError` with a stable `code` (`ERROR_CODES`) and, for byte-level problems,
123
- the file `offset`: `NOT_LAS`, `UNSUPPORTED_VERSION`, `UNSUPPORTED`, `COMPRESSED_LAZ`,
124
- `TRUNCATED`, `BAD_HEADER`, `BAD_VLR`, `INVALID_ARGUMENT`, `ABORTED`, `TOO_MANY_POINTS`.
125
- A file shorter than its header promises is `TRUNCATED`, never garbage points.
171
+ the file `offset`: `NOT_LAS`, `UNSUPPORTED_VERSION`, `UNSUPPORTED`, `TRUNCATED`, `BAD_HEADER`,
172
+ `BAD_VLR`, `INVALID_ARGUMENT`, `ABORTED`, `TOO_MANY_POINTS`. A file shorter than its header
173
+ promises is `TRUNCATED`, never garbage points. (`COMPRESSED_LAZ` is kept for 0.1 callers but is no
174
+ longer thrown: LAZ is read.)
126
175
 
127
176
  ## Scope
128
177
 
129
178
  Reprojection is out of scope (the coordinate system is reported, not changed). Waveform
130
- formats 4, 5, 9 and 10 have their point fields read; the waveform data itself is not. COPC,
131
- EPT and E57 are not read.
179
+ formats 4, 5, 9 and 10 have their point fields read from LAS; the waveform data itself is not.
180
+ COPC, EPT and E57 are not read.
132
181
 
133
182
  ## Provenance
134
183
 
135
184
  The LAS reader, writer and big-file handling come from [Kirra](https://kirra-design.com),
136
- Brent Buffham's blast-design app, rewritten as a standalone library. The LAZ codec (0.2.0) is
137
- being ported from [laz-rs](https://github.com/laz-rs/laz-rs), used under its MIT licence.
185
+ Brent Buffham's blast-design app, rewritten as a standalone library. The LAZ decoder in
186
+ `src/laz/` is a JavaScript translation of [laz-rs](https://github.com/laz-rs/laz-rs) by Thomas
187
+ Montaigu, itself a Rust port of [LASzip](https://laszip.org) by Martin Isenburg (rapidlasso).
188
+ It is checked against an independent encoder: the test fixtures were compressed by
189
+ [PDAL](https://pdal.io), and every record must equal PDAL's own decompression.
138
190
  Formats are written to the ASPRS LAS 1.4 R15 specification; see `docs/LAS_FORMAT_NOTES.md`.
139
191
 
140
192
  ## Development
@@ -144,11 +196,16 @@ npm test # node --test, every test
144
196
  npm run test:coverage # with the coverage gate
145
197
  npm run demo # the demo on http://localhost:8080/
146
198
  npm run check:private # before every push: no private sample details in the repo
199
+ node _dev/makeLazFixtures.mjs # remake test/fixtures/laz with PDAL (needs PDAL 2.x)
147
200
  ```
148
201
 
149
202
  Private sample files go in the gitignored `samples/` folder, or are listed by path in
150
- `samples/paths.txt`; the sample tests compare each file with its own header.
203
+ `samples/paths.txt`; the sample tests compare each file with its own header, and each LAZ with a
204
+ LAS twin (same count and bounds) field by field.
151
205
 
152
206
  ## Licence
153
207
 
154
- MIT © Brent Buffham
208
+ `MIT AND Apache-2.0`. The library is MIT © Brent Buffham (`LICENSE`). The LAZ decoder in
209
+ `src/laz/`, translated from laz-rs / LASzip, is under the Apache License 2.0 (`LICENSE-APACHE`,
210
+ `NOTICE`). Both are permissive: use, change and ship it in open or closed software, keeping the
211
+ notices.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "las-laz-js",
3
- "version": "0.1.0",
4
- "description": "Zero-dependency JavaScript reader and writer for ASPRS LAS point clouds (LAZ to follow), for the browser and Node, built for files larger than memory.",
3
+ "version": "0.3.0",
4
+ "description": "Zero-dependency JavaScript reader and writer for ASPRS LAS point clouds, and reader for LAZ (LASzip), for the browser and Node, built for files larger than memory.",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": "./src/index.js",
@@ -11,6 +11,8 @@
11
11
  "src",
12
12
  "README.md",
13
13
  "LICENSE",
14
+ "LICENSE-APACHE",
15
+ "NOTICE",
14
16
  "CHANGELOG.md"
15
17
  ],
16
18
  "sideEffects": false,
@@ -36,7 +38,7 @@
36
38
  "threejs"
37
39
  ],
38
40
  "author": "Brent Buffham (https://kirra-design.com)",
39
- "license": "MIT",
41
+ "license": "MIT AND Apache-2.0",
40
42
  "repository": {
41
43
  "type": "git",
42
44
  "url": "git+https://github.com/brentbuffham/las-laz-js.git"