@loaders.gl/pointclouds 0.0.0-stage → 5.0.0-beta.10
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/LAS-README.md +12 -0
- package/LICENSE +24 -0
- package/PCD-README.md +12 -0
- package/PLY-README.md +38 -0
- package/README.md +11 -2
- package/THIRD-PARTY-NOTICES.md +27 -0
- package/dist/dist.dev.js +31514 -0
- package/dist/dist.min.js +54 -0
- package/dist/index.cjs +55 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/las/bundled.cjs +69 -0
- package/dist/las/bundled.cjs.map +7 -0
- package/dist/las/bundled.d.ts +11 -0
- package/dist/las/bundled.d.ts.map +1 -0
- package/dist/las/bundled.js +11 -0
- package/dist/las/bundled.js.map +1 -0
- package/dist/las/index.cjs +75 -0
- package/dist/las/index.cjs.map +7 -0
- package/dist/las/index.d.ts +15 -0
- package/dist/las/index.d.ts.map +1 -0
- package/dist/las/index.js +12 -0
- package/dist/las/index.js.map +1 -0
- package/dist/las/las-copc-loader-types.cjs +49 -0
- package/dist/las/las-copc-loader-types.cjs.map +7 -0
- package/dist/las/las-copc-loader-types.d.ts +67 -0
- package/dist/las/las-copc-loader-types.d.ts.map +1 -0
- package/dist/las/las-copc-loader-types.js +14 -0
- package/dist/las/las-copc-loader-types.js.map +1 -0
- package/dist/las/las-copc-loader.cjs +60 -0
- package/dist/las/las-copc-loader.cjs.map +7 -0
- package/dist/las/las-copc-loader.d.ts +39 -0
- package/dist/las/las-copc-loader.d.ts.map +1 -0
- package/dist/las/las-copc-loader.js +45 -0
- package/dist/las/las-copc-loader.js.map +1 -0
- package/dist/las/las-format.cjs +44 -0
- package/dist/las/las-format.cjs.map +7 -0
- package/dist/las/las-format.d.ts +16 -0
- package/dist/las/las-format.d.ts.map +1 -0
- package/dist/las/las-format.js +19 -0
- package/dist/las/las-format.js.map +1 -0
- package/dist/las/las-loader-shared.cjs +84 -0
- package/dist/las/las-loader-shared.cjs.map +7 -0
- package/dist/las/las-loader-shared.d.ts +68 -0
- package/dist/las/las-loader-shared.d.ts.map +1 -0
- package/dist/las/las-loader-shared.js +60 -0
- package/dist/las/las-loader-shared.js.map +1 -0
- package/dist/las/las-loader-types.cjs +51 -0
- package/dist/las/las-loader-types.cjs.map +7 -0
- package/dist/las/las-loader-types.d.ts +77 -0
- package/dist/las/las-loader-types.d.ts.map +1 -0
- package/dist/las/las-loader-types.js +17 -0
- package/dist/las/las-loader-types.js.map +1 -0
- package/dist/las/las-loader.cjs +128 -0
- package/dist/las/las-loader.cjs.map +7 -0
- package/dist/las/las-loader.d.ts +91 -0
- package/dist/las/las-loader.d.ts.map +1 -0
- package/dist/las/las-loader.js +108 -0
- package/dist/las/las-loader.js.map +1 -0
- package/dist/las/las-writer.cjs +1054 -0
- package/dist/las/las-writer.cjs.map +7 -0
- package/dist/las/las-writer.d.ts +70 -0
- package/dist/las/las-writer.d.ts.map +1 -0
- package/dist/las/las-writer.js +992 -0
- package/dist/las/las-writer.js.map +1 -0
- package/dist/las/laz-rs-loader-types.cjs +49 -0
- package/dist/las/laz-rs-loader-types.cjs.map +7 -0
- package/dist/las/laz-rs-loader-types.d.ts +69 -0
- package/dist/las/laz-rs-loader-types.d.ts.map +1 -0
- package/dist/las/laz-rs-loader-types.js +16 -0
- package/dist/las/laz-rs-loader-types.js.map +1 -0
- package/dist/las/laz-rs-loader.cjs +275 -0
- package/dist/las/laz-rs-loader.cjs.map +7 -0
- package/dist/las/laz-rs-loader.d.ts +39 -0
- package/dist/las/laz-rs-loader.d.ts.map +1 -0
- package/dist/las/laz-rs-loader.js +43 -0
- package/dist/las/laz-rs-loader.js.map +1 -0
- package/dist/las/lazperf-loader-types.cjs +49 -0
- package/dist/las/lazperf-loader-types.cjs.map +7 -0
- package/dist/las/lazperf-loader-types.d.ts +71 -0
- package/dist/las/lazperf-loader-types.d.ts.map +1 -0
- package/dist/las/lazperf-loader-types.js +17 -0
- package/dist/las/lazperf-loader-types.js.map +1 -0
- package/dist/las/lazperf-loader.cjs +63 -0
- package/dist/las/lazperf-loader.cjs.map +7 -0
- package/dist/las/lazperf-loader.d.ts +41 -0
- package/dist/las/lazperf-loader.d.ts.map +1 -0
- package/dist/las/lazperf-loader.js +49 -0
- package/dist/las/lazperf-loader.js.map +1 -0
- package/dist/las/lib/copc/parse-las.cjs +177 -0
- package/dist/las/lib/copc/parse-las.cjs.map +7 -0
- package/dist/las/lib/copc/parse-las.d.ts +17 -0
- package/dist/las/lib/copc/parse-las.d.ts.map +1 -0
- package/dist/las/lib/copc/parse-las.js +215 -0
- package/dist/las/lib/copc/parse-las.js.map +1 -0
- package/dist/las/lib/get-las-schema.cjs +67 -0
- package/dist/las/lib/get-las-schema.cjs.map +7 -0
- package/dist/las/lib/get-las-schema.d.ts +16 -0
- package/dist/las/lib/get-las-schema.d.ts.map +1 -0
- package/dist/las/lib/get-las-schema.js +52 -0
- package/dist/las/lib/get-las-schema.js.map +1 -0
- package/dist/las/lib/las-compatibility.cjs +110 -0
- package/dist/las/lib/las-compatibility.cjs.map +7 -0
- package/dist/las/lib/las-compatibility.d.ts +40 -0
- package/dist/las/lib/las-compatibility.d.ts.map +1 -0
- package/dist/las/lib/las-compatibility.js +115 -0
- package/dist/las/lib/las-compatibility.js.map +1 -0
- package/dist/las/lib/las-extra-bytes.cjs +228 -0
- package/dist/las/lib/las-extra-bytes.cjs.map +7 -0
- package/dist/las/lib/las-extra-bytes.d.ts +35 -0
- package/dist/las/lib/las-extra-bytes.d.ts.map +1 -0
- package/dist/las/lib/las-extra-bytes.js +197 -0
- package/dist/las/lib/las-extra-bytes.js.map +1 -0
- package/dist/las/lib/las-types.cjs +19 -0
- package/dist/las/lib/las-types.cjs.map +7 -0
- package/dist/las/lib/las-types.d.ts +194 -0
- package/dist/las/lib/las-types.d.ts.map +1 -0
- package/dist/las/lib/las-types.js +5 -0
- package/dist/las/lib/las-types.js.map +1 -0
- package/dist/las/lib/las-waveform.cjs +196 -0
- package/dist/las/lib/las-waveform.cjs.map +7 -0
- package/dist/las/lib/las-waveform.d.ts +89 -0
- package/dist/las/lib/las-waveform.d.ts.map +1 -0
- package/dist/las/lib/las-waveform.js +193 -0
- package/dist/las/lib/las-waveform.js.map +1 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.cjs +382 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.cjs.map +7 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.d.ts +129 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.d.ts.map +1 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.js +377 -0
- package/dist/las/lib/laz-perf/laslaz-decoder.js.map +1 -0
- package/dist/las/lib/laz-perf/parse-las.cjs +271 -0
- package/dist/las/lib/laz-perf/parse-las.cjs.map +7 -0
- package/dist/las/lib/laz-perf/parse-las.d.ts +24 -0
- package/dist/las/lib/laz-perf/parse-las.d.ts.map +1 -0
- package/dist/las/lib/laz-perf/parse-las.js +308 -0
- package/dist/las/lib/laz-perf/parse-las.js.map +1 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.cjs +631 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.cjs.map +7 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.d.ts +129 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.d.ts.map +1 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.js +414 -0
- package/dist/las/lib/laz-rs-wasm/laslaz-decoder.js.map +1 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.cjs +271 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.cjs.map +7 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.d.ts +24 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.d.ts.map +1 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.js +308 -0
- package/dist/las/lib/laz-rs-wasm/parse-las.js.map +1 -0
- package/dist/las/lib/typescript/parse-las.cjs +2889 -0
- package/dist/las/lib/typescript/parse-las.cjs.map +7 -0
- package/dist/las/lib/typescript/parse-las.d.ts +39 -0
- package/dist/las/lib/typescript/parse-las.d.ts.map +1 -0
- package/dist/las/lib/typescript/parse-las.js +2703 -0
- package/dist/las/lib/typescript/parse-las.js.map +1 -0
- package/dist/las/libs/laz-perf/laz-perf.cjs +18093 -0
- package/dist/las/libs/laz-perf/laz-perf.cjs.map +7 -0
- package/dist/las/libs/laz-perf/laz-perf.d.ts +2 -0
- package/dist/las/libs/laz-perf/laz-perf.d.ts.map +1 -0
- package/dist/las/libs/laz-perf/laz-perf.js +19003 -0
- package/dist/las/libs/laz-perf/laz-perf.js.map +1 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.d.ts +95 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.d.ts.map +1 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.js +442 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm.js.map +1 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm +0 -0
- package/dist/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm.d.ts +38 -0
- package/dist/las/unbundled.cjs +69 -0
- package/dist/las/unbundled.cjs.map +7 -0
- package/dist/las/unbundled.d.ts +11 -0
- package/dist/las/unbundled.d.ts.map +1 -0
- package/dist/las/unbundled.js +11 -0
- package/dist/las/unbundled.js.map +1 -0
- package/dist/las/workers/las-worker.cjs +23 -0
- package/dist/las/workers/las-worker.cjs.map +7 -0
- package/dist/las/workers/las-worker.d.ts +2 -0
- package/dist/las/workers/las-worker.d.ts.map +1 -0
- package/dist/las/workers/las-worker.js +23 -0
- package/dist/las/workers/las-worker.js.map +1 -0
- package/dist/las-copc-loader-types.cjs +51 -0
- package/dist/las-copc-loader-types.cjs.map +7 -0
- package/dist/las-copc-loader-types.d.ts +2 -0
- package/dist/las-copc-loader-types.d.ts.map +1 -0
- package/dist/las-copc-loader-types.js +2 -0
- package/dist/las-copc-loader-types.js.map +1 -0
- package/dist/las-copc-loader.cjs +62 -0
- package/dist/las-copc-loader.cjs.map +7 -0
- package/dist/las-copc-loader.d.ts +2 -0
- package/dist/las-copc-loader.d.ts.map +1 -0
- package/dist/las-copc-loader.js +2 -0
- package/dist/las-copc-loader.js.map +1 -0
- package/dist/las-loader-types.cjs +53 -0
- package/dist/las-loader-types.cjs.map +7 -0
- package/dist/las-loader-types.d.ts +2 -0
- package/dist/las-loader-types.d.ts.map +1 -0
- package/dist/las-loader-types.js +2 -0
- package/dist/las-loader-types.js.map +1 -0
- package/dist/las-loader.cjs +130 -0
- package/dist/las-loader.cjs.map +7 -0
- package/dist/las-loader.d.ts +2 -0
- package/dist/las-loader.d.ts.map +1 -0
- package/dist/las-loader.js +2 -0
- package/dist/las-loader.js.map +1 -0
- package/dist/las-worker.js +24024 -0
- package/dist/las-writer.cjs +1056 -0
- package/dist/las-writer.cjs.map +7 -0
- package/dist/las-writer.d.ts +2 -0
- package/dist/las-writer.d.ts.map +1 -0
- package/dist/las-writer.js +2 -0
- package/dist/las-writer.js.map +1 -0
- package/dist/laz-rs-loader-types.cjs +51 -0
- package/dist/laz-rs-loader-types.cjs.map +7 -0
- package/dist/laz-rs-loader-types.d.ts +2 -0
- package/dist/laz-rs-loader-types.d.ts.map +1 -0
- package/dist/laz-rs-loader-types.js +2 -0
- package/dist/laz-rs-loader-types.js.map +1 -0
- package/dist/laz-rs-loader.cjs +277 -0
- package/dist/laz-rs-loader.cjs.map +7 -0
- package/dist/laz-rs-loader.d.ts +2 -0
- package/dist/laz-rs-loader.d.ts.map +1 -0
- package/dist/laz-rs-loader.js +2 -0
- package/dist/laz-rs-loader.js.map +1 -0
- package/dist/lazperf-loader-types.cjs +51 -0
- package/dist/lazperf-loader-types.cjs.map +7 -0
- package/dist/lazperf-loader-types.d.ts +2 -0
- package/dist/lazperf-loader-types.d.ts.map +1 -0
- package/dist/lazperf-loader-types.js +2 -0
- package/dist/lazperf-loader-types.js.map +1 -0
- package/dist/lazperf-loader.cjs +65 -0
- package/dist/lazperf-loader.cjs.map +7 -0
- package/dist/lazperf-loader.d.ts +2 -0
- package/dist/lazperf-loader.d.ts.map +1 -0
- package/dist/lazperf-loader.js +2 -0
- package/dist/lazperf-loader.js.map +1 -0
- package/dist/pcd/bundled.cjs +31 -0
- package/dist/pcd/bundled.cjs.map +7 -0
- package/dist/pcd/bundled.d.ts +3 -0
- package/dist/pcd/bundled.d.ts.map +1 -0
- package/dist/pcd/bundled.js +5 -0
- package/dist/pcd/bundled.js.map +1 -0
- package/dist/pcd/index.cjs +37 -0
- package/dist/pcd/index.cjs.map +7 -0
- package/dist/pcd/index.d.ts +6 -0
- package/dist/pcd/index.d.ts.map +1 -0
- package/dist/pcd/index.js +7 -0
- package/dist/pcd/index.js.map +1 -0
- package/dist/pcd/lib/decompress-lzf.cjs +80 -0
- package/dist/pcd/lib/decompress-lzf.cjs.map +7 -0
- package/dist/pcd/lib/decompress-lzf.d.ts +7 -0
- package/dist/pcd/lib/decompress-lzf.d.ts.map +1 -0
- package/dist/pcd/lib/decompress-lzf.js +62 -0
- package/dist/pcd/lib/decompress-lzf.js.map +1 -0
- package/dist/pcd/lib/get-pcd-schema.cjs +70 -0
- package/dist/pcd/lib/get-pcd-schema.cjs.map +7 -0
- package/dist/pcd/lib/get-pcd-schema.d.ts +10 -0
- package/dist/pcd/lib/get-pcd-schema.d.ts.map +1 -0
- package/dist/pcd/lib/get-pcd-schema.js +53 -0
- package/dist/pcd/lib/get-pcd-schema.js.map +1 -0
- package/dist/pcd/lib/parse-pcd.cjs +354 -0
- package/dist/pcd/lib/parse-pcd.cjs.map +7 -0
- package/dist/pcd/lib/parse-pcd.d.ts +20 -0
- package/dist/pcd/lib/parse-pcd.d.ts.map +1 -0
- package/dist/pcd/lib/parse-pcd.js +341 -0
- package/dist/pcd/lib/parse-pcd.js.map +1 -0
- package/dist/pcd/lib/pcd-types.cjs +19 -0
- package/dist/pcd/lib/pcd-types.cjs.map +7 -0
- package/dist/pcd/lib/pcd-types.d.ts +31 -0
- package/dist/pcd/lib/pcd-types.d.ts.map +1 -0
- package/dist/pcd/lib/pcd-types.js +5 -0
- package/dist/pcd/lib/pcd-types.js.map +1 -0
- package/dist/pcd/pcd-format.cjs +42 -0
- package/dist/pcd/pcd-format.cjs.map +7 -0
- package/dist/pcd/pcd-format.d.ts +16 -0
- package/dist/pcd/pcd-format.d.ts.map +1 -0
- package/dist/pcd/pcd-format.js +19 -0
- package/dist/pcd/pcd-format.js.map +1 -0
- package/dist/pcd/pcd-loader-types.cjs +63 -0
- package/dist/pcd/pcd-loader-types.cjs.map +7 -0
- package/dist/pcd/pcd-loader-types.d.ts +82 -0
- package/dist/pcd/pcd-loader-types.d.ts.map +1 -0
- package/dist/pcd/pcd-loader-types.js +35 -0
- package/dist/pcd/pcd-loader-types.js.map +1 -0
- package/dist/pcd/pcd-loader.cjs +201 -0
- package/dist/pcd/pcd-loader.cjs.map +7 -0
- package/dist/pcd/pcd-loader.d.ts +80 -0
- package/dist/pcd/pcd-loader.d.ts.map +1 -0
- package/dist/pcd/pcd-loader.js +179 -0
- package/dist/pcd/pcd-loader.js.map +1 -0
- package/dist/pcd/pcd-writer.cjs +134 -0
- package/dist/pcd/pcd-writer.cjs.map +7 -0
- package/dist/pcd/pcd-writer.d.ts +38 -0
- package/dist/pcd/pcd-writer.d.ts.map +1 -0
- package/dist/pcd/pcd-writer.js +115 -0
- package/dist/pcd/pcd-writer.js.map +1 -0
- package/dist/pcd/unbundled.cjs +31 -0
- package/dist/pcd/unbundled.cjs.map +7 -0
- package/dist/pcd/unbundled.d.ts +3 -0
- package/dist/pcd/unbundled.d.ts.map +1 -0
- package/dist/pcd/unbundled.js +5 -0
- package/dist/pcd/unbundled.js.map +1 -0
- package/dist/pcd/workers/pcd-worker.cjs +23 -0
- package/dist/pcd/workers/pcd-worker.cjs.map +7 -0
- package/dist/pcd/workers/pcd-worker.d.ts +2 -0
- package/dist/pcd/workers/pcd-worker.d.ts.map +1 -0
- package/dist/pcd/workers/pcd-worker.js +23 -0
- package/dist/pcd/workers/pcd-worker.js.map +1 -0
- package/dist/pcd-loader-types.cjs +65 -0
- package/dist/pcd-loader-types.cjs.map +7 -0
- package/dist/pcd-loader-types.d.ts +2 -0
- package/dist/pcd-loader-types.d.ts.map +1 -0
- package/dist/pcd-loader-types.js +2 -0
- package/dist/pcd-loader-types.js.map +1 -0
- package/dist/pcd-loader.cjs +203 -0
- package/dist/pcd-loader.cjs.map +7 -0
- package/dist/pcd-loader.d.ts +2 -0
- package/dist/pcd-loader.d.ts.map +1 -0
- package/dist/pcd-loader.js +2 -0
- package/dist/pcd-loader.js.map +1 -0
- package/dist/pcd-worker.js +18561 -0
- package/dist/pcd-writer.cjs +136 -0
- package/dist/pcd-writer.cjs.map +7 -0
- package/dist/pcd-writer.d.ts +2 -0
- package/dist/pcd-writer.d.ts.map +1 -0
- package/dist/pcd-writer.js +2 -0
- package/dist/pcd-writer.js.map +1 -0
- package/dist/ply/bundled.cjs +31 -0
- package/dist/ply/bundled.cjs.map +7 -0
- package/dist/ply/bundled.d.ts +3 -0
- package/dist/ply/bundled.d.ts.map +1 -0
- package/dist/ply/bundled.js +5 -0
- package/dist/ply/bundled.js.map +1 -0
- package/dist/ply/index.cjs +37 -0
- package/dist/ply/index.cjs.map +7 -0
- package/dist/ply/index.d.ts +6 -0
- package/dist/ply/index.d.ts.map +1 -0
- package/dist/ply/index.js +8 -0
- package/dist/ply/index.js.map +1 -0
- package/dist/ply/lib/get-ply-schema.cjs +128 -0
- package/dist/ply/lib/get-ply-schema.cjs.map +7 -0
- package/dist/ply/lib/get-ply-schema.d.ts +16 -0
- package/dist/ply/lib/get-ply-schema.d.ts.map +1 -0
- package/dist/ply/lib/get-ply-schema.js +117 -0
- package/dist/ply/lib/get-ply-schema.js.map +1 -0
- package/dist/ply/lib/normalize-ply.cjs +96 -0
- package/dist/ply/lib/normalize-ply.cjs.map +7 -0
- package/dist/ply/lib/normalize-ply.d.ts +8 -0
- package/dist/ply/lib/normalize-ply.d.ts.map +1 -0
- package/dist/ply/lib/normalize-ply.js +89 -0
- package/dist/ply/lib/normalize-ply.js.map +1 -0
- package/dist/ply/lib/parse-ply-arrow.cjs +552 -0
- package/dist/ply/lib/parse-ply-arrow.cjs.map +7 -0
- package/dist/ply/lib/parse-ply-arrow.d.ts +25 -0
- package/dist/ply/lib/parse-ply-arrow.d.ts.map +1 -0
- package/dist/ply/lib/parse-ply-arrow.js +493 -0
- package/dist/ply/lib/parse-ply-arrow.js.map +1 -0
- package/dist/ply/lib/parse-ply-in-batches.cjs +613 -0
- package/dist/ply/lib/parse-ply-in-batches.cjs.map +7 -0
- package/dist/ply/lib/parse-ply-in-batches.d.ts +9 -0
- package/dist/ply/lib/parse-ply-in-batches.d.ts.map +1 -0
- package/dist/ply/lib/parse-ply-in-batches.js +630 -0
- package/dist/ply/lib/parse-ply-in-batches.js.map +1 -0
- package/dist/ply/lib/parse-ply.cjs +758 -0
- package/dist/ply/lib/parse-ply.cjs.map +7 -0
- package/dist/ply/lib/parse-ply.d.ts +69 -0
- package/dist/ply/lib/parse-ply.d.ts.map +1 -0
- package/dist/ply/lib/parse-ply.js +855 -0
- package/dist/ply/lib/parse-ply.js.map +1 -0
- package/dist/ply/lib/ply-types.cjs +19 -0
- package/dist/ply/lib/ply-types.cjs.map +7 -0
- package/dist/ply/lib/ply-types.d.ts +37 -0
- package/dist/ply/lib/ply-types.d.ts.map +1 -0
- package/dist/ply/lib/ply-types.js +2 -0
- package/dist/ply/lib/ply-types.js.map +1 -0
- package/dist/ply/ply-format.cjs +43 -0
- package/dist/ply/ply-format.cjs.map +7 -0
- package/dist/ply/ply-format.d.ts +18 -0
- package/dist/ply/ply-format.d.ts.map +1 -0
- package/dist/ply/ply-format.js +22 -0
- package/dist/ply/ply-format.js.map +1 -0
- package/dist/ply/ply-loader-types.cjs +64 -0
- package/dist/ply/ply-loader-types.cjs.map +7 -0
- package/dist/ply/ply-loader-types.d.ts +88 -0
- package/dist/ply/ply-loader-types.d.ts.map +1 -0
- package/dist/ply/ply-loader-types.js +38 -0
- package/dist/ply/ply-loader-types.js.map +1 -0
- package/dist/ply/ply-loader.cjs +192 -0
- package/dist/ply/ply-loader.cjs.map +7 -0
- package/dist/ply/ply-loader.d.ts +81 -0
- package/dist/ply/ply-loader.d.ts.map +1 -0
- package/dist/ply/ply-loader.js +173 -0
- package/dist/ply/ply-loader.js.map +1 -0
- package/dist/ply/ply-writer.cjs +175 -0
- package/dist/ply/ply-writer.cjs.map +7 -0
- package/dist/ply/ply-writer.d.ts +38 -0
- package/dist/ply/ply-writer.d.ts.map +1 -0
- package/dist/ply/ply-writer.js +140 -0
- package/dist/ply/ply-writer.js.map +1 -0
- package/dist/ply/unbundled.cjs +31 -0
- package/dist/ply/unbundled.cjs.map +7 -0
- package/dist/ply/unbundled.d.ts +3 -0
- package/dist/ply/unbundled.d.ts.map +1 -0
- package/dist/ply/unbundled.js +5 -0
- package/dist/ply/unbundled.js.map +1 -0
- package/dist/ply/workers/ply-worker.cjs +34 -0
- package/dist/ply/workers/ply-worker.cjs.map +7 -0
- package/dist/ply/workers/ply-worker.d.ts +2 -0
- package/dist/ply/workers/ply-worker.d.ts.map +1 -0
- package/dist/ply/workers/ply-worker.js +37 -0
- package/dist/ply/workers/ply-worker.js.map +1 -0
- package/dist/ply-loader-types.cjs +66 -0
- package/dist/ply-loader-types.cjs.map +7 -0
- package/dist/ply-loader-types.d.ts +2 -0
- package/dist/ply-loader-types.d.ts.map +1 -0
- package/dist/ply-loader-types.js +2 -0
- package/dist/ply-loader-types.js.map +1 -0
- package/dist/ply-loader.cjs +194 -0
- package/dist/ply-loader.cjs.map +7 -0
- package/dist/ply-loader.d.ts +2 -0
- package/dist/ply-loader.d.ts.map +1 -0
- package/dist/ply-loader.js +2 -0
- package/dist/ply-loader.js.map +1 -0
- package/dist/ply-worker.js +20962 -0
- package/dist/ply-writer.cjs +177 -0
- package/dist/ply-writer.cjs.map +7 -0
- package/dist/ply-writer.d.ts +2 -0
- package/dist/ply-writer.d.ts.map +1 -0
- package/dist/ply-writer.js +2 -0
- package/dist/ply-writer.js.map +1 -0
- package/package.json +238 -4
- package/src/index.ts +19 -0
- package/src/las/bundled.ts +38 -0
- package/src/las/index.ts +66 -0
- package/src/las/las-copc-loader-types.ts +18 -0
- package/src/las/las-copc-loader.ts +61 -0
- package/src/las/las-format.ts +21 -0
- package/src/las/las-loader-shared.ts +126 -0
- package/src/las/las-loader-types.ts +24 -0
- package/src/las/las-loader.ts +163 -0
- package/src/las/las-writer.ts +1477 -0
- package/src/las/laz-rs-loader-types.ts +21 -0
- package/src/las/laz-rs-loader.ts +53 -0
- package/src/las/lazperf-loader-types.ts +22 -0
- package/src/las/lazperf-loader.ts +65 -0
- package/src/las/lib/LASZIP-LICENSE +202 -0
- package/src/las/lib/LASZIP-NOTICE +4 -0
- package/src/las/lib/copc/parse-las.ts +265 -0
- package/src/las/lib/get-las-schema.ts +55 -0
- package/src/las/lib/las-compatibility.ts +178 -0
- package/src/las/lib/las-extra-bytes.ts +276 -0
- package/src/las/lib/las-types.ts +206 -0
- package/src/las/lib/las-waveform.ts +292 -0
- package/src/las/lib/laz-perf/laslaz-decoder.ts +443 -0
- package/src/las/lib/laz-perf/parse-las.ts +411 -0
- package/src/las/lib/laz-rs-wasm/laslaz-decoder.ts +488 -0
- package/src/las/lib/laz-rs-wasm/parse-las.ts +411 -0
- package/src/las/lib/typescript/parse-las.ts +3862 -0
- package/src/las/libs/laz-perf/laz-perf.ts +20615 -0
- package/src/las/libs/laz-rs-wasm/README.md +5 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm.d.ts +89 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm.js +497 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm +0 -0
- package/src/las/libs/laz-rs-wasm/laz_rs_wasm_bg.wasm.d.ts +38 -0
- package/src/las/libs/laz-rs-wasm/package.json +25 -0
- package/src/las/unbundled.ts +38 -0
- package/src/las/workers/las-worker.ts +24 -0
- package/src/las-copc-loader-types.ts +1 -0
- package/src/las-copc-loader.ts +1 -0
- package/src/las-loader-types.ts +1 -0
- package/src/las-loader.ts +1 -0
- package/src/las-writer.ts +1 -0
- package/src/laz-rs-loader-types.ts +1 -0
- package/src/laz-rs-loader.ts +1 -0
- package/src/lazperf-loader-types.ts +1 -0
- package/src/lazperf-loader.ts +1 -0
- package/src/pcd/bundled.ts +6 -0
- package/src/pcd/index.ts +9 -0
- package/src/pcd/lib/decompress-lzf.ts +68 -0
- package/src/pcd/lib/get-pcd-schema.ts +66 -0
- package/src/pcd/lib/parse-pcd.ts +474 -0
- package/src/pcd/lib/pcd-types.ts +34 -0
- package/src/pcd/pcd-format.ts +21 -0
- package/src/pcd/pcd-loader-types.ts +52 -0
- package/src/pcd/pcd-loader.ts +247 -0
- package/src/pcd/pcd-writer.ts +156 -0
- package/src/pcd/unbundled.ts +6 -0
- package/src/pcd/workers/pcd-worker.ts +24 -0
- package/src/pcd-loader-types.ts +1 -0
- package/src/pcd-loader.ts +1 -0
- package/src/pcd-writer.ts +1 -0
- package/src/ply/bundled.ts +6 -0
- package/src/ply/index.ts +11 -0
- package/src/ply/lib/get-ply-schema.ts +133 -0
- package/src/ply/lib/normalize-ply.ts +110 -0
- package/src/ply/lib/parse-ply-arrow.ts +676 -0
- package/src/ply/lib/parse-ply-in-batches.ts +832 -0
- package/src/ply/lib/parse-ply.ts +1084 -0
- package/src/ply/lib/ply-types.ts +47 -0
- package/src/ply/ply-format.ts +24 -0
- package/src/ply/ply-loader-types.ts +60 -0
- package/src/ply/ply-loader.ts +255 -0
- package/src/ply/ply-writer.ts +219 -0
- package/src/ply/unbundled.ts +6 -0
- package/src/ply/workers/ply-worker.ts +40 -0
- package/src/ply-loader-types.ts +1 -0
- package/src/ply-loader.ts +1 -0
- package/src/ply-writer.ts +1 -0
- package/third-party-licenses/plasio-LICENSE +21 -0
- package/third-party-licenses/three-LICENSE +21 -0
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/ply-writer.ts
|
|
21
|
+
var ply_writer_exports = {};
|
|
22
|
+
__export(ply_writer_exports, {
|
|
23
|
+
PLYWriter: () => PLYWriter
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(ply_writer_exports);
|
|
26
|
+
|
|
27
|
+
// src/ply/ply-writer.ts
|
|
28
|
+
var import_schema_utils = require("@loaders.gl/core/schema-utils");
|
|
29
|
+
var import_ply_format = require("./ply-format.cjs");
|
|
30
|
+
var VERSION = true ? "5.0.0-beta.10" : "latest";
|
|
31
|
+
var PLYWriter = {
|
|
32
|
+
...import_ply_format.PLYFormat,
|
|
33
|
+
dataType: null,
|
|
34
|
+
batchType: null,
|
|
35
|
+
version: VERSION,
|
|
36
|
+
options: {
|
|
37
|
+
ply: {}
|
|
38
|
+
},
|
|
39
|
+
text: true,
|
|
40
|
+
encode: async (data, options) => encodePLYSync(data, options),
|
|
41
|
+
encodeSync: encodePLYSync,
|
|
42
|
+
encodeTextSync: encodePLY
|
|
43
|
+
};
|
|
44
|
+
function encodePLYSync(data, options) {
|
|
45
|
+
const text = encodePLY(data, options);
|
|
46
|
+
return new TextEncoder().encode(text).buffer;
|
|
47
|
+
}
|
|
48
|
+
function encodePLY(data, options) {
|
|
49
|
+
const mesh = (0, import_schema_utils.convertTableToMesh)(normalizeMeshArrowTable(data));
|
|
50
|
+
const positionAttribute = getRequiredAttribute(mesh, "POSITION");
|
|
51
|
+
const normalAttribute = mesh.attributes.NORMAL;
|
|
52
|
+
const textureCoordinateAttribute = mesh.attributes.TEXCOORD_0;
|
|
53
|
+
const colorAttribute = mesh.attributes.COLOR_0;
|
|
54
|
+
const customScalarAttributes = getCustomScalarAttributes(mesh);
|
|
55
|
+
const vertexCount = positionAttribute.value.length / positionAttribute.size;
|
|
56
|
+
const triangleIndices = getTriangleIndices(mesh, vertexCount);
|
|
57
|
+
const header = getPLYHeader(
|
|
58
|
+
vertexCount,
|
|
59
|
+
triangleIndices.length / 3,
|
|
60
|
+
Boolean(normalAttribute),
|
|
61
|
+
Boolean(textureCoordinateAttribute),
|
|
62
|
+
Boolean(colorAttribute),
|
|
63
|
+
customScalarAttributes
|
|
64
|
+
);
|
|
65
|
+
const rows = [];
|
|
66
|
+
for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {
|
|
67
|
+
const row = [
|
|
68
|
+
getComponent(positionAttribute, vertexIndex, 0),
|
|
69
|
+
getComponent(positionAttribute, vertexIndex, 1),
|
|
70
|
+
getComponent(positionAttribute, vertexIndex, 2)
|
|
71
|
+
];
|
|
72
|
+
if (normalAttribute) {
|
|
73
|
+
row.push(
|
|
74
|
+
getComponent(normalAttribute, vertexIndex, 0),
|
|
75
|
+
getComponent(normalAttribute, vertexIndex, 1),
|
|
76
|
+
getComponent(normalAttribute, vertexIndex, 2)
|
|
77
|
+
);
|
|
78
|
+
}
|
|
79
|
+
if (textureCoordinateAttribute) {
|
|
80
|
+
row.push(
|
|
81
|
+
getComponent(textureCoordinateAttribute, vertexIndex, 0),
|
|
82
|
+
getComponent(textureCoordinateAttribute, vertexIndex, 1)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
if (colorAttribute) {
|
|
86
|
+
row.push(
|
|
87
|
+
getColorByte(colorAttribute, vertexIndex, 0),
|
|
88
|
+
getColorByte(colorAttribute, vertexIndex, 1),
|
|
89
|
+
getColorByte(colorAttribute, vertexIndex, 2)
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
for (const [, attribute] of customScalarAttributes) {
|
|
93
|
+
row.push(getComponent(attribute, vertexIndex, 0));
|
|
94
|
+
}
|
|
95
|
+
rows.push(row.join(" "));
|
|
96
|
+
}
|
|
97
|
+
for (let triangleIndex = 0; triangleIndex < triangleIndices.length; triangleIndex += 3) {
|
|
98
|
+
rows.push(
|
|
99
|
+
`3 ${triangleIndices[triangleIndex]} ${triangleIndices[triangleIndex + 1]} ${triangleIndices[triangleIndex + 2]}`
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
return `${header.concat(rows).join("\n")}
|
|
103
|
+
`;
|
|
104
|
+
}
|
|
105
|
+
function normalizeMeshArrowTable(data) {
|
|
106
|
+
if (!("attributes" in data)) {
|
|
107
|
+
return data;
|
|
108
|
+
}
|
|
109
|
+
return (0, import_schema_utils.convertMeshToArrowTableWrapper)(data);
|
|
110
|
+
}
|
|
111
|
+
function getRequiredAttribute(mesh, attributeName) {
|
|
112
|
+
const attribute = mesh.attributes[attributeName];
|
|
113
|
+
if (!attribute) {
|
|
114
|
+
throw new Error(`PLYWriter: ${attributeName} attribute is required`);
|
|
115
|
+
}
|
|
116
|
+
return attribute;
|
|
117
|
+
}
|
|
118
|
+
function getPLYHeader(vertexCount, faceCount, hasNormals, hasTextureCoordinates, hasColors, customScalarAttributes) {
|
|
119
|
+
const header = [
|
|
120
|
+
"ply",
|
|
121
|
+
"format ascii 1.0",
|
|
122
|
+
"comment generated by loaders.gl",
|
|
123
|
+
`element vertex ${vertexCount}`,
|
|
124
|
+
"property float x",
|
|
125
|
+
"property float y",
|
|
126
|
+
"property float z"
|
|
127
|
+
];
|
|
128
|
+
if (hasNormals) {
|
|
129
|
+
header.push("property float nx", "property float ny", "property float nz");
|
|
130
|
+
}
|
|
131
|
+
if (hasTextureCoordinates) {
|
|
132
|
+
header.push("property float s", "property float t");
|
|
133
|
+
}
|
|
134
|
+
if (hasColors) {
|
|
135
|
+
header.push("property uchar red", "property uchar green", "property uchar blue");
|
|
136
|
+
}
|
|
137
|
+
for (const [attributeName] of customScalarAttributes) {
|
|
138
|
+
header.push(`property float ${attributeName}`);
|
|
139
|
+
}
|
|
140
|
+
if (faceCount > 0) {
|
|
141
|
+
header.push(`element face ${faceCount}`, "property list uchar int vertex_indices");
|
|
142
|
+
}
|
|
143
|
+
header.push("end_header");
|
|
144
|
+
return header;
|
|
145
|
+
}
|
|
146
|
+
function getCustomScalarAttributes(mesh) {
|
|
147
|
+
const reservedAttributeNames = /* @__PURE__ */ new Set(["POSITION", "NORMAL", "TEXCOORD_0", "COLOR_0"]);
|
|
148
|
+
return Object.entries(mesh.attributes).filter(
|
|
149
|
+
([attributeName, attribute]) => !reservedAttributeNames.has(attributeName) && attribute.size === 1
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
function getComponent(attribute, vertexIndex, componentIndex) {
|
|
153
|
+
return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;
|
|
154
|
+
}
|
|
155
|
+
function getColorByte(attribute, vertexIndex, componentIndex) {
|
|
156
|
+
const value = getComponent(attribute, vertexIndex, componentIndex);
|
|
157
|
+
const byteValue = attribute.normalized || value <= 1 ? value * 255 : value;
|
|
158
|
+
return Math.max(0, Math.min(255, Math.round(byteValue)));
|
|
159
|
+
}
|
|
160
|
+
function getTriangleIndices(mesh, vertexCount) {
|
|
161
|
+
if (mesh.indices?.value?.length) {
|
|
162
|
+
return Array.from(mesh.indices.value);
|
|
163
|
+
}
|
|
164
|
+
if (mesh.mode !== 4 && mesh.topology !== "triangle-list") {
|
|
165
|
+
return [];
|
|
166
|
+
}
|
|
167
|
+
const triangleIndices = [];
|
|
168
|
+
for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {
|
|
169
|
+
triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);
|
|
170
|
+
}
|
|
171
|
+
return triangleIndices;
|
|
172
|
+
}
|
|
173
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
174
|
+
0 && (module.exports = {
|
|
175
|
+
PLYWriter
|
|
176
|
+
});
|
|
177
|
+
//# sourceMappingURL=ply-writer.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/ply-writer.ts", "../src/ply/ply-writer.ts"],
|
|
4
|
+
"sourcesContent": ["export * from './ply/ply-writer.js';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Table} from 'apache-arrow';\nimport type {WriterOptions, WriterWithEncoder} from '@loaders.gl/core/loader-utils';\nimport type {Mesh, MeshArrowTable, MeshAttribute} from '@loaders.gl/core/schema';\nimport {convertMeshToArrowTableWrapper, convertTableToMesh} from '@loaders.gl/core/schema-utils';\nimport {PLYFormat} from './ply-format';\n\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nconst VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n\n/** Options for `PLYWriter`. */\nexport type PLYWriterOptions = WriterOptions & {\n /** Reserved for future PLY writer options. */\n ply?: Record<string, never>;\n};\n\n/**\n * Writer for the PLY geometry format.\n */\nexport const PLYWriter = {\n ...PLYFormat,\n dataType: null as unknown as Mesh | MeshArrowTable | Table,\n batchType: null as never,\n version: VERSION,\n options: {\n ply: {}\n },\n text: true,\n encode: async (data, options) => encodePLYSync(data, options),\n encodeSync: encodePLYSync,\n encodeTextSync: encodePLY\n} as const satisfies WriterWithEncoder<Mesh | MeshArrowTable | Table, never, PLYWriterOptions>;\n\n/** Encode mesh category data as PLY bytes. */\nfunction encodePLYSync(\n data: Mesh | MeshArrowTable | Table,\n options?: PLYWriterOptions\n): ArrayBuffer {\n const text = encodePLY(data, options);\n return new TextEncoder().encode(text).buffer;\n}\n\n/** Encode mesh category data as ASCII PLY text. */\nfunction encodePLY(data: Mesh | MeshArrowTable | Table, options?: PLYWriterOptions): string {\n const mesh = convertTableToMesh(normalizeMeshArrowTable(data));\n const positionAttribute = getRequiredAttribute(mesh, 'POSITION');\n const normalAttribute = mesh.attributes.NORMAL;\n const textureCoordinateAttribute = mesh.attributes.TEXCOORD_0;\n const colorAttribute = mesh.attributes.COLOR_0;\n const customScalarAttributes = getCustomScalarAttributes(mesh);\n const vertexCount = positionAttribute.value.length / positionAttribute.size;\n const triangleIndices = getTriangleIndices(mesh, vertexCount);\n const header = getPLYHeader(\n vertexCount,\n triangleIndices.length / 3,\n Boolean(normalAttribute),\n Boolean(textureCoordinateAttribute),\n Boolean(colorAttribute),\n customScalarAttributes\n );\n const rows: string[] = [];\n\n for (let vertexIndex = 0; vertexIndex < vertexCount; vertexIndex++) {\n const row = [\n getComponent(positionAttribute, vertexIndex, 0),\n getComponent(positionAttribute, vertexIndex, 1),\n getComponent(positionAttribute, vertexIndex, 2)\n ];\n\n if (normalAttribute) {\n row.push(\n getComponent(normalAttribute, vertexIndex, 0),\n getComponent(normalAttribute, vertexIndex, 1),\n getComponent(normalAttribute, vertexIndex, 2)\n );\n }\n\n if (textureCoordinateAttribute) {\n row.push(\n getComponent(textureCoordinateAttribute, vertexIndex, 0),\n getComponent(textureCoordinateAttribute, vertexIndex, 1)\n );\n }\n\n if (colorAttribute) {\n row.push(\n getColorByte(colorAttribute, vertexIndex, 0),\n getColorByte(colorAttribute, vertexIndex, 1),\n getColorByte(colorAttribute, vertexIndex, 2)\n );\n }\n\n for (const [, attribute] of customScalarAttributes) {\n row.push(getComponent(attribute, vertexIndex, 0));\n }\n\n rows.push(row.join(' '));\n }\n\n for (let triangleIndex = 0; triangleIndex < triangleIndices.length; triangleIndex += 3) {\n rows.push(\n `3 ${triangleIndices[triangleIndex]} ${triangleIndices[triangleIndex + 1]} ${\n triangleIndices[triangleIndex + 2]\n }`\n );\n }\n\n return `${header.concat(rows).join('\\n')}\\n`;\n}\n\n/** Return mesh data as a MeshArrowTable, converting plain Mesh data first. */\nfunction normalizeMeshArrowTable(data: Mesh | MeshArrowTable | Table): MeshArrowTable | Table {\n if (!('attributes' in data)) {\n return data;\n }\n return convertMeshToArrowTableWrapper(data as Mesh);\n}\n\n/** Return a required mesh attribute or throw a format-specific error. */\nfunction getRequiredAttribute(mesh: Mesh, attributeName: string): MeshAttribute {\n const attribute = mesh.attributes[attributeName];\n if (!attribute) {\n throw new Error(`PLYWriter: ${attributeName} attribute is required`);\n }\n return attribute;\n}\n\n/** Return the ASCII PLY header lines. */\nfunction getPLYHeader(\n vertexCount: number,\n faceCount: number,\n hasNormals: boolean,\n hasTextureCoordinates: boolean,\n hasColors: boolean,\n customScalarAttributes: [string, MeshAttribute][]\n): string[] {\n const header = [\n 'ply',\n 'format ascii 1.0',\n 'comment generated by loaders.gl',\n `element vertex ${vertexCount}`,\n 'property float x',\n 'property float y',\n 'property float z'\n ];\n\n if (hasNormals) {\n header.push('property float nx', 'property float ny', 'property float nz');\n }\n\n if (hasTextureCoordinates) {\n header.push('property float s', 'property float t');\n }\n\n if (hasColors) {\n header.push('property uchar red', 'property uchar green', 'property uchar blue');\n }\n\n for (const [attributeName] of customScalarAttributes) {\n header.push(`property float ${attributeName}`);\n }\n\n if (faceCount > 0) {\n header.push(`element face ${faceCount}`, 'property list uchar int vertex_indices');\n }\n\n header.push('end_header');\n return header;\n}\n\n/** Return additional one-component attributes that can be represented as scalar PLY properties. */\nfunction getCustomScalarAttributes(mesh: Mesh): [string, MeshAttribute][] {\n const reservedAttributeNames = new Set(['POSITION', 'NORMAL', 'TEXCOORD_0', 'COLOR_0']);\n return Object.entries(mesh.attributes).filter(\n ([attributeName, attribute]) =>\n !reservedAttributeNames.has(attributeName) && attribute.size === 1\n );\n}\n\n/** Return a single attribute component with 0 as the missing component fallback. */\nfunction getComponent(\n attribute: MeshAttribute,\n vertexIndex: number,\n componentIndex: number\n): number {\n return attribute.value[vertexIndex * attribute.size + componentIndex] || 0;\n}\n\n/** Return one color component as an unsigned byte. */\nfunction getColorByte(\n attribute: MeshAttribute,\n vertexIndex: number,\n componentIndex: number\n): number {\n const value = getComponent(attribute, vertexIndex, componentIndex);\n const byteValue = attribute.normalized || value <= 1 ? value * 255 : value;\n return Math.max(0, Math.min(255, Math.round(byteValue)));\n}\n\n/** Return triangle indices for indexed or sequential triangle-list meshes. */\nfunction getTriangleIndices(mesh: Mesh, vertexCount: number): number[] {\n if (mesh.indices?.value?.length) {\n return Array.from(mesh.indices.value);\n }\n\n if (mesh.mode !== 4 && mesh.topology !== 'triangle-list') {\n return [];\n }\n\n const triangleIndices: number[] = [];\n for (let vertexIndex = 0; vertexIndex + 2 < vertexCount; vertexIndex += 3) {\n triangleIndices.push(vertexIndex, vertexIndex + 1, vertexIndex + 2);\n }\n return triangleIndices;\n}\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-writer.d.ts","sourceRoot":"","sources":["../src/ply-writer.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ply-writer.js","sourceRoot":"","sources":["../src/ply-writer.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,240 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loaders.gl/pointclouds",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "5.0.0-beta.10",
|
|
4
|
+
"description": "LAS, LAZ, PCD, and PLY point cloud and mesh loaders and writers",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/visgl/loaders.gl"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"webgl",
|
|
16
|
+
"loader",
|
|
17
|
+
"3d",
|
|
18
|
+
"mesh",
|
|
19
|
+
"point cloud",
|
|
20
|
+
"LAS",
|
|
21
|
+
"LAZ",
|
|
22
|
+
"loaders.gl",
|
|
23
|
+
"PCD",
|
|
24
|
+
"PLY"
|
|
25
|
+
],
|
|
26
|
+
"types": "dist/index.d.ts",
|
|
27
|
+
"main": "dist/index.cjs",
|
|
28
|
+
"module": "dist/index.js",
|
|
29
|
+
"exports": {
|
|
30
|
+
".": {
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js",
|
|
33
|
+
"require": "./dist/index.cjs"
|
|
34
|
+
},
|
|
35
|
+
"./las": {
|
|
36
|
+
"types": "./dist/las/index.d.ts",
|
|
37
|
+
"import": "./dist/las/index.js",
|
|
38
|
+
"require": "./dist/las/index.cjs"
|
|
39
|
+
},
|
|
40
|
+
"./las/bundled": {
|
|
41
|
+
"types": "./dist/las/bundled.d.ts",
|
|
42
|
+
"import": "./dist/las/bundled.js",
|
|
43
|
+
"require": "./dist/las/bundled.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./las/index": {
|
|
46
|
+
"types": "./dist/las/index.d.ts",
|
|
47
|
+
"import": "./dist/las/index.js",
|
|
48
|
+
"require": "./dist/las/index.cjs"
|
|
49
|
+
},
|
|
50
|
+
"./las-copc-loader-types": {
|
|
51
|
+
"types": "./dist/las-copc-loader-types.d.ts",
|
|
52
|
+
"import": "./dist/las-copc-loader-types.js",
|
|
53
|
+
"require": "./dist/las-copc-loader-types.cjs"
|
|
54
|
+
},
|
|
55
|
+
"./las-copc-loader": {
|
|
56
|
+
"types": "./dist/las-copc-loader.d.ts",
|
|
57
|
+
"import": "./dist/las-copc-loader.js",
|
|
58
|
+
"require": "./dist/las-copc-loader.cjs"
|
|
59
|
+
},
|
|
60
|
+
"./las/las-format": {
|
|
61
|
+
"types": "./dist/las/las-format.d.ts",
|
|
62
|
+
"import": "./dist/las/las-format.js",
|
|
63
|
+
"require": "./dist/las/las-format.cjs"
|
|
64
|
+
},
|
|
65
|
+
"./las/las-loader-shared": {
|
|
66
|
+
"types": "./dist/las/las-loader-shared.d.ts",
|
|
67
|
+
"import": "./dist/las/las-loader-shared.js",
|
|
68
|
+
"require": "./dist/las/las-loader-shared.cjs"
|
|
69
|
+
},
|
|
70
|
+
"./las-loader-types": {
|
|
71
|
+
"types": "./dist/las-loader-types.d.ts",
|
|
72
|
+
"import": "./dist/las-loader-types.js",
|
|
73
|
+
"require": "./dist/las-loader-types.cjs"
|
|
74
|
+
},
|
|
75
|
+
"./las-loader": {
|
|
76
|
+
"types": "./dist/las-loader.d.ts",
|
|
77
|
+
"import": "./dist/las-loader.js",
|
|
78
|
+
"require": "./dist/las-loader.cjs"
|
|
79
|
+
},
|
|
80
|
+
"./las-writer": {
|
|
81
|
+
"types": "./dist/las-writer.d.ts",
|
|
82
|
+
"import": "./dist/las-writer.js",
|
|
83
|
+
"require": "./dist/las-writer.cjs"
|
|
84
|
+
},
|
|
85
|
+
"./laz-rs-loader-types": {
|
|
86
|
+
"types": "./dist/laz-rs-loader-types.d.ts",
|
|
87
|
+
"import": "./dist/laz-rs-loader-types.js",
|
|
88
|
+
"require": "./dist/laz-rs-loader-types.cjs"
|
|
89
|
+
},
|
|
90
|
+
"./laz-rs-loader": {
|
|
91
|
+
"types": "./dist/laz-rs-loader.d.ts",
|
|
92
|
+
"import": "./dist/laz-rs-loader.js",
|
|
93
|
+
"require": "./dist/laz-rs-loader.cjs"
|
|
94
|
+
},
|
|
95
|
+
"./lazperf-loader-types": {
|
|
96
|
+
"types": "./dist/lazperf-loader-types.d.ts",
|
|
97
|
+
"import": "./dist/lazperf-loader-types.js",
|
|
98
|
+
"require": "./dist/lazperf-loader-types.cjs"
|
|
99
|
+
},
|
|
100
|
+
"./lazperf-loader": {
|
|
101
|
+
"types": "./dist/lazperf-loader.d.ts",
|
|
102
|
+
"import": "./dist/lazperf-loader.js",
|
|
103
|
+
"require": "./dist/lazperf-loader.cjs"
|
|
104
|
+
},
|
|
105
|
+
"./las/unbundled": {
|
|
106
|
+
"types": "./dist/las/unbundled.d.ts",
|
|
107
|
+
"import": "./dist/las/unbundled.js",
|
|
108
|
+
"require": "./dist/las/unbundled.cjs"
|
|
109
|
+
},
|
|
110
|
+
"./pcd": {
|
|
111
|
+
"types": "./dist/pcd/index.d.ts",
|
|
112
|
+
"import": "./dist/pcd/index.js",
|
|
113
|
+
"require": "./dist/pcd/index.cjs"
|
|
114
|
+
},
|
|
115
|
+
"./pcd/bundled": {
|
|
116
|
+
"types": "./dist/pcd/bundled.d.ts",
|
|
117
|
+
"import": "./dist/pcd/bundled.js",
|
|
118
|
+
"require": "./dist/pcd/bundled.cjs"
|
|
119
|
+
},
|
|
120
|
+
"./pcd/index": {
|
|
121
|
+
"types": "./dist/pcd/index.d.ts",
|
|
122
|
+
"import": "./dist/pcd/index.js",
|
|
123
|
+
"require": "./dist/pcd/index.cjs"
|
|
124
|
+
},
|
|
125
|
+
"./pcd/pcd-format": {
|
|
126
|
+
"types": "./dist/pcd/pcd-format.d.ts",
|
|
127
|
+
"import": "./dist/pcd/pcd-format.js",
|
|
128
|
+
"require": "./dist/pcd/pcd-format.cjs"
|
|
129
|
+
},
|
|
130
|
+
"./pcd-loader-types": {
|
|
131
|
+
"types": "./dist/pcd-loader-types.d.ts",
|
|
132
|
+
"import": "./dist/pcd-loader-types.js",
|
|
133
|
+
"require": "./dist/pcd-loader-types.cjs"
|
|
134
|
+
},
|
|
135
|
+
"./pcd-loader": {
|
|
136
|
+
"types": "./dist/pcd-loader.d.ts",
|
|
137
|
+
"import": "./dist/pcd-loader.js",
|
|
138
|
+
"require": "./dist/pcd-loader.cjs"
|
|
139
|
+
},
|
|
140
|
+
"./pcd-writer": {
|
|
141
|
+
"types": "./dist/pcd-writer.d.ts",
|
|
142
|
+
"import": "./dist/pcd-writer.js",
|
|
143
|
+
"require": "./dist/pcd-writer.cjs"
|
|
144
|
+
},
|
|
145
|
+
"./pcd/unbundled": {
|
|
146
|
+
"types": "./dist/pcd/unbundled.d.ts",
|
|
147
|
+
"import": "./dist/pcd/unbundled.js",
|
|
148
|
+
"require": "./dist/pcd/unbundled.cjs"
|
|
149
|
+
},
|
|
150
|
+
"./ply": {
|
|
151
|
+
"types": "./dist/ply/index.d.ts",
|
|
152
|
+
"import": "./dist/ply/index.js",
|
|
153
|
+
"require": "./dist/ply/index.cjs"
|
|
154
|
+
},
|
|
155
|
+
"./ply/bundled": {
|
|
156
|
+
"types": "./dist/ply/bundled.d.ts",
|
|
157
|
+
"import": "./dist/ply/bundled.js",
|
|
158
|
+
"require": "./dist/ply/bundled.cjs"
|
|
159
|
+
},
|
|
160
|
+
"./ply/index": {
|
|
161
|
+
"types": "./dist/ply/index.d.ts",
|
|
162
|
+
"import": "./dist/ply/index.js",
|
|
163
|
+
"require": "./dist/ply/index.cjs"
|
|
164
|
+
},
|
|
165
|
+
"./ply/ply-format": {
|
|
166
|
+
"types": "./dist/ply/ply-format.d.ts",
|
|
167
|
+
"import": "./dist/ply/ply-format.js",
|
|
168
|
+
"require": "./dist/ply/ply-format.cjs"
|
|
169
|
+
},
|
|
170
|
+
"./ply-loader-types": {
|
|
171
|
+
"types": "./dist/ply-loader-types.d.ts",
|
|
172
|
+
"import": "./dist/ply-loader-types.js",
|
|
173
|
+
"require": "./dist/ply-loader-types.cjs"
|
|
174
|
+
},
|
|
175
|
+
"./ply-loader": {
|
|
176
|
+
"types": "./dist/ply-loader.d.ts",
|
|
177
|
+
"import": "./dist/ply-loader.js",
|
|
178
|
+
"require": "./dist/ply-loader.cjs"
|
|
179
|
+
},
|
|
180
|
+
"./ply-writer": {
|
|
181
|
+
"types": "./dist/ply-writer.d.ts",
|
|
182
|
+
"import": "./dist/ply-writer.js",
|
|
183
|
+
"require": "./dist/ply-writer.cjs"
|
|
184
|
+
},
|
|
185
|
+
"./ply/unbundled": {
|
|
186
|
+
"types": "./dist/ply/unbundled.d.ts",
|
|
187
|
+
"import": "./dist/ply/unbundled.js",
|
|
188
|
+
"require": "./dist/ply/unbundled.cjs"
|
|
189
|
+
},
|
|
190
|
+
"./las-worker.js": {
|
|
191
|
+
"import": "./dist/las-worker.js"
|
|
192
|
+
},
|
|
193
|
+
"./pcd-worker.js": {
|
|
194
|
+
"import": "./dist/pcd-worker.js"
|
|
195
|
+
},
|
|
196
|
+
"./ply-worker.js": {
|
|
197
|
+
"import": "./dist/ply-worker.js"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"sideEffects": false,
|
|
201
|
+
"browser": {
|
|
202
|
+
"crypto": false,
|
|
203
|
+
"fs": false,
|
|
204
|
+
"path": false,
|
|
205
|
+
"ws": false
|
|
206
|
+
},
|
|
207
|
+
"files": [
|
|
208
|
+
"src",
|
|
209
|
+
"dist",
|
|
210
|
+
"README.md",
|
|
211
|
+
"LAS-README.md",
|
|
212
|
+
"PCD-README.md",
|
|
213
|
+
"PLY-README.md",
|
|
214
|
+
"LICENSE",
|
|
215
|
+
"THIRD-PARTY-NOTICES.md",
|
|
216
|
+
"third-party-licenses"
|
|
217
|
+
],
|
|
218
|
+
"scripts": {
|
|
219
|
+
"copy-wasm-files-las": "cp src/las/libs/laz-rs-wasm/*.wasm* dist/las/libs/laz-rs-wasm/",
|
|
220
|
+
"build-worker-las": "esbuild src/las/workers/las-worker.ts --bundle --outfile=dist/las-worker.js --define:__VERSION__=\\\"$npm_package_version\\\"",
|
|
221
|
+
"build-worker-pcd": "node ../../scripts/build-codec-worker.mjs src/pcd/workers/pcd-worker.ts --bundle --outfile=dist/pcd-worker.js --define:__VERSION__=\\\"$npm_package_version\\\"",
|
|
222
|
+
"build-worker-ply": "node ../../scripts/build-codec-worker.mjs src/ply/workers/ply-worker.ts --bundle --outfile=dist/ply-worker.js --define:__VERSION__=\\\"$npm_package_version\\\"",
|
|
223
|
+
"build-format-subpaths": "node ../../scripts/build-format-subpaths.mjs",
|
|
224
|
+
"pre-build": "npm run copy-wasm-files-las && npm run build-worker-las && npm run build-worker-pcd && npm run build-worker-ply && npm run build-format-subpaths && npm run build-bundle && npm run build-bundle-dev",
|
|
225
|
+
"build-bundle": "node ../../scripts/build-codec-bundle.mjs ./bundle.ts --output=dist/dist.min.js",
|
|
226
|
+
"build-bundle-dev": "node ../../scripts/build-codec-bundle.mjs ./bundle.ts --env=dev --output=dist/dist.dev.js"
|
|
227
|
+
},
|
|
228
|
+
"dependencies": {
|
|
229
|
+
"@math.gl/geospatial": "5.0.0-beta.10",
|
|
230
|
+
"apache-arrow": ">= 17.0.0"
|
|
231
|
+
},
|
|
232
|
+
"peerDependencies": {
|
|
233
|
+
"@loaders.gl/core": "~5.0.0-alpha.0"
|
|
234
|
+
},
|
|
235
|
+
"optionalDependencies": {
|
|
236
|
+
"copc": "0.0.8",
|
|
237
|
+
"laz-perf": "^0.0.7"
|
|
238
|
+
},
|
|
239
|
+
"gitHead": "efdd84034c25e2e5dbb41bc88b75af56cb2176da"
|
|
240
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export {LASLoader} from './las/las-loader-types';
|
|
6
|
+
export type {LASLoaderOptions} from './las/las-loader-types';
|
|
7
|
+
export {LASWriter} from './las/las-writer';
|
|
8
|
+
export type {LASWriterOptions} from './las/las-writer';
|
|
9
|
+
export {LASFormat} from './las/las-format';
|
|
10
|
+
export {PCDLoader} from './pcd/pcd-loader-types';
|
|
11
|
+
export type {PCDLoaderOptions} from './pcd/pcd-loader-types';
|
|
12
|
+
export {PCDWriter} from './pcd/pcd-writer';
|
|
13
|
+
export type {PCDWriterOptions} from './pcd/pcd-writer';
|
|
14
|
+
export {PCDFormat} from './pcd/pcd-format';
|
|
15
|
+
export {PLYLoader} from './ply/ply-loader-types';
|
|
16
|
+
export type {PLYLoaderOptions} from './ply/ply-loader-types';
|
|
17
|
+
export {PLYWriter} from './ply/ply-writer';
|
|
18
|
+
export type {PLYWriterOptions} from './ply/ply-writer';
|
|
19
|
+
export {PLYFormat} from './ply/ply-format';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
export type {LASLoaderOptions} from './las-loader-types';
|
|
6
|
+
export {LASLoaderWithParser as LASLoader} from './las-loader';
|
|
7
|
+
export {LASCOPCLoaderWithParser as LASCOPCLoader} from './las-copc-loader';
|
|
8
|
+
export {LAZPerfLoaderWithParser as LAZPerfLoader} from './lazperf-loader';
|
|
9
|
+
export {LAZRsLoaderWithParser as LAZRsLoader} from './laz-rs-loader';
|
|
10
|
+
export {decodeLAZFileInBatches} from './lib/typescript/parse-las';
|
|
11
|
+
export {
|
|
12
|
+
decodeLASWaveformSamples,
|
|
13
|
+
getLASWaveformStorage,
|
|
14
|
+
parseLASWaveformPacketReference,
|
|
15
|
+
readLASWaveformPacket,
|
|
16
|
+
readLASWaveformPackets,
|
|
17
|
+
scaleLASWaveformSamples
|
|
18
|
+
} from './lib/las-waveform';
|
|
19
|
+
export type {
|
|
20
|
+
LASWaveformPacket,
|
|
21
|
+
LASWaveformPacketReference,
|
|
22
|
+
LASWaveformReadOptions,
|
|
23
|
+
LASWaveformStorage
|
|
24
|
+
} from './lib/las-waveform';
|
|
25
|
+
export {
|
|
26
|
+
NeedsMoreData,
|
|
27
|
+
createLAZChunkDecoder,
|
|
28
|
+
createLAZChunkEncoder,
|
|
29
|
+
decodeLAZChunk,
|
|
30
|
+
decodeLAZChunkInBatches,
|
|
31
|
+
encodeLAZChunk
|
|
32
|
+
} from '@loaders.gl/core/loader-utils';
|
|
33
|
+
export type {
|
|
34
|
+
FeedableLAZChunkDecoder,
|
|
35
|
+
FeedableLAZChunkEncoder,
|
|
36
|
+
LAZChunkDecoderOptions,
|
|
37
|
+
LAZChunkMetadata
|
|
38
|
+
} from '@loaders.gl/core/loader-utils';
|
package/src/las/index.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
// LASLoader
|
|
6
|
+
|
|
7
|
+
export {LASFormat} from './las-format';
|
|
8
|
+
|
|
9
|
+
export type {LASColumnName, LASLoaderOptions} from './las-loader-types';
|
|
10
|
+
|
|
11
|
+
export type {LASExtraBytesWriter, LASWriterOptions} from './las-writer';
|
|
12
|
+
export {LASWriter} from './las-writer';
|
|
13
|
+
export type {
|
|
14
|
+
LASExtendedVariableLengthRecord,
|
|
15
|
+
LASExtraBytesDescriptor,
|
|
16
|
+
LASGeoTIFFKey,
|
|
17
|
+
LASGeoTIFFKeyDirectory,
|
|
18
|
+
LASHeader,
|
|
19
|
+
LASMetadata,
|
|
20
|
+
LASMesh,
|
|
21
|
+
LASVariableLengthRecord,
|
|
22
|
+
LASWaveformPacketDescriptor
|
|
23
|
+
} from './lib/las-types';
|
|
24
|
+
export {
|
|
25
|
+
decodeLASWaveformSamples,
|
|
26
|
+
getLASWaveformStorage,
|
|
27
|
+
parseLASWaveformPacketReference,
|
|
28
|
+
readLASWaveformPacket,
|
|
29
|
+
readLASWaveformPackets,
|
|
30
|
+
scaleLASWaveformSamples
|
|
31
|
+
} from './lib/las-waveform';
|
|
32
|
+
export type {
|
|
33
|
+
LASWaveformPacket,
|
|
34
|
+
LASWaveformPacketReference,
|
|
35
|
+
LASWaveformReadOptions,
|
|
36
|
+
LASWaveformStorage
|
|
37
|
+
} from './lib/las-waveform';
|
|
38
|
+
export {
|
|
39
|
+
createLASTypedExtraBytesAttributes,
|
|
40
|
+
createLASTypedExtraBytesValue,
|
|
41
|
+
parseLASExtraBytes,
|
|
42
|
+
populateLASTypedExtraBytes
|
|
43
|
+
} from './lib/las-extra-bytes';
|
|
44
|
+
export type {
|
|
45
|
+
LASTypedExtraBytesAttribute,
|
|
46
|
+
LASTypedExtraBytesValue
|
|
47
|
+
} from './lib/las-extra-bytes';
|
|
48
|
+
|
|
49
|
+
export {LASLoader} from './las-loader-types';
|
|
50
|
+
export {decodeLAZFileInBatches} from './lib/typescript/parse-las';
|
|
51
|
+
export {
|
|
52
|
+
NeedsMoreData,
|
|
53
|
+
createLAZChunkDecoder,
|
|
54
|
+
createLAZChunkEncoder,
|
|
55
|
+
decodeLAZChunk,
|
|
56
|
+
decodeLAZChunkInBatches,
|
|
57
|
+
encodeLAZChunk
|
|
58
|
+
} from '@loaders.gl/core/loader-utils';
|
|
59
|
+
export type {
|
|
60
|
+
FeedableLAZChunkDecoder,
|
|
61
|
+
FeedableLAZChunkEncoder,
|
|
62
|
+
LAZChunkDecoderOptions,
|
|
63
|
+
LAZChunkMetadata
|
|
64
|
+
} from '@loaders.gl/core/loader-utils';
|
|
65
|
+
|
|
66
|
+
export type {LASCompatibilityLayout} from './lib/las-compatibility';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
import type {Loader} from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import type {Table, RecordBatch} from 'apache-arrow';
|
|
7
|
+
import {LAS_LOADER_METADATA, type LASLoaderOptions} from './las-loader-shared';
|
|
8
|
+
import type {LASMesh} from './lib/las-types';
|
|
9
|
+
|
|
10
|
+
/** Metadata-only LAS/LAZ loader variant using the COPC package decoder. */
|
|
11
|
+
export const LASCOPCLoader = {
|
|
12
|
+
...LAS_LOADER_METADATA,
|
|
13
|
+
name: 'LAS (COPC)',
|
|
14
|
+
preload: async () => {
|
|
15
|
+
const {LASCOPCLoaderWithParser} = await import('@loaders.gl/pointclouds/las-copc-loader');
|
|
16
|
+
return LASCOPCLoaderWithParser;
|
|
17
|
+
}
|
|
18
|
+
} as const satisfies Loader<LASMesh | Table, LASMesh | RecordBatch, LASLoaderOptions>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// loaders.gl
|
|
2
|
+
// SPDX-License-Identifier: MIT
|
|
3
|
+
// Copyright (c) vis.gl contributors
|
|
4
|
+
|
|
5
|
+
// LASER (LAS) FILE FORMAT
|
|
6
|
+
import type {LoaderWithParser} from '@loaders.gl/core/loader-utils';
|
|
7
|
+
import type {Table, RecordBatch} from 'apache-arrow';
|
|
8
|
+
import {getLASRecordBatches, toPublicLASResult} from './las-loader';
|
|
9
|
+
import type {MeshArrowTable} from '@loaders.gl/core/schema';
|
|
10
|
+
import {convertMeshToArrowTableWrapper, convertTableToMesh} from '@loaders.gl/core/schema-utils';
|
|
11
|
+
import {
|
|
12
|
+
formatLASMeshColors,
|
|
13
|
+
getLASShape,
|
|
14
|
+
LAS_LOADER_METADATA,
|
|
15
|
+
type LASLoaderOptions
|
|
16
|
+
} from './las-loader-shared';
|
|
17
|
+
import type {LASMesh} from './lib/las-types';
|
|
18
|
+
import {parseCOPCLAS, parseCOPCLASInBatches} from './lib/copc/parse-las';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* LAS/LAZ loader variant using the laz-perf decoder from the COPC package.
|
|
22
|
+
*/
|
|
23
|
+
export const LASCOPCLoaderWithParser = {
|
|
24
|
+
...LAS_LOADER_METADATA,
|
|
25
|
+
name: 'LAS (COPC)',
|
|
26
|
+
parse: async (arrayBuffer: ArrayBuffer, options?: LASLoaderOptions) =>
|
|
27
|
+
toPublicLASResult(convertLASMesh(await parseCOPCLAS(arrayBuffer, options), options)),
|
|
28
|
+
parseInBatches: (arrayBufferIterator, options?: LASLoaderOptions) =>
|
|
29
|
+
convertLASMeshBatches(parseCOPCLASInBatches(arrayBufferIterator, options), options)
|
|
30
|
+
} as const satisfies LoaderWithParser<LASMesh | Table, LASMesh | RecordBatch, LASLoaderOptions>;
|
|
31
|
+
|
|
32
|
+
function convertLASMesh(mesh: LASMesh, options?: LASLoaderOptions): LASMesh | MeshArrowTable {
|
|
33
|
+
const formattedMesh = formatLASMeshColors(mesh, options?.las?.colorFormat || 'uint8norm');
|
|
34
|
+
const table = convertMeshToArrowTableWrapper(formattedMesh) as MeshArrowTable;
|
|
35
|
+
if (getLASShape(options) === 'arrow') {
|
|
36
|
+
return {...table, loaderData: mesh.loaderData};
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
...(convertTableToMesh(table) as LASMesh),
|
|
40
|
+
loader: mesh.loader,
|
|
41
|
+
loaderData: mesh.loaderData,
|
|
42
|
+
progress: (mesh as LASMesh & {progress?: number}).progress
|
|
43
|
+
} as LASMesh & {progress?: number};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Convert LAS mesh batches to the requested output shape.
|
|
48
|
+
* @param meshBatches Decoded LAS mesh batches
|
|
49
|
+
* @param options LAS loader options
|
|
50
|
+
* @returns Converted LAS batches
|
|
51
|
+
*/
|
|
52
|
+
async function* convertLASMeshBatches(
|
|
53
|
+
meshBatches: AsyncIterable<LASMesh>,
|
|
54
|
+
options?: LASLoaderOptions
|
|
55
|
+
): AsyncIterable<LASMesh | RecordBatch> {
|
|
56
|
+
for await (const mesh of meshBatches) {
|
|
57
|
+
const result = convertLASMesh(mesh, options);
|
|
58
|
+
if ('shape' in result) yield* getLASRecordBatches(result);
|
|
59
|
+
else yield result;
|
|
60
|
+
}
|
|
61
|
+
}
|