@loaders.gl/core 5.0.0-alpha.12 → 5.0.0-alpha.13
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/LICENSE +1 -1
- package/SCHEMA-README.md +9 -0
- package/SCHEMA-UTILS-README.md +11 -0
- package/dist/dist.dev.js +163 -142
- package/dist/dist.min.js +3 -3
- package/dist/index.cjs +87 -91
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -8
- package/dist/index.js.map +1 -1
- package/dist/iterators/make-iterator/make-iterator.js +1 -1
- package/dist/iterators/make-iterator/make-iterator.js.map +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js +1 -1
- package/dist/iterators/make-iterator/make-stream-iterator.js.map +1 -1
- package/dist/iterators/make-iterator/make-string-iterator.js +1 -1
- package/dist/iterators/make-iterator/make-string-iterator.js.map +1 -1
- package/dist/lib/api/core-api.d.ts +1 -1
- package/dist/lib/api/core-api.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +1 -1
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +1 -1
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/encode-table.d.ts +2 -2
- package/dist/lib/api/encode-table.d.ts.map +1 -1
- package/dist/lib/api/encode-table.js +1 -1
- package/dist/lib/api/encode-table.js.map +1 -1
- package/dist/lib/api/encode.d.ts +1 -1
- package/dist/lib/api/encode.d.ts.map +1 -1
- package/dist/lib/api/encode.js +2 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +1 -1
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +1 -1
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +1 -1
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +1 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +1 -1
- package/dist/lib/api/load.js.map +1 -1
- package/dist/lib/api/parse-file.d.ts +1 -1
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +2 -2
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +1 -1
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +40 -4
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +1 -1
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +1 -1
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +1 -1
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +3 -3
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/preload.d.ts +1 -1
- package/dist/lib/api/preload.d.ts.map +1 -1
- package/dist/lib/api/preload.js.map +1 -1
- package/dist/lib/api/register-loaders.d.ts +1 -1
- package/dist/lib/api/register-loaders.d.ts.map +1 -1
- package/dist/lib/api/select-loader.d.ts +1 -1
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +1 -1
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/common.d.ts +1 -1
- package/dist/lib/common.d.ts.map +1 -1
- package/dist/lib/fetch/fetch-file.js +2 -2
- package/dist/lib/fetch/fetch-file.js.map +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts +1 -1
- package/dist/lib/filesystems/browser-filesystem.d.ts.map +1 -1
- package/dist/lib/filesystems/browser-filesystem.js +1 -1
- package/dist/lib/filesystems/browser-filesystem.js.map +1 -1
- package/dist/lib/init.js +2 -2
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-data.d.ts +1 -1
- package/dist/lib/loader-utils/get-data.d.ts.map +1 -1
- package/dist/lib/loader-utils/get-data.js +1 -1
- package/dist/lib/loader-utils/get-data.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.d.ts +1 -1
- package/dist/lib/loader-utils/get-fetch-function.d.ts.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loader-context.d.ts +1 -1
- package/dist/lib/loader-utils/loader-context.d.ts.map +1 -1
- package/dist/lib/loader-utils/loader-context.js +1 -1
- package/dist/lib/loader-utils/loader-context.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +1 -1
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +1 -1
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/normalize-loader.d.ts +1 -1
- package/dist/lib/loader-utils/normalize-loader.d.ts.map +1 -1
- package/dist/lib/loader-utils/normalize-loader.js +1 -1
- package/dist/lib/loader-utils/normalize-loader.js.map +1 -1
- package/dist/lib/loader-utils/option-defaults.d.ts +1 -1
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +1 -1
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +1 -1
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/lib/utils/resource-utils.js +1 -1
- package/dist/lib/utils/resource-utils.js.map +1 -1
- package/dist/lib/utils/response-utils.js +1 -1
- package/dist/lib/utils/response-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +32 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -0
- package/dist/loader-utils/format-types.js +5 -0
- package/dist/loader-utils/format-types.js.map +1 -0
- package/dist/loader-utils/index.cjs +12416 -0
- package/dist/loader-utils/index.cjs.map +6 -0
- package/dist/loader-utils/index.d.ts +122 -0
- package/dist/loader-utils/index.d.ts.map +1 -0
- package/dist/loader-utils/index.js +91 -0
- package/dist/loader-utils/index.js.map +1 -0
- package/dist/loader-utils/json-loader.d.ts +27 -0
- package/dist/loader-utils/json-loader.d.ts.map +1 -0
- package/dist/loader-utils/json-loader.js +32 -0
- package/dist/loader-utils/json-loader.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.d.ts +32 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.js +88 -0
- package/dist/loader-utils/lib/binary-utils/array-buffer-utils.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.d.ts +67 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.js +245 -0
- package/dist/loader-utils/lib/binary-utils/binary-chunk-reader.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.d.ts +43 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.js +92 -0
- package/dist/loader-utils/lib/binary-utils/dataview-copy-utils.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.d.ts +3 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.js +15 -0
- package/dist/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.d.ts +17 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.js +43 -0
- package/dist/loader-utils/lib/binary-utils/get-first-characters.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.d.ts +15 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.js +51 -0
- package/dist/loader-utils/lib/binary-utils/hex-transcoder.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.d.ts +20 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.js +82 -0
- package/dist/loader-utils/lib/binary-utils/memory-conversion-utils.js.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.d.ts +25 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.js +59 -0
- package/dist/loader-utils/lib/binary-utils/memory-copy-utils.js.map +1 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.d.ts +31 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.d.ts.map +1 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.js +20 -0
- package/dist/loader-utils/lib/crs/crs-reprojection.js.map +1 -0
- package/dist/loader-utils/lib/env-utils/assert.d.ts +6 -0
- package/dist/loader-utils/lib/env-utils/assert.d.ts.map +1 -0
- package/dist/loader-utils/lib/env-utils/assert.js +13 -0
- package/dist/loader-utils/lib/env-utils/assert.js.map +1 -0
- package/dist/loader-utils/lib/env-utils/globals.d.ts +15 -0
- package/dist/loader-utils/lib/env-utils/globals.d.ts.map +1 -0
- package/dist/loader-utils/lib/env-utils/globals.js +28 -0
- package/dist/loader-utils/lib/env-utils/globals.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +40 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.js +68 -0
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +54 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +102 -0
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +45 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +13 -0
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +57 -0
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +1 -0
- package/dist/loader-utils/lib/file-provider/file-provider.js +114 -0
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +1 -0
- package/dist/loader-utils/lib/files/array-buffer-file.d.ts +21 -0
- package/dist/loader-utils/lib/files/array-buffer-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/array-buffer-file.js +36 -0
- package/dist/loader-utils/lib/files/array-buffer-file.js.map +1 -0
- package/dist/loader-utils/lib/files/blob-file.d.ts +19 -0
- package/dist/loader-utils/lib/files/blob-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/blob-file.js +39 -0
- package/dist/loader-utils/lib/files/blob-file.js.map +1 -0
- package/dist/loader-utils/lib/files/file.d.ts +33 -0
- package/dist/loader-utils/lib/files/file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/file.js +5 -0
- package/dist/loader-utils/lib/files/file.js.map +1 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts +37 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/http-file-transport.js +290 -0
- package/dist/loader-utils/lib/files/http-file-transport.js.map +1 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts +49 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/http-file-types.js +5 -0
- package/dist/loader-utils/lib/files/http-file-types.js.map +1 -0
- package/dist/loader-utils/lib/files/http-file.d.ts +55 -0
- package/dist/loader-utils/lib/files/http-file.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/http-file.js +213 -0
- package/dist/loader-utils/lib/files/http-file.js.map +1 -0
- package/dist/loader-utils/lib/files/node-file-facade.d.ts +22 -0
- package/dist/loader-utils/lib/files/node-file-facade.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/node-file-facade.js +45 -0
- package/dist/loader-utils/lib/files/node-file-facade.js.map +1 -0
- package/dist/loader-utils/lib/files/sources.d.ts +1 -0
- package/dist/loader-utils/lib/files/sources.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/sources.js +155 -0
- package/dist/loader-utils/lib/files/sources.js.map +1 -0
- package/dist/loader-utils/lib/filesystems/filesystem.d.ts +33 -0
- package/dist/loader-utils/lib/filesystems/filesystem.d.ts.map +1 -0
- package/dist/loader-utils/lib/filesystems/filesystem.js +5 -0
- package/dist/loader-utils/lib/filesystems/filesystem.js.map +1 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.d.ts +23 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.d.ts.map +1 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.js +48 -0
- package/dist/loader-utils/lib/filesystems/node-filesystem-facade.js.map +1 -0
- package/dist/loader-utils/lib/iterators/async-iteration.d.ts +20 -0
- package/dist/loader-utils/lib/iterators/async-iteration.d.ts.map +1 -0
- package/dist/loader-utils/lib/iterators/async-iteration.js +102 -0
- package/dist/loader-utils/lib/iterators/async-iteration.js.map +1 -0
- package/dist/loader-utils/lib/iterators/text-iterators.d.ts +19 -0
- package/dist/loader-utils/lib/iterators/text-iterators.d.ts.map +1 -0
- package/dist/loader-utils/lib/iterators/text-iterators.js +60 -0
- package/dist/loader-utils/lib/iterators/text-iterators.js.map +1 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.d.ts +59 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.d.ts.map +1 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.js +68 -0
- package/dist/loader-utils/lib/javascript-utils/is-type.js.map +1 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.d.ts +118 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.js +427 -0
- package/dist/loader-utils/lib/laz/laz-arithmetic-encoder.js.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.d.ts +204 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.js +4226 -0
- package/dist/loader-utils/lib/laz/laz-chunk-decoder.js.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.d.ts +40 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.d.ts.map +1 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.js +1518 -0
- package/dist/loader-utils/lib/laz/laz-chunk-encoder.js.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts +4 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.js +21 -0
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.d.ts +10 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.d.ts.map +1 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.js +44 -0
- package/dist/loader-utils/lib/module-utils/initialize-wasm-module.js.map +1 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.d.ts +18 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.js +40 -0
- package/dist/loader-utils/lib/module-utils/js-module-utils.js.map +1 -0
- package/dist/loader-utils/lib/node/buffer.browser.d.ts +11 -0
- package/dist/loader-utils/lib/node/buffer.browser.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/buffer.browser.js +20 -0
- package/dist/loader-utils/lib/node/buffer.browser.js.map +1 -0
- package/dist/loader-utils/lib/node/buffer.d.ts +11 -0
- package/dist/loader-utils/lib/node/buffer.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/buffer.js +35 -0
- package/dist/loader-utils/lib/node/buffer.js.map +1 -0
- package/dist/loader-utils/lib/node/fs.browser.d.ts +2 -0
- package/dist/loader-utils/lib/node/fs.browser.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/fs.browser.js +5 -0
- package/dist/loader-utils/lib/node/fs.browser.js.map +1 -0
- package/dist/loader-utils/lib/node/promisify.d.ts +13 -0
- package/dist/loader-utils/lib/node/promisify.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/promisify.js +19 -0
- package/dist/loader-utils/lib/node/promisify.js.map +1 -0
- package/dist/loader-utils/lib/node/stream.browser.d.ts +2 -0
- package/dist/loader-utils/lib/node/stream.browser.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/stream.browser.js +5 -0
- package/dist/loader-utils/lib/node/stream.browser.js.map +1 -0
- package/dist/loader-utils/lib/node/stream.d.ts +6 -0
- package/dist/loader-utils/lib/node/stream.d.ts.map +1 -0
- package/dist/loader-utils/lib/node/stream.js +8 -0
- package/dist/loader-utils/lib/node/stream.js.map +1 -0
- package/dist/loader-utils/lib/option-utils/merge-options.d.ts +12 -0
- package/dist/loader-utils/lib/option-utils/merge-options.d.ts.map +1 -0
- package/dist/loader-utils/lib/option-utils/merge-options.js +34 -0
- package/dist/loader-utils/lib/option-utils/merge-options.js.map +1 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.d.ts +5 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.d.ts.map +1 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.js +16 -0
- package/dist/loader-utils/lib/parser-utils/parse-json.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.d.ts +35 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.js +64 -0
- package/dist/loader-utils/lib/path-utils/cached-uri-resolver.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.d.ts +17 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.js +44 -0
- package/dist/loader-utils/lib/path-utils/file-aliases.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.d.ts +3 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.js +12 -0
- package/dist/loader-utils/lib/path-utils/get-cwd.js.map +1 -0
- package/dist/loader-utils/lib/path-utils/path.d.ts +24 -0
- package/dist/loader-utils/lib/path-utils/path.d.ts.map +1 -0
- package/dist/loader-utils/lib/path-utils/path.js +173 -0
- package/dist/loader-utils/lib/path-utils/path.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.d.ts +5 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.js +59 -0
- package/dist/loader-utils/lib/request-utils/abort-utils.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/authentication.d.ts +56 -0
- package/dist/loader-utils/lib/request-utils/authentication.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/authentication.js +67 -0
- package/dist/loader-utils/lib/request-utils/authentication.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.d.ts +7 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.js +20 -0
- package/dist/loader-utils/lib/request-utils/parse-content-type.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.d.ts +70 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.js +203 -0
- package/dist/loader-utils/lib/request-utils/range-request-cache.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.d.ts +201 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.js +636 -0
- package/dist/loader-utils/lib/request-utils/range-request-scheduler.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-cache.d.ts +62 -0
- package/dist/loader-utils/lib/request-utils/request-cache.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-cache.js +236 -0
- package/dist/loader-utils/lib/request-utils/request-cache.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.d.ts +137 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +379 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.d.ts +71 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.d.ts.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.js +174 -0
- package/dist/loader-utils/lib/request-utils/request-scheduler.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.d.ts +56 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.js +261 -0
- package/dist/loader-utils/lib/scan-utils/columnar-predicate.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts +42 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js +5 -0
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.d.ts +56 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.js +86 -0
- package/dist/loader-utils/lib/scan-utils/point-cloud-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.d.ts +36 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.js +49 -0
- package/dist/loader-utils/lib/scan-utils/raster-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.d.ts +75 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.js +107 -0
- package/dist/loader-utils/lib/scan-utils/relational-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.d.ts +20 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.js +183 -0
- package/dist/loader-utils/lib/scan-utils/scan-executor.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.d.ts +23 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.js +5 -0
- package/dist/loader-utils/lib/scan-utils/scan-fragments.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +272 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +97 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.d.ts +39 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.js +35 -0
- package/dist/loader-utils/lib/scan-utils/table-query-explain.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +77 -0
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js +56 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +30 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +161 -0
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -0
- package/dist/loader-utils/lib/sources/catalog-source.d.ts +36 -0
- package/dist/loader-utils/lib/sources/catalog-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/catalog-source.js +5 -0
- package/dist/loader-utils/lib/sources/catalog-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/data-source-manager.d.ts +136 -0
- package/dist/loader-utils/lib/sources/data-source-manager.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/data-source-manager.js +376 -0
- package/dist/loader-utils/lib/sources/data-source-manager.js.map +1 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts +79 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/data-source.js +145 -0
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/image-source.d.ts +55 -0
- package/dist/loader-utils/lib/sources/image-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/image-source.js +5 -0
- package/dist/loader-utils/lib/sources/image-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/image-tile-source.d.ts +12 -0
- package/dist/loader-utils/lib/sources/image-tile-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/image-tile-source.js +5 -0
- package/dist/loader-utils/lib/sources/image-tile-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-coverage.d.ts +17 -0
- package/dist/loader-utils/lib/sources/raster-coverage.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-coverage.js +62 -0
- package/dist/loader-utils/lib/sources/raster-coverage.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-region.d.ts +4 -0
- package/dist/loader-utils/lib/sources/raster-region.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-region.js +22 -0
- package/dist/loader-utils/lib/sources/raster-region.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-sampling.d.ts +35 -0
- package/dist/loader-utils/lib/sources/raster-sampling.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-sampling.js +152 -0
- package/dist/loader-utils/lib/sources/raster-sampling.js.map +1 -0
- package/dist/loader-utils/lib/sources/raster-source.d.ts +302 -0
- package/dist/loader-utils/lib/sources/raster-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/raster-source.js +20 -0
- package/dist/loader-utils/lib/sources/raster-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/service-capabilities.d.ts +36 -0
- package/dist/loader-utils/lib/sources/service-capabilities.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/service-capabilities.js +5 -0
- package/dist/loader-utils/lib/sources/service-capabilities.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-grid.d.ts +46 -0
- package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-grid.js +128 -0
- package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.d.ts +24 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.js +109 -0
- package/dist/loader-utils/lib/sources/tile-source-adapter.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.d.ts +6 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.js +13 -0
- package/dist/loader-utils/lib/sources/tile-source-utils.js.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source.d.ts +190 -0
- package/dist/loader-utils/lib/sources/tile-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/tile-source.js +5 -0
- package/dist/loader-utils/lib/sources/tile-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/image-type.d.ts +10 -0
- package/dist/loader-utils/lib/sources/utils/image-type.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/utils/image-type.js +5 -0
- package/dist/loader-utils/lib/sources/utils/image-type.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.d.ts +13 -0
- package/dist/loader-utils/lib/sources/utils/utils.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.js +26 -0
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -0
- package/dist/loader-utils/lib/sources/vector-source.d.ts +76 -0
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/vector-source.js +5 -0
- package/dist/loader-utils/lib/sources/vector-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +15 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.js +5 -0
- package/dist/loader-utils/lib/sources/vector-tile-source.js.map +1 -0
- package/dist/loader-utils/lib/sources/xyz-grid.d.ts +9 -0
- package/dist/loader-utils/lib/sources/xyz-grid.d.ts.map +1 -0
- package/dist/loader-utils/lib/sources/xyz-grid.js +63 -0
- package/dist/loader-utils/lib/sources/xyz-grid.js.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.d.ts +22 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.d.ts.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.js +155 -0
- package/dist/loader-utils/lib/worker-loader-utils/create-loader-worker.js.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts +8 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js +23 -0
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts +41 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +239 -0
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -0
- package/dist/loader-utils/loader-types.d.ts +322 -0
- package/dist/loader-utils/loader-types.d.ts.map +1 -0
- package/dist/loader-utils/loader-types.js +33 -0
- package/dist/loader-utils/loader-types.js.map +1 -0
- package/dist/loader-utils/source-types.d.ts +42 -0
- package/dist/loader-utils/source-types.d.ts.map +1 -0
- package/dist/loader-utils/source-types.js +8 -0
- package/dist/loader-utils/source-types.js.map +1 -0
- package/dist/loader-utils/types.d.ts +24 -0
- package/dist/loader-utils/types.d.ts.map +1 -0
- package/dist/loader-utils/types.js +6 -0
- package/dist/loader-utils/types.js.map +1 -0
- package/dist/loader-utils/workers/json-worker.d.ts +2 -0
- package/dist/loader-utils/workers/json-worker.d.ts.map +1 -0
- package/dist/loader-utils/workers/json-worker.js +7 -0
- package/dist/loader-utils/workers/json-worker.js.map +1 -0
- package/dist/loader-utils/writer-types.d.ts +74 -0
- package/dist/loader-utils/writer-types.d.ts.map +1 -0
- package/dist/loader-utils/writer-types.js +5 -0
- package/dist/loader-utils/writer-types.js.map +1 -0
- package/dist/null-loader.d.ts +2 -2
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -1
- package/dist/null-worker-node.js +7 -7
- package/dist/null-worker.js +7 -7
- package/dist/polyfills/buffer/btoa.node.d.ts +3 -0
- package/dist/polyfills/buffer/btoa.node.d.ts.map +1 -0
- package/dist/polyfills/buffer/btoa.node.js +13 -0
- package/dist/polyfills/buffer/btoa.node.js.map +1 -0
- package/dist/polyfills/buffer/to-array-buffer.node.d.ts +2 -0
- package/dist/polyfills/buffer/to-array-buffer.node.d.ts.map +1 -0
- package/dist/polyfills/buffer/to-array-buffer.node.js +12 -0
- package/dist/polyfills/buffer/to-array-buffer.node.js.map +1 -0
- package/dist/polyfills/crypto/node-hash.d.ts +29 -0
- package/dist/polyfills/crypto/node-hash.d.ts.map +1 -0
- package/dist/polyfills/crypto/node-hash.js +63 -0
- package/dist/polyfills/crypto/node-hash.js.map +1 -0
- package/dist/polyfills/fetch/decode-data-uri.d.ts +11 -0
- package/dist/polyfills/fetch/decode-data-uri.d.ts.map +1 -0
- package/dist/polyfills/fetch/decode-data-uri.js +63 -0
- package/dist/polyfills/fetch/decode-data-uri.js.map +1 -0
- package/dist/polyfills/fetch/fetch-polyfill.d.ts +11 -0
- package/dist/polyfills/fetch/fetch-polyfill.d.ts.map +1 -0
- package/dist/polyfills/fetch/fetch-polyfill.js +141 -0
- package/dist/polyfills/fetch/fetch-polyfill.js.map +1 -0
- package/dist/polyfills/fetch/headers-polyfill.d.ts +34 -0
- package/dist/polyfills/fetch/headers-polyfill.d.ts.map +1 -0
- package/dist/polyfills/fetch/headers-polyfill.js +105 -0
- package/dist/polyfills/fetch/headers-polyfill.js.map +1 -0
- package/dist/polyfills/fetch/response-polyfill.d.ts +22 -0
- package/dist/polyfills/fetch/response-polyfill.d.ts.map +1 -0
- package/dist/polyfills/fetch/response-polyfill.js +81 -0
- package/dist/polyfills/fetch/response-polyfill.js.map +1 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.d.ts +11 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.d.ts.map +1 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.js +32 -0
- package/dist/polyfills/fetch/utils/decode-data-uri.node.js.map +1 -0
- package/dist/polyfills/file/blob-stream-controller.d.ts +29 -0
- package/dist/polyfills/file/blob-stream-controller.d.ts.map +1 -0
- package/dist/polyfills/file/blob-stream-controller.js +64 -0
- package/dist/polyfills/file/blob-stream-controller.js.map +1 -0
- package/dist/polyfills/file/blob-stream.d.ts +25 -0
- package/dist/polyfills/file/blob-stream.d.ts.map +1 -0
- package/dist/polyfills/file/blob-stream.js +38 -0
- package/dist/polyfills/file/blob-stream.js.map +1 -0
- package/dist/polyfills/file/blob.d.ts +58 -0
- package/dist/polyfills/file/blob.d.ts.map +1 -0
- package/dist/polyfills/file/blob.js +166 -0
- package/dist/polyfills/file/blob.js.map +1 -0
- package/dist/polyfills/file/file-reader.d.ts +24 -0
- package/dist/polyfills/file/file-reader.d.ts.map +1 -0
- package/dist/polyfills/file/file-reader.js +51 -0
- package/dist/polyfills/file/file-reader.js.map +1 -0
- package/dist/polyfills/file/file.d.ts +24 -0
- package/dist/polyfills/file/file.d.ts.map +1 -0
- package/dist/polyfills/file/file.js +41 -0
- package/dist/polyfills/file/file.js.map +1 -0
- package/dist/polyfills/file/install-blob-polyfills.d.ts +9 -0
- package/dist/polyfills/file/install-blob-polyfills.d.ts.map +1 -0
- package/dist/polyfills/file/install-blob-polyfills.js +14 -0
- package/dist/polyfills/file/install-blob-polyfills.js.map +1 -0
- package/dist/polyfills/file/install-file-polyfills.d.ts +3 -0
- package/dist/polyfills/file/install-file-polyfills.d.ts.map +1 -0
- package/dist/polyfills/file/install-file-polyfills.js +20 -0
- package/dist/polyfills/file/install-file-polyfills.js.map +1 -0
- package/dist/polyfills/file/readable-stream.d.ts +5 -0
- package/dist/polyfills/file/readable-stream.d.ts.map +1 -0
- package/dist/polyfills/file/readable-stream.js +8 -0
- package/dist/polyfills/file/readable-stream.js.map +1 -0
- package/dist/polyfills/filesystems/fetch-node.d.ts +8 -0
- package/dist/polyfills/filesystems/fetch-node.d.ts.map +1 -0
- package/dist/polyfills/filesystems/fetch-node.js +88 -0
- package/dist/polyfills/filesystems/fetch-node.js.map +1 -0
- package/dist/polyfills/filesystems/node-file.d.ts +15 -0
- package/dist/polyfills/filesystems/node-file.d.ts.map +1 -0
- package/dist/polyfills/filesystems/node-file.js +138 -0
- package/dist/polyfills/filesystems/node-file.js.map +1 -0
- package/dist/polyfills/filesystems/node-filesystem.d.ts +19 -0
- package/dist/polyfills/filesystems/node-filesystem.d.ts.map +1 -0
- package/dist/polyfills/filesystems/node-filesystem.js +44 -0
- package/dist/polyfills/filesystems/node-filesystem.js.map +1 -0
- package/dist/polyfills/filesystems/stream-utils.node.d.ts +18 -0
- package/dist/polyfills/filesystems/stream-utils.node.d.ts.map +1 -0
- package/dist/polyfills/filesystems/stream-utils.node.js +67 -0
- package/dist/polyfills/filesystems/stream-utils.node.js.map +1 -0
- package/dist/polyfills/images/encode-image-node.d.ts +20 -0
- package/dist/polyfills/images/encode-image-node.d.ts.map +1 -0
- package/dist/polyfills/images/encode-image-node.js +37 -0
- package/dist/polyfills/images/encode-image-node.js.map +1 -0
- package/dist/polyfills/images/image-codecs-node.d.ts +8 -0
- package/dist/polyfills/images/image-codecs-node.d.ts.map +1 -0
- package/dist/polyfills/images/image-codecs-node.js +27 -0
- package/dist/polyfills/images/image-codecs-node.js.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts +38 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.js +64 -0
- package/dist/polyfills/images/node-image-bitmap.js.map +1 -0
- package/dist/polyfills/images/node-image-formats.d.ts +3 -0
- package/dist/polyfills/images/node-image-formats.d.ts.map +1 -0
- package/dist/polyfills/images/node-image-formats.js +6 -0
- package/dist/polyfills/images/node-image-formats.js.map +1 -0
- package/dist/polyfills/images/parse-image-node.d.ts +11 -0
- package/dist/polyfills/images/parse-image-node.d.ts.map +1 -0
- package/dist/polyfills/images/parse-image-node.js +36 -0
- package/dist/polyfills/images/parse-image-node.js.map +1 -0
- package/dist/polyfills/index.browser.d.ts +8 -0
- package/dist/polyfills/index.browser.d.ts.map +1 -0
- package/dist/polyfills/index.browser.js +18 -0
- package/dist/polyfills/index.browser.js.map +1 -0
- package/dist/polyfills/index.cjs +2918 -0
- package/dist/polyfills/index.cjs.map +6 -0
- package/dist/polyfills/index.d.ts +7 -0
- package/dist/polyfills/index.d.ts.map +1 -0
- package/dist/polyfills/index.js +110 -0
- package/dist/polyfills/index.js.map +1 -0
- package/dist/polyfills/libs/encoding-indexes-asian.d.ts +10 -0
- package/dist/polyfills/libs/encoding-indexes-asian.d.ts.map +1 -0
- package/dist/polyfills/libs/encoding-indexes-asian.js +14 -0
- package/dist/polyfills/libs/encoding-indexes-asian.js.map +1 -0
- package/dist/polyfills/load-library/require-utils.node.d.ts +19 -0
- package/dist/polyfills/load-library/require-utils.node.d.ts.map +1 -0
- package/dist/polyfills/load-library/require-utils.node.js +88 -0
- package/dist/polyfills/load-library/require-utils.node.js.map +1 -0
- package/dist/polyfills/streams/make-node-stream.d.ts +10 -0
- package/dist/polyfills/streams/make-node-stream.d.ts.map +1 -0
- package/dist/polyfills/streams/make-node-stream.js +70 -0
- package/dist/polyfills/streams/make-node-stream.js.map +1 -0
- package/dist/polyfills/text-encoder/encoding-indexes.d.ts +31 -0
- package/dist/polyfills/text-encoder/encoding-indexes.d.ts.map +1 -0
- package/dist/polyfills/text-encoder/encoding-indexes.js +35 -0
- package/dist/polyfills/text-encoder/encoding-indexes.js.map +1 -0
- package/dist/polyfills/text-encoder/text-encoder.d.ts +15 -0
- package/dist/polyfills/text-encoder/text-encoder.d.ts.map +1 -0
- package/dist/polyfills/text-encoder/text-encoder.js +2778 -0
- package/dist/polyfills/text-encoder/text-encoder.js.map +1 -0
- package/dist/polyfills/utils/assert.d.ts +2 -0
- package/dist/polyfills/utils/assert.d.ts.map +1 -0
- package/dist/polyfills/utils/assert.js +9 -0
- package/dist/polyfills/utils/assert.js.map +1 -0
- package/dist/polyfills/utils/buffer-utils.d.ts +5 -0
- package/dist/polyfills/utils/buffer-utils.d.ts.map +1 -0
- package/dist/polyfills/utils/buffer-utils.js +34 -0
- package/dist/polyfills/utils/buffer-utils.js.map +1 -0
- package/dist/polyfills/utils/filesystem-types.d.ts +10 -0
- package/dist/polyfills/utils/filesystem-types.d.ts.map +1 -0
- package/dist/polyfills/utils/filesystem-types.js +5 -0
- package/dist/polyfills/utils/filesystem-types.js.map +1 -0
- package/dist/polyfills/utils/is-browser.d.ts +2 -0
- package/dist/polyfills/utils/is-browser.d.ts.map +1 -0
- package/dist/polyfills/utils/is-browser.js +8 -0
- package/dist/polyfills/utils/is-browser.js.map +1 -0
- package/dist/polyfills/utils/path-utils.d.ts +7 -0
- package/dist/polyfills/utils/path-utils.d.ts.map +1 -0
- package/dist/polyfills/utils/path-utils.js +28 -0
- package/dist/polyfills/utils/path-utils.js.map +1 -0
- package/dist/schema/categories/category-gis.d.ts +7 -0
- package/dist/schema/categories/category-gis.d.ts.map +1 -0
- package/dist/schema/categories/category-gis.js +5 -0
- package/dist/schema/categories/category-gis.js.map +1 -0
- package/dist/schema/categories/category-image.d.ts +18 -0
- package/dist/schema/categories/category-image.d.ts.map +1 -0
- package/dist/schema/categories/category-image.js +5 -0
- package/dist/schema/categories/category-image.js.map +1 -0
- package/dist/schema/categories/category-mesh.d.ts +99 -0
- package/dist/schema/categories/category-mesh.d.ts.map +1 -0
- package/dist/schema/categories/category-mesh.js +14 -0
- package/dist/schema/categories/category-mesh.js.map +1 -0
- package/dist/schema/categories/category-table.d.ts +106 -0
- package/dist/schema/categories/category-table.d.ts.map +1 -0
- package/dist/schema/categories/category-table.js +5 -0
- package/dist/schema/categories/category-table.js.map +1 -0
- package/dist/schema/categories/category-texture.d.ts +115 -0
- package/dist/schema/categories/category-texture.d.ts.map +1 -0
- package/dist/schema/categories/category-texture.js +5 -0
- package/dist/schema/categories/category-texture.js.map +1 -0
- package/dist/schema/deprecated/mesh-utils.d.ts +12 -0
- package/dist/schema/deprecated/mesh-utils.d.ts.map +1 -0
- package/dist/schema/deprecated/mesh-utils.js +37 -0
- package/dist/schema/deprecated/mesh-utils.js.map +1 -0
- package/dist/schema/float16.d.ts +19 -0
- package/dist/schema/float16.d.ts.map +1 -0
- package/dist/schema/float16.js +90 -0
- package/dist/schema/float16.js.map +1 -0
- package/dist/schema/geoarrow-metadata.schema.json +117 -0
- package/dist/schema/geometry/arrow-binary-features.d.ts +45 -0
- package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -0
- package/dist/schema/geometry/arrow-binary-features.js +5 -0
- package/dist/schema/geometry/arrow-binary-features.js.map +1 -0
- package/dist/schema/geometry/binary-features.d.ts +30 -0
- package/dist/schema/geometry/binary-features.d.ts.map +1 -0
- package/dist/schema/geometry/binary-features.js +5 -0
- package/dist/schema/geometry/binary-features.js.map +1 -0
- package/dist/schema/geometry/binary-geometries.d.ts +33 -0
- package/dist/schema/geometry/binary-geometries.d.ts.map +1 -0
- package/dist/schema/geometry/binary-geometries.js +5 -0
- package/dist/schema/geometry/binary-geometries.js.map +1 -0
- package/dist/schema/geometry/flat-geometries.d.ts +61 -0
- package/dist/schema/geometry/flat-geometries.d.ts.map +1 -0
- package/dist/schema/geometry/flat-geometries.js +5 -0
- package/dist/schema/geometry/flat-geometries.js.map +1 -0
- package/dist/schema/geometry/geoarrow.d.ts +69 -0
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -0
- package/dist/schema/geometry/geoarrow.js +5 -0
- package/dist/schema/geometry/geoarrow.js.map +1 -0
- package/dist/schema/geoparquet.schema.json +222 -0
- package/dist/schema/geospatial-metadata-zod-schema.cjs +154 -0
- package/dist/schema/geospatial-metadata-zod-schema.cjs.map +6 -0
- package/dist/schema/geospatial-metadata-zod-schema.d.ts +44 -0
- package/dist/schema/geospatial-metadata-zod-schema.d.ts.map +1 -0
- package/dist/schema/geospatial-metadata-zod-schema.js +151 -0
- package/dist/schema/geospatial-metadata-zod-schema.js.map +1 -0
- package/dist/schema/index.cjs +259 -0
- package/dist/schema/index.cjs.map +6 -0
- package/dist/schema/index.d.ts +21 -0
- package/dist/schema/index.d.ts.map +1 -0
- package/dist/schema/index.js +9 -0
- package/dist/schema/index.js.map +1 -0
- package/dist/schema/metadata.d.ts +40 -0
- package/dist/schema/metadata.d.ts.map +1 -0
- package/dist/schema/metadata.js +86 -0
- package/dist/schema/metadata.js.map +1 -0
- package/dist/schema/types/batch.d.ts +37 -0
- package/dist/schema/types/batch.d.ts.map +1 -0
- package/dist/schema/types/batch.js +5 -0
- package/dist/schema/types/batch.js.map +1 -0
- package/dist/schema/types/schema.d.ts +70 -0
- package/dist/schema/types/schema.d.ts.map +1 -0
- package/dist/schema/types/schema.js +5 -0
- package/dist/schema/types/schema.js.map +1 -0
- package/dist/schema/types/types.d.ts +16 -0
- package/dist/schema/types/types.d.ts.map +1 -0
- package/dist/schema/types/types.js +6 -0
- package/dist/schema/types/types.js.map +1 -0
- package/dist/schema-utils/arrow-transport.cjs +665 -0
- package/dist/schema-utils/arrow-transport.cjs.map +6 -0
- package/dist/schema-utils/arrow-transport.d.ts +4 -0
- package/dist/schema-utils/arrow-transport.d.ts.map +1 -0
- package/dist/schema-utils/arrow-transport.js +7 -0
- package/dist/schema-utils/arrow-transport.js.map +1 -0
- package/dist/schema-utils/deprecated.d.ts +24 -0
- package/dist/schema-utils/deprecated.d.ts.map +1 -0
- package/dist/schema-utils/deprecated.js +27 -0
- package/dist/schema-utils/deprecated.js.map +1 -0
- package/dist/schema-utils/index.cjs +3423 -0
- package/dist/schema-utils/index.cjs.map +6 -0
- package/dist/schema-utils/index.d.ts +38 -0
- package/dist/schema-utils/index.d.ts.map +1 -0
- package/dist/schema-utils/index.js +77 -0
- package/dist/schema-utils/index.js.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts +72 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js +162 -0
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js.map +1 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts +33 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js +128 -0
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.d.ts +11 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.js +45 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts +11 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.js +33 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.js.map +1 -0
- package/dist/schema-utils/lib/converters/convert.d.ts +10 -0
- package/dist/schema-utils/lib/converters/convert.d.ts.map +1 -0
- package/dist/schema-utils/lib/converters/convert.js +98 -0
- package/dist/schema-utils/lib/converters/convert.js.map +1 -0
- package/dist/schema-utils/lib/converters/converters.d.ts +3 -0
- package/dist/schema-utils/lib/converters/converters.d.ts.map +1 -0
- package/dist/schema-utils/lib/converters/converters.js +5 -0
- package/dist/schema-utils/lib/converters/converters.js.map +1 -0
- package/dist/schema-utils/lib/converters/types.d.ts +35 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -0
- package/dist/schema-utils/lib/converters/types.js +5 -0
- package/dist/schema-utils/lib/converters/types.js.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +44 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +187 -0
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +217 -0
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.d.ts +23 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.js +72 -0
- package/dist/schema-utils/lib/mesh/deduce-mesh-schema.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +23 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.js +54 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts +98 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +407 -0
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.d.ts +39 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.js +441 -0
- package/dist/schema-utils/lib/schema/convert-arrow-schema.js.map +1 -0
- package/dist/schema-utils/lib/schema/data-type.d.ts +16 -0
- package/dist/schema-utils/lib/schema/data-type.d.ts.map +1 -0
- package/dist/schema-utils/lib/schema/data-type.js +102 -0
- package/dist/schema-utils/lib/schema/data-type.js.map +1 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +14 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.js +101 -0
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.d.ts +19 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.js +37 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-field.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.d.ts +43 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.js +5 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-interface.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.d.ts +12 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.js +82 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-schema.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +28 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +64 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.d.ts +177 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.js +441 -0
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-type.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.d.ts +92 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.js +98 -0
- package/dist/schema-utils/lib/table/arrow-api/enum.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.d.ts +13 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.js +28 -0
- package/dist/schema-utils/lib/table/arrow-api/get-type-info.js.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/index.d.ts +6 -0
- package/dist/schema-utils/lib/table/arrow-api/index.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/arrow-api/index.js +8 -0
- package/dist/schema-utils/lib/table/arrow-api/index.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +10 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +71 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +28 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +104 -0
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +19 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +64 -0
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +20 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +84 -0
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +21 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +86 -0
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +24 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js +5 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +52 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +149 -0
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +10 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.js +46 -0
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +17 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +61 -0
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.d.ts +15 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.js +22 -0
- package/dist/schema-utils/lib/table/batches/make-table-batch-iterator.js.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +9 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +63 -0
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -0
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +23 -0
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/query-arrow-table.js +73 -0
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +24 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +151 -0
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +43 -0
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/convert-table.js +122 -0
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +67 -0
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/make-table.js +102 -0
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/row-utils.d.ts +15 -0
- package/dist/schema-utils/lib/table/tables/row-utils.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/row-utils.js +50 -0
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +68 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.js +352 -0
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-column.d.ts +7 -0
- package/dist/schema-utils/lib/table/tables/table-column.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-column.js +40 -0
- package/dist/schema-utils/lib/table/tables/table-column.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +9 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +19 -0
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +16 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +45 -0
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +12 -0
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -0
- package/dist/schema-utils/lib/table/tables/table-types.js +24 -0
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -0
- package/dist/schema-utils/lib/utils/assert.d.ts +2 -0
- package/dist/schema-utils/lib/utils/assert.d.ts.map +1 -0
- package/dist/schema-utils/lib/utils/assert.js +12 -0
- package/dist/schema-utils/lib/utils/assert.js.map +1 -0
- package/dist/schema-utils/lib/utils/async-queue.d.ts +18 -0
- package/dist/schema-utils/lib/utils/async-queue.d.ts.map +1 -0
- package/dist/schema-utils/lib/utils/async-queue.js +96 -0
- package/dist/schema-utils/lib/utils/async-queue.js.map +1 -0
- package/dist/schema-utils/types/types.d.ts +15 -0
- package/dist/schema-utils/types/types.d.ts.map +1 -0
- package/dist/schema-utils/types/types.js +5 -0
- package/dist/schema-utils/types/types.js.map +1 -0
- package/dist/worker-utils/index.cjs +1448 -0
- package/dist/worker-utils/index.cjs.map +6 -0
- package/dist/worker-utils/index.d.ts +22 -0
- package/dist/worker-utils/index.d.ts.map +1 -0
- package/dist/worker-utils/index.js +40 -0
- package/dist/worker-utils/index.js.map +1 -0
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts +32 -0
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts.map +1 -0
- package/dist/worker-utils/lib/async-queue/async-queue.js +91 -0
- package/dist/worker-utils/lib/async-queue/async-queue.js.map +1 -0
- package/dist/worker-utils/lib/env-utils/assert.d.ts +3 -0
- package/dist/worker-utils/lib/env-utils/assert.d.ts.map +1 -0
- package/dist/worker-utils/lib/env-utils/assert.js +13 -0
- package/dist/worker-utils/lib/env-utils/assert.js.map +1 -0
- package/dist/worker-utils/lib/env-utils/globals.d.ts +22 -0
- package/dist/worker-utils/lib/env-utils/globals.d.ts.map +1 -0
- package/dist/worker-utils/lib/env-utils/globals.js +30 -0
- package/dist/worker-utils/lib/env-utils/globals.js.map +1 -0
- package/dist/worker-utils/lib/env-utils/version.d.ts +2 -0
- package/dist/worker-utils/lib/env-utils/version.d.ts.map +1 -0
- package/dist/worker-utils/lib/env-utils/version.js +20 -0
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -0
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts +42 -0
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -0
- package/dist/worker-utils/lib/library-utils/library-utils.js +248 -0
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.d.ts +14 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.d.ts.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.js +22 -0
- package/dist/worker-utils/lib/node/worker_threads-browser.js.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads.d.ts +15 -0
- package/dist/worker-utils/lib/node/worker_threads.d.ts.map +1 -0
- package/dist/worker-utils/lib/node/worker_threads.js +16 -0
- package/dist/worker-utils/lib/node/worker_threads.js.map +1 -0
- package/dist/worker-utils/lib/npm-tag.d.ts +8 -0
- package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -0
- package/dist/worker-utils/lib/npm-tag.js +11 -0
- package/dist/worker-utils/lib/npm-tag.js.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.d.ts +8 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.d.ts.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.js +18 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.browser.js.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts +45 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +123 -0
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -0
- package/dist/worker-utils/lib/process-utils/process-utils.d.ts +2 -0
- package/dist/worker-utils/lib/process-utils/process-utils.d.ts.map +1 -0
- package/dist/worker-utils/lib/process-utils/process-utils.js +32 -0
- package/dist/worker-utils/lib/process-utils/process-utils.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts +9 -0
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/create-worker.js +123 -0
- package/dist/worker-utils/lib/worker-api/create-worker.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts +27 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +103 -0
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +44 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +312 -0
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.d.ts +9 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.js +35 -0
- package/dist/worker-utils/lib/worker-api/validate-worker-version.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts +20 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.js +131 -0
- package/dist/worker-utils/lib/worker-farm/worker-body.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts +58 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.js +116 -0
- package/dist/worker-utils/lib/worker-farm/worker-farm.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts +34 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.js +73 -0
- package/dist/worker-utils/lib/worker-farm/worker-job.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts +94 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.js +193 -0
- package/dist/worker-utils/lib/worker-farm/worker-pool.js.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts +67 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.js +175 -0
- package/dist/worker-utils/lib/worker-farm/worker-thread.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.d.ts +14 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +72 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts +15 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js +86 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.d.ts +6 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.js +27 -0
- package/dist/worker-utils/lib/worker-utils/remove-nontransferable-options.js.map +1 -0
- package/dist/worker-utils/null-worker-node.js +349 -0
- package/dist/worker-utils/null-worker-node.js.map +7 -0
- package/dist/worker-utils/null-worker.js +327 -0
- package/dist/worker-utils/null-worker.js.map +7 -0
- package/dist/worker-utils/types.d.ts +79 -0
- package/dist/worker-utils/types.d.ts.map +1 -0
- package/dist/worker-utils/types.js +5 -0
- package/dist/worker-utils/types.js.map +1 -0
- package/dist/worker-utils/workers/null-worker.d.ts +2 -0
- package/dist/worker-utils/workers/null-worker.d.ts.map +1 -0
- package/dist/worker-utils/workers/null-worker.js +17 -0
- package/dist/worker-utils/workers/null-worker.js.map +1 -0
- package/dist/workers/null-worker-node.js +1 -1
- package/dist/workers/null-worker-node.js.map +1 -1
- package/dist/workers/null-worker.js +1 -1
- package/dist/workers/null-worker.js.map +1 -1
- package/package.json +101 -11
- package/src/index.ts +10 -10
- package/src/iterators/make-iterator/make-iterator.ts +1 -1
- package/src/iterators/make-iterator/make-stream-iterator.ts +1 -1
- package/src/iterators/make-iterator/make-string-iterator.ts +1 -1
- package/src/lib/api/core-api.ts +1 -1
- package/src/lib/api/create-data-source.ts +2 -2
- package/src/lib/api/encode-table.ts +2 -2
- package/src/lib/api/encode.ts +3 -3
- package/src/lib/api/load-in-batches.ts +2 -2
- package/src/lib/api/load-loader.ts +2 -2
- package/src/lib/api/load.ts +2 -2
- package/src/lib/api/parse-file.ts +3 -3
- package/src/lib/api/parse-in-batches.ts +44 -6
- package/src/lib/api/parse-sync.ts +2 -2
- package/src/lib/api/parse.ts +4 -4
- package/src/lib/api/preload.ts +6 -1
- package/src/lib/api/register-loaders.ts +1 -1
- package/src/lib/api/select-loader.ts +3 -3
- package/src/lib/api/select-source.ts +1 -1
- package/src/lib/common.ts +1 -1
- package/src/lib/fetch/fetch-file.ts +2 -2
- package/src/lib/filesystems/browser-filesystem.ts +2 -2
- package/src/lib/init.ts +1 -1
- package/src/lib/loader-utils/get-data.ts +2 -2
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loader-context.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +1 -1
- package/src/lib/loader-utils/normalize-loader.ts +2 -2
- package/src/lib/loader-utils/option-defaults.ts +2 -2
- package/src/lib/loader-utils/option-utils.ts +1 -1
- package/src/lib/utils/resource-utils.ts +1 -1
- package/src/lib/utils/response-utils.ts +1 -1
- package/src/loader-utils/format-types.ts +49 -0
- package/src/loader-utils/index.ts +522 -0
- package/src/loader-utils/json-loader.ts +39 -0
- package/src/loader-utils/lib/binary-utils/array-buffer-utils.ts +114 -0
- package/src/loader-utils/lib/binary-utils/binary-chunk-reader.ts +297 -0
- package/src/loader-utils/lib/binary-utils/dataview-copy-utils.ts +121 -0
- package/src/loader-utils/lib/binary-utils/encode-array-buffer-to-base64.ts +17 -0
- package/src/loader-utils/lib/binary-utils/get-first-characters.ts +46 -0
- package/src/loader-utils/lib/binary-utils/hex-transcoder.ts +54 -0
- package/src/loader-utils/lib/binary-utils/memory-conversion-utils.ts +105 -0
- package/src/loader-utils/lib/binary-utils/memory-copy-utils.ts +69 -0
- package/src/loader-utils/lib/crs/crs-reprojection.ts +52 -0
- package/src/loader-utils/lib/env-utils/assert.ts +13 -0
- package/src/loader-utils/lib/env-utils/globals.ts +36 -0
- package/src/loader-utils/lib/file-provider/data-view-file.ts +83 -0
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +114 -0
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +60 -0
- package/src/loader-utils/lib/file-provider/file-provider.ts +130 -0
- package/src/loader-utils/lib/files/array-buffer-file.ts +46 -0
- package/src/loader-utils/lib/files/blob-file.ts +45 -0
- package/src/loader-utils/lib/files/file.ts +39 -0
- package/src/loader-utils/lib/files/http-file-transport.ts +432 -0
- package/src/loader-utils/lib/files/http-file-types.ts +60 -0
- package/src/loader-utils/lib/files/http-file.ts +267 -0
- package/src/loader-utils/lib/files/node-file-facade.ts +57 -0
- package/src/loader-utils/lib/files/sources.ts +154 -0
- package/src/loader-utils/lib/filesystems/filesystem.ts +40 -0
- package/src/loader-utils/lib/filesystems/node-filesystem-facade.ts +65 -0
- package/src/loader-utils/lib/iterators/async-iteration.ts +136 -0
- package/src/loader-utils/lib/iterators/text-iterators.ts +76 -0
- package/src/loader-utils/lib/javascript-utils/is-type.ts +130 -0
- package/src/loader-utils/lib/laz/LASZIP-LICENSE +202 -0
- package/src/loader-utils/lib/laz/LASZIP-NOTICE +6 -0
- package/src/loader-utils/lib/laz/laz-arithmetic-encoder.ts +446 -0
- package/src/loader-utils/lib/laz/laz-chunk-decoder.ts +5251 -0
- package/src/loader-utils/lib/laz/laz-chunk-encoder.ts +1909 -0
- package/src/loader-utils/lib/log-utils/log.ts +28 -0
- package/src/loader-utils/lib/module-utils/initialize-wasm-module.ts +51 -0
- package/src/loader-utils/lib/module-utils/js-module-utils.ts +44 -0
- package/src/loader-utils/lib/node/buffer.browser.ts +22 -0
- package/src/loader-utils/lib/node/buffer.ts +40 -0
- package/src/loader-utils/lib/node/fs.browser.ts +5 -0
- package/src/loader-utils/lib/node/promisify.ts +72 -0
- package/src/loader-utils/lib/node/stream.browser.ts +5 -0
- package/src/loader-utils/lib/node/stream.ts +12 -0
- package/src/loader-utils/lib/option-utils/merge-options.ts +50 -0
- package/src/loader-utils/lib/parser-utils/parse-json.ts +16 -0
- package/src/loader-utils/lib/path-utils/cached-uri-resolver.ts +69 -0
- package/src/loader-utils/lib/path-utils/file-aliases.ts +49 -0
- package/src/loader-utils/lib/path-utils/get-cwd.ts +12 -0
- package/src/loader-utils/lib/path-utils/path.ts +173 -0
- package/src/loader-utils/lib/request-utils/abort-utils.ts +64 -0
- package/src/loader-utils/lib/request-utils/authentication.ts +134 -0
- package/src/loader-utils/lib/request-utils/parse-content-type.ts +22 -0
- package/src/loader-utils/lib/request-utils/range-request-cache.ts +279 -0
- package/src/loader-utils/lib/request-utils/range-request-scheduler.ts +899 -0
- package/src/loader-utils/lib/request-utils/request-cache.ts +296 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +576 -0
- package/src/loader-utils/lib/request-utils/request-scheduler.ts +230 -0
- package/src/loader-utils/lib/scan-utils/columnar-predicate.ts +397 -0
- package/src/loader-utils/lib/scan-utils/experimental-scan-options.ts +46 -0
- package/src/loader-utils/lib/scan-utils/point-cloud-query.ts +176 -0
- package/src/loader-utils/lib/scan-utils/raster-query.ts +82 -0
- package/src/loader-utils/lib/scan-utils/relational-query.ts +188 -0
- package/src/loader-utils/lib/scan-utils/scan-executor.ts +208 -0
- package/src/loader-utils/lib/scan-utils/scan-fragments.ts +33 -0
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +439 -0
- package/src/loader-utils/lib/scan-utils/table-query-explain.ts +88 -0
- package/src/loader-utils/lib/scan-utils/table-query.ts +163 -0
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +200 -0
- package/src/loader-utils/lib/sources/catalog-source.ts +42 -0
- package/src/loader-utils/lib/sources/data-source-manager.ts +569 -0
- package/src/loader-utils/lib/sources/data-source.ts +236 -0
- package/src/loader-utils/lib/sources/image-source.ts +66 -0
- package/src/loader-utils/lib/sources/image-tile-source.ts +22 -0
- package/src/loader-utils/lib/sources/raster-coverage.ts +92 -0
- package/src/loader-utils/lib/sources/raster-region.ts +35 -0
- package/src/loader-utils/lib/sources/raster-sampling.ts +213 -0
- package/src/loader-utils/lib/sources/raster-source.ts +344 -0
- package/src/loader-utils/lib/sources/service-capabilities.ts +50 -0
- package/src/loader-utils/lib/sources/tile-grid.ts +162 -0
- package/src/loader-utils/lib/sources/tile-source-adapter.ts +126 -0
- package/src/loader-utils/lib/sources/tile-source-utils.ts +19 -0
- package/src/loader-utils/lib/sources/tile-source.ts +198 -0
- package/src/loader-utils/lib/sources/utils/image-type.ts +14 -0
- package/src/loader-utils/lib/sources/utils/utils.ts +31 -0
- package/src/loader-utils/lib/sources/vector-source.ts +89 -0
- package/src/loader-utils/lib/sources/vector-tile-source.ts +29 -0
- package/src/loader-utils/lib/sources/xyz-grid.ts +82 -0
- package/src/loader-utils/lib/worker-loader-utils/create-loader-worker.ts +233 -0
- package/src/loader-utils/lib/worker-loader-utils/encode-with-worker.ts +28 -0
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +347 -0
- package/src/loader-utils/loader-types.ts +531 -0
- package/src/loader-utils/source-types.ts +76 -0
- package/src/loader-utils/types.ts +83 -0
- package/src/loader-utils/workers/json-worker.ts +8 -0
- package/src/loader-utils/writer-types.ts +107 -0
- package/src/null-loader.ts +2 -2
- package/src/polyfills/README.md +16 -0
- package/src/polyfills/buffer/btoa.node.ts +15 -0
- package/src/polyfills/buffer/to-array-buffer.node.ts +12 -0
- package/src/polyfills/crypto/node-hash.ts +78 -0
- package/src/polyfills/fetch/decode-data-uri.ts +71 -0
- package/src/polyfills/fetch/fetch-polyfill.ts +165 -0
- package/src/polyfills/fetch/headers-polyfill.ts +119 -0
- package/src/polyfills/fetch/response-polyfill.ts +101 -0
- package/src/polyfills/fetch/utils/decode-data-uri.node.ts +34 -0
- package/src/polyfills/file/blob-stream-controller.ts +69 -0
- package/src/polyfills/file/blob-stream.ts +40 -0
- package/src/polyfills/file/blob.ts +177 -0
- package/src/polyfills/file/file-reader.ts +59 -0
- package/src/polyfills/file/file.ts +45 -0
- package/src/polyfills/file/install-blob-polyfills.ts +17 -0
- package/src/polyfills/file/install-file-polyfills.ts +24 -0
- package/src/polyfills/file/readable-stream.ts +8 -0
- package/src/polyfills/filesystems/fetch-node.ts +98 -0
- package/src/polyfills/filesystems/node-file.ts +169 -0
- package/src/polyfills/filesystems/node-filesystem.ts +54 -0
- package/src/polyfills/filesystems/stream-utils.node.ts +81 -0
- package/src/polyfills/images/encode-image-node.ts +45 -0
- package/src/polyfills/images/encode-image.node.ts.disabled +41 -0
- package/src/polyfills/images/image-codecs-node.ts +40 -0
- package/src/polyfills/images/node-image-bitmap.ts +81 -0
- package/src/polyfills/images/node-image-formats.ts +6 -0
- package/src/polyfills/images/parse-image-node.ts +54 -0
- package/src/polyfills/images/parse-image.node.ts.disabled +55 -0
- package/src/polyfills/index.browser.ts +23 -0
- package/src/polyfills/index.ts +154 -0
- package/src/polyfills/libs/encoding-indexes-asian.js +15 -0
- package/src/polyfills/load-library/require-utils.node.ts +108 -0
- package/src/polyfills/streams/make-node-stream.ts +83 -0
- package/src/polyfills/text-encoder/encoding-indexes.ts +36 -0
- package/src/polyfills/text-encoder/text-encoder.ts +3085 -0
- package/src/polyfills/utils/assert.ts +9 -0
- package/src/polyfills/utils/buffer-utils.ts +40 -0
- package/src/polyfills/utils/filesystem-types.ts +13 -0
- package/src/polyfills/utils/is-browser.ts +8 -0
- package/src/polyfills/utils/path-utils.ts +31 -0
- package/src/polyfills/wip/fetch-browser/fetch-file.browser.d.ts +34 -0
- package/src/schema/categories/category-gis.ts +63 -0
- package/src/schema/categories/category-image.ts +23 -0
- package/src/schema/categories/category-mesh.ts +138 -0
- package/src/schema/categories/category-table.ts +125 -0
- package/src/schema/categories/category-texture.ts +259 -0
- package/src/schema/deprecated/mesh-utils.ts +46 -0
- package/src/schema/float16.ts +111 -0
- package/src/schema/geometry/arrow-binary-features.ts +54 -0
- package/src/schema/geometry/binary-features.ts +43 -0
- package/src/schema/geometry/binary-geometries.ts +45 -0
- package/src/schema/geometry/flat-geometries.ts +72 -0
- package/src/schema/geometry/geoarrow.ts +116 -0
- package/src/schema/geospatial-metadata-zod-schema.ts +163 -0
- package/src/schema/index.ts +169 -0
- package/src/schema/metadata.ts +115 -0
- package/src/schema/types/batch.ts +47 -0
- package/src/schema/types/schema.ts +86 -0
- package/src/schema/types/types.ts +52 -0
- package/src/schema-utils/arrow-transport.ts +7 -0
- package/src/schema-utils/deprecated.ts +53 -0
- package/src/schema-utils/index.ts +165 -0
- package/src/schema-utils/lib/arrow/arrow-table-transport.ts +260 -0
- package/src/schema-utils/lib/arrow/split-arrow-buffers.ts +235 -0
- package/src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts +78 -0
- package/src/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.ts +48 -0
- package/src/schema-utils/lib/converters/convert.ts +142 -0
- package/src/schema-utils/lib/converters/converters.ts +6 -0
- package/src/schema-utils/lib/converters/types.ts +44 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +311 -0
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +257 -0
- package/src/schema-utils/lib/mesh/deduce-mesh-schema.ts +85 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +73 -0
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +485 -0
- package/src/schema-utils/lib/schema/convert-arrow-schema.ts +552 -0
- package/src/schema-utils/lib/schema/data-type.ts +122 -0
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +119 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-field.ts +53 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-interface.ts +84 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-schema.ts +101 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +85 -0
- package/src/schema-utils/lib/table/arrow-api/arrow-like-type.ts +500 -0
- package/src/schema-utils/lib/table/arrow-api/enum.ts +99 -0
- package/src/schema-utils/lib/table/arrow-api/get-type-info.ts +38 -0
- package/src/schema-utils/lib/table/arrow-api/index.ts +50 -0
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +190 -0
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +85 -0
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +123 -0
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +82 -0
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +104 -0
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +108 -0
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +28 -0
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +185 -0
- package/src/schema-utils/lib/table/batches/convert-batches.ts +83 -0
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +81 -0
- package/src/schema-utils/lib/table/batches/make-table-batch-iterator.ts +25 -0
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +84 -0
- package/src/schema-utils/lib/table/query-arrow-table.ts +130 -0
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +198 -0
- package/src/schema-utils/lib/table/tables/convert-table.ts +152 -0
- package/src/schema-utils/lib/table/tables/make-table.ts +127 -0
- package/src/schema-utils/lib/table/tables/row-utils.ts +59 -0
- package/src/schema-utils/lib/table/tables/table-accessors.ts +418 -0
- package/src/schema-utils/lib/table/tables/table-column.ts +49 -0
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +35 -0
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +57 -0
- package/src/schema-utils/lib/table/tables/table-types.ts +37 -0
- package/src/schema-utils/lib/utils/assert.ts +12 -0
- package/src/schema-utils/lib/utils/async-queue.ts +109 -0
- package/src/schema-utils/types/types.ts +45 -0
- package/src/worker-utils/index.ts +80 -0
- package/src/worker-utils/lib/async-queue/async-queue.ts +100 -0
- package/src/worker-utils/lib/env-utils/assert.ts +14 -0
- package/src/worker-utils/lib/env-utils/globals.ts +40 -0
- package/src/worker-utils/lib/env-utils/version.ts +25 -0
- package/src/worker-utils/lib/library-utils/library-utils.ts +303 -0
- package/src/worker-utils/lib/node/worker_threads-browser.ts +34 -0
- package/src/worker-utils/lib/node/worker_threads.ts +58 -0
- package/src/worker-utils/lib/npm-tag.ts +11 -0
- package/src/worker-utils/lib/process-utils/child-process-proxy.browser.ts +23 -0
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +165 -0
- package/src/worker-utils/lib/process-utils/process-utils.ts +34 -0
- package/src/worker-utils/lib/worker-api/create-worker.ts +166 -0
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +129 -0
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +413 -0
- package/src/worker-utils/lib/worker-api/validate-worker-version.ts +44 -0
- package/src/worker-utils/lib/worker-farm/worker-body.ts +145 -0
- package/src/worker-utils/lib/worker-farm/worker-farm.ts +144 -0
- package/src/worker-utils/lib/worker-farm/worker-job.ts +83 -0
- package/src/worker-utils/lib/worker-farm/worker-pool.ts +263 -0
- package/src/worker-utils/lib/worker-farm/worker-thread.ts +206 -0
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +81 -0
- package/src/worker-utils/lib/worker-utils/get-transfer-list.ts +93 -0
- package/src/worker-utils/lib/worker-utils/remove-nontransferable-options.ts +27 -0
- package/src/worker-utils/types.ts +125 -0
- package/src/worker-utils/workers/null-worker.ts +20 -0
- package/src/workers/null-worker-node.ts +1 -1
- package/src/workers/null-worker.ts +1 -1
|
@@ -0,0 +1,3423 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/schema-utils/index.ts
|
|
31
|
+
var index_exports = {};
|
|
32
|
+
__export(index_exports, {
|
|
33
|
+
ArrowLikeDataType: () => DataType3,
|
|
34
|
+
ArrowLikeField: () => ArrowLikeField,
|
|
35
|
+
ArrowLikeSchema: () => ArrowLikeSchema,
|
|
36
|
+
ArrowLikeTable: () => ArrowLikeTable,
|
|
37
|
+
ArrowTableBuilder: () => ArrowTableBuilder,
|
|
38
|
+
AsyncQueue: () => AsyncQueue,
|
|
39
|
+
ColumnarTableBatchAggregator: () => ColumnarTableBatchAggregator,
|
|
40
|
+
PointCloudTiler: () => PointCloudTiler,
|
|
41
|
+
RowTableBatchAggregator: () => RowTableBatchAggregator,
|
|
42
|
+
TABLE_CONVERTERS: () => TABLE_CONVERTERS,
|
|
43
|
+
TableBatchBuilder: () => TableBatchBuilder,
|
|
44
|
+
TableConverter: () => TableConverter,
|
|
45
|
+
convert: () => convert,
|
|
46
|
+
convertArrowToSchema: () => convertArrowToSchema,
|
|
47
|
+
convertArrowToTable: () => convertArrowToTable2,
|
|
48
|
+
convertBatch: () => convertBatch,
|
|
49
|
+
convertBatches: () => convertBatches,
|
|
50
|
+
convertMeshToTable: () => convertMeshToTable,
|
|
51
|
+
convertSchemaToArrow: () => convertSchemaToArrow,
|
|
52
|
+
convertTable: () => convertTable2,
|
|
53
|
+
convertTableToArrow: () => convertTableToArrow2,
|
|
54
|
+
convertTableToMesh: () => convertTableToMesh,
|
|
55
|
+
convertToArrayRow: () => convertToArrayRow2,
|
|
56
|
+
convertToObjectRow: () => convertToObjectRow2,
|
|
57
|
+
deduceMeshField: () => deduceMeshField,
|
|
58
|
+
deduceMeshSchema: () => deduceMeshSchema,
|
|
59
|
+
deduceTableSchema: () => deduceTableSchema,
|
|
60
|
+
deserializeArrowField: () => deserializeArrowField,
|
|
61
|
+
deserializeArrowMetadata: () => deserializeArrowMetadata,
|
|
62
|
+
deserializeArrowSchema: () => deserializeArrowSchema,
|
|
63
|
+
deserializeArrowType: () => deserializeArrowType,
|
|
64
|
+
getArrayTypeFromDataType: () => getArrayTypeFromDataType,
|
|
65
|
+
getArrowViewTypeSupport: () => getArrowViewTypeSupport,
|
|
66
|
+
getDataTypeFromArray: () => getDataTypeFromArray,
|
|
67
|
+
getMeshBoundingBox: () => getMeshBoundingBox,
|
|
68
|
+
getMeshSize: () => getMeshSize,
|
|
69
|
+
getTableCell: () => getTableCell,
|
|
70
|
+
getTableCellAt: () => getTableCellAt,
|
|
71
|
+
getTableColumnIndex: () => getTableColumnIndex,
|
|
72
|
+
getTableColumnName: () => getTableColumnName,
|
|
73
|
+
getTableLength: () => getTableLength,
|
|
74
|
+
getTableNumCols: () => getTableNumCols,
|
|
75
|
+
getTableRowAsArray: () => getTableRowAsArray,
|
|
76
|
+
getTableRowAsObject: () => getTableRowAsObject,
|
|
77
|
+
getTableRowShape: () => getTableRowShape,
|
|
78
|
+
getTypeInfo: () => getTypeInfo,
|
|
79
|
+
isArrayRowTable: () => isArrayRowTable,
|
|
80
|
+
isArrowTable: () => isArrowTable,
|
|
81
|
+
isColumnarTable: () => isColumnarTable,
|
|
82
|
+
isGeoJSONTable: () => isGeoJSONTable,
|
|
83
|
+
isObjectRowTable: () => isObjectRowTable,
|
|
84
|
+
isTable: () => isTable,
|
|
85
|
+
makeArrayRowIterator: () => makeArrayRowIterator,
|
|
86
|
+
makeArrowRecordBatchIterator: () => makeArrowRecordBatchIterator,
|
|
87
|
+
makeArrowTableBatchIterator: () => makeArrowTableBatchIterator,
|
|
88
|
+
makeBatchFromTable: () => makeBatchFromTable,
|
|
89
|
+
makeMeshArrowTable: () => makeMeshArrowTable,
|
|
90
|
+
makeMeshAttributeMetadata: () => makeMeshAttributeMetadata,
|
|
91
|
+
makeObjectRowIterator: () => makeObjectRowIterator,
|
|
92
|
+
makeRowIterator: () => makeRowIterator,
|
|
93
|
+
makeTableBatchIterator: () => makeTableBatchIterator,
|
|
94
|
+
makeTableFromBatches: () => makeTableFromBatches,
|
|
95
|
+
makeTableFromData: () => makeTableFromData,
|
|
96
|
+
queryArrowTable: () => queryArrowTable,
|
|
97
|
+
selectArrowTableRows: () => selectArrowTableRows,
|
|
98
|
+
serializeArrowField: () => serializeArrowField,
|
|
99
|
+
serializeArrowMetadata: () => serializeArrowMetadata,
|
|
100
|
+
serializeArrowSchema: () => serializeArrowSchema,
|
|
101
|
+
serializeArrowType: () => serializeArrowType
|
|
102
|
+
});
|
|
103
|
+
module.exports = __toCommonJS(index_exports);
|
|
104
|
+
|
|
105
|
+
// src/schema-utils/lib/schema/data-type.ts
|
|
106
|
+
var import_types = require("@math.gl/core/types");
|
|
107
|
+
function getDataTypeFromValue(value, defaultNumberType = "float32") {
|
|
108
|
+
if (value instanceof Date) {
|
|
109
|
+
return "date-millisecond";
|
|
110
|
+
}
|
|
111
|
+
if (typeof value === "number") {
|
|
112
|
+
return defaultNumberType;
|
|
113
|
+
}
|
|
114
|
+
if (typeof value === "boolean") {
|
|
115
|
+
return "bool";
|
|
116
|
+
}
|
|
117
|
+
if (typeof value === "string") {
|
|
118
|
+
return "utf8";
|
|
119
|
+
}
|
|
120
|
+
if (value === null || value === "undefined") {
|
|
121
|
+
return "null";
|
|
122
|
+
}
|
|
123
|
+
return "null";
|
|
124
|
+
}
|
|
125
|
+
function getDataTypeFromArray(array) {
|
|
126
|
+
let type = getDataTypeFromTypedArray(array);
|
|
127
|
+
if (type !== "null") {
|
|
128
|
+
return { type, nullable: false };
|
|
129
|
+
}
|
|
130
|
+
if (array.length > 0) {
|
|
131
|
+
type = getDataTypeFromValue(array[0]);
|
|
132
|
+
return { type, nullable: true };
|
|
133
|
+
}
|
|
134
|
+
return { type: "null", nullable: true };
|
|
135
|
+
}
|
|
136
|
+
function getDataTypeFromTypedArray(array) {
|
|
137
|
+
if (typeof Float16Array !== "undefined" && array instanceof Float16Array) {
|
|
138
|
+
return "float16";
|
|
139
|
+
}
|
|
140
|
+
switch (array.constructor) {
|
|
141
|
+
case Int8Array:
|
|
142
|
+
return "int8";
|
|
143
|
+
case Uint8Array:
|
|
144
|
+
case Uint8ClampedArray:
|
|
145
|
+
return "uint8";
|
|
146
|
+
case Int16Array:
|
|
147
|
+
return "int16";
|
|
148
|
+
case Uint16Array:
|
|
149
|
+
return "uint16";
|
|
150
|
+
case Int32Array:
|
|
151
|
+
return "int32";
|
|
152
|
+
case Uint32Array:
|
|
153
|
+
return "uint32";
|
|
154
|
+
case BigInt64Array:
|
|
155
|
+
return "int64";
|
|
156
|
+
case BigUint64Array:
|
|
157
|
+
return "uint64";
|
|
158
|
+
case Float32Array:
|
|
159
|
+
return "float32";
|
|
160
|
+
case Float64Array:
|
|
161
|
+
return "float64";
|
|
162
|
+
default:
|
|
163
|
+
return "null";
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
function getArrayTypeFromDataType(type, nullable) {
|
|
167
|
+
if (!nullable) {
|
|
168
|
+
switch (type) {
|
|
169
|
+
case "int8":
|
|
170
|
+
return Int8Array;
|
|
171
|
+
case "uint8":
|
|
172
|
+
return Uint8Array;
|
|
173
|
+
case "int16":
|
|
174
|
+
return Int16Array;
|
|
175
|
+
case "uint16":
|
|
176
|
+
return Uint16Array;
|
|
177
|
+
case "int32":
|
|
178
|
+
return Int32Array;
|
|
179
|
+
case "uint32":
|
|
180
|
+
return Uint32Array;
|
|
181
|
+
case "float32":
|
|
182
|
+
return Float32Array;
|
|
183
|
+
case "float64":
|
|
184
|
+
return Float64Array;
|
|
185
|
+
case "float16":
|
|
186
|
+
return (0, import_types.getFloat16ArrayConstructor)();
|
|
187
|
+
default:
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return Array;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// src/schema-utils/lib/converters/convert.ts
|
|
195
|
+
function convert(input, targetShape, converters, options) {
|
|
196
|
+
const normalizedConverters = Array.isArray(converters) ? converters : [converters];
|
|
197
|
+
const sourceShape = detectSourceShape(input, normalizedConverters);
|
|
198
|
+
if (sourceShape === targetShape) {
|
|
199
|
+
return input;
|
|
200
|
+
}
|
|
201
|
+
const steps = findConversionPath(sourceShape, targetShape, normalizedConverters);
|
|
202
|
+
if (!steps) {
|
|
203
|
+
throw new Error(
|
|
204
|
+
`No conversion path found from "${sourceShape}" to "${targetShape}" using converters: ${normalizedConverters.map((converter) => converter.id).join(", ")}`
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
let currentValue = input;
|
|
208
|
+
let currentShape = sourceShape;
|
|
209
|
+
const path = [sourceShape, ...steps.map((step) => step.shape)];
|
|
210
|
+
for (let stepIndex = 0; stepIndex < steps.length; stepIndex++) {
|
|
211
|
+
const step = steps[stepIndex];
|
|
212
|
+
const context = {
|
|
213
|
+
sourceShape,
|
|
214
|
+
targetShape,
|
|
215
|
+
currentShape,
|
|
216
|
+
path,
|
|
217
|
+
converters: normalizedConverters,
|
|
218
|
+
stepIndex
|
|
219
|
+
};
|
|
220
|
+
currentValue = step.converter.convert(currentValue, step.shape, options, context);
|
|
221
|
+
currentShape = step.shape;
|
|
222
|
+
}
|
|
223
|
+
return currentValue;
|
|
224
|
+
}
|
|
225
|
+
function detectSourceShape(input, converters) {
|
|
226
|
+
const detectedShapes = /* @__PURE__ */ new Set();
|
|
227
|
+
const fallbackShape = getShapeFromInput(input);
|
|
228
|
+
if (fallbackShape !== null) {
|
|
229
|
+
detectedShapes.add(fallbackShape);
|
|
230
|
+
}
|
|
231
|
+
for (const converter of converters) {
|
|
232
|
+
const detectedShape = converter.detectInputShape?.(input);
|
|
233
|
+
if (detectedShape) {
|
|
234
|
+
detectedShapes.add(detectedShape);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
if (detectedShapes.size === 0) {
|
|
238
|
+
throw new Error("Could not detect source shape for conversion input");
|
|
239
|
+
}
|
|
240
|
+
if (detectedShapes.size > 1) {
|
|
241
|
+
throw new Error(
|
|
242
|
+
`Ambiguous source shape for conversion input: ${Array.from(detectedShapes).join(", ")}`
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
return Array.from(detectedShapes)[0];
|
|
246
|
+
}
|
|
247
|
+
function getShapeFromInput(input) {
|
|
248
|
+
return typeof input === "object" && input !== null && "shape" in input && typeof input.shape === "string" ? input.shape : null;
|
|
249
|
+
}
|
|
250
|
+
function findConversionPath(sourceShape, targetShape, converters) {
|
|
251
|
+
const queue = [
|
|
252
|
+
{ shape: sourceShape, path: [] }
|
|
253
|
+
];
|
|
254
|
+
const visitedShapes = /* @__PURE__ */ new Set([sourceShape]);
|
|
255
|
+
while (queue.length > 0) {
|
|
256
|
+
const candidate = queue.shift();
|
|
257
|
+
for (const converter of converters) {
|
|
258
|
+
if (!converter.from.includes(candidate.shape)) {
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
for (const nextShape of converter.to) {
|
|
262
|
+
if (!converter.canConvert?.(candidate.shape, nextShape) && converter.canConvert !== void 0) {
|
|
263
|
+
continue;
|
|
264
|
+
}
|
|
265
|
+
const nextPath = [...candidate.path, { shape: nextShape, converter }];
|
|
266
|
+
if (nextShape === targetShape) {
|
|
267
|
+
return nextPath;
|
|
268
|
+
}
|
|
269
|
+
if (!visitedShapes.has(nextShape)) {
|
|
270
|
+
visitedShapes.add(nextShape);
|
|
271
|
+
queue.push({ shape: nextShape, path: nextPath });
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// src/schema-utils/lib/schema/convert-arrow-schema.ts
|
|
280
|
+
var arrow = __toESM(require("apache-arrow"), 1);
|
|
281
|
+
function getArrowViewTypeSupport() {
|
|
282
|
+
return {
|
|
283
|
+
binaryView: typeof getOptionalArrowConstructor("BinaryView") === "function",
|
|
284
|
+
utf8View: typeof getOptionalArrowConstructor("Utf8View") === "function"
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
function convertArrowToSchema(arrowSchema) {
|
|
288
|
+
return serializeArrowSchema(arrowSchema);
|
|
289
|
+
}
|
|
290
|
+
function convertSchemaToArrow(schema, options) {
|
|
291
|
+
return deserializeArrowSchema(schema, options);
|
|
292
|
+
}
|
|
293
|
+
function serializeArrowSchema(arrowSchema) {
|
|
294
|
+
return {
|
|
295
|
+
fields: arrowSchema.fields.map((arrowField) => serializeArrowField(arrowField)),
|
|
296
|
+
metadata: serializeArrowMetadata(arrowSchema.metadata)
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
function deserializeArrowSchema(schema, options) {
|
|
300
|
+
return new arrow.Schema(
|
|
301
|
+
schema.fields.map((field) => deserializeArrowField(field, options)),
|
|
302
|
+
deserializeArrowMetadata(schema.metadata)
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
function serializeArrowMetadata(arrowMetadata) {
|
|
306
|
+
return Object.fromEntries(arrowMetadata);
|
|
307
|
+
}
|
|
308
|
+
function deserializeArrowMetadata(metadata) {
|
|
309
|
+
return metadata ? new Map(Object.entries(metadata)) : /* @__PURE__ */ new Map();
|
|
310
|
+
}
|
|
311
|
+
function serializeArrowField(field) {
|
|
312
|
+
return {
|
|
313
|
+
name: field.name,
|
|
314
|
+
type: serializeArrowType(field.type),
|
|
315
|
+
nullable: field.nullable,
|
|
316
|
+
metadata: serializeArrowMetadata(field.metadata)
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
function deserializeArrowField(field, options) {
|
|
320
|
+
return new arrow.Field(
|
|
321
|
+
field.name,
|
|
322
|
+
deserializeArrowType(field.type, options),
|
|
323
|
+
field.nullable,
|
|
324
|
+
deserializeArrowMetadata(field.metadata)
|
|
325
|
+
);
|
|
326
|
+
}
|
|
327
|
+
function serializeArrowType(arrowType) {
|
|
328
|
+
if (isArrowViewType(arrowType, "BinaryView")) {
|
|
329
|
+
return "binary-view";
|
|
330
|
+
}
|
|
331
|
+
if (isArrowViewType(arrowType, "Utf8View")) {
|
|
332
|
+
return "utf8-view";
|
|
333
|
+
}
|
|
334
|
+
if (isOptionalArrowType(arrowType, "LargeList")) {
|
|
335
|
+
const largeListType = arrowType;
|
|
336
|
+
return {
|
|
337
|
+
type: "large-list",
|
|
338
|
+
children: [serializeArrowField(largeListType.valueField)]
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
switch (arrowType.constructor) {
|
|
342
|
+
case arrow.Null:
|
|
343
|
+
return "null";
|
|
344
|
+
case arrow.Binary:
|
|
345
|
+
return "binary";
|
|
346
|
+
case arrow.FixedSizeBinary:
|
|
347
|
+
return {
|
|
348
|
+
type: "fixed-size-binary",
|
|
349
|
+
byteWidth: arrowType.byteWidth
|
|
350
|
+
};
|
|
351
|
+
case arrow.Bool:
|
|
352
|
+
return "bool";
|
|
353
|
+
case arrow.Int:
|
|
354
|
+
const intType = arrowType;
|
|
355
|
+
return `${intType.isSigned ? "" : "u"}int${intType.bitWidth}`;
|
|
356
|
+
case arrow.Int8:
|
|
357
|
+
return "int8";
|
|
358
|
+
case arrow.Int16:
|
|
359
|
+
return "int16";
|
|
360
|
+
case arrow.Int32:
|
|
361
|
+
return "int32";
|
|
362
|
+
case arrow.Int64:
|
|
363
|
+
return "int64";
|
|
364
|
+
case arrow.Uint8:
|
|
365
|
+
return "uint8";
|
|
366
|
+
case arrow.Uint16:
|
|
367
|
+
return "uint16";
|
|
368
|
+
case arrow.Uint32:
|
|
369
|
+
return "uint32";
|
|
370
|
+
case arrow.Uint64:
|
|
371
|
+
return "uint64";
|
|
372
|
+
case arrow.Float:
|
|
373
|
+
const precision = arrowType.precision;
|
|
374
|
+
switch (precision) {
|
|
375
|
+
case arrow.Precision.HALF:
|
|
376
|
+
return "float16";
|
|
377
|
+
case arrow.Precision.SINGLE:
|
|
378
|
+
return "float32";
|
|
379
|
+
case arrow.Precision.DOUBLE:
|
|
380
|
+
return "float64";
|
|
381
|
+
default:
|
|
382
|
+
return "float16";
|
|
383
|
+
}
|
|
384
|
+
case arrow.Float16:
|
|
385
|
+
return "float16";
|
|
386
|
+
case arrow.Float32:
|
|
387
|
+
return "float32";
|
|
388
|
+
case arrow.Float64:
|
|
389
|
+
return "float64";
|
|
390
|
+
case arrow.Utf8:
|
|
391
|
+
return "utf8";
|
|
392
|
+
case arrow.Decimal:
|
|
393
|
+
const decimal = arrowType;
|
|
394
|
+
return {
|
|
395
|
+
type: "decimal",
|
|
396
|
+
bitWidth: decimal.bitWidth,
|
|
397
|
+
precision: decimal.precision,
|
|
398
|
+
scale: decimal.scale
|
|
399
|
+
};
|
|
400
|
+
case arrow.Date_:
|
|
401
|
+
const dateUnit = arrowType.unit;
|
|
402
|
+
return dateUnit === arrow.DateUnit.DAY ? "date-day" : "date-millisecond";
|
|
403
|
+
case arrow.DateDay:
|
|
404
|
+
return "date-day";
|
|
405
|
+
case arrow.DateMillisecond:
|
|
406
|
+
return "date-millisecond";
|
|
407
|
+
case arrow.Time:
|
|
408
|
+
const timeUnit = arrowType.unit;
|
|
409
|
+
switch (timeUnit) {
|
|
410
|
+
case arrow.TimeUnit.SECOND:
|
|
411
|
+
return "time-second";
|
|
412
|
+
case arrow.TimeUnit.MILLISECOND:
|
|
413
|
+
return "time-millisecond";
|
|
414
|
+
case arrow.TimeUnit.MICROSECOND:
|
|
415
|
+
return "time-microsecond";
|
|
416
|
+
case arrow.TimeUnit.NANOSECOND:
|
|
417
|
+
return "time-nanosecond";
|
|
418
|
+
default:
|
|
419
|
+
return "time-second";
|
|
420
|
+
}
|
|
421
|
+
case arrow.TimeMillisecond:
|
|
422
|
+
return "time-millisecond";
|
|
423
|
+
case arrow.TimeSecond:
|
|
424
|
+
return "time-second";
|
|
425
|
+
case arrow.TimeMicrosecond:
|
|
426
|
+
return "time-microsecond";
|
|
427
|
+
case arrow.TimeNanosecond:
|
|
428
|
+
return "time-nanosecond";
|
|
429
|
+
case arrow.Timestamp:
|
|
430
|
+
const timeStampUnit = arrowType.unit;
|
|
431
|
+
switch (timeStampUnit) {
|
|
432
|
+
case arrow.TimeUnit.SECOND:
|
|
433
|
+
return "timestamp-second";
|
|
434
|
+
case arrow.TimeUnit.MILLISECOND:
|
|
435
|
+
return "timestamp-millisecond";
|
|
436
|
+
case arrow.TimeUnit.MICROSECOND:
|
|
437
|
+
return "timestamp-microsecond";
|
|
438
|
+
case arrow.TimeUnit.NANOSECOND:
|
|
439
|
+
return "timestamp-nanosecond";
|
|
440
|
+
default:
|
|
441
|
+
return "timestamp-second";
|
|
442
|
+
}
|
|
443
|
+
case arrow.TimestampSecond:
|
|
444
|
+
return "timestamp-second";
|
|
445
|
+
case arrow.TimestampMillisecond:
|
|
446
|
+
return "timestamp-millisecond";
|
|
447
|
+
case arrow.TimestampMicrosecond:
|
|
448
|
+
return "timestamp-microsecond";
|
|
449
|
+
case arrow.TimestampNanosecond:
|
|
450
|
+
return "timestamp-nanosecond";
|
|
451
|
+
case arrow.Interval:
|
|
452
|
+
const intervalUnit = arrowType.unit;
|
|
453
|
+
switch (intervalUnit) {
|
|
454
|
+
case arrow.IntervalUnit.DAY_TIME:
|
|
455
|
+
return "interval-daytime";
|
|
456
|
+
case arrow.IntervalUnit.YEAR_MONTH:
|
|
457
|
+
return "interval-yearmonth";
|
|
458
|
+
default:
|
|
459
|
+
return "interval-daytime";
|
|
460
|
+
}
|
|
461
|
+
case arrow.IntervalDayTime:
|
|
462
|
+
return "interval-daytime";
|
|
463
|
+
case arrow.IntervalYearMonth:
|
|
464
|
+
return "interval-yearmonth";
|
|
465
|
+
case arrow.Map_:
|
|
466
|
+
const mapType = arrowType;
|
|
467
|
+
return {
|
|
468
|
+
type: "map",
|
|
469
|
+
keysSorted: mapType.keysSorted,
|
|
470
|
+
children: mapType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
471
|
+
};
|
|
472
|
+
case arrow.List:
|
|
473
|
+
const listType = arrowType;
|
|
474
|
+
const listField = listType.valueField;
|
|
475
|
+
return {
|
|
476
|
+
type: "list",
|
|
477
|
+
children: [serializeArrowField(listField)]
|
|
478
|
+
};
|
|
479
|
+
case arrow.FixedSizeList:
|
|
480
|
+
const fixedSizeList = arrowType;
|
|
481
|
+
return {
|
|
482
|
+
type: "fixed-size-list",
|
|
483
|
+
listSize: fixedSizeList.listSize,
|
|
484
|
+
children: [serializeArrowField(fixedSizeList.children[0])]
|
|
485
|
+
};
|
|
486
|
+
case arrow.Struct:
|
|
487
|
+
const structType = arrowType;
|
|
488
|
+
return {
|
|
489
|
+
type: "struct",
|
|
490
|
+
children: structType.children.map((arrowField) => serializeArrowField(arrowField))
|
|
491
|
+
};
|
|
492
|
+
case arrow.SparseUnion:
|
|
493
|
+
case arrow.DenseUnion:
|
|
494
|
+
const unionType = arrowType;
|
|
495
|
+
return {
|
|
496
|
+
type: unionType instanceof arrow.DenseUnion ? "dense-union" : "sparse-union",
|
|
497
|
+
typeIds: unionType.typeIds,
|
|
498
|
+
children: unionType.children.map((arrowField) => serializeArrowField(arrowField)),
|
|
499
|
+
typeIdToChildIndex: { ...unionType.typeIdToChildIndex }
|
|
500
|
+
};
|
|
501
|
+
case arrow.Dictionary:
|
|
502
|
+
const dictionaryType = arrowType;
|
|
503
|
+
return {
|
|
504
|
+
type: "dictionary",
|
|
505
|
+
id: dictionaryType.id,
|
|
506
|
+
indices: serializeArrowDictionaryKeyType(dictionaryType.indices),
|
|
507
|
+
dictionary: serializeArrowType(dictionaryType.dictionary),
|
|
508
|
+
isOrdered: dictionaryType.isOrdered
|
|
509
|
+
};
|
|
510
|
+
default:
|
|
511
|
+
throw new Error(`arrow type not supported: ${arrowType.constructor.name}`);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
function deserializeArrowType(dataType, options) {
|
|
515
|
+
if (typeof dataType === "object") {
|
|
516
|
+
switch (dataType.type) {
|
|
517
|
+
case "decimal":
|
|
518
|
+
return new arrow.Decimal(dataType.scale, dataType.precision, dataType.bitWidth);
|
|
519
|
+
case "map": {
|
|
520
|
+
const children = dataType.children.map(
|
|
521
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
522
|
+
);
|
|
523
|
+
return new arrow.Map_(children[0], dataType.keysSorted);
|
|
524
|
+
}
|
|
525
|
+
case "list": {
|
|
526
|
+
const field = deserializeArrowField(dataType.children[0], options);
|
|
527
|
+
return new arrow.List(field);
|
|
528
|
+
}
|
|
529
|
+
case "large-list": {
|
|
530
|
+
const field = deserializeArrowField(dataType.children[0], options);
|
|
531
|
+
const LargeList = getOptionalArrowConstructor("LargeList");
|
|
532
|
+
if (!LargeList) {
|
|
533
|
+
throw new Error(
|
|
534
|
+
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
return new LargeList(field);
|
|
538
|
+
}
|
|
539
|
+
case "fixed-size-list": {
|
|
540
|
+
const child = deserializeArrowField(dataType.children[0], options);
|
|
541
|
+
return new arrow.FixedSizeList(dataType.listSize, child);
|
|
542
|
+
}
|
|
543
|
+
case "fixed-size-binary":
|
|
544
|
+
return new arrow.FixedSizeBinary(dataType.byteWidth);
|
|
545
|
+
case "struct": {
|
|
546
|
+
const children = dataType.children.map(
|
|
547
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
548
|
+
);
|
|
549
|
+
return new arrow.Struct(children);
|
|
550
|
+
}
|
|
551
|
+
case "sparse-union":
|
|
552
|
+
case "dense-union": {
|
|
553
|
+
const children = dataType.children.map(
|
|
554
|
+
(arrowField) => deserializeArrowField(arrowField, options)
|
|
555
|
+
);
|
|
556
|
+
return dataType.type === "dense-union" ? new arrow.DenseUnion(dataType.typeIds, children) : new arrow.SparseUnion(dataType.typeIds, children);
|
|
557
|
+
}
|
|
558
|
+
case "dictionary": {
|
|
559
|
+
return new arrow.Dictionary(
|
|
560
|
+
deserializeArrowType(dataType.dictionary, options),
|
|
561
|
+
deserializeArrowDictionaryKeyType(dataType.indices),
|
|
562
|
+
dataType.id,
|
|
563
|
+
dataType.isOrdered
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
default:
|
|
567
|
+
throw new Error("array type not supported");
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
switch (dataType) {
|
|
571
|
+
case "null":
|
|
572
|
+
return new arrow.Null();
|
|
573
|
+
case "binary":
|
|
574
|
+
return makeVariableWidthArrowType("BinaryView", new arrow.Binary(), options);
|
|
575
|
+
case "binary-view":
|
|
576
|
+
return makeRequiredArrowViewType("BinaryView");
|
|
577
|
+
case "bool":
|
|
578
|
+
return new arrow.Bool();
|
|
579
|
+
case "int8":
|
|
580
|
+
return new arrow.Int8();
|
|
581
|
+
case "int16":
|
|
582
|
+
return new arrow.Int16();
|
|
583
|
+
case "int32":
|
|
584
|
+
return new arrow.Int32();
|
|
585
|
+
case "int64":
|
|
586
|
+
return new arrow.Int64();
|
|
587
|
+
case "uint8":
|
|
588
|
+
return new arrow.Uint8();
|
|
589
|
+
case "uint16":
|
|
590
|
+
return new arrow.Uint16();
|
|
591
|
+
case "uint32":
|
|
592
|
+
return new arrow.Uint32();
|
|
593
|
+
case "uint64":
|
|
594
|
+
return new arrow.Uint64();
|
|
595
|
+
case "float16":
|
|
596
|
+
return new arrow.Float16();
|
|
597
|
+
case "float32":
|
|
598
|
+
return new arrow.Float32();
|
|
599
|
+
case "float64":
|
|
600
|
+
return new arrow.Float64();
|
|
601
|
+
case "utf8":
|
|
602
|
+
return makeVariableWidthArrowType("Utf8View", new arrow.Utf8(), options);
|
|
603
|
+
case "utf8-view":
|
|
604
|
+
return makeRequiredArrowViewType("Utf8View");
|
|
605
|
+
case "date-day":
|
|
606
|
+
return new arrow.DateDay();
|
|
607
|
+
case "date-millisecond":
|
|
608
|
+
return new arrow.DateMillisecond();
|
|
609
|
+
case "time-second":
|
|
610
|
+
return new arrow.TimeSecond();
|
|
611
|
+
case "time-millisecond":
|
|
612
|
+
return new arrow.TimeMillisecond();
|
|
613
|
+
case "time-microsecond":
|
|
614
|
+
return new arrow.TimeMicrosecond();
|
|
615
|
+
case "time-nanosecond":
|
|
616
|
+
return new arrow.TimeNanosecond();
|
|
617
|
+
case "timestamp-second":
|
|
618
|
+
return new arrow.TimestampSecond();
|
|
619
|
+
case "timestamp-millisecond":
|
|
620
|
+
return new arrow.TimestampMillisecond();
|
|
621
|
+
case "timestamp-microsecond":
|
|
622
|
+
return new arrow.TimestampMicrosecond();
|
|
623
|
+
case "timestamp-nanosecond":
|
|
624
|
+
return new arrow.TimestampNanosecond();
|
|
625
|
+
case "interval-daytime":
|
|
626
|
+
return new arrow.IntervalDayTime();
|
|
627
|
+
case "interval-yearmonth":
|
|
628
|
+
return new arrow.IntervalYearMonth();
|
|
629
|
+
default:
|
|
630
|
+
throw new Error("array type not supported");
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
function getOptionalArrowConstructor(typeName) {
|
|
634
|
+
return arrow[typeName];
|
|
635
|
+
}
|
|
636
|
+
function isArrowViewType(arrowType, viewTypeName) {
|
|
637
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
638
|
+
if (constructor && arrowType instanceof constructor) {
|
|
639
|
+
return true;
|
|
640
|
+
}
|
|
641
|
+
const guards = arrow.DataType;
|
|
642
|
+
const guard = viewTypeName === "BinaryView" ? guards.isBinaryView : guards.isUtf8View;
|
|
643
|
+
return Boolean(guard?.(arrowType));
|
|
644
|
+
}
|
|
645
|
+
function isOptionalArrowType(arrowType, typeName) {
|
|
646
|
+
const constructor = getOptionalArrowConstructor(typeName);
|
|
647
|
+
return Boolean(constructor && arrowType instanceof constructor);
|
|
648
|
+
}
|
|
649
|
+
function makeVariableWidthArrowType(viewTypeName, fallbackType, options) {
|
|
650
|
+
const viewTypeMode = options?.viewTypes || "never";
|
|
651
|
+
if (viewTypeMode === "never") {
|
|
652
|
+
return fallbackType;
|
|
653
|
+
}
|
|
654
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
655
|
+
if (constructor) {
|
|
656
|
+
return new constructor();
|
|
657
|
+
}
|
|
658
|
+
if (viewTypeMode === "require") {
|
|
659
|
+
throw new Error(
|
|
660
|
+
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
return fallbackType;
|
|
664
|
+
}
|
|
665
|
+
function makeRequiredArrowViewType(viewTypeName) {
|
|
666
|
+
const constructor = getOptionalArrowConstructor(viewTypeName);
|
|
667
|
+
if (!constructor) {
|
|
668
|
+
throw new Error(
|
|
669
|
+
`${viewTypeName} requires apache-arrow 21.2.0 or later; the installed runtime does not support it`
|
|
670
|
+
);
|
|
671
|
+
}
|
|
672
|
+
return new constructor();
|
|
673
|
+
}
|
|
674
|
+
function serializeArrowDictionaryKeyType(arrowType) {
|
|
675
|
+
if (arrowType instanceof arrow.Int) {
|
|
676
|
+
const prefix = arrowType.isSigned ? "int" : "uint";
|
|
677
|
+
const keyType = `${prefix}${arrowType.bitWidth}`;
|
|
678
|
+
if (isSchemaDictionaryKeyType(keyType)) {
|
|
679
|
+
return keyType;
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
switch (arrowType.constructor) {
|
|
683
|
+
case arrow.Int8:
|
|
684
|
+
return "int8";
|
|
685
|
+
case arrow.Int16:
|
|
686
|
+
return "int16";
|
|
687
|
+
case arrow.Int32:
|
|
688
|
+
return "int32";
|
|
689
|
+
case arrow.Uint8:
|
|
690
|
+
return "uint8";
|
|
691
|
+
case arrow.Uint16:
|
|
692
|
+
return "uint16";
|
|
693
|
+
case arrow.Uint32:
|
|
694
|
+
return "uint32";
|
|
695
|
+
default:
|
|
696
|
+
throw new Error(`arrow dictionary index type not supported: ${arrowType.constructor.name}`);
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
function isSchemaDictionaryKeyType(keyType) {
|
|
700
|
+
return ["int8", "int16", "int32", "uint8", "uint16", "uint32"].includes(keyType);
|
|
701
|
+
}
|
|
702
|
+
function deserializeArrowDictionaryKeyType(keyType) {
|
|
703
|
+
switch (keyType) {
|
|
704
|
+
case "int8":
|
|
705
|
+
return new arrow.Int8();
|
|
706
|
+
case "int16":
|
|
707
|
+
return new arrow.Int16();
|
|
708
|
+
case "int32":
|
|
709
|
+
return new arrow.Int32();
|
|
710
|
+
case "uint8":
|
|
711
|
+
return new arrow.Uint8();
|
|
712
|
+
case "uint16":
|
|
713
|
+
return new arrow.Uint16();
|
|
714
|
+
case "uint32":
|
|
715
|
+
return new arrow.Uint32();
|
|
716
|
+
default:
|
|
717
|
+
throw new Error(`schema dictionary index type not supported: ${keyType}`);
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// src/schema-utils/lib/schema/deduce-table-schema.ts
|
|
722
|
+
function deduceTableSchema(table) {
|
|
723
|
+
switch (table.shape) {
|
|
724
|
+
case "array-row-table":
|
|
725
|
+
case "object-row-table":
|
|
726
|
+
return deduceSchemaFromRows(table.data);
|
|
727
|
+
case "geojson-table":
|
|
728
|
+
return deduceSchemaFromGeoJSON(table.features);
|
|
729
|
+
case "columnar-table":
|
|
730
|
+
return deduceSchemaFromColumns(table.data);
|
|
731
|
+
case "arrow-table":
|
|
732
|
+
default:
|
|
733
|
+
throw new Error("Deduce schema");
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
function deduceSchemaFromColumns(columnarTable) {
|
|
737
|
+
const fields = [];
|
|
738
|
+
for (const [columnName, column] of Object.entries(columnarTable)) {
|
|
739
|
+
const field = deduceFieldFromColumn(column, columnName);
|
|
740
|
+
fields.push(field);
|
|
741
|
+
}
|
|
742
|
+
return { fields, metadata: {} };
|
|
743
|
+
}
|
|
744
|
+
function deduceSchemaFromRows(rowTable) {
|
|
745
|
+
if (!rowTable.length) {
|
|
746
|
+
throw new Error("deduce from empty table");
|
|
747
|
+
}
|
|
748
|
+
const fields = [];
|
|
749
|
+
const row0 = rowTable[0];
|
|
750
|
+
for (const [columnName, value] of Object.entries(row0)) {
|
|
751
|
+
fields.push(deduceFieldFromValue(value, columnName));
|
|
752
|
+
}
|
|
753
|
+
return { fields, metadata: {} };
|
|
754
|
+
}
|
|
755
|
+
function deduceSchemaFromGeoJSON(features) {
|
|
756
|
+
if (!features.length) {
|
|
757
|
+
throw new Error("deduce from empty table");
|
|
758
|
+
}
|
|
759
|
+
const fields = [];
|
|
760
|
+
const row0 = features[0].properties || {};
|
|
761
|
+
for (const [columnName, value] of Object.entries(row0)) {
|
|
762
|
+
fields.push(deduceFieldFromValue(value, columnName));
|
|
763
|
+
}
|
|
764
|
+
return { fields, metadata: {} };
|
|
765
|
+
}
|
|
766
|
+
function deduceFieldFromColumn(column, name) {
|
|
767
|
+
if (ArrayBuffer.isView(column)) {
|
|
768
|
+
const type = getDataTypeFromArray(column);
|
|
769
|
+
return {
|
|
770
|
+
name,
|
|
771
|
+
type: type.type || "null",
|
|
772
|
+
nullable: type.nullable
|
|
773
|
+
// metadata: {}
|
|
774
|
+
};
|
|
775
|
+
}
|
|
776
|
+
if (Array.isArray(column) && column.length > 0) {
|
|
777
|
+
const value = column[0];
|
|
778
|
+
const type = getDataTypeFromValue(value);
|
|
779
|
+
return {
|
|
780
|
+
name,
|
|
781
|
+
type,
|
|
782
|
+
nullable: true
|
|
783
|
+
// metadata: {},
|
|
784
|
+
};
|
|
785
|
+
}
|
|
786
|
+
throw new Error("empty table");
|
|
787
|
+
}
|
|
788
|
+
function deduceFieldFromValue(value, name) {
|
|
789
|
+
const type = getDataTypeFromValue(value);
|
|
790
|
+
return {
|
|
791
|
+
name,
|
|
792
|
+
type,
|
|
793
|
+
nullable: true
|
|
794
|
+
// metadata: {}
|
|
795
|
+
};
|
|
796
|
+
}
|
|
797
|
+
|
|
798
|
+
// src/schema-utils/lib/table/tables/make-table.ts
|
|
799
|
+
var arrow2 = __toESM(require("apache-arrow"), 1);
|
|
800
|
+
function makeTableFromData(data) {
|
|
801
|
+
let table;
|
|
802
|
+
switch (getTableShapeFromData(data)) {
|
|
803
|
+
case "array-row-table":
|
|
804
|
+
table = { shape: "array-row-table", data };
|
|
805
|
+
break;
|
|
806
|
+
case "object-row-table":
|
|
807
|
+
table = { shape: "object-row-table", data };
|
|
808
|
+
break;
|
|
809
|
+
case "columnar-table":
|
|
810
|
+
table = { shape: "columnar-table", data };
|
|
811
|
+
break;
|
|
812
|
+
case "arrow-table":
|
|
813
|
+
table = { shape: "arrow-table", data };
|
|
814
|
+
break;
|
|
815
|
+
default:
|
|
816
|
+
throw new Error("table");
|
|
817
|
+
}
|
|
818
|
+
const schema = deduceTableSchema(table);
|
|
819
|
+
return { ...table, schema };
|
|
820
|
+
}
|
|
821
|
+
function getTableShapeFromData(data) {
|
|
822
|
+
if (data instanceof arrow2.Table) {
|
|
823
|
+
return "arrow-table";
|
|
824
|
+
}
|
|
825
|
+
if (Array.isArray(data)) {
|
|
826
|
+
if (data.length === 0) {
|
|
827
|
+
throw new Error("cannot deduce type of empty table");
|
|
828
|
+
}
|
|
829
|
+
const firstRow = data[0];
|
|
830
|
+
if (Array.isArray(firstRow)) {
|
|
831
|
+
return "array-row-table";
|
|
832
|
+
}
|
|
833
|
+
if (firstRow && typeof firstRow === "object") {
|
|
834
|
+
return "object-row-table";
|
|
835
|
+
}
|
|
836
|
+
}
|
|
837
|
+
if (data && typeof data === "object") {
|
|
838
|
+
return "columnar-table";
|
|
839
|
+
}
|
|
840
|
+
throw new Error("invalid table");
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
// src/schema-utils/lib/table/tables/table-accessors.ts
|
|
844
|
+
function isTable(table) {
|
|
845
|
+
const shape = typeof table === "object" && table?.shape;
|
|
846
|
+
switch (shape) {
|
|
847
|
+
case "array-row-table":
|
|
848
|
+
case "object-row-table":
|
|
849
|
+
return Array.isArray(table.data);
|
|
850
|
+
case "geojson-table":
|
|
851
|
+
return Array.isArray(table.features);
|
|
852
|
+
case "columnar-table":
|
|
853
|
+
return Boolean(table.data && typeof table.data === "object");
|
|
854
|
+
case "arrow-table":
|
|
855
|
+
return Boolean(table?.data?.numRows !== void 0);
|
|
856
|
+
default:
|
|
857
|
+
return false;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
function getTableLength(table) {
|
|
861
|
+
switch (table.shape) {
|
|
862
|
+
case "array-row-table":
|
|
863
|
+
case "object-row-table":
|
|
864
|
+
return table.data.length;
|
|
865
|
+
case "geojson-table":
|
|
866
|
+
return table.features.length;
|
|
867
|
+
case "arrow-table":
|
|
868
|
+
const arrowTable = table.data;
|
|
869
|
+
return arrowTable.numRows;
|
|
870
|
+
case "columnar-table":
|
|
871
|
+
for (const column of Object.values(table.data)) {
|
|
872
|
+
return column.length || 0;
|
|
873
|
+
}
|
|
874
|
+
return 0;
|
|
875
|
+
default:
|
|
876
|
+
throw new Error("table");
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
function getTableNumCols(table) {
|
|
880
|
+
if (table.schema) {
|
|
881
|
+
return table.schema.fields.length;
|
|
882
|
+
}
|
|
883
|
+
if (getTableLength(table) === 0) {
|
|
884
|
+
throw new Error("empty table");
|
|
885
|
+
}
|
|
886
|
+
switch (table.shape) {
|
|
887
|
+
case "array-row-table":
|
|
888
|
+
return table.data[0].length;
|
|
889
|
+
case "object-row-table":
|
|
890
|
+
return Object.keys(table.data[0]).length;
|
|
891
|
+
case "geojson-table":
|
|
892
|
+
return Object.keys(table.features[0]).length;
|
|
893
|
+
case "columnar-table":
|
|
894
|
+
return Object.keys(table.data).length;
|
|
895
|
+
case "arrow-table":
|
|
896
|
+
const arrowTable = table.data;
|
|
897
|
+
return arrowTable.numCols;
|
|
898
|
+
default:
|
|
899
|
+
throw new Error("table");
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
function getTableCell(table, rowIndex, columnName) {
|
|
903
|
+
switch (table.shape) {
|
|
904
|
+
case "array-row-table":
|
|
905
|
+
const columnIndex = getTableColumnIndex(table, columnName);
|
|
906
|
+
return table.data[rowIndex][columnIndex];
|
|
907
|
+
case "object-row-table":
|
|
908
|
+
return table.data[rowIndex][columnName];
|
|
909
|
+
case "geojson-table":
|
|
910
|
+
return table.features[rowIndex][columnName];
|
|
911
|
+
case "columnar-table":
|
|
912
|
+
const column = table.data[columnName];
|
|
913
|
+
return column[rowIndex];
|
|
914
|
+
case "arrow-table":
|
|
915
|
+
const arrowTable = table.data;
|
|
916
|
+
const arrowColumnIndex = arrowTable.schema.fields.findIndex(
|
|
917
|
+
(field) => field.name === columnName
|
|
918
|
+
);
|
|
919
|
+
return arrowTable.getChildAt(arrowColumnIndex)?.get(rowIndex);
|
|
920
|
+
default:
|
|
921
|
+
throw new Error("todo");
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
function getTableCellAt(table, rowIndex, columnIndex) {
|
|
925
|
+
switch (table.shape) {
|
|
926
|
+
case "array-row-table":
|
|
927
|
+
return table.data[rowIndex][columnIndex];
|
|
928
|
+
case "object-row-table":
|
|
929
|
+
const columnName1 = getTableColumnName(table, columnIndex);
|
|
930
|
+
return table.data[rowIndex][columnName1];
|
|
931
|
+
case "geojson-table":
|
|
932
|
+
const columnName2 = getTableColumnName(table, columnIndex);
|
|
933
|
+
return table.features[rowIndex][columnName2];
|
|
934
|
+
case "columnar-table":
|
|
935
|
+
const columnName3 = getTableColumnName(table, columnIndex);
|
|
936
|
+
const column = table.data[columnName3];
|
|
937
|
+
return column[rowIndex];
|
|
938
|
+
case "arrow-table":
|
|
939
|
+
const arrowTable = table.data;
|
|
940
|
+
return arrowTable.getChildAt(columnIndex)?.get(rowIndex);
|
|
941
|
+
default:
|
|
942
|
+
throw new Error("todo");
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
function getTableRowShape(table) {
|
|
946
|
+
switch (table.shape) {
|
|
947
|
+
case "array-row-table":
|
|
948
|
+
case "object-row-table":
|
|
949
|
+
return table.shape;
|
|
950
|
+
case "geojson-table":
|
|
951
|
+
return "object-row-table";
|
|
952
|
+
case "columnar-table":
|
|
953
|
+
default:
|
|
954
|
+
throw new Error("Not a row table");
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
function getTableColumnIndex(table, columnName) {
|
|
958
|
+
const columnIndex = table.schema?.fields.findIndex((field) => field.name === columnName);
|
|
959
|
+
if (columnIndex === void 0) {
|
|
960
|
+
throw new Error(columnName);
|
|
961
|
+
}
|
|
962
|
+
return columnIndex;
|
|
963
|
+
}
|
|
964
|
+
function getTableColumnName(table, columnIndex) {
|
|
965
|
+
const columnName = table.schema?.fields[columnIndex]?.name;
|
|
966
|
+
if (!columnName) {
|
|
967
|
+
throw new Error(`${columnIndex}`);
|
|
968
|
+
}
|
|
969
|
+
return columnName;
|
|
970
|
+
}
|
|
971
|
+
function getTableRowAsObject(table, rowIndex, target, copy) {
|
|
972
|
+
switch (table.shape) {
|
|
973
|
+
case "object-row-table":
|
|
974
|
+
return copy ? Object.fromEntries(Object.entries(table.data[rowIndex])) : table.data[rowIndex];
|
|
975
|
+
case "array-row-table":
|
|
976
|
+
if (table.schema) {
|
|
977
|
+
const objectRow2 = target || {};
|
|
978
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
979
|
+
objectRow2[table.schema.fields[i].name] = table.data[rowIndex][i];
|
|
980
|
+
}
|
|
981
|
+
return objectRow2;
|
|
982
|
+
}
|
|
983
|
+
throw new Error("no schema");
|
|
984
|
+
case "geojson-table":
|
|
985
|
+
if (table.schema) {
|
|
986
|
+
const objectRow2 = target || {};
|
|
987
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
988
|
+
objectRow2[table.schema.fields[i].name] = table.features[rowIndex][table.schema.fields[i].name];
|
|
989
|
+
}
|
|
990
|
+
return objectRow2;
|
|
991
|
+
}
|
|
992
|
+
throw new Error("no schema");
|
|
993
|
+
case "columnar-table":
|
|
994
|
+
if (table.schema) {
|
|
995
|
+
const objectRow2 = target || {};
|
|
996
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
997
|
+
objectRow2[table.schema.fields[i].name] = table.data[table.schema.fields[i].name][rowIndex];
|
|
998
|
+
}
|
|
999
|
+
return objectRow2;
|
|
1000
|
+
} else {
|
|
1001
|
+
const objectRow2 = target || {};
|
|
1002
|
+
for (const [name, column] of Object.entries(table.data)) {
|
|
1003
|
+
objectRow2[name] = column[rowIndex];
|
|
1004
|
+
}
|
|
1005
|
+
return objectRow2;
|
|
1006
|
+
}
|
|
1007
|
+
case "arrow-table":
|
|
1008
|
+
const arrowTable = table.data;
|
|
1009
|
+
const objectRow = target || {};
|
|
1010
|
+
const row = arrowTable.get(rowIndex);
|
|
1011
|
+
const schema = arrowTable.schema;
|
|
1012
|
+
for (let i = 0; i < schema.fields.length; i++) {
|
|
1013
|
+
objectRow[schema.fields[i].name] = row?.[schema.fields[i].name];
|
|
1014
|
+
}
|
|
1015
|
+
return objectRow;
|
|
1016
|
+
default:
|
|
1017
|
+
throw new Error("shape");
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
function getTableRowAsArray(table, rowIndex, target, copy) {
|
|
1021
|
+
switch (table.shape) {
|
|
1022
|
+
case "array-row-table":
|
|
1023
|
+
return copy ? Array.from(table.data[rowIndex]) : table.data[rowIndex];
|
|
1024
|
+
case "object-row-table":
|
|
1025
|
+
if (table.schema) {
|
|
1026
|
+
const arrayRow2 = target || [];
|
|
1027
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
1028
|
+
arrayRow2[i] = table.data[rowIndex][table.schema.fields[i].name];
|
|
1029
|
+
}
|
|
1030
|
+
return arrayRow2;
|
|
1031
|
+
}
|
|
1032
|
+
return Object.values(table.data[rowIndex]);
|
|
1033
|
+
case "geojson-table":
|
|
1034
|
+
if (table.schema) {
|
|
1035
|
+
const arrayRow2 = target || [];
|
|
1036
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
1037
|
+
arrayRow2[i] = table.features[rowIndex][table.schema.fields[i].name];
|
|
1038
|
+
}
|
|
1039
|
+
return arrayRow2;
|
|
1040
|
+
}
|
|
1041
|
+
return Object.values(table.features[rowIndex]);
|
|
1042
|
+
case "columnar-table":
|
|
1043
|
+
if (table.schema) {
|
|
1044
|
+
const arrayRow2 = target || [];
|
|
1045
|
+
for (let i = 0; i < table.schema.fields.length; i++) {
|
|
1046
|
+
arrayRow2[i] = table.data[table.schema.fields[i].name][rowIndex];
|
|
1047
|
+
}
|
|
1048
|
+
return arrayRow2;
|
|
1049
|
+
} else {
|
|
1050
|
+
const arrayRow2 = target || [];
|
|
1051
|
+
let i = 0;
|
|
1052
|
+
for (const column of Object.values(table.data)) {
|
|
1053
|
+
arrayRow2[i] = column[rowIndex];
|
|
1054
|
+
i++;
|
|
1055
|
+
}
|
|
1056
|
+
return arrayRow2;
|
|
1057
|
+
}
|
|
1058
|
+
case "arrow-table":
|
|
1059
|
+
const arrowTable = table.data;
|
|
1060
|
+
const arrayRow = target || [];
|
|
1061
|
+
const row = arrowTable.get(rowIndex);
|
|
1062
|
+
const schema = arrowTable.schema;
|
|
1063
|
+
for (let i = 0; i < schema.fields.length; i++) {
|
|
1064
|
+
arrayRow[i] = row?.[schema.fields[i].name];
|
|
1065
|
+
}
|
|
1066
|
+
return arrayRow;
|
|
1067
|
+
default:
|
|
1068
|
+
throw new Error("shape");
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
function* makeRowIterator(table, shape) {
|
|
1072
|
+
switch (shape) {
|
|
1073
|
+
case "array-row-table":
|
|
1074
|
+
yield* makeArrayRowIterator(table);
|
|
1075
|
+
break;
|
|
1076
|
+
case "object-row-table":
|
|
1077
|
+
yield* makeObjectRowIterator(table);
|
|
1078
|
+
break;
|
|
1079
|
+
default:
|
|
1080
|
+
throw new Error(`Unknown row type ${shape}`);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
function* makeArrayRowIterator(table, target = []) {
|
|
1084
|
+
const length = getTableLength(table);
|
|
1085
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
1086
|
+
yield getTableRowAsArray(table, rowIndex, target);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
function* makeObjectRowIterator(table, target = {}) {
|
|
1090
|
+
const length = getTableLength(table);
|
|
1091
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
1092
|
+
yield getTableRowAsObject(table, rowIndex, target);
|
|
1093
|
+
}
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1096
|
+
// src/schema-utils/lib/table/batches/make-table-from-batches.ts
|
|
1097
|
+
async function makeTableFromBatches(batchIterator) {
|
|
1098
|
+
let arrayRows;
|
|
1099
|
+
let objectRows;
|
|
1100
|
+
let features;
|
|
1101
|
+
let shape = null;
|
|
1102
|
+
let schema;
|
|
1103
|
+
for await (const batch of batchIterator) {
|
|
1104
|
+
shape = shape || batch.shape;
|
|
1105
|
+
schema = schema || batch.schema;
|
|
1106
|
+
switch (batch.shape) {
|
|
1107
|
+
case "array-row-table":
|
|
1108
|
+
arrayRows = arrayRows || [];
|
|
1109
|
+
for (let rowIndex = 0; rowIndex < getTableLength(batch); rowIndex++) {
|
|
1110
|
+
const row = batch.data[rowIndex];
|
|
1111
|
+
arrayRows.push(row);
|
|
1112
|
+
}
|
|
1113
|
+
break;
|
|
1114
|
+
case "object-row-table":
|
|
1115
|
+
objectRows = objectRows || [];
|
|
1116
|
+
for (let rowIndex = 0; rowIndex < getTableLength(batch); rowIndex++) {
|
|
1117
|
+
const row = batch.data[rowIndex];
|
|
1118
|
+
objectRows.push(row);
|
|
1119
|
+
}
|
|
1120
|
+
break;
|
|
1121
|
+
case "geojson-table":
|
|
1122
|
+
features = features || [];
|
|
1123
|
+
for (let rowIndex = 0; rowIndex < getTableLength(batch); rowIndex++) {
|
|
1124
|
+
const row = batch.features[rowIndex];
|
|
1125
|
+
features.push(row);
|
|
1126
|
+
}
|
|
1127
|
+
break;
|
|
1128
|
+
case "columnar-table":
|
|
1129
|
+
case "arrow-table":
|
|
1130
|
+
default:
|
|
1131
|
+
throw new Error("shape");
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
if (!shape) {
|
|
1135
|
+
return null;
|
|
1136
|
+
}
|
|
1137
|
+
switch (shape) {
|
|
1138
|
+
case "array-row-table":
|
|
1139
|
+
return { shape: "array-row-table", data: arrayRows, schema };
|
|
1140
|
+
case "object-row-table":
|
|
1141
|
+
return { shape: "object-row-table", data: objectRows, schema };
|
|
1142
|
+
case "geojson-table":
|
|
1143
|
+
return { shape: "geojson-table", type: "FeatureCollection", features, schema };
|
|
1144
|
+
default:
|
|
1145
|
+
return null;
|
|
1146
|
+
}
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
// src/schema-utils/lib/table/tables/table-column.ts
|
|
1150
|
+
function makeColumnFromField(field, length) {
|
|
1151
|
+
const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);
|
|
1152
|
+
return new ArrayType(length);
|
|
1153
|
+
}
|
|
1154
|
+
|
|
1155
|
+
// src/schema-utils/lib/table/tables/convert-arrow-table.ts
|
|
1156
|
+
var arrow4 = __toESM(require("apache-arrow"), 1);
|
|
1157
|
+
|
|
1158
|
+
// src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts
|
|
1159
|
+
var arrow3 = __toESM(require("apache-arrow"), 1);
|
|
1160
|
+
function* makeArrowTableBatchIterator(table, options) {
|
|
1161
|
+
for (const batch of makeArrowRecordBatchIterator(table, options)) {
|
|
1162
|
+
const arrowTable = new arrow3.Table([batch]);
|
|
1163
|
+
yield {
|
|
1164
|
+
...batch,
|
|
1165
|
+
shape: "arrow-table",
|
|
1166
|
+
schema: table.schema,
|
|
1167
|
+
batchType: "data",
|
|
1168
|
+
length: arrowTable.numRows,
|
|
1169
|
+
data: arrowTable
|
|
1170
|
+
};
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
function* makeArrowRecordBatchIterator(table, options) {
|
|
1174
|
+
const arrowSchema = convertSchemaToArrow(table.schema);
|
|
1175
|
+
const length = getTableLength(table);
|
|
1176
|
+
const numColumns = getTableNumCols(table);
|
|
1177
|
+
const batchSize = options?.batchSize || length;
|
|
1178
|
+
const builders = arrowSchema?.fields.map(
|
|
1179
|
+
(arrowField) => arrow3.makeBuilder({
|
|
1180
|
+
type: arrowField.type,
|
|
1181
|
+
nullValues: [null, void 0]
|
|
1182
|
+
})
|
|
1183
|
+
);
|
|
1184
|
+
const structField = new arrow3.Struct(arrowSchema.fields);
|
|
1185
|
+
let batchLength = 0;
|
|
1186
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
1187
|
+
for (let columnIndex = 0; columnIndex < numColumns; ++columnIndex) {
|
|
1188
|
+
const value = getTableCellAt(table, rowIndex, columnIndex);
|
|
1189
|
+
const builder = builders[columnIndex];
|
|
1190
|
+
builder.append(value);
|
|
1191
|
+
}
|
|
1192
|
+
batchLength++;
|
|
1193
|
+
if (batchLength >= batchSize) {
|
|
1194
|
+
const datas = builders.map((builder) => builder.flush());
|
|
1195
|
+
const structData = new arrow3.Data(structField, 0, batchLength, 0, void 0, datas);
|
|
1196
|
+
yield new arrow3.RecordBatch(arrowSchema, structData);
|
|
1197
|
+
batchLength = 0;
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
if (batchLength > 0) {
|
|
1201
|
+
const datas = builders.map((builder) => builder.flush());
|
|
1202
|
+
const structData = new arrow3.Data(structField, 0, batchLength, 0, void 0, datas);
|
|
1203
|
+
yield new arrow3.RecordBatch(arrowSchema, structData);
|
|
1204
|
+
batchLength = 0;
|
|
1205
|
+
}
|
|
1206
|
+
builders.map((builder) => builder.finish());
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
// src/schema-utils/lib/table/tables/convert-arrow-table.ts
|
|
1210
|
+
function convertTableToArrow(table, options) {
|
|
1211
|
+
switch (table.shape) {
|
|
1212
|
+
case "arrow-table":
|
|
1213
|
+
return table.data;
|
|
1214
|
+
case "columnar-table":
|
|
1215
|
+
// TODO - optimized implementation is possible
|
|
1216
|
+
// return convertColumnarTableToArrow(table, options);
|
|
1217
|
+
// fall through
|
|
1218
|
+
default:
|
|
1219
|
+
const arrowBatchIterator = makeArrowRecordBatchIterator(table, options);
|
|
1220
|
+
return new arrow4.Table(arrowBatchIterator);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
function convertArrowToTable(arrowTable, shape) {
|
|
1224
|
+
switch (shape) {
|
|
1225
|
+
case "arrow-table":
|
|
1226
|
+
return convertArrowToArrowTable(arrowTable);
|
|
1227
|
+
case "array-row-table":
|
|
1228
|
+
return convertArrowToArrayRowTable(arrowTable);
|
|
1229
|
+
case "object-row-table":
|
|
1230
|
+
return convertArrowToObjectRowTable(arrowTable);
|
|
1231
|
+
case "columnar-table":
|
|
1232
|
+
return convertArrowToColumnarTable(arrowTable);
|
|
1233
|
+
case "geojson-table":
|
|
1234
|
+
return convertArrowToGeoJSONTable(arrowTable);
|
|
1235
|
+
default:
|
|
1236
|
+
throw new Error(shape);
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
function convertArrowToArrowTable(arrowTable) {
|
|
1240
|
+
return {
|
|
1241
|
+
shape: "arrow-table",
|
|
1242
|
+
schema: convertArrowToSchema(arrowTable.schema),
|
|
1243
|
+
data: arrowTable
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
function convertArrowToArrayRowTable(arrowTable) {
|
|
1247
|
+
const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
1248
|
+
return convertTable(columnarTable, "array-row-table");
|
|
1249
|
+
}
|
|
1250
|
+
function convertArrowToObjectRowTable(arrowTable) {
|
|
1251
|
+
const columnarTable = convertArrowToColumnarTable(arrowTable);
|
|
1252
|
+
return convertTable(columnarTable, "object-row-table");
|
|
1253
|
+
}
|
|
1254
|
+
function convertArrowToColumnarTable(arrowTable) {
|
|
1255
|
+
const columns = {};
|
|
1256
|
+
for (const field of arrowTable.schema.fields) {
|
|
1257
|
+
const arrowColumn = arrowTable.getChild(field.name);
|
|
1258
|
+
const values = arrowColumn?.toArray();
|
|
1259
|
+
columns[field.name] = values;
|
|
1260
|
+
}
|
|
1261
|
+
const schema = convertArrowToSchema(arrowTable.schema);
|
|
1262
|
+
return {
|
|
1263
|
+
shape: "columnar-table",
|
|
1264
|
+
schema,
|
|
1265
|
+
data: columns
|
|
1266
|
+
};
|
|
1267
|
+
}
|
|
1268
|
+
function convertArrowToGeoJSONTable(arrowTable) {
|
|
1269
|
+
const schema = convertArrowToSchema(arrowTable.schema);
|
|
1270
|
+
const features = [];
|
|
1271
|
+
for (let row = 0; row < arrowTable.numRows; row++) {
|
|
1272
|
+
const properties = arrowTable.get(row)?.toJSON() || {};
|
|
1273
|
+
features.push({ type: "Feature", geometry: null, properties });
|
|
1274
|
+
}
|
|
1275
|
+
return {
|
|
1276
|
+
shape: "geojson-table",
|
|
1277
|
+
type: "FeatureCollection",
|
|
1278
|
+
schema,
|
|
1279
|
+
features
|
|
1280
|
+
};
|
|
1281
|
+
}
|
|
1282
|
+
|
|
1283
|
+
// src/schema-utils/lib/table/tables/convert-table.ts
|
|
1284
|
+
function convertTable(table, shape) {
|
|
1285
|
+
switch (shape) {
|
|
1286
|
+
case "object-row-table":
|
|
1287
|
+
return convertToObjectRowTable(table);
|
|
1288
|
+
case "array-row-table":
|
|
1289
|
+
return convertToArrayRowTable(table);
|
|
1290
|
+
case "columnar-table":
|
|
1291
|
+
return convertToColumnarTable(table);
|
|
1292
|
+
case "arrow-table":
|
|
1293
|
+
return convertToArrowTable(table);
|
|
1294
|
+
default:
|
|
1295
|
+
throw new Error(shape);
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
function convertToColumnarTable(table) {
|
|
1299
|
+
const schema = table.schema || deduceTableSchema(table);
|
|
1300
|
+
const fields = schema.fields;
|
|
1301
|
+
if (table.shape === "columnar-table") {
|
|
1302
|
+
return { ...table, schema };
|
|
1303
|
+
}
|
|
1304
|
+
const length = getTableLength(table);
|
|
1305
|
+
const columns = {};
|
|
1306
|
+
for (const field of fields) {
|
|
1307
|
+
const column = makeColumnFromField(field, length);
|
|
1308
|
+
columns[field.name] = column;
|
|
1309
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
1310
|
+
column[rowIndex] = getTableCell(table, rowIndex, field.name);
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
return {
|
|
1314
|
+
shape: "columnar-table",
|
|
1315
|
+
schema,
|
|
1316
|
+
data: columns
|
|
1317
|
+
};
|
|
1318
|
+
}
|
|
1319
|
+
function convertToArrayRowTable(table) {
|
|
1320
|
+
if (table.shape === "array-row-table") {
|
|
1321
|
+
return table;
|
|
1322
|
+
}
|
|
1323
|
+
const length = getTableLength(table);
|
|
1324
|
+
const data = new Array(length);
|
|
1325
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
1326
|
+
data[rowIndex] = getTableRowAsArray(table, rowIndex);
|
|
1327
|
+
}
|
|
1328
|
+
return {
|
|
1329
|
+
shape: "array-row-table",
|
|
1330
|
+
schema: table.schema,
|
|
1331
|
+
data
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
function convertToObjectRowTable(table) {
|
|
1335
|
+
if (table.shape === "object-row-table") {
|
|
1336
|
+
return table;
|
|
1337
|
+
}
|
|
1338
|
+
const length = getTableLength(table);
|
|
1339
|
+
const data = new Array(length);
|
|
1340
|
+
for (let rowIndex = 0; rowIndex < length; rowIndex++) {
|
|
1341
|
+
data[rowIndex] = getTableRowAsObject(table, rowIndex);
|
|
1342
|
+
}
|
|
1343
|
+
return {
|
|
1344
|
+
shape: "object-row-table",
|
|
1345
|
+
schema: table.schema,
|
|
1346
|
+
data
|
|
1347
|
+
};
|
|
1348
|
+
}
|
|
1349
|
+
function convertToArrowTable(table) {
|
|
1350
|
+
const schema = table.schema || deduceTableSchema(table);
|
|
1351
|
+
const arrowTable = convertTableToArrow({ ...table, schema });
|
|
1352
|
+
return {
|
|
1353
|
+
shape: "arrow-table",
|
|
1354
|
+
schema,
|
|
1355
|
+
data: arrowTable
|
|
1356
|
+
};
|
|
1357
|
+
}
|
|
1358
|
+
|
|
1359
|
+
// src/schema-utils/lib/table/tables/table-converter/convert-tables.ts
|
|
1360
|
+
function convertTables(table, shape) {
|
|
1361
|
+
switch (shape) {
|
|
1362
|
+
case "object-row-table":
|
|
1363
|
+
return convertTable(table, "object-row-table");
|
|
1364
|
+
case "array-row-table":
|
|
1365
|
+
return convertTable(table, "array-row-table");
|
|
1366
|
+
case "columnar-table":
|
|
1367
|
+
return convertTable(table, "columnar-table");
|
|
1368
|
+
case "arrow-table":
|
|
1369
|
+
return convertTable(table, "arrow-table");
|
|
1370
|
+
default:
|
|
1371
|
+
throw new Error(`Unsupported table conversion target: ${shape}`);
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// src/schema-utils/lib/table/tables/table-converter/table-converter.ts
|
|
1376
|
+
var TableConverter = {
|
|
1377
|
+
id: "table",
|
|
1378
|
+
from: ["object-row-table", "array-row-table", "columnar-table", "arrow-table"],
|
|
1379
|
+
to: ["object-row-table", "array-row-table", "columnar-table", "arrow-table"],
|
|
1380
|
+
canConvert(sourceShape, targetShape) {
|
|
1381
|
+
return sourceShape !== targetShape;
|
|
1382
|
+
},
|
|
1383
|
+
detectInputShape(input) {
|
|
1384
|
+
if (typeof input === "object" && input !== null && "shape" in input && typeof input.shape === "string" && ["object-row-table", "array-row-table", "columnar-table", "arrow-table"].includes(input.shape)) {
|
|
1385
|
+
return input.shape;
|
|
1386
|
+
}
|
|
1387
|
+
return null;
|
|
1388
|
+
},
|
|
1389
|
+
convert(input, targetShape) {
|
|
1390
|
+
switch (targetShape) {
|
|
1391
|
+
case "object-row-table":
|
|
1392
|
+
return convertTables(input, "object-row-table");
|
|
1393
|
+
case "array-row-table":
|
|
1394
|
+
return convertTables(input, "array-row-table");
|
|
1395
|
+
case "columnar-table":
|
|
1396
|
+
return convertTables(input, "columnar-table");
|
|
1397
|
+
case "arrow-table":
|
|
1398
|
+
return convertTables(input, "arrow-table");
|
|
1399
|
+
default:
|
|
1400
|
+
throw new Error(`Unsupported table conversion target: ${targetShape}`);
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
};
|
|
1404
|
+
var TABLE_CONVERTERS = [TableConverter];
|
|
1405
|
+
|
|
1406
|
+
// src/schema-utils/lib/table/tables/row-utils.ts
|
|
1407
|
+
function convertToObjectRow(arrayRow, headers) {
|
|
1408
|
+
if (!arrayRow) {
|
|
1409
|
+
throw new Error("null row");
|
|
1410
|
+
}
|
|
1411
|
+
const objectRow = {};
|
|
1412
|
+
if (headers) {
|
|
1413
|
+
for (let i = 0; i < headers.length; i++) {
|
|
1414
|
+
objectRow[headers[i]] = arrayRow[i];
|
|
1415
|
+
}
|
|
1416
|
+
} else {
|
|
1417
|
+
for (let i = 0; i < arrayRow.length; i++) {
|
|
1418
|
+
const columnName = `column-${i}`;
|
|
1419
|
+
objectRow[columnName] = arrayRow[i];
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
return objectRow;
|
|
1423
|
+
}
|
|
1424
|
+
function convertToArrayRow(objectRow, headers) {
|
|
1425
|
+
if (!objectRow) {
|
|
1426
|
+
throw new Error("null row");
|
|
1427
|
+
}
|
|
1428
|
+
if (headers) {
|
|
1429
|
+
const arrayRow = new Array(headers.length);
|
|
1430
|
+
for (let i = 0; i < headers.length; i++) {
|
|
1431
|
+
arrayRow[i] = objectRow[headers[i]];
|
|
1432
|
+
}
|
|
1433
|
+
return arrayRow;
|
|
1434
|
+
}
|
|
1435
|
+
return Object.values(objectRow);
|
|
1436
|
+
}
|
|
1437
|
+
function inferHeadersFromArrayRow(arrayRow) {
|
|
1438
|
+
const headers = [];
|
|
1439
|
+
for (let i = 0; i < arrayRow.length; i++) {
|
|
1440
|
+
const columnName = `column-${i}`;
|
|
1441
|
+
headers.push(columnName);
|
|
1442
|
+
}
|
|
1443
|
+
return headers;
|
|
1444
|
+
}
|
|
1445
|
+
function inferHeadersFromObjectRow(row) {
|
|
1446
|
+
return Object.keys(row);
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1449
|
+
// src/schema-utils/deprecated.ts
|
|
1450
|
+
var convertTable2 = ((...args) => convertTable(
|
|
1451
|
+
...args
|
|
1452
|
+
));
|
|
1453
|
+
var convertArrowToTable2 = ((...args) => convertArrowToTable(
|
|
1454
|
+
...args
|
|
1455
|
+
));
|
|
1456
|
+
var convertTableToArrow2 = ((...args) => convertTableToArrow(
|
|
1457
|
+
...args
|
|
1458
|
+
));
|
|
1459
|
+
var convertToObjectRow2 = ((...args) => convertToObjectRow(
|
|
1460
|
+
...args
|
|
1461
|
+
));
|
|
1462
|
+
var convertToArrayRow2 = ((...args) => convertToArrayRow(
|
|
1463
|
+
...args
|
|
1464
|
+
));
|
|
1465
|
+
|
|
1466
|
+
// src/schema-utils/lib/table/batches/make-table-batch-iterator.ts
|
|
1467
|
+
function* makeTableBatchIterator(table) {
|
|
1468
|
+
yield makeBatchFromTable(table);
|
|
1469
|
+
}
|
|
1470
|
+
function makeBatchFromTable(table) {
|
|
1471
|
+
return { ...table, length: getTableLength(table), batchType: "data" };
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
// src/schema-utils/lib/table/query-arrow-table.ts
|
|
1475
|
+
var arrow5 = __toESM(require("apache-arrow"), 1);
|
|
1476
|
+
function queryArrowTable(table, options = {}, filterRows) {
|
|
1477
|
+
const availableColumns = table.data.schema.fields.map((field) => field.name);
|
|
1478
|
+
const selectedColumns = options.columns ? [...options.columns] : availableColumns;
|
|
1479
|
+
for (const columnName of selectedColumns) {
|
|
1480
|
+
if (!availableColumns.includes(columnName)) {
|
|
1481
|
+
throw new Error(`Arrow table query could not read column "${columnName}".`);
|
|
1482
|
+
}
|
|
1483
|
+
}
|
|
1484
|
+
let rowIndices;
|
|
1485
|
+
if (options.predicate !== void 0) {
|
|
1486
|
+
if (!filterRows) throw new Error("Arrow table query requires a predicate evaluator.");
|
|
1487
|
+
const columns = Object.fromEntries(
|
|
1488
|
+
availableColumns.map((name) => [name, [...table.data.getChild(name) || []]])
|
|
1489
|
+
);
|
|
1490
|
+
rowIndices = filterRows(options.predicate, columns, table.data.numRows);
|
|
1491
|
+
}
|
|
1492
|
+
const limitedRowIndices = rowIndices ? rowIndices.slice(0, options.limit ?? Number.POSITIVE_INFINITY) : void 0;
|
|
1493
|
+
const data = limitedRowIndices ? createArrowTableFromRowIndices(table.data, selectedColumns, limitedRowIndices) : table.data.select(selectedColumns).slice(0, options.limit ?? Number.POSITIVE_INFINITY);
|
|
1494
|
+
const schema = table.schema ? {
|
|
1495
|
+
...table.schema,
|
|
1496
|
+
fields: selectedColumns.flatMap(
|
|
1497
|
+
(columnName) => table.schema?.fields.filter((field) => field.name === columnName) || []
|
|
1498
|
+
)
|
|
1499
|
+
} : void 0;
|
|
1500
|
+
return schema ? { shape: "arrow-table", schema, data } : { shape: "arrow-table", data };
|
|
1501
|
+
}
|
|
1502
|
+
function selectArrowTableRows(table, rowIndices, columns, limit) {
|
|
1503
|
+
const availableColumns = table.data.schema.fields.map((field) => field.name);
|
|
1504
|
+
const selectedColumns = columns ? [...columns] : availableColumns;
|
|
1505
|
+
for (const columnName of selectedColumns) {
|
|
1506
|
+
if (!availableColumns.includes(columnName)) {
|
|
1507
|
+
throw new Error(`Arrow table query could not read column "${columnName}".`);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1510
|
+
const limitedRowIndices = rowIndices.slice(0, limit ?? Number.POSITIVE_INFINITY);
|
|
1511
|
+
const data = createArrowTableFromRowIndices(table.data, selectedColumns, limitedRowIndices);
|
|
1512
|
+
const schema = table.schema ? {
|
|
1513
|
+
...table.schema,
|
|
1514
|
+
fields: selectedColumns.flatMap(
|
|
1515
|
+
(columnName) => table.schema?.fields.filter((field) => field.name === columnName) || []
|
|
1516
|
+
)
|
|
1517
|
+
} : void 0;
|
|
1518
|
+
return schema ? { shape: "arrow-table", schema, data } : { shape: "arrow-table", data };
|
|
1519
|
+
}
|
|
1520
|
+
function createArrowTableFromRowIndices(sourceData, selectedColumns, rowIndices) {
|
|
1521
|
+
const schema = new arrow5.Schema(
|
|
1522
|
+
selectedColumns.map(
|
|
1523
|
+
(columnName) => sourceData.schema.fields.find((field) => field.name === columnName)
|
|
1524
|
+
)
|
|
1525
|
+
);
|
|
1526
|
+
const vectors = Object.fromEntries(
|
|
1527
|
+
selectedColumns.map((columnName) => {
|
|
1528
|
+
const sourceVector = sourceData.getChild(columnName);
|
|
1529
|
+
return [
|
|
1530
|
+
columnName,
|
|
1531
|
+
arrow5.vectorFromArray(
|
|
1532
|
+
rowIndices.map((rowIndex) => sourceVector?.get(rowIndex)),
|
|
1533
|
+
sourceVector?.type
|
|
1534
|
+
)
|
|
1535
|
+
];
|
|
1536
|
+
})
|
|
1537
|
+
);
|
|
1538
|
+
const children = selectedColumns.map((columnName) => vectors[columnName].data[0]);
|
|
1539
|
+
const data = new arrow5.Data(
|
|
1540
|
+
new arrow5.Struct(schema.fields),
|
|
1541
|
+
0,
|
|
1542
|
+
rowIndices.length,
|
|
1543
|
+
0,
|
|
1544
|
+
void 0,
|
|
1545
|
+
children
|
|
1546
|
+
);
|
|
1547
|
+
return new arrow5.Table(schema, new arrow5.RecordBatch(schema, data));
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
// src/schema-utils/lib/table/batches/convert-batches.ts
|
|
1551
|
+
function convertBatch(batch, shape) {
|
|
1552
|
+
switch (shape) {
|
|
1553
|
+
case "object-row-table":
|
|
1554
|
+
return { ...batch, ...convertTable(batch, "object-row-table") };
|
|
1555
|
+
case "array-row-table":
|
|
1556
|
+
return { ...batch, ...convertTable(batch, "array-row-table") };
|
|
1557
|
+
case "columnar-table":
|
|
1558
|
+
return { ...batch, ...convertTable(batch, "columnar-table") };
|
|
1559
|
+
case "arrow-table":
|
|
1560
|
+
return { ...batch, ...convertTable(batch, "arrow-table") };
|
|
1561
|
+
default:
|
|
1562
|
+
throw new Error(shape);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
async function* convertBatches(batches, shape) {
|
|
1566
|
+
for await (const batch of batches) {
|
|
1567
|
+
switch (shape) {
|
|
1568
|
+
case "object-row-table":
|
|
1569
|
+
yield convertBatch(batch, "object-row-table");
|
|
1570
|
+
break;
|
|
1571
|
+
case "array-row-table":
|
|
1572
|
+
yield convertBatch(batch, "array-row-table");
|
|
1573
|
+
break;
|
|
1574
|
+
case "columnar-table":
|
|
1575
|
+
yield convertBatch(batch, "columnar-table");
|
|
1576
|
+
break;
|
|
1577
|
+
case "arrow-table":
|
|
1578
|
+
yield convertBatch(batch, "arrow-table");
|
|
1579
|
+
break;
|
|
1580
|
+
default:
|
|
1581
|
+
throw new Error(shape);
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
// src/schema-utils/lib/table/tables/table-types.ts
|
|
1587
|
+
function isArrayRowTable(table) {
|
|
1588
|
+
return table.shape === "array-row-table";
|
|
1589
|
+
}
|
|
1590
|
+
function isObjectRowTable(table) {
|
|
1591
|
+
return table.shape === "object-row-table";
|
|
1592
|
+
}
|
|
1593
|
+
function isColumnarTable(table) {
|
|
1594
|
+
return table.shape === "columnar-table";
|
|
1595
|
+
}
|
|
1596
|
+
function isGeoJSONTable(table) {
|
|
1597
|
+
return table.shape === "geojson-table";
|
|
1598
|
+
}
|
|
1599
|
+
function isArrowTable(table) {
|
|
1600
|
+
return table.shape === "arrow-table";
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
// src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts
|
|
1604
|
+
var DEFAULT_ROW_COUNT = 100;
|
|
1605
|
+
var BaseTableBatchAggregator = class {
|
|
1606
|
+
schema;
|
|
1607
|
+
options;
|
|
1608
|
+
shape;
|
|
1609
|
+
length = 0;
|
|
1610
|
+
rows = null;
|
|
1611
|
+
cursor = 0;
|
|
1612
|
+
_headers = [];
|
|
1613
|
+
constructor(schema, options) {
|
|
1614
|
+
this.options = options;
|
|
1615
|
+
this.schema = schema;
|
|
1616
|
+
if (!Array.isArray(schema)) {
|
|
1617
|
+
this._headers = [];
|
|
1618
|
+
for (const key in schema) {
|
|
1619
|
+
this._headers[schema[key].index] = schema[key].name;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
rowCount() {
|
|
1624
|
+
return this.length;
|
|
1625
|
+
}
|
|
1626
|
+
addArrayRow(row, cursor) {
|
|
1627
|
+
if (Number.isFinite(cursor)) {
|
|
1628
|
+
this.cursor = cursor;
|
|
1629
|
+
}
|
|
1630
|
+
this.shape = "array-row-table";
|
|
1631
|
+
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
1632
|
+
this.rows[this.length] = row;
|
|
1633
|
+
this.length++;
|
|
1634
|
+
}
|
|
1635
|
+
addObjectRow(row, cursor) {
|
|
1636
|
+
if (Number.isFinite(cursor)) {
|
|
1637
|
+
this.cursor = cursor;
|
|
1638
|
+
}
|
|
1639
|
+
this.shape = "object-row-table";
|
|
1640
|
+
this.rows = this.rows || new Array(DEFAULT_ROW_COUNT);
|
|
1641
|
+
this.rows[this.length] = row;
|
|
1642
|
+
this.length++;
|
|
1643
|
+
}
|
|
1644
|
+
getBatch() {
|
|
1645
|
+
let rows = this.rows;
|
|
1646
|
+
if (!rows) {
|
|
1647
|
+
return null;
|
|
1648
|
+
}
|
|
1649
|
+
rows = rows.slice(0, this.length);
|
|
1650
|
+
this.rows = null;
|
|
1651
|
+
const batch = {
|
|
1652
|
+
shape: this.shape || "array-row-table",
|
|
1653
|
+
batchType: "data",
|
|
1654
|
+
data: rows,
|
|
1655
|
+
length: this.length,
|
|
1656
|
+
schema: this.schema,
|
|
1657
|
+
cursor: this.cursor
|
|
1658
|
+
};
|
|
1659
|
+
return batch;
|
|
1660
|
+
}
|
|
1661
|
+
};
|
|
1662
|
+
|
|
1663
|
+
// src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts
|
|
1664
|
+
var DEFAULT_ROW_COUNT2 = 100;
|
|
1665
|
+
var RowTableBatchAggregator = class {
|
|
1666
|
+
schema;
|
|
1667
|
+
options;
|
|
1668
|
+
length = 0;
|
|
1669
|
+
objectRows = null;
|
|
1670
|
+
arrayRows = null;
|
|
1671
|
+
cursor = 0;
|
|
1672
|
+
_headers = null;
|
|
1673
|
+
constructor(schema, options) {
|
|
1674
|
+
this.options = options;
|
|
1675
|
+
this.schema = schema;
|
|
1676
|
+
if (schema) {
|
|
1677
|
+
this._headers = [];
|
|
1678
|
+
for (let i = 0; i < schema.fields.length; i++) {
|
|
1679
|
+
this._headers[i] = schema.fields[i].name;
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
}
|
|
1683
|
+
rowCount() {
|
|
1684
|
+
return this.length;
|
|
1685
|
+
}
|
|
1686
|
+
addArrayRow(row, cursor) {
|
|
1687
|
+
if (Number.isFinite(cursor)) {
|
|
1688
|
+
this.cursor = cursor;
|
|
1689
|
+
}
|
|
1690
|
+
this._headers ||= inferHeadersFromArrayRow(row);
|
|
1691
|
+
switch (this.options.shape) {
|
|
1692
|
+
case "object-row-table":
|
|
1693
|
+
const rowObject = convertToObjectRow(row, this._headers);
|
|
1694
|
+
this.addObjectRow(rowObject, cursor);
|
|
1695
|
+
break;
|
|
1696
|
+
case "array-row-table":
|
|
1697
|
+
this.arrayRows = this.arrayRows || new Array(DEFAULT_ROW_COUNT2);
|
|
1698
|
+
this.arrayRows[this.length] = row;
|
|
1699
|
+
this.length++;
|
|
1700
|
+
break;
|
|
1701
|
+
}
|
|
1702
|
+
}
|
|
1703
|
+
addObjectRow(row, cursor) {
|
|
1704
|
+
if (Number.isFinite(cursor)) {
|
|
1705
|
+
this.cursor = cursor;
|
|
1706
|
+
}
|
|
1707
|
+
this._headers ||= inferHeadersFromObjectRow(row);
|
|
1708
|
+
switch (this.options.shape) {
|
|
1709
|
+
case "array-row-table":
|
|
1710
|
+
const rowArray = convertToArrayRow(row, this._headers);
|
|
1711
|
+
this.addArrayRow(rowArray, cursor);
|
|
1712
|
+
break;
|
|
1713
|
+
case "object-row-table":
|
|
1714
|
+
this.objectRows = this.objectRows || new Array(DEFAULT_ROW_COUNT2);
|
|
1715
|
+
this.objectRows[this.length] = row;
|
|
1716
|
+
this.length++;
|
|
1717
|
+
break;
|
|
1718
|
+
}
|
|
1719
|
+
}
|
|
1720
|
+
getBatch() {
|
|
1721
|
+
let rows = this.arrayRows || this.objectRows;
|
|
1722
|
+
if (!rows) {
|
|
1723
|
+
return null;
|
|
1724
|
+
}
|
|
1725
|
+
rows = rows.slice(0, this.length);
|
|
1726
|
+
this.arrayRows = null;
|
|
1727
|
+
this.objectRows = null;
|
|
1728
|
+
return {
|
|
1729
|
+
shape: this.options.shape,
|
|
1730
|
+
batchType: "data",
|
|
1731
|
+
data: rows,
|
|
1732
|
+
length: this.length,
|
|
1733
|
+
// @ts-expect-error we should infer a schema
|
|
1734
|
+
schema: this.schema,
|
|
1735
|
+
cursor: this.cursor
|
|
1736
|
+
};
|
|
1737
|
+
}
|
|
1738
|
+
};
|
|
1739
|
+
|
|
1740
|
+
// src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts
|
|
1741
|
+
var import_types2 = require("@math.gl/core/types");
|
|
1742
|
+
var DEFAULT_ROW_COUNT3 = 100;
|
|
1743
|
+
var ColumnarTableBatchAggregator = class {
|
|
1744
|
+
schema;
|
|
1745
|
+
length = 0;
|
|
1746
|
+
allocated = 0;
|
|
1747
|
+
columns = {};
|
|
1748
|
+
constructor(schema, options) {
|
|
1749
|
+
this.schema = schema;
|
|
1750
|
+
this._reallocateColumns();
|
|
1751
|
+
}
|
|
1752
|
+
rowCount() {
|
|
1753
|
+
return this.length;
|
|
1754
|
+
}
|
|
1755
|
+
addArrayRow(row) {
|
|
1756
|
+
this._reallocateColumns();
|
|
1757
|
+
let i = 0;
|
|
1758
|
+
for (const fieldName in this.columns) {
|
|
1759
|
+
this.columns[fieldName][this.length] = row[i++];
|
|
1760
|
+
}
|
|
1761
|
+
this.length++;
|
|
1762
|
+
}
|
|
1763
|
+
addObjectRow(row) {
|
|
1764
|
+
this._reallocateColumns();
|
|
1765
|
+
for (const fieldName in row) {
|
|
1766
|
+
this.columns[fieldName][this.length] = row[fieldName];
|
|
1767
|
+
}
|
|
1768
|
+
this.length++;
|
|
1769
|
+
}
|
|
1770
|
+
getBatch() {
|
|
1771
|
+
this._pruneColumns();
|
|
1772
|
+
const batch = {
|
|
1773
|
+
shape: "columnar-table",
|
|
1774
|
+
batchType: "data",
|
|
1775
|
+
data: this.columns,
|
|
1776
|
+
schema: this.schema,
|
|
1777
|
+
length: this.length
|
|
1778
|
+
};
|
|
1779
|
+
return batch;
|
|
1780
|
+
}
|
|
1781
|
+
// HELPERS
|
|
1782
|
+
_reallocateColumns() {
|
|
1783
|
+
if (this.length < this.allocated) {
|
|
1784
|
+
return;
|
|
1785
|
+
}
|
|
1786
|
+
this.allocated = this.allocated > 0 ? this.allocated * 2 : DEFAULT_ROW_COUNT3;
|
|
1787
|
+
this.columns = {};
|
|
1788
|
+
for (const field of this.schema.fields) {
|
|
1789
|
+
const ArrayType = getArrayTypeFromDataType(field.type, field.nullable);
|
|
1790
|
+
const oldColumn = this.columns[field.name];
|
|
1791
|
+
if (!oldColumn) {
|
|
1792
|
+
this.columns[field.name] = new ArrayType(this.allocated);
|
|
1793
|
+
} else if (Array.isArray(oldColumn)) {
|
|
1794
|
+
oldColumn.length = this.allocated;
|
|
1795
|
+
} else if ((0, import_types2.isTypedArray)(oldColumn)) {
|
|
1796
|
+
const typedArray = new ArrayType(this.allocated);
|
|
1797
|
+
typedArray.set(oldColumn);
|
|
1798
|
+
this.columns[field.name] = typedArray;
|
|
1799
|
+
} else {
|
|
1800
|
+
throw new Error("Invalid column type");
|
|
1801
|
+
}
|
|
1802
|
+
}
|
|
1803
|
+
}
|
|
1804
|
+
_pruneColumns() {
|
|
1805
|
+
for (const [columnName, column] of Object.entries(this.columns)) {
|
|
1806
|
+
this.columns[columnName] = column.slice(0, this.length);
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
};
|
|
1810
|
+
|
|
1811
|
+
// src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts
|
|
1812
|
+
var arrow6 = __toESM(require("apache-arrow"), 1);
|
|
1813
|
+
var ArrowTableBatchAggregator = class extends ColumnarTableBatchAggregator {
|
|
1814
|
+
arrowSchema;
|
|
1815
|
+
constructor(schema, options) {
|
|
1816
|
+
super(schema, options);
|
|
1817
|
+
this.arrowSchema = null;
|
|
1818
|
+
}
|
|
1819
|
+
getBatch() {
|
|
1820
|
+
const batch = super.getBatch();
|
|
1821
|
+
if (batch) {
|
|
1822
|
+
this.arrowSchema = this.arrowSchema || getArrowSchema(batch.schema);
|
|
1823
|
+
const arrowVectors = getArrowVectors(this.arrowSchema, batch.data);
|
|
1824
|
+
const recordBatch = new arrow6.RecordBatch(
|
|
1825
|
+
this.arrowSchema,
|
|
1826
|
+
arrow6.makeData({
|
|
1827
|
+
type: new arrow6.Struct(this.arrowSchema.fields),
|
|
1828
|
+
children: arrowVectors.map(({ data }) => data[0])
|
|
1829
|
+
})
|
|
1830
|
+
);
|
|
1831
|
+
return {
|
|
1832
|
+
shape: "arrow-table",
|
|
1833
|
+
batchType: "data",
|
|
1834
|
+
data: new arrow6.Table([recordBatch]),
|
|
1835
|
+
length: batch.length
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
return null;
|
|
1839
|
+
}
|
|
1840
|
+
};
|
|
1841
|
+
function getArrowSchema(schema) {
|
|
1842
|
+
const arrowFields = [];
|
|
1843
|
+
const fields = Array.isArray(schema.fields) ? schema.fields : Object.values(schema);
|
|
1844
|
+
for (const field of fields) {
|
|
1845
|
+
if (field.type === "float32" || field.type === Float32Array) {
|
|
1846
|
+
const metadata = /* @__PURE__ */ new Map();
|
|
1847
|
+
const arrowField = new arrow6.Field(field.name, new arrow6.Float32(), field.nullable, metadata);
|
|
1848
|
+
arrowFields.push(arrowField);
|
|
1849
|
+
}
|
|
1850
|
+
}
|
|
1851
|
+
if (arrowFields.length === 0) {
|
|
1852
|
+
throw new Error("No arrow convertible fields");
|
|
1853
|
+
}
|
|
1854
|
+
if (arrowFields.length !== fields.length) {
|
|
1855
|
+
throw new Error("Some schema fields are not arrow convertible");
|
|
1856
|
+
}
|
|
1857
|
+
return new arrow6.Schema(arrowFields);
|
|
1858
|
+
}
|
|
1859
|
+
function getArrowVectors(arrowSchema, data) {
|
|
1860
|
+
const arrowVectors = [];
|
|
1861
|
+
for (const field of arrowSchema.fields) {
|
|
1862
|
+
const vector = data[field.name];
|
|
1863
|
+
if (vector instanceof Float32Array) {
|
|
1864
|
+
const arrowVector = arrow6.makeVector(vector);
|
|
1865
|
+
arrowVectors.push(arrowVector);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
if (arrowSchema.fields.length !== arrowVectors.length) {
|
|
1869
|
+
throw new Error("Some columns not arrow convertible");
|
|
1870
|
+
}
|
|
1871
|
+
return arrowVectors;
|
|
1872
|
+
}
|
|
1873
|
+
|
|
1874
|
+
// src/schema-utils/lib/table/batch-builder/table-batch-builder.ts
|
|
1875
|
+
var DEFAULT_OPTIONS = {
|
|
1876
|
+
shape: void 0,
|
|
1877
|
+
batchSize: "auto",
|
|
1878
|
+
batchDebounceMs: 0,
|
|
1879
|
+
limit: 0,
|
|
1880
|
+
_limitMB: 0
|
|
1881
|
+
};
|
|
1882
|
+
var TableBatchBuilder = class {
|
|
1883
|
+
schema;
|
|
1884
|
+
options;
|
|
1885
|
+
aggregator = null;
|
|
1886
|
+
batchCount = 0;
|
|
1887
|
+
bytesUsed = 0;
|
|
1888
|
+
isChunkComplete = false;
|
|
1889
|
+
lastBatchEmittedMs = Date.now();
|
|
1890
|
+
totalLength = 0;
|
|
1891
|
+
totalBytes = 0;
|
|
1892
|
+
rowBytes = 0;
|
|
1893
|
+
static ArrowBatch;
|
|
1894
|
+
constructor(schema, options) {
|
|
1895
|
+
this.schema = schema;
|
|
1896
|
+
this.options = { ...DEFAULT_OPTIONS, ...options };
|
|
1897
|
+
}
|
|
1898
|
+
limitReached() {
|
|
1899
|
+
if (Boolean(this.options?.limit) && this.totalLength >= this.options.limit) {
|
|
1900
|
+
return true;
|
|
1901
|
+
}
|
|
1902
|
+
if (Boolean(this.options?._limitMB) && this.totalBytes / 1e6 >= this.options._limitMB) {
|
|
1903
|
+
return true;
|
|
1904
|
+
}
|
|
1905
|
+
return false;
|
|
1906
|
+
}
|
|
1907
|
+
/** @deprecated Use addArrayRow or addObjectRow */
|
|
1908
|
+
addRow(row) {
|
|
1909
|
+
if (this.limitReached()) {
|
|
1910
|
+
return;
|
|
1911
|
+
}
|
|
1912
|
+
this.totalLength++;
|
|
1913
|
+
this.rowBytes = this.rowBytes || this._estimateRowMB(row);
|
|
1914
|
+
this.totalBytes += this.rowBytes;
|
|
1915
|
+
if (Array.isArray(row)) {
|
|
1916
|
+
this.addArrayRow(row);
|
|
1917
|
+
} else {
|
|
1918
|
+
this.addObjectRow(row);
|
|
1919
|
+
}
|
|
1920
|
+
}
|
|
1921
|
+
/** Add one row to the batch */
|
|
1922
|
+
addArrayRow(row) {
|
|
1923
|
+
if (!this.aggregator) {
|
|
1924
|
+
const TableBatchType = this._getTableBatchType();
|
|
1925
|
+
this.aggregator = new TableBatchType(this.schema, this.options);
|
|
1926
|
+
}
|
|
1927
|
+
this.aggregator.addArrayRow(row);
|
|
1928
|
+
}
|
|
1929
|
+
/** Add one row to the batch */
|
|
1930
|
+
addObjectRow(row) {
|
|
1931
|
+
if (!this.aggregator) {
|
|
1932
|
+
const TableBatchType = this._getTableBatchType();
|
|
1933
|
+
this.aggregator = new TableBatchType(this.schema, this.options);
|
|
1934
|
+
}
|
|
1935
|
+
this.aggregator.addObjectRow(row);
|
|
1936
|
+
}
|
|
1937
|
+
/** Mark an incoming raw memory chunk has completed */
|
|
1938
|
+
chunkComplete(chunk) {
|
|
1939
|
+
if (chunk instanceof ArrayBuffer) {
|
|
1940
|
+
this.bytesUsed += chunk.byteLength;
|
|
1941
|
+
}
|
|
1942
|
+
if (typeof chunk === "string") {
|
|
1943
|
+
this.bytesUsed += chunk.length;
|
|
1944
|
+
}
|
|
1945
|
+
this.isChunkComplete = true;
|
|
1946
|
+
}
|
|
1947
|
+
getFullBatch(options) {
|
|
1948
|
+
return this._isFull() ? this._getBatch(options) : null;
|
|
1949
|
+
}
|
|
1950
|
+
getFinalBatch(options) {
|
|
1951
|
+
return this._getBatch(options);
|
|
1952
|
+
}
|
|
1953
|
+
// INTERNAL
|
|
1954
|
+
_estimateRowMB(row) {
|
|
1955
|
+
return Array.isArray(row) ? row.length * 8 : Object.keys(row).length * 8;
|
|
1956
|
+
}
|
|
1957
|
+
_isFull() {
|
|
1958
|
+
if (!this.aggregator || this.aggregator.rowCount() === 0) {
|
|
1959
|
+
return false;
|
|
1960
|
+
}
|
|
1961
|
+
if (this.options.batchSize === "auto") {
|
|
1962
|
+
if (!this.isChunkComplete) {
|
|
1963
|
+
return false;
|
|
1964
|
+
}
|
|
1965
|
+
} else if (this.options.batchSize > this.aggregator.rowCount()) {
|
|
1966
|
+
return false;
|
|
1967
|
+
}
|
|
1968
|
+
if (this.options.batchDebounceMs > Date.now() - this.lastBatchEmittedMs) {
|
|
1969
|
+
return false;
|
|
1970
|
+
}
|
|
1971
|
+
this.isChunkComplete = false;
|
|
1972
|
+
this.lastBatchEmittedMs = Date.now();
|
|
1973
|
+
return true;
|
|
1974
|
+
}
|
|
1975
|
+
/**
|
|
1976
|
+
* bytesUsed can be set via chunkComplete or via getBatch*
|
|
1977
|
+
*/
|
|
1978
|
+
_getBatch(options) {
|
|
1979
|
+
if (!this.aggregator) {
|
|
1980
|
+
return null;
|
|
1981
|
+
}
|
|
1982
|
+
if (options?.bytesUsed) {
|
|
1983
|
+
this.bytesUsed = options.bytesUsed;
|
|
1984
|
+
}
|
|
1985
|
+
const normalizedBatch = this.aggregator.getBatch();
|
|
1986
|
+
normalizedBatch.count = this.batchCount;
|
|
1987
|
+
normalizedBatch.bytesUsed = this.bytesUsed;
|
|
1988
|
+
Object.assign(normalizedBatch, options);
|
|
1989
|
+
this.batchCount++;
|
|
1990
|
+
this.aggregator = null;
|
|
1991
|
+
return normalizedBatch;
|
|
1992
|
+
}
|
|
1993
|
+
_getTableBatchType() {
|
|
1994
|
+
switch (this.options.shape) {
|
|
1995
|
+
case "array-row-table":
|
|
1996
|
+
case "object-row-table":
|
|
1997
|
+
return RowTableBatchAggregator;
|
|
1998
|
+
case "columnar-table":
|
|
1999
|
+
return ColumnarTableBatchAggregator;
|
|
2000
|
+
case "arrow-table":
|
|
2001
|
+
return ArrowTableBatchAggregator;
|
|
2002
|
+
default:
|
|
2003
|
+
return BaseTableBatchAggregator;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
};
|
|
2007
|
+
|
|
2008
|
+
// src/schema-utils/lib/table/arrow-api/arrow-like-field.ts
|
|
2009
|
+
var ArrowLikeField = class _ArrowLikeField {
|
|
2010
|
+
name;
|
|
2011
|
+
type;
|
|
2012
|
+
nullable;
|
|
2013
|
+
metadata;
|
|
2014
|
+
constructor(name, type, nullable = false, metadata = /* @__PURE__ */ new Map()) {
|
|
2015
|
+
this.name = name;
|
|
2016
|
+
this.type = type;
|
|
2017
|
+
this.nullable = nullable;
|
|
2018
|
+
this.metadata = metadata;
|
|
2019
|
+
}
|
|
2020
|
+
get typeId() {
|
|
2021
|
+
return this.type && this.type.typeId;
|
|
2022
|
+
}
|
|
2023
|
+
clone() {
|
|
2024
|
+
return new _ArrowLikeField(this.name, this.type, this.nullable, this.metadata);
|
|
2025
|
+
}
|
|
2026
|
+
compareTo(other) {
|
|
2027
|
+
return this.name === other.name && this.type === other.type && this.nullable === other.nullable && this.metadata === other.metadata;
|
|
2028
|
+
}
|
|
2029
|
+
toString() {
|
|
2030
|
+
return `${JSON.stringify(this.type)}${this.nullable ? ", nullable" : ""}${this.metadata ? `, metadata: ${JSON.stringify(this.metadata)}` : ""}`;
|
|
2031
|
+
}
|
|
2032
|
+
};
|
|
2033
|
+
|
|
2034
|
+
// src/schema-utils/lib/table/arrow-api/arrow-like-schema.ts
|
|
2035
|
+
var ArrowLikeSchema = class _ArrowLikeSchema {
|
|
2036
|
+
fields;
|
|
2037
|
+
metadata;
|
|
2038
|
+
constructor(fields, metadata = /* @__PURE__ */ new Map()) {
|
|
2039
|
+
this.fields = fields.map(
|
|
2040
|
+
(field) => new ArrowLikeField(field.name, field.type, field.nullable, field.metadata)
|
|
2041
|
+
);
|
|
2042
|
+
this.metadata = metadata instanceof Map ? metadata : new Map(Object.entries(metadata));
|
|
2043
|
+
}
|
|
2044
|
+
// TODO - arrow only seems to compare fields, not metadata
|
|
2045
|
+
compareTo(other) {
|
|
2046
|
+
if (this.metadata !== other.metadata) {
|
|
2047
|
+
return false;
|
|
2048
|
+
}
|
|
2049
|
+
if (this.fields.length !== other.fields.length) {
|
|
2050
|
+
return false;
|
|
2051
|
+
}
|
|
2052
|
+
for (let i = 0; i < this.fields.length; ++i) {
|
|
2053
|
+
if (!this.fields[i].compareTo(other.fields[i])) {
|
|
2054
|
+
return false;
|
|
2055
|
+
}
|
|
2056
|
+
}
|
|
2057
|
+
return true;
|
|
2058
|
+
}
|
|
2059
|
+
select(...columnNames) {
|
|
2060
|
+
const nameMap = /* @__PURE__ */ Object.create(null);
|
|
2061
|
+
for (const name of columnNames) {
|
|
2062
|
+
nameMap[name] = true;
|
|
2063
|
+
}
|
|
2064
|
+
const selectedFields = this.fields.filter((field) => nameMap[field.name]);
|
|
2065
|
+
return new _ArrowLikeSchema(selectedFields, this.metadata);
|
|
2066
|
+
}
|
|
2067
|
+
selectAt(...columnIndices) {
|
|
2068
|
+
const selectedFields = columnIndices.map((index) => this.fields[index]).filter(Boolean);
|
|
2069
|
+
return new _ArrowLikeSchema(selectedFields, this.metadata);
|
|
2070
|
+
}
|
|
2071
|
+
assign(schemaOrFields) {
|
|
2072
|
+
let fields;
|
|
2073
|
+
let metadata = this.metadata;
|
|
2074
|
+
if (schemaOrFields instanceof _ArrowLikeSchema) {
|
|
2075
|
+
const otherArrowLikeSchema = schemaOrFields;
|
|
2076
|
+
fields = otherArrowLikeSchema.fields;
|
|
2077
|
+
metadata = mergeMaps(mergeMaps(/* @__PURE__ */ new Map(), this.metadata), otherArrowLikeSchema.metadata);
|
|
2078
|
+
} else {
|
|
2079
|
+
fields = schemaOrFields;
|
|
2080
|
+
}
|
|
2081
|
+
const fieldMap = /* @__PURE__ */ Object.create(null);
|
|
2082
|
+
for (const field of this.fields) {
|
|
2083
|
+
fieldMap[field.name] = field;
|
|
2084
|
+
}
|
|
2085
|
+
for (const field of fields) {
|
|
2086
|
+
fieldMap[field.name] = field;
|
|
2087
|
+
}
|
|
2088
|
+
const mergedFields = Object.values(fieldMap);
|
|
2089
|
+
return new _ArrowLikeSchema(mergedFields, metadata);
|
|
2090
|
+
}
|
|
2091
|
+
};
|
|
2092
|
+
function mergeMaps(m1, m2) {
|
|
2093
|
+
return new Map([...m1 || /* @__PURE__ */ new Map(), ...m2 || /* @__PURE__ */ new Map()]);
|
|
2094
|
+
}
|
|
2095
|
+
|
|
2096
|
+
// src/schema-utils/lib/table/arrow-api/arrow-like-table.ts
|
|
2097
|
+
var ArrowLikeVector = class {
|
|
2098
|
+
table;
|
|
2099
|
+
columnName;
|
|
2100
|
+
constructor(table, columnName) {
|
|
2101
|
+
this.table = table;
|
|
2102
|
+
this.columnName = columnName;
|
|
2103
|
+
}
|
|
2104
|
+
get(rowIndex) {
|
|
2105
|
+
return getTableCell(this.table, rowIndex, this.columnName);
|
|
2106
|
+
}
|
|
2107
|
+
toArray() {
|
|
2108
|
+
switch (this.table.shape) {
|
|
2109
|
+
case "arrow-table":
|
|
2110
|
+
const arrowTable = this.table.data;
|
|
2111
|
+
return arrowTable.getChild(this.columnName)?.toArray();
|
|
2112
|
+
case "columnar-table":
|
|
2113
|
+
return this.table.data[this.columnName];
|
|
2114
|
+
default:
|
|
2115
|
+
throw new Error(this.table.shape);
|
|
2116
|
+
}
|
|
2117
|
+
}
|
|
2118
|
+
};
|
|
2119
|
+
var ArrowLikeTable = class {
|
|
2120
|
+
schema;
|
|
2121
|
+
table;
|
|
2122
|
+
constructor(table) {
|
|
2123
|
+
const schema = table.schema || deduceTableSchema(table);
|
|
2124
|
+
this.schema = new ArrowLikeSchema(schema.fields, schema.metadata);
|
|
2125
|
+
this.table = { ...table, schema };
|
|
2126
|
+
}
|
|
2127
|
+
// get schema() {
|
|
2128
|
+
// return this.table.schema;
|
|
2129
|
+
// }
|
|
2130
|
+
get data() {
|
|
2131
|
+
return this.table.shape === "geojson-table" ? this.table.features : this.table.data;
|
|
2132
|
+
}
|
|
2133
|
+
get numCols() {
|
|
2134
|
+
return getTableNumCols(this.table);
|
|
2135
|
+
}
|
|
2136
|
+
get length() {
|
|
2137
|
+
return getTableLength(this.table);
|
|
2138
|
+
}
|
|
2139
|
+
getChild(columnName) {
|
|
2140
|
+
return new ArrowLikeVector(this.table, columnName);
|
|
2141
|
+
}
|
|
2142
|
+
// getChildAt(columnIndex: number): ArrowLikeVector {
|
|
2143
|
+
// return
|
|
2144
|
+
// }
|
|
2145
|
+
};
|
|
2146
|
+
|
|
2147
|
+
// src/schema-utils/lib/mesh/mesh-utils.ts
|
|
2148
|
+
function getMeshSize(attributes) {
|
|
2149
|
+
let size = 0;
|
|
2150
|
+
for (const attributeName in attributes) {
|
|
2151
|
+
const attribute = attributes[attributeName];
|
|
2152
|
+
if (ArrayBuffer.isView(attribute)) {
|
|
2153
|
+
size += attribute.byteLength * attribute.BYTES_PER_ELEMENT;
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
return size;
|
|
2157
|
+
}
|
|
2158
|
+
function getMeshBoundingBox(attributes) {
|
|
2159
|
+
const positionAttribute = attributes?.POSITION;
|
|
2160
|
+
if (!positionAttribute || !("value" in positionAttribute) || !positionAttribute.value.length) {
|
|
2161
|
+
return null;
|
|
2162
|
+
}
|
|
2163
|
+
let minX = Infinity;
|
|
2164
|
+
let minY = Infinity;
|
|
2165
|
+
let minZ = Infinity;
|
|
2166
|
+
let maxX = -Infinity;
|
|
2167
|
+
let maxY = -Infinity;
|
|
2168
|
+
let maxZ = -Infinity;
|
|
2169
|
+
const positions = positionAttribute.value;
|
|
2170
|
+
const len = positions.length;
|
|
2171
|
+
for (let i = 0; i < len; i += 3) {
|
|
2172
|
+
const x = positions[i];
|
|
2173
|
+
const y = positions[i + 1];
|
|
2174
|
+
const z = positions[i + 2];
|
|
2175
|
+
minX = x < minX ? x : minX;
|
|
2176
|
+
minY = y < minY ? y : minY;
|
|
2177
|
+
minZ = z < minZ ? z : minZ;
|
|
2178
|
+
maxX = x > maxX ? x : maxX;
|
|
2179
|
+
maxY = y > maxY ? y : maxY;
|
|
2180
|
+
maxZ = z > maxZ ? z : maxZ;
|
|
2181
|
+
}
|
|
2182
|
+
return [
|
|
2183
|
+
[minX, minY, minZ],
|
|
2184
|
+
[maxX, maxY, maxZ]
|
|
2185
|
+
];
|
|
2186
|
+
}
|
|
2187
|
+
|
|
2188
|
+
// src/schema/float16.ts
|
|
2189
|
+
var import_types3 = require("@math.gl/core/types");
|
|
2190
|
+
function createFloat16Array(length) {
|
|
2191
|
+
const ArrayConstructor = (0, import_types3.getFloat16ArrayConstructor)();
|
|
2192
|
+
return new ArrayConstructor(length);
|
|
2193
|
+
}
|
|
2194
|
+
function isNativeFloat16Array(value) {
|
|
2195
|
+
return Boolean(import_types3.NativeFloat16ArrayConstructor && value instanceof import_types3.NativeFloat16ArrayConstructor);
|
|
2196
|
+
}
|
|
2197
|
+
function setFloat16Value(array, index, value) {
|
|
2198
|
+
if (isNativeFloat16Array(array)) {
|
|
2199
|
+
array[index] = value;
|
|
2200
|
+
} else {
|
|
2201
|
+
array[index] = encodeFloat16(value);
|
|
2202
|
+
}
|
|
2203
|
+
}
|
|
2204
|
+
function getFloat16Value(array, index) {
|
|
2205
|
+
if (isNativeFloat16Array(array)) {
|
|
2206
|
+
return array[index];
|
|
2207
|
+
}
|
|
2208
|
+
return decodeFloat16(array[index]);
|
|
2209
|
+
}
|
|
2210
|
+
function getFloat16Storage(array) {
|
|
2211
|
+
return isNativeFloat16Array(array) ? new Uint16Array(array.buffer, array.byteOffset, array.length) : array;
|
|
2212
|
+
}
|
|
2213
|
+
function encodeFloat16(value) {
|
|
2214
|
+
if (!Number.isFinite(value)) {
|
|
2215
|
+
return value === Infinity ? 31744 : value === -Infinity ? 64512 : 32256;
|
|
2216
|
+
}
|
|
2217
|
+
const sign = value < 0 || Object.is(value, -0) ? 32768 : 0;
|
|
2218
|
+
const absoluteValue = Math.abs(value);
|
|
2219
|
+
if (absoluteValue === 0) {
|
|
2220
|
+
return sign;
|
|
2221
|
+
}
|
|
2222
|
+
if (absoluteValue >= 65520) {
|
|
2223
|
+
return sign | 31744;
|
|
2224
|
+
}
|
|
2225
|
+
if (absoluteValue >= 65504) {
|
|
2226
|
+
return sign | 31743;
|
|
2227
|
+
}
|
|
2228
|
+
const exponent = Math.floor(Math.log2(absoluteValue));
|
|
2229
|
+
if (exponent < -14) {
|
|
2230
|
+
return sign | Math.round(absoluteValue / 2 ** -24);
|
|
2231
|
+
}
|
|
2232
|
+
const normalizedExponent = exponent + 15;
|
|
2233
|
+
const mantissa = Math.round((absoluteValue / 2 ** exponent - 1) * 1024);
|
|
2234
|
+
if (mantissa === 1024) {
|
|
2235
|
+
return sign | normalizedExponent + 1 << 10;
|
|
2236
|
+
}
|
|
2237
|
+
return sign | normalizedExponent << 10 | mantissa;
|
|
2238
|
+
}
|
|
2239
|
+
function decodeFloat16(value) {
|
|
2240
|
+
const sign = value & 32768 ? -1 : 1;
|
|
2241
|
+
const exponent = value >> 10 & 31;
|
|
2242
|
+
const mantissa = value & 1023;
|
|
2243
|
+
if (exponent === 0) {
|
|
2244
|
+
return sign * mantissa * 2 ** -24;
|
|
2245
|
+
}
|
|
2246
|
+
if (exponent === 31) {
|
|
2247
|
+
return mantissa ? NaN : sign * Infinity;
|
|
2248
|
+
}
|
|
2249
|
+
return sign * (1 + mantissa / 1024) * 2 ** (exponent - 15);
|
|
2250
|
+
}
|
|
2251
|
+
|
|
2252
|
+
// src/schema/categories/category-mesh.ts
|
|
2253
|
+
var arrow7 = __toESM(require("apache-arrow"), 1);
|
|
2254
|
+
var meshArrowSchema = new arrow7.Schema([
|
|
2255
|
+
new arrow7.Field(
|
|
2256
|
+
"POSITION",
|
|
2257
|
+
new arrow7.FixedSizeList(3, new arrow7.Field("value", new arrow7.Float32(), false)),
|
|
2258
|
+
false
|
|
2259
|
+
)
|
|
2260
|
+
]);
|
|
2261
|
+
var indexedMeshArrowSchema = new arrow7.Schema([
|
|
2262
|
+
...meshArrowSchema.fields,
|
|
2263
|
+
new arrow7.Field(
|
|
2264
|
+
"indices",
|
|
2265
|
+
new arrow7.List(new arrow7.Field("item", new arrow7.Uint32(), false)),
|
|
2266
|
+
true
|
|
2267
|
+
)
|
|
2268
|
+
]);
|
|
2269
|
+
|
|
2270
|
+
// src/schema-utils/lib/mesh/convert-mesh-to-table.ts
|
|
2271
|
+
var arrow9 = __toESM(require("apache-arrow"), 1);
|
|
2272
|
+
|
|
2273
|
+
// src/schema-utils/lib/arrow-utils/arrow-fixed-size-list-utils.ts
|
|
2274
|
+
var arrow8 = __toESM(require("apache-arrow"), 1);
|
|
2275
|
+
function getFixedSizeListSize(vector) {
|
|
2276
|
+
return vector.type instanceof arrow8.FixedSizeList ? vector.type.listSize : 1;
|
|
2277
|
+
}
|
|
2278
|
+
function getFixedSizeListVector(typedArray, stride, logicalType) {
|
|
2279
|
+
const data = getFixedSizeListData(typedArray, stride, logicalType);
|
|
2280
|
+
return new arrow8.Vector([data]);
|
|
2281
|
+
}
|
|
2282
|
+
function getFixedSizeListData(typedArray, stride, logicalType) {
|
|
2283
|
+
const listType = getFixedSizeListType(typedArray, stride, logicalType);
|
|
2284
|
+
const nestedType = listType.children[0].type;
|
|
2285
|
+
const storage = logicalType === "float16" && isNativeFloat16Array(typedArray) ? getFloat16Storage(typedArray) : typedArray;
|
|
2286
|
+
const buffers = {
|
|
2287
|
+
// valueOffsets: undefined,
|
|
2288
|
+
[arrow8.BufferType.DATA]: storage
|
|
2289
|
+
// values
|
|
2290
|
+
// nullBitmap: undefined,
|
|
2291
|
+
// typeIds: undefined
|
|
2292
|
+
};
|
|
2293
|
+
const nestedData = new arrow8.Data(nestedType, 0, storage.length, 0, buffers);
|
|
2294
|
+
const data = new arrow8.Data(
|
|
2295
|
+
listType,
|
|
2296
|
+
0,
|
|
2297
|
+
storage.length / stride,
|
|
2298
|
+
0,
|
|
2299
|
+
void 0,
|
|
2300
|
+
[nestedData]
|
|
2301
|
+
);
|
|
2302
|
+
return data;
|
|
2303
|
+
}
|
|
2304
|
+
function getFixedSizeListType(typedArray, stride, logicalType) {
|
|
2305
|
+
const type = logicalType || getDataTypeFromArray(typedArray).type;
|
|
2306
|
+
const arrowType = deserializeArrowType(type);
|
|
2307
|
+
const listType = new arrow8.FixedSizeList(stride, new arrow8.Field("value", arrowType, false));
|
|
2308
|
+
return listType;
|
|
2309
|
+
}
|
|
2310
|
+
|
|
2311
|
+
// src/schema-utils/lib/mesh/convert-mesh-to-table.ts
|
|
2312
|
+
var MESH_ARROW_ATTRIBUTE_ORDER = ["POSITION"];
|
|
2313
|
+
function convertMeshToTable(mesh, shape) {
|
|
2314
|
+
switch (shape) {
|
|
2315
|
+
case "columnar-table":
|
|
2316
|
+
return convertMeshToColumnarTable(mesh);
|
|
2317
|
+
case "arrow-table":
|
|
2318
|
+
return convertMeshToArrowTable(mesh);
|
|
2319
|
+
default:
|
|
2320
|
+
throw new Error(shape);
|
|
2321
|
+
}
|
|
2322
|
+
}
|
|
2323
|
+
function convertMeshToColumnarTable(mesh) {
|
|
2324
|
+
const columns = {};
|
|
2325
|
+
const hasIndices = hasMeshIndices(mesh);
|
|
2326
|
+
for (const [columnName, attribute] of Object.entries(mesh.attributes)) {
|
|
2327
|
+
columns[columnName] = attribute.value;
|
|
2328
|
+
}
|
|
2329
|
+
return {
|
|
2330
|
+
shape: "columnar-table",
|
|
2331
|
+
schema: mesh.schema,
|
|
2332
|
+
data: columns,
|
|
2333
|
+
topology: mesh.topology,
|
|
2334
|
+
indices: hasIndices ? mesh.indices : void 0
|
|
2335
|
+
};
|
|
2336
|
+
}
|
|
2337
|
+
function convertMeshToArrowTable(mesh, batchSize) {
|
|
2338
|
+
return makeMeshArrowTable(mesh.attributes, {
|
|
2339
|
+
schema: mesh.schema,
|
|
2340
|
+
topology: mesh.topology,
|
|
2341
|
+
mode: mesh.mode,
|
|
2342
|
+
boundingBox: mesh.header?.boundingBox,
|
|
2343
|
+
indices: hasMeshIndices(mesh) ? mesh.indices : void 0
|
|
2344
|
+
});
|
|
2345
|
+
}
|
|
2346
|
+
function makeMeshArrowTable(attributes, options = {}) {
|
|
2347
|
+
const fields = [];
|
|
2348
|
+
const columns = {};
|
|
2349
|
+
const attributeNames = getOrderedAttributeNames(attributes);
|
|
2350
|
+
for (const attributeName of attributeNames) {
|
|
2351
|
+
const attribute = attributes[attributeName];
|
|
2352
|
+
const { value, size = 1 } = attribute;
|
|
2353
|
+
const column = getAttributeArrowVector(value, size, attribute.componentType);
|
|
2354
|
+
columns[attributeName] = column;
|
|
2355
|
+
fields.push(
|
|
2356
|
+
getAttributeArrowField(options.schema, attributeName, column, attribute.componentType)
|
|
2357
|
+
);
|
|
2358
|
+
if (attributeName === "POSITION" && options.indices?.value?.length) {
|
|
2359
|
+
const indicesField = indexedMeshArrowSchema.fields.find((field) => field.name === "indices");
|
|
2360
|
+
columns.indices = getIndicesVector(options.indices.value, column.length, indicesField.type);
|
|
2361
|
+
fields.push(indicesField);
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
const arrowSchema = new arrow9.Schema(fields, getMeshArrowMetadata(options));
|
|
2365
|
+
const table = columns[attributeNames[0]]?.length === 0 ? new arrow9.Table(arrowSchema) : new arrow9.Table(arrowSchema, columns);
|
|
2366
|
+
const schema = serializeArrowSchema(table.schema);
|
|
2367
|
+
return {
|
|
2368
|
+
shape: "arrow-table",
|
|
2369
|
+
schema,
|
|
2370
|
+
data: table,
|
|
2371
|
+
topology: options.topology || "point-list",
|
|
2372
|
+
indices: options.indices
|
|
2373
|
+
};
|
|
2374
|
+
}
|
|
2375
|
+
function getAttributeArrowVector(value, size, componentType) {
|
|
2376
|
+
if (componentType === "float16") {
|
|
2377
|
+
const storage = isNativeFloat16Array(value) ? getFloat16Storage(value) : value;
|
|
2378
|
+
if (size === 1) {
|
|
2379
|
+
const data = new arrow9.Data(new arrow9.Float16(), 0, storage.length, 0, {
|
|
2380
|
+
[arrow9.BufferType.DATA]: storage
|
|
2381
|
+
});
|
|
2382
|
+
return new arrow9.Vector([data]);
|
|
2383
|
+
}
|
|
2384
|
+
return getFixedSizeListVector(value, size, componentType);
|
|
2385
|
+
}
|
|
2386
|
+
return size === 1 ? arrow9.makeVector(value) : getFixedSizeListVector(value, size);
|
|
2387
|
+
}
|
|
2388
|
+
function getOrderedAttributeNames(attributes) {
|
|
2389
|
+
const attributeNames = Object.keys(attributes);
|
|
2390
|
+
const orderedAttributeNames = MESH_ARROW_ATTRIBUTE_ORDER.filter(
|
|
2391
|
+
(attributeName) => attributeName in attributes
|
|
2392
|
+
);
|
|
2393
|
+
const remainingAttributeNames = attributeNames.filter(
|
|
2394
|
+
(attributeName) => !MESH_ARROW_ATTRIBUTE_ORDER.includes(attributeName)
|
|
2395
|
+
);
|
|
2396
|
+
return [...orderedAttributeNames, ...remainingAttributeNames];
|
|
2397
|
+
}
|
|
2398
|
+
function hasMeshIndices(mesh) {
|
|
2399
|
+
return Boolean(mesh.indices?.value?.length);
|
|
2400
|
+
}
|
|
2401
|
+
function getAttributeArrowField(schema, attributeName, column, componentType) {
|
|
2402
|
+
if (attributeName === "POSITION" && isMeshPositionColumn(column)) {
|
|
2403
|
+
const canonicalField = meshArrowSchema.fields[0];
|
|
2404
|
+
const suppliedField = schema?.fields.find((schemaField) => schemaField.name === attributeName);
|
|
2405
|
+
if (!suppliedField?.metadata) {
|
|
2406
|
+
return canonicalField;
|
|
2407
|
+
}
|
|
2408
|
+
const metadata = new Map(canonicalField.metadata);
|
|
2409
|
+
for (const [key, value] of Object.entries(suppliedField.metadata)) {
|
|
2410
|
+
metadata.set(key, value);
|
|
2411
|
+
}
|
|
2412
|
+
return new arrow9.Field(
|
|
2413
|
+
canonicalField.name,
|
|
2414
|
+
canonicalField.type,
|
|
2415
|
+
canonicalField.nullable,
|
|
2416
|
+
metadata
|
|
2417
|
+
);
|
|
2418
|
+
}
|
|
2419
|
+
const field = schema?.fields.find((schemaField) => schemaField.name === attributeName);
|
|
2420
|
+
if (componentType === "float16") {
|
|
2421
|
+
const metadata = new Map(Object.entries(field?.metadata || {}));
|
|
2422
|
+
metadata.set("componentType", "float16");
|
|
2423
|
+
return new arrow9.Field(attributeName, column.type, false, metadata);
|
|
2424
|
+
}
|
|
2425
|
+
if (field && field.type.toString() !== column.type.toString()) {
|
|
2426
|
+
const deserializedField = deserializeArrowField(field);
|
|
2427
|
+
return new arrow9.Field(
|
|
2428
|
+
attributeName,
|
|
2429
|
+
column.type,
|
|
2430
|
+
deserializedField.nullable,
|
|
2431
|
+
deserializedField.metadata
|
|
2432
|
+
);
|
|
2433
|
+
}
|
|
2434
|
+
return field ? deserializeArrowField(field) : new arrow9.Field(attributeName, column.type, false);
|
|
2435
|
+
}
|
|
2436
|
+
function isMeshPositionColumn(column) {
|
|
2437
|
+
return column.type instanceof arrow9.FixedSizeList && column.type.listSize === 3 && column.type.children[0].type instanceof arrow9.Float32;
|
|
2438
|
+
}
|
|
2439
|
+
function getIndicesVector(indices, vertexCount, type) {
|
|
2440
|
+
const indicesType = type;
|
|
2441
|
+
const values = indices instanceof Uint32Array ? indices : Uint32Array.from(indices);
|
|
2442
|
+
const valueOffsets = new Int32Array(vertexCount + 1);
|
|
2443
|
+
if (vertexCount > 0) {
|
|
2444
|
+
valueOffsets.fill(values.length, 1);
|
|
2445
|
+
}
|
|
2446
|
+
const nullBitmap = new Uint8Array(Math.ceil(vertexCount / 8));
|
|
2447
|
+
if (vertexCount > 0) {
|
|
2448
|
+
nullBitmap[0] = 1;
|
|
2449
|
+
}
|
|
2450
|
+
const valuesData = new arrow9.Data(
|
|
2451
|
+
indicesType.children[0].type,
|
|
2452
|
+
0,
|
|
2453
|
+
values.length,
|
|
2454
|
+
0,
|
|
2455
|
+
{ [arrow9.BufferType.DATA]: values }
|
|
2456
|
+
);
|
|
2457
|
+
const indicesData = new arrow9.Data(
|
|
2458
|
+
indicesType,
|
|
2459
|
+
0,
|
|
2460
|
+
vertexCount,
|
|
2461
|
+
Math.max(0, vertexCount - 1),
|
|
2462
|
+
{
|
|
2463
|
+
[arrow9.BufferType.OFFSET]: valueOffsets,
|
|
2464
|
+
[arrow9.BufferType.VALIDITY]: nullBitmap
|
|
2465
|
+
},
|
|
2466
|
+
[valuesData]
|
|
2467
|
+
);
|
|
2468
|
+
return new arrow9.Vector([indicesData]);
|
|
2469
|
+
}
|
|
2470
|
+
function getMeshArrowMetadata(options) {
|
|
2471
|
+
const metadata = { ...options.schema?.metadata };
|
|
2472
|
+
if (options.topology) {
|
|
2473
|
+
metadata.topology ||= options.topology;
|
|
2474
|
+
}
|
|
2475
|
+
if (Number.isFinite(options.mode)) {
|
|
2476
|
+
metadata.mode ||= String(options.mode);
|
|
2477
|
+
}
|
|
2478
|
+
if (options.boundingBox) {
|
|
2479
|
+
metadata.boundingBox ||= JSON.stringify(options.boundingBox);
|
|
2480
|
+
}
|
|
2481
|
+
return deserializeArrowMetadata(metadata);
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
// src/schema-utils/lib/mesh/convert-table-to-mesh.ts
|
|
2485
|
+
var arrow10 = __toESM(require("apache-arrow"), 1);
|
|
2486
|
+
function convertTableToMesh(table) {
|
|
2487
|
+
switch (table.shape) {
|
|
2488
|
+
// case 'columnar-table':
|
|
2489
|
+
// return convertColumnarTableToMesh(table);
|
|
2490
|
+
case "arrow-table":
|
|
2491
|
+
return convertArrowTableToMesh(table);
|
|
2492
|
+
default:
|
|
2493
|
+
throw new Error(table.shape);
|
|
2494
|
+
}
|
|
2495
|
+
}
|
|
2496
|
+
function convertArrowTableToMesh(table) {
|
|
2497
|
+
const arrowTable = table.data;
|
|
2498
|
+
const schema = serializeArrowSchema(arrowTable.schema);
|
|
2499
|
+
const fields = schema.fields;
|
|
2500
|
+
const attributes = {};
|
|
2501
|
+
const columns = [];
|
|
2502
|
+
for (const field of fields) {
|
|
2503
|
+
const { name } = field;
|
|
2504
|
+
if (name === "indices") {
|
|
2505
|
+
continue;
|
|
2506
|
+
}
|
|
2507
|
+
const attributeData = arrowTable.getChild(name);
|
|
2508
|
+
const size = getFixedSizeListSize(attributeData);
|
|
2509
|
+
const typedArray = getAttributeTypedArray(attributeData, size);
|
|
2510
|
+
const metadata = getMeshAttributeMetadata(field.metadata);
|
|
2511
|
+
const value = metadata.componentType === "float16" ? restoreFloat16Array(typedArray) : typedArray;
|
|
2512
|
+
const shared = columns.find(
|
|
2513
|
+
(column) => column.data.length === attributeData.data.length && attributes[column.name].value.constructor === value.constructor && column.data.every((chunk, index) => shareArrowStorage(chunk, attributeData.data[index]))
|
|
2514
|
+
);
|
|
2515
|
+
attributes[name] = {
|
|
2516
|
+
value: shared ? attributes[shared.name].value : value,
|
|
2517
|
+
size,
|
|
2518
|
+
...metadata
|
|
2519
|
+
};
|
|
2520
|
+
if (!shared) columns.push({ name, data: attributeData.data });
|
|
2521
|
+
}
|
|
2522
|
+
fixMetadata(schema);
|
|
2523
|
+
const topology = schema.metadata.topology;
|
|
2524
|
+
const mode = getMeshMode(schema);
|
|
2525
|
+
const indices = getIndices(arrowTable);
|
|
2526
|
+
const boundingBox = attributes.POSITION?.transform?.type === "quantization" ? getMeshBoundingBoxFromSchema(schema) || getMeshBoundingBox(attributes) : getMeshBoundingBox(attributes);
|
|
2527
|
+
return {
|
|
2528
|
+
schema,
|
|
2529
|
+
attributes,
|
|
2530
|
+
topology,
|
|
2531
|
+
mode,
|
|
2532
|
+
indices,
|
|
2533
|
+
header: {
|
|
2534
|
+
vertexCount: arrowTable.numRows,
|
|
2535
|
+
boundingBox: boundingBox ?? void 0
|
|
2536
|
+
}
|
|
2537
|
+
};
|
|
2538
|
+
}
|
|
2539
|
+
function getMeshBoundingBoxFromSchema(schema) {
|
|
2540
|
+
const serializedBoundingBox = schema.metadata?.boundingBox;
|
|
2541
|
+
if (!serializedBoundingBox) {
|
|
2542
|
+
return null;
|
|
2543
|
+
}
|
|
2544
|
+
try {
|
|
2545
|
+
const boundingBox = JSON.parse(serializedBoundingBox);
|
|
2546
|
+
if (Array.isArray(boundingBox) && boundingBox.length === 2 && boundingBox.every(
|
|
2547
|
+
(corner) => Array.isArray(corner) && corner.length === 3 && corner.every((value) => typeof value === "number")
|
|
2548
|
+
)) {
|
|
2549
|
+
return boundingBox;
|
|
2550
|
+
}
|
|
2551
|
+
} catch {
|
|
2552
|
+
}
|
|
2553
|
+
return null;
|
|
2554
|
+
}
|
|
2555
|
+
function getMeshAttributeMetadata(metadata = {}) {
|
|
2556
|
+
const result = {};
|
|
2557
|
+
if (metadata.byteOffset !== void 0) {
|
|
2558
|
+
result.byteOffset = Number(metadata.byteOffset);
|
|
2559
|
+
}
|
|
2560
|
+
if (metadata.byteStride !== void 0) {
|
|
2561
|
+
result.byteStride = Number(metadata.byteStride);
|
|
2562
|
+
}
|
|
2563
|
+
if (metadata.normalized !== void 0) {
|
|
2564
|
+
result.normalized = metadata.normalized === "true";
|
|
2565
|
+
}
|
|
2566
|
+
if (metadata.componentType === "float16") {
|
|
2567
|
+
result.componentType = "float16";
|
|
2568
|
+
}
|
|
2569
|
+
if (metadata["loaders.gl.transform"]) {
|
|
2570
|
+
try {
|
|
2571
|
+
const transform = JSON.parse(metadata["loaders.gl.transform"]);
|
|
2572
|
+
if (isMeshAttributeTransform(transform)) {
|
|
2573
|
+
result.transform = transform;
|
|
2574
|
+
}
|
|
2575
|
+
} catch {
|
|
2576
|
+
}
|
|
2577
|
+
}
|
|
2578
|
+
return result;
|
|
2579
|
+
}
|
|
2580
|
+
function isMeshAttributeTransform(value) {
|
|
2581
|
+
if (!value || typeof value !== "object" || !("type" in value)) {
|
|
2582
|
+
return false;
|
|
2583
|
+
}
|
|
2584
|
+
const transform = value;
|
|
2585
|
+
if (transform.type === "octahedron") {
|
|
2586
|
+
return Number.isInteger(transform.bits) && transform.bits >= 1 && transform.bits <= 30;
|
|
2587
|
+
}
|
|
2588
|
+
return transform.type === "quantization" && Number.isInteger(transform.bits) && transform.bits >= 1 && transform.bits <= 30 && Array.isArray(transform.origin) && transform.origin.every((component) => typeof component === "number") && typeof transform.range === "number";
|
|
2589
|
+
}
|
|
2590
|
+
function fixMetadata(schema) {
|
|
2591
|
+
schema.metadata ||= {};
|
|
2592
|
+
schema.metadata.topology ||= "point-list";
|
|
2593
|
+
schema.metadata.mode ||= "0";
|
|
2594
|
+
}
|
|
2595
|
+
function getAttributeTypedArray(attributeData, size) {
|
|
2596
|
+
if (!(attributeData.type instanceof arrow10.FixedSizeList)) {
|
|
2597
|
+
return attributeData.toArray();
|
|
2598
|
+
}
|
|
2599
|
+
const values = attributeData.data[0].children[0].values;
|
|
2600
|
+
const TypedArrayConstructor = values.constructor;
|
|
2601
|
+
const typedArray = new TypedArrayConstructor(attributeData.length * size);
|
|
2602
|
+
let targetOffset = 0;
|
|
2603
|
+
for (const data of attributeData.data) {
|
|
2604
|
+
const child = data.children[0];
|
|
2605
|
+
const sourceLength = data.length * size;
|
|
2606
|
+
const sourceOffset = child.offset || data.offset * size;
|
|
2607
|
+
const sourceStart = sourceOffset + sourceLength <= child.values.length ? sourceOffset : 0;
|
|
2608
|
+
const source = child.values.subarray(sourceStart, sourceStart + sourceLength);
|
|
2609
|
+
typedArray.set(source, targetOffset);
|
|
2610
|
+
targetOffset += sourceLength;
|
|
2611
|
+
}
|
|
2612
|
+
return typedArray;
|
|
2613
|
+
}
|
|
2614
|
+
function restoreFloat16Array(typedArray) {
|
|
2615
|
+
const result = createFloat16Array(typedArray.length);
|
|
2616
|
+
for (let index = 0; index < typedArray.length; index++) {
|
|
2617
|
+
setFloat16Value(result, index, getFloat16Value(typedArray, index));
|
|
2618
|
+
}
|
|
2619
|
+
return result;
|
|
2620
|
+
}
|
|
2621
|
+
function getMeshMode(schema) {
|
|
2622
|
+
const mode = Number(schema.metadata?.mode);
|
|
2623
|
+
return Number.isFinite(mode) ? mode : 0;
|
|
2624
|
+
}
|
|
2625
|
+
function getIndices(arrowTable) {
|
|
2626
|
+
const indicesColumn = arrowTable.getChild("indices");
|
|
2627
|
+
if (!indicesColumn?.isValid(0)) {
|
|
2628
|
+
return void 0;
|
|
2629
|
+
}
|
|
2630
|
+
const indicesData = indicesColumn.data[0];
|
|
2631
|
+
const valueOffsets = indicesData.valueOffsets;
|
|
2632
|
+
const start = valueOffsets[indicesData.offset];
|
|
2633
|
+
const end = valueOffsets[indicesData.offset + 1];
|
|
2634
|
+
const values = indicesData.children[0].values.subarray(start, end);
|
|
2635
|
+
return { value: values, size: 1 };
|
|
2636
|
+
}
|
|
2637
|
+
function shareArrowStorage(left, right) {
|
|
2638
|
+
const rightBuffers = Object.values(right.buffers);
|
|
2639
|
+
return left.type.toString() === right.type.toString() && left.offset === right.offset && left.length === right.length && left.nullCount === right.nullCount && left.dictionary === right.dictionary && Object.values(left.buffers).every((buffer, index) => {
|
|
2640
|
+
const other = rightBuffers[index];
|
|
2641
|
+
return buffer === other || Boolean(
|
|
2642
|
+
buffer && other && buffer.buffer === other.buffer && buffer.byteOffset === other.byteOffset && buffer.byteLength === other.byteLength
|
|
2643
|
+
);
|
|
2644
|
+
}) && left.children.length === right.children.length && left.children.every((child, index) => shareArrowStorage(child, right.children[index]));
|
|
2645
|
+
}
|
|
2646
|
+
|
|
2647
|
+
// src/schema-utils/lib/mesh/deduce-mesh-schema.ts
|
|
2648
|
+
function deduceMeshSchema(attributes, metadata = {}) {
|
|
2649
|
+
const fields = deduceMeshFields(attributes);
|
|
2650
|
+
return { fields, metadata };
|
|
2651
|
+
}
|
|
2652
|
+
function deduceMeshField(name, attribute, optionalMetadata) {
|
|
2653
|
+
const type = attribute.componentType || getDataTypeFromTypedArray(attribute.value);
|
|
2654
|
+
const metadata = optionalMetadata ? optionalMetadata : makeMeshAttributeMetadata(attribute);
|
|
2655
|
+
const dataType = attribute.size === 1 ? type : { type: "fixed-size-list", listSize: attribute.size, children: [{ name: "value", type }] };
|
|
2656
|
+
return {
|
|
2657
|
+
name,
|
|
2658
|
+
type: dataType,
|
|
2659
|
+
nullable: false,
|
|
2660
|
+
metadata
|
|
2661
|
+
};
|
|
2662
|
+
}
|
|
2663
|
+
function deduceMeshFields(attributes) {
|
|
2664
|
+
const fields = [];
|
|
2665
|
+
for (const attributeName in attributes) {
|
|
2666
|
+
const attribute = attributes[attributeName];
|
|
2667
|
+
fields.push(deduceMeshField(attributeName, attribute));
|
|
2668
|
+
}
|
|
2669
|
+
return fields;
|
|
2670
|
+
}
|
|
2671
|
+
function makeMeshAttributeMetadata(attribute) {
|
|
2672
|
+
const result = {};
|
|
2673
|
+
if ("byteOffset" in attribute) {
|
|
2674
|
+
result.byteOffset = attribute.byteOffset.toString(10);
|
|
2675
|
+
}
|
|
2676
|
+
if ("byteStride" in attribute) {
|
|
2677
|
+
result.byteStride = attribute.byteStride.toString(10);
|
|
2678
|
+
}
|
|
2679
|
+
if ("normalized" in attribute) {
|
|
2680
|
+
result.normalized = attribute.normalized.toString();
|
|
2681
|
+
}
|
|
2682
|
+
if (attribute.componentType) {
|
|
2683
|
+
result.componentType = attribute.componentType;
|
|
2684
|
+
}
|
|
2685
|
+
if (attribute.transform) {
|
|
2686
|
+
result["loaders.gl.transform"] = JSON.stringify(attribute.transform);
|
|
2687
|
+
}
|
|
2688
|
+
return result;
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
// src/schema-utils/lib/table/arrow-api/enum.ts
|
|
2692
|
+
var Type = /* @__PURE__ */ ((Type2) => {
|
|
2693
|
+
Type2[Type2["NONE"] = 0] = "NONE";
|
|
2694
|
+
Type2[Type2["Null"] = 1] = "Null";
|
|
2695
|
+
Type2[Type2["Int"] = 2] = "Int";
|
|
2696
|
+
Type2[Type2["Float"] = 3] = "Float";
|
|
2697
|
+
Type2[Type2["Binary"] = 4] = "Binary";
|
|
2698
|
+
Type2[Type2["Utf8"] = 5] = "Utf8";
|
|
2699
|
+
Type2[Type2["Bool"] = 6] = "Bool";
|
|
2700
|
+
Type2[Type2["Decimal"] = 7] = "Decimal";
|
|
2701
|
+
Type2[Type2["Date"] = 8] = "Date";
|
|
2702
|
+
Type2[Type2["Time"] = 9] = "Time";
|
|
2703
|
+
Type2[Type2["Timestamp"] = 10] = "Timestamp";
|
|
2704
|
+
Type2[Type2["Interval"] = 11] = "Interval";
|
|
2705
|
+
Type2[Type2["List"] = 12] = "List";
|
|
2706
|
+
Type2[Type2["Struct"] = 13] = "Struct";
|
|
2707
|
+
Type2[Type2["Union"] = 14] = "Union";
|
|
2708
|
+
Type2[Type2["FixedSizeBinary"] = 15] = "FixedSizeBinary";
|
|
2709
|
+
Type2[Type2["FixedSizeList"] = 16] = "FixedSizeList";
|
|
2710
|
+
Type2[Type2["Map"] = 17] = "Map";
|
|
2711
|
+
Type2[Type2["Dictionary"] = -1] = "Dictionary";
|
|
2712
|
+
Type2[Type2["Int8"] = -2] = "Int8";
|
|
2713
|
+
Type2[Type2["Int16"] = -3] = "Int16";
|
|
2714
|
+
Type2[Type2["Int32"] = -4] = "Int32";
|
|
2715
|
+
Type2[Type2["Int64"] = -5] = "Int64";
|
|
2716
|
+
Type2[Type2["Uint8"] = -6] = "Uint8";
|
|
2717
|
+
Type2[Type2["Uint16"] = -7] = "Uint16";
|
|
2718
|
+
Type2[Type2["Uint32"] = -8] = "Uint32";
|
|
2719
|
+
Type2[Type2["Uint64"] = -9] = "Uint64";
|
|
2720
|
+
Type2[Type2["Float16"] = -10] = "Float16";
|
|
2721
|
+
Type2[Type2["Float32"] = -11] = "Float32";
|
|
2722
|
+
Type2[Type2["Float64"] = -12] = "Float64";
|
|
2723
|
+
Type2[Type2["DateDay"] = -13] = "DateDay";
|
|
2724
|
+
Type2[Type2["DateMillisecond"] = -14] = "DateMillisecond";
|
|
2725
|
+
Type2[Type2["TimestampSecond"] = -15] = "TimestampSecond";
|
|
2726
|
+
Type2[Type2["TimestampMillisecond"] = -16] = "TimestampMillisecond";
|
|
2727
|
+
Type2[Type2["TimestampMicrosecond"] = -17] = "TimestampMicrosecond";
|
|
2728
|
+
Type2[Type2["TimestampNanosecond"] = -18] = "TimestampNanosecond";
|
|
2729
|
+
Type2[Type2["TimeSecond"] = -19] = "TimeSecond";
|
|
2730
|
+
Type2[Type2["TimeMillisecond"] = -20] = "TimeMillisecond";
|
|
2731
|
+
Type2[Type2["TimeMicrosecond"] = -21] = "TimeMicrosecond";
|
|
2732
|
+
Type2[Type2["TimeNanosecond"] = -22] = "TimeNanosecond";
|
|
2733
|
+
Type2[Type2["DenseUnion"] = -23] = "DenseUnion";
|
|
2734
|
+
Type2[Type2["SparseUnion"] = -24] = "SparseUnion";
|
|
2735
|
+
Type2[Type2["IntervalDayTime"] = -25] = "IntervalDayTime";
|
|
2736
|
+
Type2[Type2["IntervalYearMonth"] = -26] = "IntervalYearMonth";
|
|
2737
|
+
return Type2;
|
|
2738
|
+
})(Type || {});
|
|
2739
|
+
|
|
2740
|
+
// src/schema-utils/lib/table/arrow-api/arrow-like-type.ts
|
|
2741
|
+
var DataType3 = class {
|
|
2742
|
+
static isNull(x) {
|
|
2743
|
+
return x && x.typeId === 1 /* Null */;
|
|
2744
|
+
}
|
|
2745
|
+
static isInt(x) {
|
|
2746
|
+
return x && x.typeId === 2 /* Int */;
|
|
2747
|
+
}
|
|
2748
|
+
static isFloat(x) {
|
|
2749
|
+
return x && x.typeId === 3 /* Float */;
|
|
2750
|
+
}
|
|
2751
|
+
static isBinary(x) {
|
|
2752
|
+
return x && x.typeId === 4 /* Binary */;
|
|
2753
|
+
}
|
|
2754
|
+
static isUtf8(x) {
|
|
2755
|
+
return x && x.typeId === 5 /* Utf8 */;
|
|
2756
|
+
}
|
|
2757
|
+
static isBool(x) {
|
|
2758
|
+
return x && x.typeId === 6 /* Bool */;
|
|
2759
|
+
}
|
|
2760
|
+
static isDecimal(x) {
|
|
2761
|
+
return x && x.typeId === 7 /* Decimal */;
|
|
2762
|
+
}
|
|
2763
|
+
static isDate(x) {
|
|
2764
|
+
return x && x.typeId === 8 /* Date */;
|
|
2765
|
+
}
|
|
2766
|
+
static isTime(x) {
|
|
2767
|
+
return x && x.typeId === 9 /* Time */;
|
|
2768
|
+
}
|
|
2769
|
+
static isTimestamp(x) {
|
|
2770
|
+
return x && x.typeId === 10 /* Timestamp */;
|
|
2771
|
+
}
|
|
2772
|
+
static isInterval(x) {
|
|
2773
|
+
return x && x.typeId === 11 /* Interval */;
|
|
2774
|
+
}
|
|
2775
|
+
static isList(x) {
|
|
2776
|
+
return x && x.typeId === 12 /* List */;
|
|
2777
|
+
}
|
|
2778
|
+
static isStruct(x) {
|
|
2779
|
+
return x && x.typeId === 13 /* Struct */;
|
|
2780
|
+
}
|
|
2781
|
+
static isUnion(x) {
|
|
2782
|
+
return x && x.typeId === 14 /* Union */;
|
|
2783
|
+
}
|
|
2784
|
+
static isFixedSizeBinary(x) {
|
|
2785
|
+
return x && x.typeId === 15 /* FixedSizeBinary */;
|
|
2786
|
+
}
|
|
2787
|
+
static isFixedSizeList(x) {
|
|
2788
|
+
return x && x.typeId === 16 /* FixedSizeList */;
|
|
2789
|
+
}
|
|
2790
|
+
static isMap(x) {
|
|
2791
|
+
return x && x.typeId === 17 /* Map */;
|
|
2792
|
+
}
|
|
2793
|
+
static isDictionary(x) {
|
|
2794
|
+
return x && x.typeId === -1 /* Dictionary */;
|
|
2795
|
+
}
|
|
2796
|
+
get typeId() {
|
|
2797
|
+
return 0 /* NONE */;
|
|
2798
|
+
}
|
|
2799
|
+
// get ArrayType(): AnyArrayType {
|
|
2800
|
+
// return Int8Array;
|
|
2801
|
+
// }
|
|
2802
|
+
// get ArrayType() { return Array; }
|
|
2803
|
+
compareTo(other) {
|
|
2804
|
+
return this === other;
|
|
2805
|
+
}
|
|
2806
|
+
};
|
|
2807
|
+
|
|
2808
|
+
// src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts
|
|
2809
|
+
var arrow11 = __toESM(require("apache-arrow"), 1);
|
|
2810
|
+
var ArrowTableBuilder = class {
|
|
2811
|
+
schema;
|
|
2812
|
+
arrowSchema;
|
|
2813
|
+
arrowBuilders;
|
|
2814
|
+
length;
|
|
2815
|
+
constructor(schema, options) {
|
|
2816
|
+
this.arrowSchema = convertSchemaToArrow(schema, options);
|
|
2817
|
+
this.schema = options?.viewTypes && options.viewTypes !== "never" ? convertArrowToSchema(this.arrowSchema) : schema;
|
|
2818
|
+
this.arrowBuilders = this.arrowSchema.fields.map(
|
|
2819
|
+
(field) => arrow11.makeBuilder({ type: field.type, nullValues: [null] })
|
|
2820
|
+
);
|
|
2821
|
+
this.length = 0;
|
|
2822
|
+
}
|
|
2823
|
+
addObjectRow(row) {
|
|
2824
|
+
for (let i = 0; i < this.arrowBuilders.length; i++) {
|
|
2825
|
+
const columnName = this.schema.fields[i].name;
|
|
2826
|
+
const value = row[columnName];
|
|
2827
|
+
this.arrowBuilders[i].append(value);
|
|
2828
|
+
}
|
|
2829
|
+
this.length++;
|
|
2830
|
+
}
|
|
2831
|
+
addArrayRow(row) {
|
|
2832
|
+
for (let i = 0; i < this.arrowBuilders.length; i++) {
|
|
2833
|
+
this.arrowBuilders[i].append(row[i]);
|
|
2834
|
+
}
|
|
2835
|
+
this.length++;
|
|
2836
|
+
}
|
|
2837
|
+
/** Makes sure that a first batch with schema is sent even if no rows */
|
|
2838
|
+
firstBatch() {
|
|
2839
|
+
const arrowRecordBatch = this._getArrowRecordBatch();
|
|
2840
|
+
if (arrowRecordBatch.numCols !== 0) {
|
|
2841
|
+
return null;
|
|
2842
|
+
}
|
|
2843
|
+
return {
|
|
2844
|
+
shape: "arrow-table",
|
|
2845
|
+
batchType: "data",
|
|
2846
|
+
length: arrowRecordBatch.numRows,
|
|
2847
|
+
schema: this.schema,
|
|
2848
|
+
data: new arrow11.Table(arrowRecordBatch)
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
/** Flush the current batch if conditions are right */
|
|
2852
|
+
flushBatch() {
|
|
2853
|
+
const arrowRecordBatch = this._getArrowRecordBatch();
|
|
2854
|
+
if (arrowRecordBatch.numCols === 0) {
|
|
2855
|
+
return null;
|
|
2856
|
+
}
|
|
2857
|
+
return {
|
|
2858
|
+
shape: "arrow-table",
|
|
2859
|
+
batchType: "data",
|
|
2860
|
+
length: arrowRecordBatch.numRows,
|
|
2861
|
+
schema: this.schema,
|
|
2862
|
+
data: new arrow11.Table(arrowRecordBatch)
|
|
2863
|
+
};
|
|
2864
|
+
}
|
|
2865
|
+
/** Get a last batch if any data is left */
|
|
2866
|
+
finishBatch() {
|
|
2867
|
+
const arrowRecordBatch = this._getArrowRecordBatch();
|
|
2868
|
+
this.arrowBuilders.forEach((builder) => builder.finish());
|
|
2869
|
+
if (arrowRecordBatch.numCols === 0 && arrowRecordBatch.numRows === 0) {
|
|
2870
|
+
return null;
|
|
2871
|
+
}
|
|
2872
|
+
return {
|
|
2873
|
+
shape: "arrow-table",
|
|
2874
|
+
batchType: "data",
|
|
2875
|
+
length: arrowRecordBatch.numRows,
|
|
2876
|
+
schema: this.schema,
|
|
2877
|
+
data: new arrow11.Table(arrowRecordBatch)
|
|
2878
|
+
};
|
|
2879
|
+
}
|
|
2880
|
+
/** Return a table with all the accumulated data */
|
|
2881
|
+
finishTable() {
|
|
2882
|
+
const arrowRecordBatch = this._getArrowRecordBatch();
|
|
2883
|
+
this.arrowBuilders.forEach((builder) => builder.finish());
|
|
2884
|
+
return {
|
|
2885
|
+
shape: "arrow-table",
|
|
2886
|
+
schema: this.schema,
|
|
2887
|
+
data: new arrow11.Table(arrowRecordBatch)
|
|
2888
|
+
};
|
|
2889
|
+
}
|
|
2890
|
+
/** Extract a record batch flushing the currently accumulated data in the builders */
|
|
2891
|
+
_getArrowRecordBatch() {
|
|
2892
|
+
const { arrowBuilders, arrowSchema } = this;
|
|
2893
|
+
const arrowDatas = arrowBuilders.map((builder) => builder.flush());
|
|
2894
|
+
const length = arrowDatas[0]?.length || this.length;
|
|
2895
|
+
this.length = 0;
|
|
2896
|
+
const structField = new arrow11.Struct(arrowSchema.fields);
|
|
2897
|
+
const arrowStructData = new arrow11.Data(structField, 0, length, 0, void 0, arrowDatas);
|
|
2898
|
+
const arrowRecordBatch = new arrow11.RecordBatch(arrowSchema, arrowStructData);
|
|
2899
|
+
return arrowRecordBatch;
|
|
2900
|
+
}
|
|
2901
|
+
};
|
|
2902
|
+
|
|
2903
|
+
// src/schema-utils/lib/table/arrow-api/get-type-info.ts
|
|
2904
|
+
function getTypeInfo(arrowTypeLike) {
|
|
2905
|
+
return {
|
|
2906
|
+
typeId: arrowTypeLike.typeId,
|
|
2907
|
+
ArrayType: arrowTypeLike.ArrayType,
|
|
2908
|
+
typeName: arrowTypeLike.toString(),
|
|
2909
|
+
typeEnumName: getTypeKey(arrowTypeLike.typeId),
|
|
2910
|
+
precision: arrowTypeLike.precision
|
|
2911
|
+
};
|
|
2912
|
+
}
|
|
2913
|
+
var ReverseType = null;
|
|
2914
|
+
function getTypeKey(typeKey) {
|
|
2915
|
+
if (!ReverseType) {
|
|
2916
|
+
ReverseType = {};
|
|
2917
|
+
for (const key in Type) {
|
|
2918
|
+
ReverseType[Type[key]] = key;
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
return ReverseType[typeKey];
|
|
2922
|
+
}
|
|
2923
|
+
|
|
2924
|
+
// src/schema-utils/lib/utils/async-queue.ts
|
|
2925
|
+
var ArrayQueue = class extends Array {
|
|
2926
|
+
enqueue(value) {
|
|
2927
|
+
return this.push(value);
|
|
2928
|
+
}
|
|
2929
|
+
dequeue() {
|
|
2930
|
+
return this.shift();
|
|
2931
|
+
}
|
|
2932
|
+
};
|
|
2933
|
+
var AsyncQueue = class {
|
|
2934
|
+
_values;
|
|
2935
|
+
_settlers;
|
|
2936
|
+
_closed;
|
|
2937
|
+
constructor() {
|
|
2938
|
+
this._values = new ArrayQueue();
|
|
2939
|
+
this._settlers = new ArrayQueue();
|
|
2940
|
+
this._closed = false;
|
|
2941
|
+
}
|
|
2942
|
+
close() {
|
|
2943
|
+
while (this._settlers.length > 0) {
|
|
2944
|
+
this._settlers.dequeue().resolve({ done: true });
|
|
2945
|
+
}
|
|
2946
|
+
this._closed = true;
|
|
2947
|
+
}
|
|
2948
|
+
[Symbol.asyncIterator]() {
|
|
2949
|
+
return this;
|
|
2950
|
+
}
|
|
2951
|
+
enqueue(value) {
|
|
2952
|
+
if (this._closed) {
|
|
2953
|
+
throw new Error("Closed");
|
|
2954
|
+
}
|
|
2955
|
+
if (this._settlers.length > 0) {
|
|
2956
|
+
if (this._values.length > 0) {
|
|
2957
|
+
throw new Error("Illegal internal state");
|
|
2958
|
+
}
|
|
2959
|
+
const settler = this._settlers.dequeue();
|
|
2960
|
+
if (value instanceof Error) {
|
|
2961
|
+
settler.reject(value);
|
|
2962
|
+
} else {
|
|
2963
|
+
settler.resolve({ value });
|
|
2964
|
+
}
|
|
2965
|
+
} else {
|
|
2966
|
+
this._values.enqueue(value);
|
|
2967
|
+
}
|
|
2968
|
+
}
|
|
2969
|
+
/**
|
|
2970
|
+
* @returns a Promise for an IteratorResult
|
|
2971
|
+
*/
|
|
2972
|
+
next() {
|
|
2973
|
+
if (this._values.length > 0) {
|
|
2974
|
+
const value = this._values.dequeue();
|
|
2975
|
+
if (value instanceof Error) {
|
|
2976
|
+
return Promise.reject(value);
|
|
2977
|
+
}
|
|
2978
|
+
return Promise.resolve({ value });
|
|
2979
|
+
}
|
|
2980
|
+
if (this._closed) {
|
|
2981
|
+
if (this._settlers.length > 0) {
|
|
2982
|
+
throw new Error("Illegal internal state");
|
|
2983
|
+
}
|
|
2984
|
+
return Promise.resolve({ done: true });
|
|
2985
|
+
}
|
|
2986
|
+
return new Promise((resolve, reject) => {
|
|
2987
|
+
this._settlers.enqueue({ resolve, reject });
|
|
2988
|
+
});
|
|
2989
|
+
}
|
|
2990
|
+
};
|
|
2991
|
+
|
|
2992
|
+
// src/schema-utils/lib/mesh/point-cloud-tiler.ts
|
|
2993
|
+
var PointCloudTiler = class {
|
|
2994
|
+
/** Resolves after validation, bounds calculation and root sampling. */
|
|
2995
|
+
ready;
|
|
2996
|
+
/** Exact number of validated source rows. */
|
|
2997
|
+
sourcePointCount = 0;
|
|
2998
|
+
/** Number of source point rows, available after ready. */
|
|
2999
|
+
get pointCount() {
|
|
3000
|
+
return this.sourcePointCount;
|
|
3001
|
+
}
|
|
3002
|
+
/** Lifetime cancellation, including close(). */
|
|
3003
|
+
controller = new AbortController();
|
|
3004
|
+
/** Resolved source and allocation limits. */
|
|
3005
|
+
options;
|
|
3006
|
+
/** Combined caller and lifetime cancellation. */
|
|
3007
|
+
signal;
|
|
3008
|
+
/** Source typed attributes, retained without copying Mesh inputs. */
|
|
3009
|
+
mesh = null;
|
|
3010
|
+
/** Discovered octree nodes. */
|
|
3011
|
+
nodes = /* @__PURE__ */ new Map();
|
|
3012
|
+
/** Live row-index bytes including intermediate allocations. */
|
|
3013
|
+
indexBytes = 0;
|
|
3014
|
+
/** Packed source bytes per row. */
|
|
3015
|
+
pointByteLength = 0;
|
|
3016
|
+
/** Starts indexing one decoded point dataset with explicit allocation limits. */
|
|
3017
|
+
constructor(input, options = {}) {
|
|
3018
|
+
this.options = {
|
|
3019
|
+
nodePointLimit: options.nodePointLimit ?? 5e4,
|
|
3020
|
+
maximumDepth: options.maximumDepth ?? 16,
|
|
3021
|
+
maxInputBytes: options.maxInputBytes ?? 512 * 1024 * 1024,
|
|
3022
|
+
maxIndexBytes: options.maxIndexBytes ?? 128 * 1024 * 1024,
|
|
3023
|
+
maxTileBytes: options.maxTileBytes ?? 64 * 1024 * 1024,
|
|
3024
|
+
maxNodes: options.maxNodes ?? 1e5
|
|
3025
|
+
};
|
|
3026
|
+
for (const [name, value] of Object.entries(this.options)) {
|
|
3027
|
+
if (!Number.isSafeInteger(value) || value < (name === "maximumDepth" ? 0 : 1))
|
|
3028
|
+
throw new Error(`PointCloudTiler: invalid ${name}`);
|
|
3029
|
+
}
|
|
3030
|
+
if (this.options.maximumDepth > 24 || this.options.nodePointLimit > 1e6)
|
|
3031
|
+
throw new Error("PointCloudTiler: maximumDepth must be <= 24 and nodePointLimit <= 1000000");
|
|
3032
|
+
this.signal = options.signal ? AbortSignal.any([options.signal, this.controller.signal]) : this.controller.signal;
|
|
3033
|
+
this.ready = this.initialize(input).catch((error) => {
|
|
3034
|
+
this.close();
|
|
3035
|
+
throw error;
|
|
3036
|
+
});
|
|
3037
|
+
}
|
|
3038
|
+
/** Returns the root after indexing, without discovering its children. */
|
|
3039
|
+
async getRootNode() {
|
|
3040
|
+
await this.ready;
|
|
3041
|
+
return this.getNode("r").node;
|
|
3042
|
+
}
|
|
3043
|
+
/** Returns checked source-owned metadata for an already discovered node. */
|
|
3044
|
+
async getNodeMetadata(id) {
|
|
3045
|
+
await this.ready;
|
|
3046
|
+
return this.getNode(id).node;
|
|
3047
|
+
}
|
|
3048
|
+
/** Partitions only the requested node, in deterministic octant order. */
|
|
3049
|
+
async getChildNodes(id) {
|
|
3050
|
+
await this.ready;
|
|
3051
|
+
const state = this.getNode(id);
|
|
3052
|
+
if (!state.childrenPromise) state.childrenPromise = this.splitNode(state);
|
|
3053
|
+
return state.childrenPromise;
|
|
3054
|
+
}
|
|
3055
|
+
/** Splits one node exactly once, sharing its result with concurrent callers. */
|
|
3056
|
+
async splitNode(state) {
|
|
3057
|
+
const id = state.node.id;
|
|
3058
|
+
if (state.children) return state.children;
|
|
3059
|
+
const groups = Array.from({ length: 8 }, () => 0);
|
|
3060
|
+
const midpoint = state.node.bounds[0].map(
|
|
3061
|
+
(value, axis) => value + (state.node.bounds[1][axis] - value) / 2
|
|
3062
|
+
);
|
|
3063
|
+
for (let index = 0; index < state.remaining.length; index++) {
|
|
3064
|
+
if (index % 65536 === 0) await this.checkpoint();
|
|
3065
|
+
groups[this.getOctant(state.remaining[index], midpoint)]++;
|
|
3066
|
+
}
|
|
3067
|
+
if (this.nodes.size + groups.filter((count) => count > 0).length > this.options.maxNodes)
|
|
3068
|
+
throw new Error("PointCloudTiler: node budget exceeded");
|
|
3069
|
+
const children = [];
|
|
3070
|
+
const partitions = [];
|
|
3071
|
+
try {
|
|
3072
|
+
for (const count of groups) partitions.push(this.allocateRows(count));
|
|
3073
|
+
const offsets = new Uint32Array(8);
|
|
3074
|
+
for (let index = 0; index < state.remaining.length; index++) {
|
|
3075
|
+
if (index % 65536 === 0) await this.checkpoint();
|
|
3076
|
+
const row = state.remaining[index];
|
|
3077
|
+
const octant = this.getOctant(row, midpoint);
|
|
3078
|
+
partitions[octant][offsets[octant]++] = row;
|
|
3079
|
+
}
|
|
3080
|
+
for (let octant = 0; octant < 8; octant++) {
|
|
3081
|
+
if (!partitions[octant].length) continue;
|
|
3082
|
+
const bounds = state.node.bounds.map((corner) => [...corner]);
|
|
3083
|
+
for (let axis = 0; axis < 3; axis++)
|
|
3084
|
+
bounds[octant & 4 >> axis ? 0 : 1][axis] = midpoint[axis];
|
|
3085
|
+
const child = await this.createNode(`${id}${octant}`, bounds, partitions[octant]);
|
|
3086
|
+
partitions[octant] = new Uint32Array(0);
|
|
3087
|
+
children.push(child.node);
|
|
3088
|
+
}
|
|
3089
|
+
this.releaseRows(state.remaining);
|
|
3090
|
+
state.remaining = new Uint32Array(0);
|
|
3091
|
+
state.children = Object.freeze(children);
|
|
3092
|
+
return state.children;
|
|
3093
|
+
} catch (error) {
|
|
3094
|
+
this.close();
|
|
3095
|
+
throw error;
|
|
3096
|
+
}
|
|
3097
|
+
}
|
|
3098
|
+
/** Gathers a fresh packed Mesh; source row IDs and attribute component widths are preserved. */
|
|
3099
|
+
async getTileMesh(id) {
|
|
3100
|
+
await this.ready;
|
|
3101
|
+
const state = this.getNode(id);
|
|
3102
|
+
const byteLength = state.rows.length * this.pointByteLength;
|
|
3103
|
+
if (byteLength > this.options.maxTileBytes)
|
|
3104
|
+
throw new Error("PointCloudTiler: tile byte budget exceeded");
|
|
3105
|
+
const attributes = {};
|
|
3106
|
+
const gatheredValues = /* @__PURE__ */ new Map();
|
|
3107
|
+
for (const [name, attribute] of Object.entries(this.mesh.attributes)) {
|
|
3108
|
+
const storageKey = getAttributeStorageKey(attribute);
|
|
3109
|
+
const sharedValue = gatheredValues.get(attribute.value.buffer)?.get(storageKey);
|
|
3110
|
+
if (sharedValue) {
|
|
3111
|
+
attributes[name] = { ...attribute, value: sharedValue, byteOffset: 0, byteStride: 0 };
|
|
3112
|
+
continue;
|
|
3113
|
+
}
|
|
3114
|
+
const Constructor = attribute.value.constructor;
|
|
3115
|
+
const value = new Constructor(state.rows.length * attribute.size);
|
|
3116
|
+
const sourceBytes = new Uint8Array(
|
|
3117
|
+
attribute.value.buffer,
|
|
3118
|
+
attribute.value.byteOffset,
|
|
3119
|
+
attribute.value.byteLength
|
|
3120
|
+
);
|
|
3121
|
+
const targetBytes = new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
3122
|
+
const bytesPerElement = attribute.value.BYTES_PER_ELEMENT;
|
|
3123
|
+
const rowBytes = attribute.size * bytesPerElement;
|
|
3124
|
+
const stride = attribute.byteStride || rowBytes;
|
|
3125
|
+
for (let index = 0; index < state.rows.length; index++) {
|
|
3126
|
+
if (index % 65536 === 0) await this.checkpoint();
|
|
3127
|
+
const offset = (attribute.byteOffset || 0) + state.rows[index] * stride;
|
|
3128
|
+
targetBytes.set(sourceBytes.subarray(offset, offset + rowBytes), index * rowBytes);
|
|
3129
|
+
}
|
|
3130
|
+
const storage = gatheredValues.get(attribute.value.buffer) ?? /* @__PURE__ */ new Map();
|
|
3131
|
+
storage.set(storageKey, value);
|
|
3132
|
+
gatheredValues.set(attribute.value.buffer, storage);
|
|
3133
|
+
attributes[name] = { ...attribute, value, byteOffset: 0, byteStride: 0 };
|
|
3134
|
+
}
|
|
3135
|
+
return {
|
|
3136
|
+
...this.mesh,
|
|
3137
|
+
attributes,
|
|
3138
|
+
topology: "point-list",
|
|
3139
|
+
mode: 0,
|
|
3140
|
+
indices: void 0,
|
|
3141
|
+
header: {
|
|
3142
|
+
vertexCount: state.rows.length,
|
|
3143
|
+
boundingBox: state.node.bounds.map((corner) => [...corner])
|
|
3144
|
+
},
|
|
3145
|
+
loaderData: { ...this.mesh.loaderData, pointCloudTileId: id }
|
|
3146
|
+
};
|
|
3147
|
+
}
|
|
3148
|
+
/** Releases retained attributes and index state and cancels subsequent operations. */
|
|
3149
|
+
close() {
|
|
3150
|
+
this.controller.abort(new Error("PointCloudTiler: closed"));
|
|
3151
|
+
this.mesh = null;
|
|
3152
|
+
this.nodes.clear();
|
|
3153
|
+
this.indexBytes = 0;
|
|
3154
|
+
}
|
|
3155
|
+
/** Validates the decoded profile and creates a root cube from finite native coordinates. */
|
|
3156
|
+
async initialize(input) {
|
|
3157
|
+
this.signal.throwIfAborted();
|
|
3158
|
+
if ("shape" in input) {
|
|
3159
|
+
const buffers2 = /* @__PURE__ */ new Set();
|
|
3160
|
+
let arrowBytes = 0;
|
|
3161
|
+
const checkData = (data) => {
|
|
3162
|
+
if (data.nullCount)
|
|
3163
|
+
throw new Error("PointCloudTiler: null point attributes require an explicit mapping");
|
|
3164
|
+
for (const view of Object.values(data.buffers)) {
|
|
3165
|
+
if (view && !buffers2.has(view.buffer)) {
|
|
3166
|
+
buffers2.add(view.buffer);
|
|
3167
|
+
arrowBytes += view.buffer.byteLength;
|
|
3168
|
+
}
|
|
3169
|
+
}
|
|
3170
|
+
for (const child of data.children) checkData(child);
|
|
3171
|
+
if (data.dictionary)
|
|
3172
|
+
for (const dictionaryData of data.dictionary.data) checkData(dictionaryData);
|
|
3173
|
+
};
|
|
3174
|
+
for (const batch of input.data.batches) checkData(batch.data);
|
|
3175
|
+
if (arrowBytes > this.options.maxInputBytes)
|
|
3176
|
+
throw new Error("PointCloudTiler: input byte budget exceeded");
|
|
3177
|
+
for (const column of input.data.schema.fields) {
|
|
3178
|
+
if (input.data.getChild(column.name)?.nullCount)
|
|
3179
|
+
throw new Error("PointCloudTiler: null point attributes require an explicit mapping");
|
|
3180
|
+
}
|
|
3181
|
+
}
|
|
3182
|
+
const mesh = "shape" in input ? convertTableToMesh(input) : input;
|
|
3183
|
+
if (mesh.topology !== "point-list" || mesh.indices)
|
|
3184
|
+
throw new Error("PointCloudTiler: unindexed point-list input required");
|
|
3185
|
+
const position = mesh.attributes.POSITION;
|
|
3186
|
+
if (!position || position.size !== 3 || !(position.value instanceof Float32Array || position.value instanceof Float64Array) || position.transform || position.normalized || position.componentType === "float16")
|
|
3187
|
+
throw new Error("PointCloudTiler: POSITION requires decoded floating-point XYZ");
|
|
3188
|
+
if (!mesh.header && (position.byteOffset || position.byteStride))
|
|
3189
|
+
throw new Error("PointCloudTiler: strided POSITION requires vertexCount");
|
|
3190
|
+
const count = mesh.header?.vertexCount ?? position.value.length / 3;
|
|
3191
|
+
if (!Number.isSafeInteger(count) || count < 0 || count > 4294967295)
|
|
3192
|
+
throw new Error("PointCloudTiler: invalid point count");
|
|
3193
|
+
let inputBytes = 0;
|
|
3194
|
+
const storageKeys = /* @__PURE__ */ new Map();
|
|
3195
|
+
const buffers = /* @__PURE__ */ new Set();
|
|
3196
|
+
for (const attribute of Object.values(mesh.attributes)) {
|
|
3197
|
+
this.validateAttribute(attribute, count);
|
|
3198
|
+
if (!buffers.has(attribute.value.buffer)) {
|
|
3199
|
+
buffers.add(attribute.value.buffer);
|
|
3200
|
+
inputBytes += attribute.value.buffer.byteLength;
|
|
3201
|
+
}
|
|
3202
|
+
const storage = storageKeys.get(attribute.value.buffer) ?? /* @__PURE__ */ new Set();
|
|
3203
|
+
const storageKey = getAttributeStorageKey(attribute);
|
|
3204
|
+
if (!storage.has(storageKey)) {
|
|
3205
|
+
this.pointByteLength += attribute.size * attribute.value.BYTES_PER_ELEMENT;
|
|
3206
|
+
storage.add(storageKey);
|
|
3207
|
+
storageKeys.set(attribute.value.buffer, storage);
|
|
3208
|
+
}
|
|
3209
|
+
}
|
|
3210
|
+
if (inputBytes > this.options.maxInputBytes)
|
|
3211
|
+
throw new Error("PointCloudTiler: input byte budget exceeded");
|
|
3212
|
+
this.mesh = mesh;
|
|
3213
|
+
this.sourcePointCount = count;
|
|
3214
|
+
const rows = this.allocateRows(count);
|
|
3215
|
+
const minimum = [Infinity, Infinity, Infinity];
|
|
3216
|
+
const maximum = [-Infinity, -Infinity, -Infinity];
|
|
3217
|
+
for (let row = 0; row < count; row++) {
|
|
3218
|
+
if (row % 65536 === 0) await this.checkpoint();
|
|
3219
|
+
rows[row] = row;
|
|
3220
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
3221
|
+
const coordinate = this.getCoordinate(row, axis);
|
|
3222
|
+
if (!Number.isFinite(coordinate)) throw new Error("PointCloudTiler: nonfinite position");
|
|
3223
|
+
minimum[axis] = Math.min(minimum[axis], coordinate);
|
|
3224
|
+
maximum[axis] = Math.max(maximum[axis], coordinate);
|
|
3225
|
+
}
|
|
3226
|
+
}
|
|
3227
|
+
if (!count) {
|
|
3228
|
+
minimum.fill(0);
|
|
3229
|
+
maximum.fill(0);
|
|
3230
|
+
}
|
|
3231
|
+
const width = Math.max(...minimum.map((value, axis) => maximum[axis] - value));
|
|
3232
|
+
if (!Number.isFinite(width)) throw new Error("PointCloudTiler: coordinate extent overflow");
|
|
3233
|
+
for (let axis = 0; axis < 3; axis++) maximum[axis] = minimum[axis] + width;
|
|
3234
|
+
if (!maximum.every(Number.isFinite) || !Number.isFinite(Math.hypot(width, width, width)))
|
|
3235
|
+
throw new Error("PointCloudTiler: coordinate extent overflow");
|
|
3236
|
+
await this.createNode("r", [minimum, maximum], rows);
|
|
3237
|
+
this.signal.throwIfAborted();
|
|
3238
|
+
}
|
|
3239
|
+
/** Selects at most one source row per grid cell; rejects no input rows. */
|
|
3240
|
+
async createNode(id, bounds, inputRows) {
|
|
3241
|
+
const terminal = id.length - 1 >= this.options.maximumDepth || bounds[0].every((value, axis) => value === bounds[1][axis]) || inputRows.length <= this.options.nodePointLimit;
|
|
3242
|
+
let rows = inputRows;
|
|
3243
|
+
let remaining = new Uint32Array(0);
|
|
3244
|
+
if (!terminal) {
|
|
3245
|
+
const resolution = Math.ceil(Math.cbrt(this.options.nodePointLimit));
|
|
3246
|
+
const cells = /* @__PURE__ */ new Set();
|
|
3247
|
+
const selected = this.allocateRows(Math.min(inputRows.length, this.options.nodePointLimit));
|
|
3248
|
+
const deferred = this.allocateRows(inputRows.length);
|
|
3249
|
+
let selectedCount = 0;
|
|
3250
|
+
let deferredCount = 0;
|
|
3251
|
+
for (let index = 0; index < inputRows.length; index++) {
|
|
3252
|
+
if (index % 65536 === 0) await this.checkpoint();
|
|
3253
|
+
const row = inputRows[index];
|
|
3254
|
+
let cell = 0;
|
|
3255
|
+
for (let axis = 0; axis < 3; axis++) {
|
|
3256
|
+
const component = Math.min(
|
|
3257
|
+
resolution - 1,
|
|
3258
|
+
Math.floor(
|
|
3259
|
+
(this.getCoordinate(row, axis) - bounds[0][axis]) / (bounds[1][axis] - bounds[0][axis]) * resolution
|
|
3260
|
+
)
|
|
3261
|
+
);
|
|
3262
|
+
cell = cell * resolution + component;
|
|
3263
|
+
}
|
|
3264
|
+
if (selectedCount < selected.length && !cells.has(cell)) {
|
|
3265
|
+
cells.add(cell);
|
|
3266
|
+
selected[selectedCount++] = row;
|
|
3267
|
+
} else deferred[deferredCount++] = row;
|
|
3268
|
+
}
|
|
3269
|
+
rows = selected.subarray(0, selectedCount);
|
|
3270
|
+
remaining = deferred.subarray(0, deferredCount);
|
|
3271
|
+
this.releaseRows(inputRows);
|
|
3272
|
+
}
|
|
3273
|
+
const state = {
|
|
3274
|
+
node: {
|
|
3275
|
+
id,
|
|
3276
|
+
level: id.length - 1,
|
|
3277
|
+
pointCount: rows.length,
|
|
3278
|
+
bounds,
|
|
3279
|
+
geometricError: remaining.length ? Math.hypot(...bounds[0].map((value, axis) => bounds[1][axis] - value)) : 0
|
|
3280
|
+
},
|
|
3281
|
+
rows,
|
|
3282
|
+
remaining
|
|
3283
|
+
};
|
|
3284
|
+
Object.freeze(bounds[0]);
|
|
3285
|
+
Object.freeze(bounds[1]);
|
|
3286
|
+
Object.freeze(bounds);
|
|
3287
|
+
Object.freeze(state.node);
|
|
3288
|
+
this.signal.throwIfAborted();
|
|
3289
|
+
if (this.nodes.size >= this.options.maxNodes)
|
|
3290
|
+
throw new Error("PointCloudTiler: node budget exceeded");
|
|
3291
|
+
this.nodes.set(id, state);
|
|
3292
|
+
return state;
|
|
3293
|
+
}
|
|
3294
|
+
/** Reads a floating-point coordinate from a checked packed or strided accessor. */
|
|
3295
|
+
getCoordinate(row, axis) {
|
|
3296
|
+
const attribute = this.mesh.attributes.POSITION;
|
|
3297
|
+
return Number(
|
|
3298
|
+
attribute.value[(attribute.byteOffset || 0) / attribute.value.BYTES_PER_ELEMENT + row * (attribute.byteStride || 3 * attribute.value.BYTES_PER_ELEMENT) / attribute.value.BYTES_PER_ELEMENT + axis]
|
|
3299
|
+
);
|
|
3300
|
+
}
|
|
3301
|
+
/** Validates a typed attribute's alignment and coverage before indexing or gathering. */
|
|
3302
|
+
validateAttribute(attribute, count) {
|
|
3303
|
+
const bytes = attribute.value?.BYTES_PER_ELEMENT;
|
|
3304
|
+
const offset = attribute.byteOffset ?? 0;
|
|
3305
|
+
const stride = attribute.byteStride || attribute.size * bytes;
|
|
3306
|
+
if (!bytes || !Number.isSafeInteger(attribute.size) || attribute.size < 1 || !Number.isSafeInteger(offset) || offset < 0 || offset % bytes || !Number.isSafeInteger(stride) || stride < attribute.size * bytes || stride % bytes || count && offset + (count - 1) * stride + attribute.size * bytes > attribute.value.byteLength)
|
|
3307
|
+
throw new Error("PointCloudTiler: invalid attribute layout");
|
|
3308
|
+
}
|
|
3309
|
+
/** Allocates counted row-index storage before any allocation exceeds the live budget. */
|
|
3310
|
+
allocateRows(count) {
|
|
3311
|
+
if (count * 4 > this.options.maxIndexBytes - this.indexBytes)
|
|
3312
|
+
throw new Error("PointCloudTiler: index byte budget exceeded");
|
|
3313
|
+
const rows = new Uint32Array(count);
|
|
3314
|
+
this.indexBytes += rows.byteLength;
|
|
3315
|
+
return rows;
|
|
3316
|
+
}
|
|
3317
|
+
/** Releases the allocation underlying a row subview. */
|
|
3318
|
+
releaseRows(rows) {
|
|
3319
|
+
this.indexBytes -= rows.buffer.byteLength;
|
|
3320
|
+
}
|
|
3321
|
+
/** Retrieves source-owned state, rejecting unknown or closed tiles. */
|
|
3322
|
+
getNode(id) {
|
|
3323
|
+
this.signal.throwIfAborted();
|
|
3324
|
+
const state = this.nodes.get(id);
|
|
3325
|
+
if (!state) throw new Error(`PointCloudTiler: unknown tile ${id}`);
|
|
3326
|
+
return state;
|
|
3327
|
+
}
|
|
3328
|
+
/** Resolves deterministic octant ownership, assigning midpoint boundaries to the upper child. */
|
|
3329
|
+
getOctant(row, midpoint) {
|
|
3330
|
+
let octant = 0;
|
|
3331
|
+
for (let axis = 0; axis < 3; axis++)
|
|
3332
|
+
if (this.getCoordinate(row, axis) >= midpoint[axis]) octant |= 4 >> axis;
|
|
3333
|
+
return octant;
|
|
3334
|
+
}
|
|
3335
|
+
/** Yields to the event loop and checks cancellation without public-network or platform APIs. */
|
|
3336
|
+
async checkpoint() {
|
|
3337
|
+
this.signal.throwIfAborted();
|
|
3338
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
3339
|
+
this.signal.throwIfAborted();
|
|
3340
|
+
}
|
|
3341
|
+
};
|
|
3342
|
+
function getAttributeStorageKey(attribute) {
|
|
3343
|
+
return [
|
|
3344
|
+
attribute.value.constructor.name,
|
|
3345
|
+
attribute.value.byteOffset,
|
|
3346
|
+
attribute.value.byteLength,
|
|
3347
|
+
attribute.size,
|
|
3348
|
+
attribute.byteOffset ?? 0,
|
|
3349
|
+
attribute.byteStride || attribute.size * attribute.value.BYTES_PER_ELEMENT
|
|
3350
|
+
].join(":");
|
|
3351
|
+
}
|
|
3352
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
3353
|
+
0 && (module.exports = {
|
|
3354
|
+
ArrowLikeDataType,
|
|
3355
|
+
ArrowLikeField,
|
|
3356
|
+
ArrowLikeSchema,
|
|
3357
|
+
ArrowLikeTable,
|
|
3358
|
+
ArrowTableBuilder,
|
|
3359
|
+
AsyncQueue,
|
|
3360
|
+
ColumnarTableBatchAggregator,
|
|
3361
|
+
PointCloudTiler,
|
|
3362
|
+
RowTableBatchAggregator,
|
|
3363
|
+
TABLE_CONVERTERS,
|
|
3364
|
+
TableBatchBuilder,
|
|
3365
|
+
TableConverter,
|
|
3366
|
+
convert,
|
|
3367
|
+
convertArrowToSchema,
|
|
3368
|
+
convertArrowToTable,
|
|
3369
|
+
convertBatch,
|
|
3370
|
+
convertBatches,
|
|
3371
|
+
convertMeshToTable,
|
|
3372
|
+
convertSchemaToArrow,
|
|
3373
|
+
convertTable,
|
|
3374
|
+
convertTableToArrow,
|
|
3375
|
+
convertTableToMesh,
|
|
3376
|
+
convertToArrayRow,
|
|
3377
|
+
convertToObjectRow,
|
|
3378
|
+
deduceMeshField,
|
|
3379
|
+
deduceMeshSchema,
|
|
3380
|
+
deduceTableSchema,
|
|
3381
|
+
deserializeArrowField,
|
|
3382
|
+
deserializeArrowMetadata,
|
|
3383
|
+
deserializeArrowSchema,
|
|
3384
|
+
deserializeArrowType,
|
|
3385
|
+
getArrayTypeFromDataType,
|
|
3386
|
+
getArrowViewTypeSupport,
|
|
3387
|
+
getDataTypeFromArray,
|
|
3388
|
+
getMeshBoundingBox,
|
|
3389
|
+
getMeshSize,
|
|
3390
|
+
getTableCell,
|
|
3391
|
+
getTableCellAt,
|
|
3392
|
+
getTableColumnIndex,
|
|
3393
|
+
getTableColumnName,
|
|
3394
|
+
getTableLength,
|
|
3395
|
+
getTableNumCols,
|
|
3396
|
+
getTableRowAsArray,
|
|
3397
|
+
getTableRowAsObject,
|
|
3398
|
+
getTableRowShape,
|
|
3399
|
+
getTypeInfo,
|
|
3400
|
+
isArrayRowTable,
|
|
3401
|
+
isArrowTable,
|
|
3402
|
+
isColumnarTable,
|
|
3403
|
+
isGeoJSONTable,
|
|
3404
|
+
isObjectRowTable,
|
|
3405
|
+
isTable,
|
|
3406
|
+
makeArrayRowIterator,
|
|
3407
|
+
makeArrowRecordBatchIterator,
|
|
3408
|
+
makeArrowTableBatchIterator,
|
|
3409
|
+
makeBatchFromTable,
|
|
3410
|
+
makeMeshArrowTable,
|
|
3411
|
+
makeMeshAttributeMetadata,
|
|
3412
|
+
makeObjectRowIterator,
|
|
3413
|
+
makeRowIterator,
|
|
3414
|
+
makeTableBatchIterator,
|
|
3415
|
+
makeTableFromBatches,
|
|
3416
|
+
makeTableFromData,
|
|
3417
|
+
queryArrowTable,
|
|
3418
|
+
selectArrowTableRows,
|
|
3419
|
+
serializeArrowField,
|
|
3420
|
+
serializeArrowMetadata,
|
|
3421
|
+
serializeArrowSchema,
|
|
3422
|
+
serializeArrowType
|
|
3423
|
+
});
|