@loaders.gl/core 5.0.0-beta.1 → 5.0.0-beta.11
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/GEOARROW-README.md +1 -1
- package/README.md +4 -2
- package/SCAN-README.md +3 -3
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
- package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
- package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.cjs.map +2 -2
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -6
- package/dist/arrow-geometry/feature-table.cjs.map +2 -2
- package/dist/arrow-geometry/feature-table.d.ts +6 -5
- package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-table.js +5 -9
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +295 -18
- package/dist/arrow-geometry/geojson-table.cjs.map +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts +10 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +23 -13
- package/dist/arrow-geometry/geojson-table.js.map +1 -1
- package/dist/arrow-geometry/geometry-codecs.cjs +6 -6
- package/dist/arrow-geometry/geometry-codecs.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-codecs.js +1 -1
- package/dist/arrow-geometry/geometry-codecs.js.map +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.cjs +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.cjs.map +2 -2
- package/dist/arrow-geometry/geometry-to-wkt.js +1 -1
- package/dist/arrow-geometry/geometry-to-wkt.js.map +1 -1
- package/dist/arrow-geometry/index.cjs +0 -11
- package/dist/arrow-geometry/index.cjs.map +2 -2
- package/dist/arrow-geometry/index.d.ts +0 -1
- package/dist/arrow-geometry/index.d.ts.map +1 -1
- package/dist/arrow-geometry/index.js +0 -1
- package/dist/arrow-geometry/index.js.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.cjs +1 -5
- package/dist/arrow-geometry/wkb-arrow-utils.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts +7 -7
- package/dist/arrow-geometry/wkb-arrow-utils.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-arrow-utils.js +4 -8
- package/dist/arrow-geometry/wkb-arrow-utils.js.map +1 -1
- package/dist/arrow-geometry/wkb-builder.cjs +3 -3
- package/dist/arrow-geometry/wkb-builder.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-builder.d.ts +1 -1
- package/dist/arrow-geometry/wkb-builder.d.ts.map +1 -1
- package/dist/arrow-geometry/wkb-builder.js +1 -1
- package/dist/arrow-geometry/wkb-builder.js.map +1 -1
- package/dist/arrow-geometry/wkb-statistics.cjs +2 -2
- package/dist/arrow-geometry/wkb-statistics.cjs.map +2 -2
- package/dist/arrow-geometry/wkb-statistics.js +1 -1
- package/dist/arrow-geometry/wkb-statistics.js.map +1 -1
- package/dist/arrow-worker-transport.cjs +105 -0
- package/dist/arrow-worker-transport.cjs.map +6 -0
- package/dist/arrow-worker-transport.d.ts +11 -0
- package/dist/arrow-worker-transport.d.ts.map +1 -0
- package/dist/arrow-worker-transport.js +77 -0
- package/dist/arrow-worker-transport.js.map +1 -0
- package/dist/cluster-source.cjs +6874 -0
- package/dist/cluster-source.cjs.map +6 -0
- package/dist/cluster-source.d.ts +2 -0
- package/dist/cluster-source.d.ts.map +1 -0
- package/dist/cluster-source.js +2 -0
- package/dist/cluster-source.js.map +1 -0
- package/dist/dist.dev.js +3040 -817
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +2409 -0
- package/dist/federated-table-scan-source.cjs.map +6 -0
- package/dist/federated-table-scan-source.d.ts +2 -0
- package/dist/federated-table-scan-source.d.ts.map +1 -0
- package/dist/federated-table-scan-source.js +2 -0
- package/dist/federated-table-scan-source.js.map +1 -0
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.cjs +16 -19
- package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.js +13 -18
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
- package/dist/geoarrow/geoarrow-bounds.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-bounds.js +3 -3
- package/dist/geoarrow/geoarrow-bounds.js.map +1 -1
- package/dist/geoarrow/geoarrow-capabilities.cjs +2 -2
- package/dist/geoarrow/geoarrow-capabilities.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-capabilities.js +1 -1
- package/dist/geoarrow/geoarrow-capabilities.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +8 -8
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +6 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
- package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
- package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-inspection.js +1 -1
- package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
- package/dist/geoarrow/geoarrow-stream.cjs +11 -12
- package/dist/geoarrow/geoarrow-stream.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts +2 -2
- package/dist/geoarrow/geoarrow-stream.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-stream.js +10 -13
- package/dist/geoarrow/geoarrow-stream.js.map +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
- package/dist/geoarrow/get-geoarrow-vertex-count.js +1 -1
- package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.cjs.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js +3 -3
- package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs +4 -8
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs.map +2 -2
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.d.ts.map +1 -1
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +4 -8
- package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs +4 -4
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -3
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs.map +2 -2
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +1 -1
- package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs +3 -3
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js +1 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +2 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +3 -2
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs +44 -2
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +4 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.js +3 -4
- package/dist/geoarrow/metadata/geoarrow-metadata.js.map +1 -1
- package/dist/index.cjs +746 -1365
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +2 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +20 -9
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +55 -45
- package/dist/lib/api/create-data-source.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 +11 -2
- package/dist/lib/api/encode.js.map +1 -1
- package/dist/lib/api/load-in-batches.d.ts +3 -2
- package/dist/lib/api/load-in-batches.d.ts.map +1 -1
- package/dist/lib/api/load-in-batches.js.map +1 -1
- package/dist/lib/api/load-loader.d.ts +3 -3
- package/dist/lib/api/load-loader.d.ts.map +1 -1
- package/dist/lib/api/load-loader.js +15 -19
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts +7 -3
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +15 -67
- package/dist/lib/api/load.js.map +1 -1
- package/dist/lib/api/loader-options.d.ts +6 -0
- package/dist/lib/api/loader-options.d.ts.map +1 -1
- package/dist/lib/api/loader-options.js +48 -0
- package/dist/lib/api/loader-options.js.map +1 -1
- package/dist/lib/api/parse-file.d.ts +5 -3
- package/dist/lib/api/parse-file.d.ts.map +1 -1
- package/dist/lib/api/parse-file.js +8 -6
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.d.ts +5 -3
- package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +60 -9
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts +5 -3
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +3 -4
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts +5 -3
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +22 -14
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/api/select-loader.d.ts +4 -2
- package/dist/lib/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +47 -53
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/api/select-source.d.ts.map +1 -1
- package/dist/lib/api/select-source.js +1 -1
- package/dist/lib/api/select-source.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +2 -2
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/loggers.d.ts +2 -37
- package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
- package/dist/lib/loader-utils/loggers.js +2 -63
- package/dist/lib/loader-utils/loggers.js.map +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +13 -0
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -0
- package/dist/lib/loader-utils/native-arrow.js +66 -0
- package/dist/lib/loader-utils/native-arrow.js.map +1 -0
- package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +9 -10
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +0 -6
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +31 -114
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +3 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -1
- package/dist/loader-utils/index.cjs +854 -1295
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +17 -8
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +9 -5
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/files/http-file-transport.d.ts +4 -0
- package/dist/loader-utils/lib/files/http-file-transport.d.ts.map +1 -1
- package/dist/loader-utils/lib/files/http-file-transport.js +45 -1
- package/dist/loader-utils/lib/files/http-file-transport.js.map +1 -1
- package/dist/loader-utils/lib/files/http-file-types.d.ts +2 -0
- package/dist/loader-utils/lib/files/http-file-types.d.ts.map +1 -1
- package/dist/loader-utils/lib/files/read-range-response.d.ts +3 -0
- package/dist/loader-utils/lib/files/read-range-response.d.ts.map +1 -0
- package/dist/loader-utils/lib/files/read-range-response.js +62 -0
- package/dist/loader-utils/lib/files/read-range-response.js.map +1 -0
- package/dist/loader-utils/lib/log-utils/log.d.ts +23 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +32 -1
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts +43 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts.map +1 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js +104 -0
- package/dist/loader-utils/lib/scan-utils/logical-table-query.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/{experimental-scan-options.d.ts → query-options.d.ts} +5 -8
- package/dist/loader-utils/lib/scan-utils/query-options.d.ts.map +1 -0
- package/dist/{schema-utils/lib/table/batch-builder/table-batch-aggregator.js → loader-utils/lib/scan-utils/query-options.js} +1 -1
- package/dist/loader-utils/lib/scan-utils/query-options.js.map +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +58 -18
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +17 -6
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +54 -3
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.js +6 -0
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +18 -12
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +58 -29
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.d.ts +4 -0
- package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.js +53 -14
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
- package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +31 -0
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -0
- package/dist/loader-utils/lib/{scan-utils/experimental-scan-options.js → sources/table-source-collection.js} +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.js.map +1 -0
- package/dist/loader-utils/lib/sources/utils/utils.js +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js +2 -5
- package/dist/loader-utils/lib/worker-loader-utils/encode-with-worker.js.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +40 -21
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +118 -91
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.js.map +1 -1
- package/dist/loader-utils/source-types.d.ts +7 -5
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +9 -1
- package/dist/loader-utils/source-types.js.map +1 -1
- package/dist/null-loader.d.ts +0 -18
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -19
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +771 -82
- package/dist/null-worker.js +742 -81
- package/dist/polyfills/images/encode-image-node.d.ts +18 -15
- package/dist/polyfills/images/encode-image-node.d.ts.map +1 -1
- package/dist/polyfills/images/encode-image-node.js +19 -33
- package/dist/polyfills/images/encode-image-node.js.map +1 -1
- package/dist/polyfills/images/image-codecs-node.d.ts +2 -6
- package/dist/polyfills/images/image-codecs-node.d.ts.map +1 -1
- package/dist/polyfills/images/image-codecs-node.js +2 -24
- package/dist/polyfills/images/image-codecs-node.js.map +1 -1
- package/dist/polyfills/images/load-sharp.d.ts +3 -0
- package/dist/polyfills/images/load-sharp.d.ts.map +1 -0
- package/dist/polyfills/images/load-sharp.js +11 -0
- package/dist/polyfills/images/load-sharp.js.map +1 -0
- package/dist/polyfills/images/node-image-bitmap.d.ts +1 -1
- package/dist/polyfills/images/node-image-bitmap.js +1 -1
- package/dist/polyfills/images/node-image-formats.d.ts +1 -1
- package/dist/polyfills/images/node-image-formats.d.ts.map +1 -1
- package/dist/polyfills/images/node-image-formats.js +10 -4
- package/dist/polyfills/images/node-image-formats.js.map +1 -1
- package/dist/polyfills/images/parse-image-node.d.ts +10 -2
- package/dist/polyfills/images/parse-image-node.d.ts.map +1 -1
- package/dist/polyfills/images/parse-image-node.js +20 -32
- package/dist/polyfills/images/parse-image-node.js.map +1 -1
- package/dist/polyfills/index.cjs +76 -151
- package/dist/polyfills/index.d.ts.map +1 -1
- package/dist/polyfills/index.js +2 -2
- package/dist/polyfills/index.js.map +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +134 -0
- package/dist/scan/arrow-execution/expressions.cjs.map +7 -0
- package/dist/scan/arrow-execution/expressions.d.ts +11 -0
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -0
- package/dist/scan/arrow-execution/expressions.js +86 -0
- package/dist/scan/arrow-execution/expressions.js.map +1 -0
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +255 -0
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +7 -0
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts +18 -0
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -0
- package/dist/scan/arrow-execution/filter-arrow-table.js +224 -0
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -0
- package/dist/scan/arrow-execution/project-arrow-table.cjs +70 -0
- package/dist/scan/arrow-execution/project-arrow-table.cjs.map +7 -0
- package/dist/scan/arrow-execution/project-arrow-table.d.ts +8 -0
- package/dist/scan/arrow-execution/project-arrow-table.d.ts.map +1 -0
- package/dist/scan/arrow-execution/project-arrow-table.js +39 -0
- package/dist/scan/arrow-execution/project-arrow-table.js.map +1 -0
- package/dist/scan/arrow-execution.cjs +34 -0
- package/dist/scan/arrow-execution.cjs.map +7 -0
- package/dist/scan/arrow-execution.d.ts +4 -0
- package/dist/scan/arrow-execution.d.ts.map +1 -0
- package/dist/scan/arrow-execution.js +6 -0
- package/dist/scan/arrow-execution.js.map +1 -0
- package/dist/scan/arrow-query-worker-entry.cjs +121 -0
- package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
- package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
- package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker-entry.js +7 -0
- package/dist/scan/arrow-query-worker-entry.js.map +1 -0
- package/dist/scan/arrow-query-worker.cjs +197 -0
- package/dist/scan/arrow-query-worker.cjs.map +7 -0
- package/dist/scan/arrow-query-worker.d.ts +47 -0
- package/dist/scan/arrow-query-worker.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker.js +101 -0
- package/dist/scan/arrow-query-worker.js.map +1 -0
- package/dist/scan/arrow-query.cjs.map +1 -1
- package/dist/scan/arrow-query.d.ts +1 -1
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/catalog-query-source.cjs +122 -0
- package/dist/scan/catalog-query-source.cjs.map +7 -0
- package/dist/scan/catalog-query-source.d.ts +6 -0
- package/dist/scan/catalog-query-source.d.ts.map +1 -0
- package/dist/scan/catalog-query-source.js +115 -0
- package/dist/scan/catalog-query-source.js.map +1 -0
- package/dist/scan/federated-table-scan-source.cjs +42 -43
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts +6 -10
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +39 -40
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +213 -6
- package/dist/scan/index.cjs.map +4 -4
- package/dist/scan/index.d.ts +15 -4
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +8 -2
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/parse-sql-predicate.cjs +3 -294
- package/dist/scan/parse-sql-predicate.cjs.map +3 -3
- package/dist/scan/parse-sql-predicate.d.ts +6 -9
- package/dist/scan/parse-sql-predicate.d.ts.map +1 -1
- package/dist/scan/parse-sql-predicate.js +5 -314
- package/dist/scan/parse-sql-predicate.js.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.cjs +75 -0
- package/dist/scan/query-arrow-table-in-batches.cjs.map +7 -0
- package/dist/scan/query-arrow-table-in-batches.d.ts +8 -0
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -0
- package/dist/scan/query-arrow-table-in-batches.js +54 -0
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -0
- package/dist/scan/query-arrow-table.cjs +65 -202
- package/dist/scan/query-arrow-table.cjs.map +3 -3
- package/dist/scan/query-arrow-table.d.ts +7 -40
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +51 -211
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-open-source.cjs +52 -0
- package/dist/scan/query-open-source.cjs.map +7 -0
- package/dist/scan/query-open-source.d.ts +4 -0
- package/dist/scan/query-open-source.d.ts.map +1 -0
- package/dist/scan/query-open-source.js +26 -0
- package/dist/scan/query-open-source.js.map +1 -0
- package/dist/scan/query-progressive.cjs +190 -0
- package/dist/scan/query-progressive.cjs.map +7 -0
- package/dist/scan/query-progressive.d.ts +39 -0
- package/dist/scan/query-progressive.d.ts.map +1 -0
- package/dist/scan/query-progressive.js +173 -0
- package/dist/scan/query-progressive.js.map +1 -0
- package/dist/scan/query-pushdown.cjs +140 -0
- package/dist/scan/query-pushdown.cjs.map +7 -0
- package/dist/scan/query-pushdown.d.ts +14 -0
- package/dist/scan/query-pushdown.d.ts.map +1 -0
- package/dist/scan/query-pushdown.js +133 -0
- package/dist/scan/query-pushdown.js.map +1 -0
- package/dist/scan/query-scales.cjs +140 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +35 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +120 -0
- package/dist/scan/query-scales.js.map +1 -0
- package/dist/scan/query.cjs +385 -0
- package/dist/scan/query.cjs.map +7 -0
- package/dist/scan/query.d.ts +67 -0
- package/dist/scan/query.d.ts.map +1 -0
- package/dist/scan/query.js +402 -0
- package/dist/scan/query.js.map +1 -0
- package/dist/scan/resolve-query-source.cjs +59 -0
- package/dist/scan/resolve-query-source.cjs.map +7 -0
- package/dist/scan/resolve-query-source.d.ts +6 -0
- package/dist/scan/resolve-query-source.d.ts.map +1 -0
- package/dist/scan/resolve-query-source.js +37 -0
- package/dist/scan/resolve-query-source.js.map +1 -0
- package/dist/scan/rows-to-arrow.cjs +1 -28
- package/dist/scan/rows-to-arrow.cjs.map +2 -2
- package/dist/scan/rows-to-arrow.d.ts +3 -3
- package/dist/scan/rows-to-arrow.d.ts.map +1 -1
- package/dist/scan/rows-to-arrow.js +2 -32
- package/dist/scan/rows-to-arrow.js.map +1 -1
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +5 -5
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/sql-catalog.cjs +110 -0
- package/dist/scan/sql-catalog.cjs.map +7 -0
- package/dist/scan/sql-catalog.d.ts +47 -0
- package/dist/scan/sql-catalog.d.ts.map +1 -0
- package/dist/scan/sql-catalog.js +97 -0
- package/dist/scan/sql-catalog.js.map +1 -0
- package/dist/scan/table-query.cjs.map +2 -2
- package/dist/scan/table-query.d.ts +4 -1
- package/dist/scan/table-query.d.ts.map +1 -1
- package/dist/scan/table-query.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +24 -17
- package/dist/scan/vector-table-scan-source.cjs.map +4 -4
- package/dist/scan/vector-table-scan-source.d.ts +8 -8
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +19 -17
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema/categories/category-mesh.d.ts +3 -10
- package/dist/schema/categories/category-mesh.d.ts.map +1 -1
- package/dist/schema/categories/category-mesh.js.map +1 -1
- package/dist/schema/categories/category-table.d.ts +2 -19
- package/dist/schema/categories/category-table.d.ts.map +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts +1 -1
- package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -1
- package/dist/schema/geometry/geoarrow.d.ts +3 -6
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
- package/dist/schema/index.cjs +11 -7
- package/dist/schema/index.cjs.map +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/types/batch.d.ts +0 -4
- package/dist/schema/types/batch.d.ts.map +1 -1
- package/dist/schema-utils/index.cjs +404 -620
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -6
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
- package/dist/schema-utils/lib/converters/convert.js +9 -2
- package/dist/schema-utils/lib/converters/convert.js.map +1 -1
- package/dist/schema-utils/lib/converters/types.d.ts +2 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +2 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -1
- package/dist/schema-utils/lib/schema/deduce-table-schema.js +7 -3
- package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
- package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +9 -9
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +13 -75
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/row-utils.js +2 -2
- package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
- package/dist/vector-table-scan-source.cjs +1766 -0
- package/dist/vector-table-scan-source.cjs.map +6 -0
- package/dist/vector-table-scan-source.d.ts +2 -0
- package/dist/vector-table-scan-source.d.ts.map +1 -0
- package/dist/vector-table-scan-source.js +2 -0
- package/dist/vector-table-scan-source.js.map +1 -0
- package/dist/worker-utils/index.cjs +407 -1184
- package/dist/worker-utils/index.cjs.map +3 -3
- package/dist/worker-utils/index.d.ts +2 -8
- package/dist/worker-utils/index.d.ts.map +1 -1
- package/dist/worker-utils/index.js +1 -10
- package/dist/worker-utils/index.js.map +1 -1
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -1
- package/dist/worker-utils/lib/library-utils/library-utils.js +3 -2
- package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -1
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js +8 -7
- package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts +5 -7
- package/dist/worker-utils/lib/worker-api/create-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/create-worker.js +76 -146
- package/dist/worker-utils/lib/worker-api/create-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/get-worker-url.js +5 -2
- package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +17 -45
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +214 -312
- package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/task-runtime.d.ts +36 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.d.ts.map +1 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.js +23 -0
- package/dist/worker-utils/lib/worker-api/task-runtime.js.map +1 -0
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +1 -6
- package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts +1 -0
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js +3 -1
- package/dist/worker-utils/lib/worker-utils/get-transfer-list.js.map +1 -1
- package/dist/worker-utils/null-worker-node.js +836 -147
- package/dist/worker-utils/null-worker-node.js.map +4 -4
- package/dist/worker-utils/null-worker.js +804 -143
- package/dist/worker-utils/null-worker.js.map +4 -4
- package/dist/worker-utils/types.d.ts +55 -72
- package/dist/worker-utils/types.d.ts.map +1 -1
- package/package.json +141 -35
- package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
- package/src/arrow-geometry/feature-collection-to-arrow.ts +4 -3
- package/src/arrow-geometry/feature-table.ts +8 -17
- package/src/arrow-geometry/geojson-table.ts +32 -21
- package/src/arrow-geometry/geometry-codecs.ts +2 -2
- package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
- package/src/arrow-geometry/index.ts +0 -9
- package/src/arrow-geometry/wkb-arrow-utils.ts +8 -12
- package/src/arrow-geometry/wkb-builder.ts +2 -2
- package/src/arrow-geometry/wkb-statistics.ts +2 -2
- package/src/arrow-worker-transport.ts +126 -0
- package/src/cluster-source.ts +1 -0
- package/src/federated-table-scan-source.ts +1 -0
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +20 -30
- package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
- package/src/geoarrow/geoarrow-bounds.ts +3 -3
- package/src/geoarrow/geoarrow-capabilities.ts +1 -1
- package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +3 -3
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +16 -16
- package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
- package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts +3 -3
- package/src/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.ts +4 -11
- package/src/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +1 -1
- package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +2 -2
- package/src/geoarrow/lib/kernels/encode-geoarrow-box.ts +1 -1
- package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +11 -11
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +3 -2
- package/src/geoarrow/metadata/geoarrow-metadata.ts +3 -4
- package/src/index.ts +2 -6
- package/src/lib/api/create-data-source.ts +148 -58
- package/src/lib/api/encode.ts +14 -3
- package/src/lib/api/load-in-batches.ts +15 -7
- package/src/lib/api/load-loader.ts +22 -21
- package/src/lib/api/load.ts +51 -127
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +32 -22
- package/src/lib/api/parse-in-batches.ts +121 -20
- package/src/lib/api/parse-sync.ts +30 -16
- package/src/lib/api/parse.ts +46 -29
- package/src/lib/api/select-loader.ts +54 -69
- package/src/lib/api/select-source.ts +7 -1
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/loggers.ts +2 -70
- package/src/lib/loader-utils/native-arrow.ts +83 -0
- package/src/lib/loader-utils/option-defaults.ts +9 -10
- package/src/lib/loader-utils/option-utils.ts +33 -122
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +50 -10
- package/src/loader-utils/lib/files/http-file-transport.ts +65 -1
- package/src/loader-utils/lib/files/http-file-types.ts +2 -0
- package/src/loader-utils/lib/files/read-range-response.ts +66 -0
- package/src/loader-utils/lib/log-utils/log.ts +36 -1
- package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
- package/src/loader-utils/lib/scan-utils/logical-table-query.ts +174 -0
- package/src/loader-utils/lib/scan-utils/query-options.ts +44 -0
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +81 -28
- package/src/loader-utils/lib/scan-utils/table-query.ts +76 -8
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +101 -53
- package/src/loader-utils/lib/sources/data-source.ts +57 -16
- package/src/loader-utils/lib/sources/image-source.ts +1 -1
- package/src/loader-utils/lib/sources/table-source-collection.ts +39 -0
- package/src/loader-utils/lib/sources/utils/utils.ts +1 -1
- package/src/loader-utils/lib/sources/vector-source.ts +3 -3
- package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
- package/src/loader-utils/lib/worker-loader-utils/encode-with-worker.ts +5 -6
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +41 -24
- package/src/loader-utils/loader-types.ts +190 -111
- package/src/loader-utils/source-types.ts +17 -6
- package/src/null-loader.ts +1 -20
- package/src/polyfills/README.md +2 -2
- package/src/polyfills/images/encode-image-node.ts +44 -37
- package/src/polyfills/images/image-codecs-node.ts +2 -37
- package/src/polyfills/images/load-sharp.ts +13 -0
- package/src/polyfills/images/node-image-bitmap.ts +1 -1
- package/src/polyfills/images/node-image-formats.ts +10 -4
- package/src/polyfills/images/parse-image-node.ts +31 -40
- package/src/polyfills/index.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +116 -0
- package/src/scan/arrow-execution/filter-arrow-table.ts +298 -0
- package/src/scan/arrow-execution/project-arrow-table.ts +53 -0
- package/src/scan/arrow-execution.ts +7 -0
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/arrow-query.ts +3 -0
- package/src/scan/catalog-query-source.ts +132 -0
- package/src/scan/federated-table-scan-source.ts +67 -78
- package/src/scan/index.ts +64 -6
- package/src/scan/parse-sql-predicate.ts +14 -367
- package/src/scan/query-arrow-table-in-batches.ts +55 -0
- package/src/scan/query-arrow-table.ts +81 -271
- package/src/scan/query-open-source.ts +39 -0
- package/src/scan/query-progressive.ts +229 -0
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +199 -0
- package/src/scan/query.ts +594 -0
- package/src/scan/resolve-query-source.ts +47 -0
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +6 -6
- package/src/scan/sql-catalog.ts +167 -0
- package/src/scan/table-query.ts +6 -1
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +8 -19
- package/src/schema/index.ts +4 -5
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +19 -10
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
- package/src/schema-utils/lib/converters/convert.ts +7 -2
- package/src/schema-utils/lib/converters/types.ts +2 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
- package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +8 -4
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
- package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +21 -51
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
- package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
- package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +27 -95
- package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
- package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
- package/src/schema-utils/lib/table/tables/row-utils.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/vector-table-scan-source.ts +1 -0
- package/src/worker-utils/index.ts +2 -18
- package/src/worker-utils/lib/library-utils/library-utils.ts +3 -2
- package/src/worker-utils/lib/process-utils/child-process-proxy.ts +8 -7
- package/src/worker-utils/lib/worker-api/create-worker.ts +89 -188
- package/src/worker-utils/lib/worker-api/get-worker-url.ts +4 -3
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +246 -402
- package/src/worker-utils/lib/worker-api/task-runtime.ts +66 -0
- package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +1 -6
- package/src/worker-utils/lib/worker-utils/get-transfer-list.ts +2 -0
- package/src/worker-utils/types.ts +74 -109
- package/dist/arrow-geometry/arrow-geoarrow-adapter.cjs +0 -477
- package/dist/arrow-geometry/arrow-geoarrow-adapter.cjs.map +0 -7
- package/dist/arrow-geometry/arrow-geoarrow-adapter.d.ts +0 -29
- package/dist/arrow-geometry/arrow-geoarrow-adapter.d.ts.map +0 -1
- package/dist/arrow-geometry/arrow-geoarrow-adapter.js +0 -434
- package/dist/arrow-geometry/arrow-geoarrow-adapter.js.map +0 -1
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.cjs +0 -39
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.cjs.map +0 -7
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.d.ts +0 -2
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.d.ts.map +0 -1
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.js +0 -5
- package/dist/geoarrow/lib/arrow-geoarrow-adapter.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.d.ts.map +0 -1
- package/dist/loader-utils/lib/scan-utils/experimental-scan-options.js.map +0 -1
- package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
- package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
- package/dist/schema/deprecated/mesh-utils.js +0 -37
- package/dist/schema/deprecated/mesh-utils.js.map +0 -1
- package/dist/schema-utils/arrow-transport.cjs +0 -691
- package/dist/schema-utils/arrow-transport.cjs.map +0 -6
- package/dist/schema-utils/arrow-transport.d.ts +0 -4
- package/dist/schema-utils/arrow-transport.d.ts.map +0 -1
- package/dist/schema-utils/arrow-transport.js +0 -7
- package/dist/schema-utils/arrow-transport.js.map +0 -1
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts +0 -76
- package/dist/schema-utils/lib/arrow/arrow-table-transport.d.ts.map +0 -1
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js +0 -182
- package/dist/schema-utils/lib/arrow/arrow-table-transport.js.map +0 -1
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts +0 -33
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.d.ts.map +0 -1
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js +0 -134
- package/dist/schema-utils/lib/arrow/split-arrow-buffers.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts +0 -32
- package/dist/worker-utils/lib/async-queue/async-queue.d.ts.map +0 -1
- package/dist/worker-utils/lib/async-queue/async-queue.js +0 -91
- package/dist/worker-utils/lib/async-queue/async-queue.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts +0 -20
- package/dist/worker-utils/lib/worker-farm/worker-body.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-body.js +0 -131
- package/dist/worker-utils/lib/worker-farm/worker-body.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts +0 -58
- package/dist/worker-utils/lib/worker-farm/worker-farm.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-farm.js +0 -116
- package/dist/worker-utils/lib/worker-farm/worker-farm.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts +0 -34
- package/dist/worker-utils/lib/worker-farm/worker-job.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-job.js +0 -74
- package/dist/worker-utils/lib/worker-farm/worker-job.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts +0 -94
- package/dist/worker-utils/lib/worker-farm/worker-pool.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-pool.js +0 -246
- package/dist/worker-utils/lib/worker-farm/worker-pool.js.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts +0 -67
- package/dist/worker-utils/lib/worker-farm/worker-thread.d.ts.map +0 -1
- package/dist/worker-utils/lib/worker-farm/worker-thread.js +0 -175
- package/dist/worker-utils/lib/worker-farm/worker-thread.js.map +0 -1
- package/src/arrow-geometry/arrow-geoarrow-adapter.ts +0 -568
- package/src/geoarrow/lib/arrow-geoarrow-adapter.ts +0 -12
- package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
- package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
- package/src/loader-utils/lib/scan-utils/experimental-scan-options.ts +0 -46
- package/src/polyfills/images/encode-image.node.ts.disabled +0 -41
- package/src/polyfills/images/parse-image.node.ts.disabled +0 -55
- package/src/schema/deprecated/mesh-utils.ts +0 -46
- package/src/schema-utils/arrow-transport.ts +0 -7
- package/src/schema-utils/lib/arrow/arrow-table-transport.ts +0 -282
- package/src/schema-utils/lib/arrow/split-arrow-buffers.ts +0 -247
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
- package/src/worker-utils/lib/async-queue/async-queue.ts +0 -100
- package/src/worker-utils/lib/worker-farm/worker-body.ts +0 -145
- package/src/worker-utils/lib/worker-farm/worker-farm.ts +0 -144
- package/src/worker-utils/lib/worker-farm/worker-job.ts +0 -85
- package/src/worker-utils/lib/worker-farm/worker-pool.ts +0 -316
- package/src/worker-utils/lib/worker-farm/worker-thread.ts +0 -206
|
@@ -3,4 +3,52 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
export { setGlobalOptions as setLoaderOptions } from "../loader-utils/option-utils.js";
|
|
5
5
|
export { getGlobalLoaderOptions as getLoaderOptions } from "../loader-utils/option-utils.js";
|
|
6
|
+
/**
|
|
7
|
+
* Compares two option inputs without applying loader defaults or global options.
|
|
8
|
+
* Compares plain objects and arrays recursively, and callbacks and other objects by reference.
|
|
9
|
+
*/
|
|
10
|
+
export function compareLoaderOptions(left, right) {
|
|
11
|
+
return Object.is(left, right) || compareOptionValues(left, right, new WeakMap());
|
|
12
|
+
}
|
|
13
|
+
/** Compares option values and tracks visited object pairs to handle cycles. */
|
|
14
|
+
function compareOptionValues(left, right, visited) {
|
|
15
|
+
if (Object.is(left, right)) {
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
if (!left || !right || typeof left !== 'object' || typeof right !== 'object') {
|
|
19
|
+
return false;
|
|
20
|
+
}
|
|
21
|
+
const leftPrototype = Object.getPrototypeOf(left);
|
|
22
|
+
if (leftPrototype !== Object.getPrototypeOf(right)) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (Array.isArray(left)) {
|
|
26
|
+
if (!Array.isArray(right) || left.length !== right.length) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
else if (leftPrototype !== Object.prototype && leftPrototype !== null) {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
let rightValues = visited.get(left);
|
|
34
|
+
if (rightValues?.has(right)) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
if (!rightValues) {
|
|
38
|
+
rightValues = new WeakSet();
|
|
39
|
+
visited.set(left, rightValues);
|
|
40
|
+
}
|
|
41
|
+
rightValues.add(right);
|
|
42
|
+
const leftKeys = getEnumerableKeys(left);
|
|
43
|
+
const rightKeys = getEnumerableKeys(right);
|
|
44
|
+
const leftOptions = left;
|
|
45
|
+
const rightOptions = right;
|
|
46
|
+
return (leftKeys.length === rightKeys.length &&
|
|
47
|
+
leftKeys.every(key => Object.prototype.propertyIsEnumerable.call(right, key) &&
|
|
48
|
+
compareOptionValues(leftOptions[key], rightOptions[key], visited)));
|
|
49
|
+
}
|
|
50
|
+
/** Returns own enumerable keys, including symbols. */
|
|
51
|
+
function getEnumerableKeys(value) {
|
|
52
|
+
return Reflect.ownKeys(value).filter(key => Object.prototype.propertyIsEnumerable.call(value, key));
|
|
53
|
+
}
|
|
6
54
|
//# sourceMappingURL=loader-options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-options.js","sourceRoot":"","sources":["../../../src/lib/api/loader-options.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"loader-options.js","sourceRoot":"","sources":["../../../src/lib/api/loader-options.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAIpC,OAAO,EAAC,gBAAgB,IAAI,gBAAgB,EAAC,wCAAqC;AAClF,OAAO,EAAC,sBAAsB,IAAI,gBAAgB,EAAC,wCAAqC;AAExF;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAClC,IAA+B,EAC/B,KAAgC;IAEhC,OAAO,MAAM,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,mBAAmB,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CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IAEvB,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAoC,CAAC;IACzD,MAAM,YAAY,GAAG,KAAqC,CAAC;IAC3D,OAAO,CACL,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;QACpC,QAAQ,CAAC,KAAK,CACZ,GAAG,CAAC,EAAE,CACJ,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC;YACtD,mBAAmB,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,YAAY,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CACpE,CACF,CAAC;AACJ,CAAC;AAED,sDAAsD;AACtD,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CACzC,MAAM,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,EAAE,GAAG,CAAC,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LoaderArrayOptionsType, LoaderShapeType, LoaderOptionsType, LoaderOptionsWithShape, LoaderCallOptions, Loader, LoaderContext, LoaderOptions, LoaderReturnType, LoaderArrayReturnType, ReadableFile } from '@loaders.gl/core/loader-utils';
|
|
2
2
|
/**
|
|
3
3
|
* Parses a random access readable file asynchronously using the supplied loader.
|
|
4
4
|
*/
|
|
5
|
-
export declare function parseFile<LoaderT extends Loader
|
|
5
|
+
export declare function parseFile<LoaderT extends Loader>(file: ReadableFile, loader: LoaderT, options?: undefined, context?: LoaderContext): Promise<LoaderReturnType<LoaderT>>;
|
|
6
|
+
export declare function parseFile<LoaderT extends Loader, const OptionsT extends LoaderOptions = LoaderOptionsWithShape<LoaderOptionsType<LoaderT>, LoaderShapeType<LoaderT>>>(file: ReadableFile, loader: LoaderT, options?: OptionsT & LoaderCallOptions<NoInfer<LoaderT>, NoInfer<OptionsT>>, context?: LoaderContext): Promise<LoaderReturnType<LoaderT, OptionsT>>;
|
|
6
7
|
/**
|
|
7
8
|
* Parses a random access readable file asynchronously by matching one of the supplied loaders.
|
|
8
9
|
*/
|
|
9
|
-
export declare function parseFile<LoaderArrayT extends Loader[]
|
|
10
|
+
export declare function parseFile<LoaderArrayT extends Loader[]>(file: ReadableFile, loaders: LoaderArrayT, options?: undefined, context?: LoaderContext): Promise<LoaderArrayReturnType<LoaderArrayT>>;
|
|
11
|
+
export declare function parseFile<LoaderArrayT extends Loader[], const OptionsT extends LoaderOptions = LoaderArrayOptionsType<LoaderArrayT>>(file: ReadableFile, loaders: LoaderArrayT, options?: OptionsT, context?: LoaderContext): Promise<LoaderArrayReturnType<LoaderArrayT, OptionsT>>;
|
|
10
12
|
/**
|
|
11
13
|
* Parses a random access readable file asynchronously by matching a pre-registered loader.
|
|
12
14
|
* @deprecated Loader registration is deprecated, use parseFile(file, loaders, options) instead.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-file.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,
|
|
1
|
+
{"version":3,"file":"parse-file.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse-file.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,qBAAqB,EAErB,YAAY,EAEb,MAAM,+BAA+B,CAAC;AAUvC;;GAEG;AACH,wBAAsB,SAAS,CAAC,OAAO,SAAS,MAAM,EACpD,IAAI,EAAE,YAAY,EAClB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@ -1,7 +1,7 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import {
|
|
4
|
+
import { mergeOptions, resolveLoaderAuthenticationOptions } from '@loaders.gl/core/loader-utils';
|
|
5
5
|
import { validateWorkerVersion } from '@loaders.gl/core/worker-utils';
|
|
6
6
|
import { isLoaderObject } from "../loader-utils/normalize-loader.js";
|
|
7
7
|
import { normalizeOptions } from "../loader-utils/option-utils.js";
|
|
@@ -32,9 +32,6 @@ export async function parseFile(file, loaders, options, context) {
|
|
|
32
32
|
if (!loader) {
|
|
33
33
|
return null;
|
|
34
34
|
}
|
|
35
|
-
if (isSourceLoader(loader)) {
|
|
36
|
-
throw new Error(`${loader.id} is a SourceLoader. Use load() to create a runtime source object instead of parseFile().`);
|
|
37
|
-
}
|
|
38
35
|
// @ts-expect-error candidateLoaders may be a single forced loader
|
|
39
36
|
const normalizedOptions = normalizeOptions(options, loader, candidateLoaders, url);
|
|
40
37
|
const authenticationLoader = !loader.getAuthentications && normalizedOptions.core?.credentials?.length
|
|
@@ -44,7 +41,7 @@ export async function parseFile(file, loaders, options, context) {
|
|
|
44
41
|
context = getLoaderContext(
|
|
45
42
|
// @ts-expect-error candidateLoaders may be a single forced loader
|
|
46
43
|
{ url, _parse: parse, loaders: candidateLoaders }, strictOptions, context || null);
|
|
47
|
-
return
|
|
44
|
+
return parseFileWithLoader(loader, file, strictOptions, context);
|
|
48
45
|
}
|
|
49
46
|
/**
|
|
50
47
|
* Parses a readable file after a loader has been selected.
|
|
@@ -60,7 +57,9 @@ async function parseFileWithLoader(loader, file, options, context) {
|
|
|
60
57
|
options = mergeOptions(loader.options, options);
|
|
61
58
|
const loaderWithParser = await getLoaderImplementation(loader, options, context.url);
|
|
62
59
|
if (loaderWithParser.parseFile) {
|
|
63
|
-
|
|
60
|
+
const output = loaderWithParser.prepareParseOutput?.(options);
|
|
61
|
+
const result = await loaderWithParser.parseFile(file, output?.options ?? options, context);
|
|
62
|
+
return output ? output.convert(result) : result;
|
|
64
63
|
}
|
|
65
64
|
const parseFunction = loaderWithParser.parse;
|
|
66
65
|
if (parseFunction) {
|
|
@@ -71,6 +70,9 @@ async function parseFileWithLoader(loader, file, options, context) {
|
|
|
71
70
|
const data = await file.read(0n, length);
|
|
72
71
|
return await parse(data, loaderWithParser, options, context);
|
|
73
72
|
}
|
|
73
|
+
if (loaderWithParser.createDataSourceSync) {
|
|
74
|
+
throw new Error(`${loader.id} has no file parser. Use createDataSource() to open a source.`);
|
|
75
|
+
}
|
|
74
76
|
throw new Error(`${loader.id} loader - no file parser found`);
|
|
75
77
|
}
|
|
76
78
|
//# sourceMappingURL=parse-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-file.js","sourceRoot":"","sources":["../../../src/lib/api/parse-file.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"parse-file.js","sourceRoot":"","sources":["../../../src/lib/api/parse-file.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAiBpC,OAAO,EAAC,YAAY,EAAE,kCAAkC,EAAC,MAAM,+BAA+B,CAAC;AAC/F,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAC,cAAc,EAAC,4CAAyC;AAChE,OAAO,EAAC,gBAAgB,EAAC,wCAAqC;AAC9D,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,0CAAuC;AACvF,OAAO,EAAC,uBAAuB,EAAC,yBAAsB;AACtD,OAAO,EAAC,KAAK,EAAC,mBAAgB;AAC9B,OAAO,EAAC,YAAY,EAAC,2BAAwB;AAmD7C;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,IAAkB,EAClB,OAA2C,EAC3C,OAAuB,EACvB,OAAuB;IAEvB,I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;QACD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;QACzC,OAAO,MAAM,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,gBAAgB,CAAC,oBAAoB,EAAE,CAAC;QAC1C,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,EAAE,+DAA+D,CAAC,CAAC;IAC/F,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,EAAE,gCAAgC,CAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LoaderArrayOptionsType, LoaderShapeType, LoaderOptionsType, LoaderOptionsWithShape, LoaderCallOptions, Loader, LoaderOptions, LoaderContext, BatchableDataType, LoaderBatchType, LoaderArrayBatchType } from '@loaders.gl/core/loader-utils';
|
|
2
2
|
/**
|
|
3
3
|
* Parses `data` synchronously using a specified loader
|
|
4
4
|
*/
|
|
5
|
-
export declare function parseInBatches<LoaderT extends Loader
|
|
5
|
+
export declare function parseInBatches<LoaderT extends Loader>(data: BatchableDataType, loader: LoaderT, options?: undefined, context?: LoaderContext): Promise<AsyncIterable<LoaderBatchType<LoaderT>>>;
|
|
6
|
+
export declare function parseInBatches<LoaderT extends Loader, const OptionsT extends LoaderOptions = LoaderOptionsWithShape<LoaderOptionsType<LoaderT>, LoaderShapeType<LoaderT>>>(data: BatchableDataType, loader: LoaderT, options?: OptionsT & LoaderCallOptions<NoInfer<LoaderT>, NoInfer<OptionsT>>, context?: LoaderContext): Promise<AsyncIterable<LoaderBatchType<LoaderT, OptionsT>>>;
|
|
6
7
|
/**
|
|
7
8
|
* Parses `data` using one of the supplied loaders
|
|
8
9
|
*/
|
|
9
|
-
export declare function parseInBatches<LoaderArrayT extends Loader[]
|
|
10
|
+
export declare function parseInBatches<LoaderArrayT extends Loader[]>(data: BatchableDataType, loaders: LoaderArrayT, options?: undefined, context?: LoaderContext): Promise<AsyncIterable<LoaderArrayBatchType<LoaderArrayT>>>;
|
|
11
|
+
export declare function parseInBatches<LoaderArrayT extends Loader[], const OptionsT extends LoaderOptions = LoaderArrayOptionsType<LoaderArrayT>>(data: BatchableDataType, loaders: LoaderArrayT, options?: OptionsT, context?: LoaderContext): Promise<AsyncIterable<LoaderArrayBatchType<LoaderArrayT, OptionsT>>>;
|
|
10
12
|
/**
|
|
11
13
|
* Parses `data` in batches by selecting a pre-registered loader
|
|
12
14
|
* @deprecated Loader registration is deprecated, use parseInBatches(data, loaders, options) instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-in-batches.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse-in-batches.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"parse-in-batches.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse-in-batches.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,EAGN,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,oBAAoB,EAErB,MAAM,+BAA+B,CAAC;AAmBvC;;GAEG;AACH,wBAAsB,cAAc,CAAC,OAAO,SAAS,MAAM,EACzD,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,SAAS,EACnB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;AAEpD,wBAAsB,cAAc,CAClC,OAAO,SAAS,MAAM,EACtB,KAAK,CAAC,QAAQ,SAAS,aAAa,GAAG,sBAAsB,CAC3D,iBAAiB,CAAC,OAAO,CAAC,EAC1B,eAAe,CAAC,OAAO,CAAC,CACzB,EAED,IAAI,EAAE,iBAAiB,EACvB,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,QAAQ,GAAG,iBAAiB,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,EAC3E,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,aAAa,CAAC,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAE9D;;GAEG;AACH,wBAAsB,cAAc,CAAC,YAAY,SAAS,MAAM,EAAE,EAChE,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,SAAS,EACnB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;AAE9D,wBAAsB,cAAc,CAClC,YAAY,SAAS,MAAM,EAAE,EAC7B,KAAK,CAAC,QAAQ,SAAS,aAAa,GAAG,sBAAsB,CAAC,YAAY,CAAC,EAE3E,IAAI,EAAE,iBAAiB,EACvB,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;AAExE;;;GAGG;AAEH,wBAAsB,cAAc,CAClC,IAAI,EAAE,iBAAiB,EACvB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
+
import { usesNativeArrowBatches, isArrowTable, normalizeNativeArrowBatches } from "../loader-utils/native-arrow.js";
|
|
4
5
|
import { resolveLoaderAuthenticationOptions } from '@loaders.gl/core/loader-utils';
|
|
5
|
-
import { canParseWithWorkerInBatches, concatenateArrayBuffersAsync, parseWithWorkerInBatches } from '@loaders.gl/core/loader-utils';
|
|
6
|
+
import { canParseWithWorkerInBatches, concatenateArrayBuffersAsync, parseWithWorkerInBatches, paceBatchIterator, validateBatchDeliveryRate } from '@loaders.gl/core/loader-utils';
|
|
6
7
|
import { isLoaderObject } from "../loader-utils/normalize-loader.js";
|
|
7
8
|
import { normalizeOptions } from "../loader-utils/option-utils.js";
|
|
8
9
|
import { getLoaderContext } from "../loader-utils/loader-context.js";
|
|
@@ -38,7 +39,7 @@ context) {
|
|
|
38
39
|
// Chooses a loader and normalizes it
|
|
39
40
|
// Note - only uses URL and contentType for streams and iterator inputs
|
|
40
41
|
const loader = await selectLoader(data, loaders, options);
|
|
41
|
-
// Note: if options.nothrow was set, it is possible that no loader was found, if so just return null
|
|
42
|
+
// Note: if options.core.nothrow was set, it is possible that no loader was found, if so just return null
|
|
42
43
|
if (!loader) {
|
|
43
44
|
return [];
|
|
44
45
|
}
|
|
@@ -48,15 +49,36 @@ context) {
|
|
|
48
49
|
? await getLoaderImplementation(loader, normalizedOptions, url || context?.url)
|
|
49
50
|
: loader;
|
|
50
51
|
const strictOptions = await resolveLoaderAuthenticationOptions(authenticationLoader, url || '', normalizedOptions);
|
|
52
|
+
const nativeArrow = usesNativeArrowBatches(loader, strictOptions);
|
|
51
53
|
context = getLoaderContext({ url, _parseInBatches: parseInBatches, _parse: parse, loaders: loaderArray }, strictOptions, context || null);
|
|
52
54
|
const loaderWithParser = await getLoaderImplementation(loader, strictOptions, context.url);
|
|
53
|
-
|
|
55
|
+
const batches = await parseWithLoaderInBatches(loader, loaderWithParser, data, strictOptions, context);
|
|
56
|
+
return nativeArrow ? normalizeNativeArrowBatches(batches) : batches;
|
|
54
57
|
}
|
|
55
58
|
/**
|
|
56
59
|
* Loader has been selected and context has been prepared, see if we need to emit a metadata batch
|
|
57
60
|
*/
|
|
58
61
|
async function parseWithLoaderInBatches(originalLoader, loader, data, options, context) {
|
|
59
|
-
const
|
|
62
|
+
const { batchMaxRowsPerSecond = 0, batchSize } = options.core ?? {};
|
|
63
|
+
validateBatchDeliveryRate(batchMaxRowsPerSecond);
|
|
64
|
+
if (batchSize !== undefined &&
|
|
65
|
+
batchSize !== 'auto' &&
|
|
66
|
+
(!Number.isSafeInteger(batchSize) || batchSize < 1)) {
|
|
67
|
+
throw new RangeError('core.batchSize must be a positive integer or "auto"');
|
|
68
|
+
}
|
|
69
|
+
const parserOptions = batchMaxRowsPerSecond
|
|
70
|
+
? { ...options, core: { ...options.core, batchMaxRowsPerSecond: 0 } }
|
|
71
|
+
: options;
|
|
72
|
+
const output = loader.parseInBatches ? loader.prepareParseBatchOutput?.(parserOptions) : null;
|
|
73
|
+
const decoded = await parseToOutputIterator(loader, data, output?.options ?? parserOptions, context);
|
|
74
|
+
const batches = output ? convertOutputBatches(decoded, output.convert) : decoded;
|
|
75
|
+
const outputIterator = batchMaxRowsPerSecond
|
|
76
|
+
? paceBatchIterator(batches, {
|
|
77
|
+
batchMaxRowsPerSecond,
|
|
78
|
+
getRowCount: batch => getBatchRowCount(batch, loader.module),
|
|
79
|
+
signal: options.signal ?? context.signal
|
|
80
|
+
})
|
|
81
|
+
: batches;
|
|
60
82
|
// Generate metadata batch if requested
|
|
61
83
|
if (!options?.core?.metadata) {
|
|
62
84
|
return outputIterator;
|
|
@@ -78,6 +100,12 @@ async function parseWithLoaderInBatches(originalLoader, loader, data, options, c
|
|
|
78
100
|
}
|
|
79
101
|
return makeMetadataBatchIterator(outputIterator);
|
|
80
102
|
}
|
|
103
|
+
/** Converts batches as they are consumed and closes the decoder on early return. */
|
|
104
|
+
async function* convertOutputBatches(batches, convert) {
|
|
105
|
+
for await (const batch of batches) {
|
|
106
|
+
yield convert(batch);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
81
109
|
/**
|
|
82
110
|
* Prep work is done, now it is time to start parsing into an output operator
|
|
83
111
|
* The approach depends on which parse function the loader exposes
|
|
@@ -86,7 +114,7 @@ async function parseWithLoaderInBatches(originalLoader, loader, data, options, c
|
|
|
86
114
|
async function parseToOutputIterator(loader, data, options, context) {
|
|
87
115
|
// Get an iterator from the input
|
|
88
116
|
const inputIterator = await getAsyncIterableFromData(data, options);
|
|
89
|
-
// Apply any iterator transforms (options.transforms)
|
|
117
|
+
// Apply any iterator transforms (options.core.transforms)
|
|
90
118
|
const transformedIterator = await applyInputTransforms(inputIterator, options?.core?.transforms || []);
|
|
91
119
|
// Lease one worker for the complete iterator when the loader advertises batch support.
|
|
92
120
|
if (loader.parseInBatches) {
|
|
@@ -104,6 +132,10 @@ async function* parseChunkInBatches(transformedIterator, loader, options, contex
|
|
|
104
132
|
const parsedData = await parse(arrayBuffer, loader,
|
|
105
133
|
// TODO - Hack: supply loaders MIME type to ensure we match it
|
|
106
134
|
{ ...options, core: { ...options?.core, mimeType: loader.mimeTypes[0] } }, context);
|
|
135
|
+
if (isArrowTable(parsedData)) {
|
|
136
|
+
yield* parsedData.batches;
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
107
139
|
// yield a single batch, the output from loader.parse() repackaged as a batch
|
|
108
140
|
const batch = convertDataToBatch(parsedData, loader);
|
|
109
141
|
yield batch;
|
|
@@ -139,8 +171,6 @@ function isTable(value) {
|
|
|
139
171
|
return Array.isArray(table.features);
|
|
140
172
|
case 'columnar-table':
|
|
141
173
|
return Boolean(table.data && typeof table.data === 'object');
|
|
142
|
-
case 'arrow-table':
|
|
143
|
-
return Boolean(table.data && typeof table.data === 'object' && 'numRows' in table.data);
|
|
144
174
|
default:
|
|
145
175
|
return false;
|
|
146
176
|
}
|
|
@@ -153,8 +183,6 @@ function getTableLength(table) {
|
|
|
153
183
|
return table.data.length;
|
|
154
184
|
case 'geojson-table':
|
|
155
185
|
return table.features.length;
|
|
156
|
-
case 'arrow-table':
|
|
157
|
-
return table.data.numRows;
|
|
158
186
|
case 'columnar-table':
|
|
159
187
|
for (const column of Object.values(table.data)) {
|
|
160
188
|
return column.length || 0;
|
|
@@ -174,4 +202,27 @@ async function applyInputTransforms(inputIterator, transforms = []) {
|
|
|
174
202
|
}
|
|
175
203
|
return iteratorChain;
|
|
176
204
|
}
|
|
205
|
+
/** Reads row counts from data batches, including tagged trace and point-cloud batches. */
|
|
206
|
+
function getBatchRowCount(batch, module) {
|
|
207
|
+
if (!batch || typeof batch !== 'object')
|
|
208
|
+
return undefined;
|
|
209
|
+
if (module === 'geospatial' && Array.isArray(batch))
|
|
210
|
+
return batch.length;
|
|
211
|
+
const result = batch;
|
|
212
|
+
if (module === 'traces' &&
|
|
213
|
+
result.table !== undefined &&
|
|
214
|
+
result.table !== 'spans' &&
|
|
215
|
+
result.table !== 'slices') {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
if (result.batchType !== undefined && result.batchType !== 'data')
|
|
219
|
+
return undefined;
|
|
220
|
+
if (result.shape === 'unknown')
|
|
221
|
+
return undefined;
|
|
222
|
+
return (result.data?.numRows ??
|
|
223
|
+
result.numRows ??
|
|
224
|
+
result.header?.vertexCount ??
|
|
225
|
+
result.features?.length ??
|
|
226
|
+
result.length);
|
|
227
|
+
}
|
|
177
228
|
//# sourceMappingURL=parse-in-batches.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-in-batches.js","sourceRoot":"","sources":["../../../src/lib/api/parse-in-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"parse-in-batches.js","sourceRoot":"","sources":["../../../src/lib/api/parse-in-batches.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,2BAA2B,EAC5B,wCAAqC;AAGtC,OAAO,EAAC,kCAAkC,EAAC,MAAM,+BAA+B,CAAC;AAiBjF,OAAO,EACL,2BAA2B,EAC3B,4BAA4B,EAC5B,wBAAwB,EACxB,iBAAiB,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1
|
-
import type {
|
|
1
|
+
import type { LoaderArrayOptionsType, LoaderShapeType, LoaderOptionsType, LoaderOptionsWithShape, LoaderCallOptions, Loader, LoaderOptions, LoaderContext, SyncDataType, LoaderReturnType, LoaderArrayReturnType } from '@loaders.gl/core/loader-utils';
|
|
2
2
|
/**
|
|
3
3
|
* Parses `data` synchronously using the specified loader
|
|
4
4
|
*/
|
|
5
|
-
export declare function parseSync<LoaderT extends Loader
|
|
5
|
+
export declare function parseSync<LoaderT extends Loader>(data: SyncDataType, loader: LoaderT, options?: undefined, context?: LoaderContext): LoaderReturnType<LoaderT>;
|
|
6
|
+
export declare function parseSync<LoaderT extends Loader, const OptionsT extends LoaderOptions = LoaderOptionsWithShape<LoaderOptionsType<LoaderT>, LoaderShapeType<LoaderT>>>(data: SyncDataType, loader: LoaderT, options?: OptionsT & LoaderCallOptions<NoInfer<LoaderT>, NoInfer<OptionsT>>, context?: LoaderContext): LoaderReturnType<LoaderT, OptionsT>;
|
|
6
7
|
/**
|
|
7
8
|
* Parses `data` synchronously by matching one of the supplied loaders
|
|
8
9
|
*/
|
|
9
|
-
export declare function parseSync<LoaderArrayT extends Loader[]
|
|
10
|
+
export declare function parseSync<LoaderArrayT extends Loader[]>(data: SyncDataType, loaders: LoaderArrayT, options?: undefined, context?: LoaderContext): LoaderArrayReturnType<LoaderArrayT>;
|
|
11
|
+
export declare function parseSync<LoaderArrayT extends Loader[], const OptionsT extends LoaderOptions = LoaderArrayOptionsType<LoaderArrayT>>(data: SyncDataType, loaders: LoaderArrayT, options?: OptionsT, context?: LoaderContext): LoaderArrayReturnType<LoaderArrayT, OptionsT>;
|
|
10
12
|
/**
|
|
11
13
|
* Parses `data` synchronously by matching a pre=registered loader
|
|
12
14
|
* @deprecated Loader registration is deprecated, use parseSync(data, loaders, options) instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-sync.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse-sync.ts"],"names":[],"mappings":"AA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AQ,SAAS,aAAa,GAAG,sBAAsB,CAAC,YAAY,CAAC,EAE3E,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,QAAQ,EAClB,OAAO,CAAC,EAAE,aAAa,GACtB,qBAAqB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
// loaders.gl
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
|
-
import { isSourceLoader } from '@loaders.gl/core/loader-utils';
|
|
5
4
|
import { selectLoaderSync } from "./select-loader.js";
|
|
6
5
|
import { isLoaderObject } from "../loader-utils/normalize-loader.js";
|
|
7
6
|
import { normalizeOptions } from "../loader-utils/option-utils.js";
|
|
@@ -30,9 +29,6 @@ export function parseSync(data, loaders, options, context) {
|
|
|
30
29
|
if (!loader) {
|
|
31
30
|
return null;
|
|
32
31
|
}
|
|
33
|
-
if (isSourceLoader(loader)) {
|
|
34
|
-
throw new Error(`${loader.id} is a SourceLoader. Use load() to create a runtime source object instead of parseSync().`);
|
|
35
|
-
}
|
|
36
32
|
// Normalize options
|
|
37
33
|
const strictOptions = normalizeOptions(options, loader, candidateLoaders);
|
|
38
34
|
// Extract a url for auto detection
|
|
@@ -56,6 +52,9 @@ function parseWithLoaderSync(loader, data, options, context) {
|
|
|
56
52
|
if (loader.preload) {
|
|
57
53
|
throw new Error(`${loader.name} loader: 'parseSync' requires a parser-bearing loader. Import the loader implementation directly, or call preload(loader) before parseSync(). ${context.url || ''}`);
|
|
58
54
|
}
|
|
55
|
+
if (loader.createDataSourceSync) {
|
|
56
|
+
throw new Error(`${loader.id} has no synchronous parser. Use createDataSource() to open a source.`);
|
|
57
|
+
}
|
|
59
58
|
// TBD - If synchronous parser not available, return null
|
|
60
59
|
throw new Error(`${loader.name} loader: 'parseSync' not supported by this loader, use 'parse' instead. ${context.url || ''}`);
|
|
61
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse-sync.js","sourceRoot":"","sources":["../../../src/lib/api/parse-sync.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;
|
|
1
|
+
{"version":3,"file":"parse-sync.js","sourceRoot":"","sources":["../../../src/lib/api/parse-sync.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAiBpC,OAAO,EAAC,gBAAgB,EAAC,2BAAwB;AACjD,OAAO,EAAC,cAAc,EAAC,4CAAyC;AAChE,OAAO,EAAC,gBAAgB,EAAC,wCAAqC;AAC9D,OAAO,EAAC,kCAAkC,EAAC,oCAAiC;AAC5E,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,0CAAuC;AACvF,OAAO,EAAC,cAAc,EAAC,mCAAgC;AACvD,OAAO,EAAC,2BAA2B,EAAC,yBAAsB;AAqD1D;;GAEG;AACH,MAAM,UAAU,SAAS,CACvB,IAAkB,EAClB,OAA2C,EAC3C,OAAuB,EACvB,OAAuB;IAEvB,sCAAsC;IACtC,0BAA0B;IAC1B,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,CAAC;QACxD,OAAO,GAAG,SAAS,CAAC,CAAC,2CAA2C;QAChE,OAAO,GAAG,OAAwB,CAAC;QACnC,OAAO,GAAG,SAAS,CAAC;IACtB,CAAC;IAED,OAAO,GAAG,OAAO,IAAI,EAAE,CAAC;IAExB,uCAAuC;IACvC,iEAAiE;IACjE,MAAM,YAAY,GAAG,OAAwC,CAAC;IAC9D,MAAM,gBAAgB,GAAG,qBAAqB,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IACtE,MAAM,MAAM,GAAG,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,aAAa;IAChE,CAAC;IAED,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,CAAC,IAAI,iJAAiJ,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CACnL,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,oBAAoB,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,CAAC,EAAE,sEAAsE,CACnF,CAAC;IACJ,CAAC;IAED,yDAAyD;IACzD,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,CAAC,IAAI,2EACZ,OAAO,CAAC,GAAG,IAAI,EACjB,EAAE,CACH,CAAC;AACJ,CAAC"}
|
package/dist/lib/api/parse.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LoaderArrayOptionsType, LoaderShapeType, LoaderOptionsType, LoaderOptionsWithShape, LoaderCallOptions, Loader, LoaderContext, LoaderOptions, DataType, LoaderReturnType, LoaderArrayReturnType } from '@loaders.gl/core/loader-utils';
|
|
2
2
|
/**
|
|
3
3
|
* Parses `data` asynchronously using the supplied loader
|
|
4
4
|
*/
|
|
5
|
-
export declare function parse<LoaderT extends Loader
|
|
5
|
+
export declare function parse<LoaderT extends Loader>(data: DataType | Promise<DataType>, loader: LoaderT, options?: undefined, context?: LoaderContext): Promise<LoaderReturnType<LoaderT>>;
|
|
6
|
+
export declare function parse<LoaderT extends Loader, const OptionsT extends LoaderOptions = LoaderOptionsWithShape<LoaderOptionsType<LoaderT>, LoaderShapeType<LoaderT>>>(data: DataType | Promise<DataType>, loader: LoaderT, options?: OptionsT & LoaderCallOptions<NoInfer<LoaderT>, NoInfer<OptionsT>>, context?: LoaderContext): Promise<LoaderReturnType<LoaderT, OptionsT>>;
|
|
6
7
|
/**
|
|
7
8
|
* Parses `data` asynchronously by matching one of the supplied loader
|
|
8
9
|
*/
|
|
9
|
-
export declare function parse<LoaderArrayT extends Loader[]
|
|
10
|
+
export declare function parse<LoaderArrayT extends Loader[]>(data: DataType | Promise<DataType>, loaders: LoaderArrayT, options?: undefined, context?: LoaderContext): Promise<LoaderArrayReturnType<LoaderArrayT>>;
|
|
11
|
+
export declare function parse<LoaderArrayT extends Loader[], const OptionsT extends LoaderOptions = LoaderArrayOptionsType<LoaderArrayT>>(data: DataType | Promise<DataType>, loaders: LoaderArrayT, options?: OptionsT, context?: LoaderContext): Promise<LoaderArrayReturnType<LoaderArrayT, OptionsT>>;
|
|
10
12
|
/**
|
|
11
13
|
* Parses data asynchronously by matching a pre-registered loader
|
|
12
14
|
* @deprecated Loader registration is deprecated, use parse(data, loaders, options) instead
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,MAAM,EACN,aAAa,EACb,aAAa,EACb,
|
|
1
|
+
{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../../src/lib/api/parse.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,iBAAiB,EACjB,MAAM,EACN,aAAa,EACb,aAAa,EACb,QAAQ,EAER,gBAAgB,EAChB,qBAAqB,EAEtB,MAAM,+BAA+B,CAAC;AAoBvC;;GAEG;AACH,wBAAsB,KAAK,CAAC,OAAO,SAAS,MAAM,EAChD,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,EAClC,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,SAAS,EACnB,OAAO,CAAC,EAAE,aAAa,GACtB,OAAO,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,CAAC;AAEtC,wBAAsB,KAAK,CACzB,OAAO,SAAS,MAAM,EACtB,KAAK,CAAC,QAAQ,SAAS,aAAa,GAAG,sBAAsB,CAC3D,iBAAiB,CAAC,O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LoaderAuthenticationOptions } from '@loaders.gl/core/loader-utils';
|
|
5
|
-
import { parseWithWorker, shouldParseWithWorker, mergeOptions, isResponse, isBlob
|
|
5
|
+
import { parseWithWorker, shouldParseWithWorker, mergeOptions, isResponse, isBlob } from '@loaders.gl/core/loader-utils';
|
|
6
6
|
import { validateWorkerVersion } from '@loaders.gl/core/worker-utils';
|
|
7
7
|
import { isLoaderObject } from "../loader-utils/normalize-loader.js";
|
|
8
8
|
import { normalizeOptions } from "../loader-utils/option-utils.js";
|
|
@@ -10,7 +10,7 @@ import { getArrayBufferOrStringFromData } from "../loader-utils/get-data.js";
|
|
|
10
10
|
import { getArrayBufferFromData } from "../loader-utils/get-data.js";
|
|
11
11
|
import { getLoaderContext, getLoadersFromContext } from "../loader-utils/loader-context.js";
|
|
12
12
|
import { getResourceUrl } from "../utils/resource-utils.js";
|
|
13
|
-
import { getLoaderImplementation } from "./load-loader.js";
|
|
13
|
+
import { getLoaderImplementation, isLoaderWithParser } from "./load-loader.js";
|
|
14
14
|
import { selectLoader } from "./select-loader.js";
|
|
15
15
|
/**
|
|
16
16
|
* Parses `data` using a specified loader
|
|
@@ -44,9 +44,6 @@ export async function parse(data, loaders, options, context) {
|
|
|
44
44
|
if (!loader) {
|
|
45
45
|
return null;
|
|
46
46
|
}
|
|
47
|
-
if (isSourceLoader(loader)) {
|
|
48
|
-
throw new Error(`${loader.id} is a SourceLoader. Use load() to create a runtime source object instead of parse().`);
|
|
49
|
-
}
|
|
50
47
|
// Normalize options
|
|
51
48
|
// @ts-expect-error candidateLoaders
|
|
52
49
|
const normalizedOptions = normalizeOptions(options, loader, candidateLoaders, url); // Could be invalid...
|
|
@@ -58,7 +55,7 @@ export async function parse(data, loaders, options, context) {
|
|
|
58
55
|
context = getLoaderContext(
|
|
59
56
|
// @ts-expect-error
|
|
60
57
|
{ url, _parse: parse, loaders: candidateLoaders }, strictOptions, context || null);
|
|
61
|
-
return
|
|
58
|
+
return parseWithLoader(loader, data, strictOptions, context);
|
|
62
59
|
}
|
|
63
60
|
// TODO - should accept loader.parseAsyncIterator and concatenate.
|
|
64
61
|
async function parseWithLoader(loader, data, options, context) {
|
|
@@ -73,15 +70,24 @@ async function parseWithLoader(loader, data, options, context) {
|
|
|
73
70
|
context.response = { headers, ok, redirected, status, statusText, type, url };
|
|
74
71
|
}
|
|
75
72
|
const loaderWithParser = await getLoaderImplementation(loader, options, context.url);
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
73
|
+
if (loaderWithParser.createDataSourceSync && !isLoaderWithParser(loaderWithParser)) {
|
|
74
|
+
throw new Error(`${loader.id} creates sources. Use createDataSource() to open a source.`);
|
|
75
|
+
}
|
|
76
|
+
const output = loaderWithParser.prepareParseOutput?.(options);
|
|
77
|
+
const parseOptions = output?.options ?? options;
|
|
78
|
+
let result;
|
|
79
|
+
if (shouldParseWithWorker(loaderWithParser, data, parseOptions, context, loader)) {
|
|
80
|
+
data = await getArrayBufferFromData(data, parseOptions);
|
|
81
|
+
result = await parseWithWorker(loaderWithParser, data, parseOptions, context, parse);
|
|
79
82
|
}
|
|
80
|
-
if (isBlob(data) && loaderWithParser.parseBlob) {
|
|
81
|
-
|
|
83
|
+
else if (isBlob(data) && loaderWithParser.parseBlob) {
|
|
84
|
+
result = await loaderWithParser.parseBlob(data, parseOptions, context);
|
|
82
85
|
}
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
else {
|
|
87
|
+
data = await getArrayBufferOrStringFromData(data, loader, parseOptions);
|
|
88
|
+
result = await parseWithLoaderImplementation(loaderWithParser, data, parseOptions, context);
|
|
89
|
+
}
|
|
90
|
+
return output ? output.convert(result) : result;
|
|
85
91
|
}
|
|
86
92
|
async function parseWithLoaderImplementation(loader, data, options, context) {
|
|
87
93
|
if (loader.parseText && typeof data === 'string') {
|
|
@@ -94,10 +100,12 @@ async function parseWithLoaderImplementation(loader, data, options, context) {
|
|
|
94
100
|
if (loader.parse) {
|
|
95
101
|
return await loader.parse(data, options, context);
|
|
96
102
|
}
|
|
97
|
-
// All parser-bearing sync loaders should also offer `parse` so async APIs can use them.
|
|
98
103
|
if (loader.parseSync) {
|
|
99
104
|
throw new Error(`${loader.name} loader: 'parse' not available on parser-bearing sync loader. Add an async 'parse' function to this loader, or call preload(loader) before parseSync(). ${context.url || ''}`);
|
|
100
105
|
}
|
|
106
|
+
if (loader.createDataSourceSync) {
|
|
107
|
+
throw new Error(`${loader.id} creates sources. Use createDataSource() to open a source.`);
|
|
108
|
+
}
|
|
101
109
|
// TBD - If asynchronous parser not available, return null
|
|
102
110
|
throw new Error(`${loader.id} loader - no parser found and worker is disabled`);
|
|
103
111
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/lib/api/parse.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,kCAAkC,EAAC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"parse.js","sourceRoot":"","sources":["../../../src/lib/api/parse.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EAAC,kCAAkC,EAAC,MAAM,+BAA+B,CAAC;AAgBjF,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,YAAY,EACZ,UAAU,EACV,MAAM,EACP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,qBAAqB,EAAC,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAC,cAAc,EAAC,4CAAyC;AAChE,OAAO,EAAC,gBAAgB,EAAC,wCAAqC;AAC9D,OAAO,EAAC,8BAA8B,EAAC,oCAAiC;AACxE,OAAO,EAAC,sBAAsB,EAAC,oCAAiC;AAChE,OAAO,EAAC,gBAAgB,EAAE,qBAAqB,EAAC,0CAAuC;AACvF,OAAO,EAAC,cAAc,EAAC,mCAAgC;AACvD,OAAO,EAAC,uBAAuB,EAAE,kBAAkB,EAAC,yBA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AAC,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;AAClD,CAAC;AAED,KAAK,UAAU,6BAA6B,CAC1C,MAAwB,EACxB,IAA0B,EAC1B,OAA4B,EAC5B,OAAsB;IAEtB,IAAI,MAAM,CAAC,SAAS,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACjD,OAAO,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACxD,CAAC;IAED,iEAAiE;IACjE,IAAI,MAAM,CAAC,aAAa,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QACrD,OAAO,MAAM,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,MAAM,MAAM,CAAC,KAAK,CAAC,IAAmB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;IAED,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CACb,GAAG,MAAM,CAAC,IAAI,2JAA2J,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE,CAC7L,CAAC;IACJ,CAAC;IAED,IAAI,MAAM,CAAC,oBAAoB,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,EAAE,4DAA4D,CAAC,CAAC;IAC5F,CAAC;IAED,0DAA0D;IAC1D,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,CAAC,EAAE,kDAAkD,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -7,8 +7,9 @@ import type { LoaderContext, LoaderOptions, Loader, DataType } from '@loaders.gl
|
|
|
7
7
|
* @param loaders
|
|
8
8
|
* @param options
|
|
9
9
|
* @param context used internally, applications should not provide this parameter
|
|
10
|
+
* @param operation selects the URL matching priority for parsing or source creation
|
|
10
11
|
*/
|
|
11
|
-
export declare function selectLoader(data: DataType, loaders?: Loader[] | Loader, options?: LoaderOptions, context?: LoaderContext): Promise<Loader | null>;
|
|
12
|
+
export declare function selectLoader(data: DataType, loaders?: Loader[] | Loader, options?: LoaderOptions, context?: LoaderContext, operation?: 'parse' | 'source'): Promise<Loader | null>;
|
|
12
13
|
/**
|
|
13
14
|
* Find a loader that matches file extension and/or initial file content
|
|
14
15
|
* Search the loaders array argument for a loader that matches url extension or initial data
|
|
@@ -17,6 +18,7 @@ export declare function selectLoader(data: DataType, loaders?: Loader[] | Loader
|
|
|
17
18
|
* @param loaders
|
|
18
19
|
* @param options
|
|
19
20
|
* @param context used internally, applications should not provide this parameter
|
|
21
|
+
* @param operation selects the URL matching priority for parsing or source creation
|
|
20
22
|
*/
|
|
21
|
-
export declare function selectLoaderSync(data: DataType, loaders?: Loader[] | Loader, options?: LoaderOptions, context?: LoaderContext): Loader | null;
|
|
23
|
+
export declare function selectLoaderSync(data: DataType, loaders?: Loader[] | Loader, options?: LoaderOptions, context?: LoaderContext, operation?: 'parse' | 'source'): Loader | null;
|
|
22
24
|
//# sourceMappingURL=select-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/api/select-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"select-loader.d.ts","sourceRoot":"","sources":["../../../src/lib/api/select-loader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,aAAa,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AAsBlG;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,MAAM,EAAE,GAAG,MAAW,EAC/B,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,aAAa,EACvB,SAAS,GAAE,OAAO,GAAG,QAAkB,GACtC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAmCxB;AAYD;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,OAAO,GAAE,MAAM,EAAE,GAAG,MAAW,EAC/B,OAAO,CAAC,EAAE,aAAa,EACvB,OAAO,CAAC,EAAE,aAAa,EACvB,SAAS,GAAE,OAAO,GAAG,QAAkB,GACtC,MAAM,GAAG,IAAI,CA0Bf"}
|