@loaders.gl/core 5.0.0-beta.10 → 5.0.0-beta.12
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/SCAN-README.md +2 -2
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-features.cjs +4 -1
- package/dist/arrow-geometry/binary-features.cjs.map +2 -2
- package/dist/arrow-geometry/binary-features.d.ts.map +1 -1
- package/dist/arrow-geometry/binary-features.js +1 -1
- package/dist/arrow-geometry/binary-features.js.map +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 +1 -5
- 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 +2 -6
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -10
- 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 -13
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +3 -3
- package/dist/arrow-geometry/geojson-table.cjs.map +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts +1 -1
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +2 -2
- 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/legacy-binary/convert-flat-geojson-to-binary-features.cjs +3 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs.map +2 -2
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js +3 -1
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.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 +8 -76
- package/dist/arrow-worker-transport.cjs.map +1 -1
- package/dist/arrow-worker-transport.d.ts +4 -8
- package/dist/arrow-worker-transport.d.ts.map +1 -1
- package/dist/arrow-worker-transport.js +15 -89
- package/dist/arrow-worker-transport.js.map +1 -1
- package/dist/cluster-source.cjs +47 -45
- package/dist/cluster-source.cjs.map +2 -2
- package/dist/dist.dev.js +71 -60
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +88 -126
- package/dist/federated-table-scan-source.cjs.map +2 -2
- 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 +12 -12
- 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 +12 -14
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +4 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +5 -5
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +6 -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 +3 -3
- 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 +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.d.ts.map +1 -1
- 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 +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +2 -3
- 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 +2 -3
- 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 +10 -11
- 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 +9 -12
- 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 +5 -2
- 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.js +2 -2
- 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.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
- package/dist/index.cjs +69 -54
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +2 -4
- 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.map +1 -1
- package/dist/lib/api/parse-file.js +2 -5
- package/dist/lib/api/parse-file.js.map +1 -1
- package/dist/lib/api/parse-in-batches.js +6 -10
- package/dist/lib/api/parse-in-batches.js.map +1 -1
- package/dist/lib/api/parse-sync.d.ts.map +1 -1
- package/dist/lib/api/parse-sync.js +2 -5
- package/dist/lib/api/parse-sync.js.map +1 -1
- package/dist/lib/api/parse.d.ts.map +1 -1
- package/dist/lib/api/parse.js +2 -5
- package/dist/lib/api/parse.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +5 -8
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -1
- package/dist/lib/loader-utils/native-arrow.js +13 -31
- package/dist/lib/loader-utils/native-arrow.js.map +1 -1
- package/dist/loader-utils/index.cjs +48 -31
- package/dist/loader-utils/index.cjs.map +1 -1
- package/dist/loader-utils/index.d.ts +1 -1
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +1 -1
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +6 -2
- 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 +1 -0
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +15 -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 +36 -22
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +2 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/tile-grid.d.ts +6 -1
- package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/tile-grid.js +32 -14
- package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +3 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +3 -5
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/tile-grid.cjs +21 -9
- package/dist/loader-utils/tile-grid.cjs.map +1 -1
- package/dist/null-loader.js +1 -1
- package/dist/null-worker-node.js +1 -1
- package/dist/null-worker.js +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +4 -4
- package/dist/scan/arrow-execution/expressions.cjs.map +2 -2
- package/dist/scan/arrow-execution/expressions.d.ts +4 -4
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
- package/dist/scan/arrow-execution/expressions.js +4 -4
- package/dist/scan/arrow-execution/expressions.js.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
- 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/federated-table-scan-source.cjs +12 -13
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +14 -15
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +5 -2
- package/dist/scan/index.cjs.map +2 -2
- package/dist/scan/index.d.ts +2 -1
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +2 -1
- package/dist/scan/index.js.map +1 -1
- package/dist/scan/parse-sql-predicate.cjs +2 -2
- package/dist/scan/parse-sql-predicate.cjs.map +2 -2
- package/dist/scan/parse-sql-predicate.js +1 -1
- package/dist/scan/parse-sql-predicate.js.map +1 -1
- package/dist/scan/query-pushdown.cjs +6 -6
- package/dist/scan/query-pushdown.cjs.map +2 -2
- package/dist/scan/query-pushdown.d.ts +1 -1
- package/dist/scan/query-pushdown.d.ts.map +1 -1
- package/dist/scan/query-pushdown.js +3 -6
- package/dist/scan/query-pushdown.js.map +1 -1
- package/dist/scan/query-scales.cjs +195 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +47 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +201 -0
- package/dist/scan/query-scales.js.map +1 -0
- package/dist/scan/query.cjs +49 -45
- package/dist/scan/query.cjs.map +2 -2
- package/dist/scan/query.d.ts +7 -4
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +35 -52
- package/dist/scan/query.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +19 -13
- package/dist/scan/vector-table-scan-source.cjs.map +3 -3
- package/dist/scan/vector-table-scan-source.d.ts +3 -4
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +11 -12
- 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 +2 -2
- package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.ts +2 -2
- package/dist/schema/index.d.ts.map +1 -1
- 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 +420 -503
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +4 -5
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +4 -5
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +4 -5
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +21 -18
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +6 -11
- 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 +4 -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 +13 -15
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts +2 -2
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +1 -1
- 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 +3 -1
- 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/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +5 -8
- 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 +1 -1
- 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 +2 -6
- 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 +1 -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 +4 -24
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +3 -6
- 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 +8 -58
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +2 -2
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +2 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +2 -2
- 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 +4 -4
- 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 +17 -11
- package/dist/vector-table-scan-source.cjs.map +2 -2
- package/dist/wkt/index.cjs.map +1 -1
- package/dist/wkt/index.d.ts.map +1 -1
- package/dist/wkt/index.js.map +1 -1
- package/dist/worker-utils/index.cjs +2 -2
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -1
- package/dist/worker-utils/lib/npm-tag.js.map +1 -1
- package/dist/worker-utils/null-worker-node.js.map +1 -1
- package/dist/worker-utils/null-worker.js.map +1 -1
- package/package.json +22 -8
- package/src/arrow-geometry/binary-features.ts +4 -1
- package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
- package/src/arrow-geometry/feature-collection-to-arrow.ts +5 -8
- package/src/arrow-geometry/feature-table.ts +8 -21
- package/src/arrow-geometry/geojson-table.ts +2 -2
- package/src/arrow-geometry/geometry-codecs.ts +2 -2
- package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
- package/src/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.ts +3 -1
- 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 +22 -121
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +16 -23
- package/src/geoarrow/convert-table-to-geoarrow.ts +11 -23
- 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 -7
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +2 -2
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +2 -4
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +15 -15
- 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 +5 -2
- 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 +7 -5
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lib/api/load.ts +2 -12
- package/src/lib/api/loader-options.ts +69 -0
- package/src/lib/api/parse-file.ts +2 -11
- package/src/lib/api/parse-in-batches.ts +8 -12
- package/src/lib/api/parse-sync.ts +3 -7
- package/src/lib/api/parse.ts +2 -6
- package/src/lib/loader-utils/native-arrow.ts +12 -38
- package/src/loader-utils/index.ts +0 -1
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +7 -6
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +64 -41
- package/src/loader-utils/lib/sources/table-source-collection.ts +2 -1
- package/src/loader-utils/lib/sources/tile-grid.ts +34 -18
- package/src/loader-utils/lib/sources/vector-tile-source.ts +3 -9
- package/src/loader-utils/loader-types.ts +3 -3
- package/src/scan/arrow-execution/expressions.ts +7 -7
- package/src/scan/arrow-execution/filter-arrow-table.ts +1 -1
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/federated-table-scan-source.ts +15 -18
- package/src/scan/index.ts +7 -1
- package/src/scan/parse-sql-predicate.ts +1 -1
- package/src/scan/query-pushdown.ts +7 -7
- package/src/scan/query-scales.ts +299 -0
- package/src/scan/query.ts +68 -71
- package/src/scan/vector-table-scan-source.ts +16 -21
- 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 +2 -2
- package/src/schema/index.ts +1 -3
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +5 -11
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +33 -30
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +12 -38
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +15 -18
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +4 -13
- package/src/schema-utils/lib/schema/deduce-table-schema.ts +4 -2
- package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
- package/src/schema-utils/lib/table/batches/convert-batches.ts +5 -8
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +2 -6
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +5 -27
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +11 -73
- package/src/schema-utils/lib/table/tables/make-table.ts +2 -2
- package/src/schema-utils/lib/table/tables/table-accessors.ts +2 -22
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +6 -6
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/wkt/index.ts +1 -1
- package/src/worker-utils/lib/npm-tag.ts +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts +0 -27
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js +0 -23
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js.map +0 -1
- package/src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts +0 -54
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type {RecordBatch, Table} from 'apache-arrow';
|
|
6
6
|
import {makeArrowMetadataBatch} from '@loaders.gl/core/schema-utils';
|
|
7
|
-
import
|
|
7
|
+
import {isArrowTable} from '../lib/loader-utils/native-arrow';
|
|
8
8
|
import {convertArrowToSchema} from '@loaders.gl/core/schema-utils';
|
|
9
9
|
import type {
|
|
10
10
|
GetFeaturesParameters,
|
|
@@ -61,7 +61,7 @@ export abstract class AddressedVectorTableScanSource {
|
|
|
61
61
|
/** Spatial extent of the bound physical selection. */
|
|
62
62
|
readonly spatial?: ScanSpatialMetadata;
|
|
63
63
|
|
|
64
|
-
private tablePromise: Promise<
|
|
64
|
+
private tablePromise: Promise<Table> | null = null;
|
|
65
65
|
|
|
66
66
|
/** Creates a table-scan view over one immutable physical selection. */
|
|
67
67
|
protected constructor(
|
|
@@ -79,12 +79,12 @@ export abstract class AddressedVectorTableScanSource {
|
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
/** Loads the physically addressed data as one Arrow table. */
|
|
82
|
-
protected abstract loadTable(signal?: AbortSignal): Promise<
|
|
82
|
+
protected abstract loadTable(signal?: AbortSignal): Promise<Table | null>;
|
|
83
83
|
|
|
84
84
|
/** Discovers the addressed result schema and portable residual-query capabilities. */
|
|
85
85
|
async getQueryMetadata(options: ScanQueryMetadataOptions = {}): Promise<ScanQueryMetadata> {
|
|
86
86
|
const table = await this.getTable(options.signal);
|
|
87
|
-
const schema =
|
|
87
|
+
const schema = convertArrowToSchema(table.schema);
|
|
88
88
|
return createScanQueryMetadata({
|
|
89
89
|
sourceType: this.sourceType,
|
|
90
90
|
queryType: 'table',
|
|
@@ -99,20 +99,20 @@ export abstract class AddressedVectorTableScanSource {
|
|
|
99
99
|
},
|
|
100
100
|
columnRoles: inferVectorColumnRoles(schema.fields.map(field => field.name)),
|
|
101
101
|
spatial: this.spatial,
|
|
102
|
-
statistics: {rowCount: table.
|
|
102
|
+
statistics: {rowCount: table.numRows}
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
/** Applies the portable Arrow query to the addressed feature table. */
|
|
107
107
|
async query(options: ArrowQueryOptions = {}): Promise<Table> {
|
|
108
108
|
const table = await this.getTable(options.signal);
|
|
109
|
-
return queryArrowTable(table
|
|
109
|
+
return queryArrowTable(table, options);
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/** Explains the residual Arrow plan after resolving the addressed feature table. */
|
|
113
113
|
async explain(options: ArrowQueryOptions = {}): Promise<TableQueryExplain<SQLPredicate>> {
|
|
114
114
|
const table = await this.getTable(options.signal);
|
|
115
|
-
return explainArrowTableQuery(table
|
|
115
|
+
return explainArrowTableQuery(table, options);
|
|
116
116
|
}
|
|
117
117
|
|
|
118
118
|
/** Emits the portable query result as one bounded Arrow batch. */
|
|
@@ -128,7 +128,7 @@ export abstract class AddressedVectorTableScanSource {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/** Resolves and caches the addressed table while allowing failed loads to be retried. */
|
|
131
|
-
private async getTable(signal?: AbortSignal): Promise<
|
|
131
|
+
private async getTable(signal?: AbortSignal): Promise<Table> {
|
|
132
132
|
throwIfAborted(signal);
|
|
133
133
|
if (!this.tablePromise) {
|
|
134
134
|
this.tablePromise = this.loadTable()
|
|
@@ -136,11 +136,6 @@ export abstract class AddressedVectorTableScanSource {
|
|
|
136
136
|
if (!table) {
|
|
137
137
|
throw new Error('The addressed vector selection did not return a feature table.');
|
|
138
138
|
}
|
|
139
|
-
if (table.shape !== 'arrow-table') {
|
|
140
|
-
throw new Error(
|
|
141
|
-
'The addressed vector selection must return an Arrow table. Configure the source with shape "arrow".'
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
139
|
return table;
|
|
145
140
|
})
|
|
146
141
|
.catch(error => {
|
|
@@ -183,12 +178,12 @@ export class VectorTileTableScanSource extends AddressedVectorTableScanSource {
|
|
|
183
178
|
}
|
|
184
179
|
|
|
185
180
|
/** Loads the bound vector tile using the source's requested Arrow output shape. */
|
|
186
|
-
protected loadTable(signal?: AbortSignal): Promise<
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
181
|
+
protected async loadTable(signal?: AbortSignal): Promise<Table | null> {
|
|
182
|
+
const tile = await this.source.getVectorTile({...this.tile, signal});
|
|
183
|
+
if (tile === null || isArrowTable(tile)) return tile;
|
|
184
|
+
throw new Error(
|
|
185
|
+
'The addressed vector selection must return an Arrow table. Configure the source with shape "arrow".'
|
|
186
|
+
);
|
|
192
187
|
}
|
|
193
188
|
}
|
|
194
189
|
|
|
@@ -232,9 +227,9 @@ export class VectorFeatureTableScanSource extends AddressedVectorTableScanSource
|
|
|
232
227
|
}
|
|
233
228
|
|
|
234
229
|
/** Loads the bound service request through the source's Arrow feature output. */
|
|
235
|
-
protected async loadTable(signal?: AbortSignal): Promise<
|
|
230
|
+
protected async loadTable(signal?: AbortSignal): Promise<Table | null> {
|
|
236
231
|
const data = await this.source.getFeatures({...this.request, format: 'arrow', signal});
|
|
237
|
-
return
|
|
232
|
+
return isArrowTable(data) ? data : null;
|
|
238
233
|
}
|
|
239
234
|
}
|
|
240
235
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import type {Schema} from '../types/schema';
|
|
6
6
|
import type {TypedArray} from '../types/types';
|
|
7
|
-
import type {ColumnarTable
|
|
7
|
+
import type {ColumnarTable} from './category-table';
|
|
8
8
|
import * as arrow from 'apache-arrow';
|
|
9
9
|
|
|
10
10
|
/** Mesh as columnar table */
|
|
@@ -14,16 +14,8 @@ export interface MeshTable extends ColumnarTable {
|
|
|
14
14
|
indices?: MeshAttribute;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
export
|
|
19
|
-
// shape: 'mesh-arrow-table';
|
|
20
|
-
/** Mesh topology represented by the Arrow table rows and indices. */
|
|
21
|
-
topology: MeshTopology;
|
|
22
|
-
/** Optional top-level primitive indices accessor for indexed meshes. */
|
|
23
|
-
indices?: MeshAttribute;
|
|
24
|
-
/** Raw Apache Arrow table data for Mesh or IndexedMesh columns. */
|
|
25
|
-
data: MeshArrowTableData | IndexedMeshArrowTableData;
|
|
26
|
-
}
|
|
17
|
+
/** Native Apache Arrow table carrying mesh columns and topology metadata. */
|
|
18
|
+
export type MeshArrowTable = arrow.Table;
|
|
27
19
|
|
|
28
20
|
/** Apache Arrow columns for a mesh vertex table. */
|
|
29
21
|
export type MeshArrowColumns = {
|
|
@@ -5,16 +5,9 @@
|
|
|
5
5
|
import type {Schema} from '../types/schema';
|
|
6
6
|
import type {Batch} from '../types/batch';
|
|
7
7
|
import type {Feature} from './category-gis';
|
|
8
|
-
import type * as arrow from 'apache-arrow';
|
|
9
8
|
|
|
10
9
|
/** A general table */
|
|
11
|
-
export type Table =
|
|
12
|
-
| RowTable
|
|
13
|
-
| ArrayRowTable
|
|
14
|
-
| ObjectRowTable
|
|
15
|
-
| GeoJSONTable
|
|
16
|
-
| ColumnarTable
|
|
17
|
-
| ArrowTable;
|
|
10
|
+
export type Table = RowTable | ArrayRowTable | ObjectRowTable | GeoJSONTable | ColumnarTable;
|
|
18
11
|
|
|
19
12
|
/** A table organized as an array of rows */
|
|
20
13
|
export type RowTable = ArrayRowTable | ObjectRowTable | GeoJSONTable;
|
|
@@ -53,15 +46,6 @@ export type ColumnarTable = {
|
|
|
53
46
|
data: {[columnName: string]: ArrayLike<unknown>};
|
|
54
47
|
};
|
|
55
48
|
|
|
56
|
-
/**
|
|
57
|
-
* A table that wraps an Apache Arrow table
|
|
58
|
-
*/
|
|
59
|
-
export type ArrowTable = {
|
|
60
|
-
shape: 'arrow-table';
|
|
61
|
-
schema?: Schema;
|
|
62
|
-
data: arrow.Table;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
49
|
/** A collection of tables */
|
|
66
50
|
export type Tables<TableType = Table> = {
|
|
67
51
|
shape: 'tables';
|
|
@@ -75,8 +59,7 @@ export type TableBatch =
|
|
|
75
59
|
| ArrayRowTableBatch
|
|
76
60
|
| ObjectRowTableBatch
|
|
77
61
|
| GeoJSONTableBatch
|
|
78
|
-
| ColumnarTableBatch
|
|
79
|
-
| ArrowTableBatch;
|
|
62
|
+
| ColumnarTableBatch;
|
|
80
63
|
|
|
81
64
|
/** Batch for a table organized as an array of rows, each row is an array of values */
|
|
82
65
|
export type ArrayRowTableBatch<MetadataT = unknown> = Batch<MetadataT> & {
|
|
@@ -114,12 +97,3 @@ export type ColumnarTableBatch<MetadataT = unknown> = Batch<MetadataT> & {
|
|
|
114
97
|
data: {[columnName: string]: ArrayLike<unknown>};
|
|
115
98
|
length: number;
|
|
116
99
|
};
|
|
117
|
-
|
|
118
|
-
/** Batch that wraps an Apache Arrow RecordBatch */
|
|
119
|
-
export type ArrowTableBatch<MetadataT = unknown> = Batch<MetadataT> & {
|
|
120
|
-
shape: 'arrow-table';
|
|
121
|
-
schemaType?: 'explicit' | 'deduced';
|
|
122
|
-
schema?: Schema;
|
|
123
|
-
data: arrow.Table; // RecordBatch wrapped in Table
|
|
124
|
-
length: number;
|
|
125
|
-
};
|
|
@@ -10,7 +10,7 @@ import type {BinaryGeometryType} from './binary-geometries';
|
|
|
10
10
|
export type ArrowBinaryFeatureTable = {
|
|
11
11
|
/** Geometry family stored in this table. */
|
|
12
12
|
type: BinaryGeometryType;
|
|
13
|
-
/** Arrow table
|
|
13
|
+
/** Native Arrow table for the family. */
|
|
14
14
|
table: arrow.Table;
|
|
15
15
|
/** Original feature-level properties sidecar from the binary feature collection. */
|
|
16
16
|
properties: BinaryProperties['properties'];
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {GeoArrowEncoding} from '@math.gl/arrow
|
|
5
|
+
import type {GeoArrowEncoding} from '@math.gl/core/arrow';
|
|
6
6
|
|
|
7
7
|
/** Canonical geometry encodings are shared with math.gl. */
|
|
8
8
|
export type {
|
|
9
9
|
GeoArrowEncoding,
|
|
10
10
|
GeoArrowDimension,
|
|
11
11
|
GeoArrowCoordinateLayout
|
|
12
|
-
} from '@math.gl/arrow
|
|
12
|
+
} from '@math.gl/core/arrow';
|
|
13
13
|
|
|
14
14
|
/** Preferred output policy for loader-facing GeoArrow conversions. */
|
|
15
15
|
export type GeoArrowEncodingPreference = 'geoarrow.wkb' | 'geoarrow.geometry' | 'optimized';
|
package/src/schema/index.ts
CHANGED
|
@@ -62,7 +62,6 @@ export type {
|
|
|
62
62
|
ObjectRowTable,
|
|
63
63
|
GeoJSONTable,
|
|
64
64
|
ColumnarTable,
|
|
65
|
-
ArrowTable,
|
|
66
65
|
Tables
|
|
67
66
|
} from './categories/category-table';
|
|
68
67
|
export type {
|
|
@@ -70,8 +69,7 @@ export type {
|
|
|
70
69
|
ArrayRowTableBatch,
|
|
71
70
|
ObjectRowTableBatch,
|
|
72
71
|
GeoJSONTableBatch,
|
|
73
|
-
ColumnarTableBatch
|
|
74
|
-
ArrowTableBatch
|
|
72
|
+
ColumnarTableBatch
|
|
75
73
|
} from './categories/category-table';
|
|
76
74
|
|
|
77
75
|
// MESH CATEGORY
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {Schema} from './schema';
|
|
6
|
-
// import type {RecordBatch} from 'apache-arrow';
|
|
7
|
-
|
|
8
|
-
type ApacheRecordBatch = unknown;
|
|
9
6
|
|
|
10
7
|
/**
|
|
11
8
|
* A batch of data (or metadata/schema), from a streaming loader
|
|
@@ -23,8 +20,6 @@ export type Batch<MetadataT = unknown> = {
|
|
|
23
20
|
schema?: Schema;
|
|
24
21
|
/** Data in this batch */
|
|
25
22
|
data?: unknown;
|
|
26
|
-
/** If this is an arrow table. @deprecated Use `data` */
|
|
27
|
-
recordBatch?: ApacheRecordBatch;
|
|
28
23
|
/** Length of data in this batch */
|
|
29
24
|
length: number;
|
|
30
25
|
|
|
@@ -29,11 +29,6 @@ export type {
|
|
|
29
29
|
export {getArrowViewTypeSupport} from './lib/schema/convert-arrow-schema';
|
|
30
30
|
export {getDataTypeFromArray} from './lib/schema/data-type';
|
|
31
31
|
|
|
32
|
-
export {
|
|
33
|
-
convertArrowTable,
|
|
34
|
-
convertArrowTableBatch
|
|
35
|
-
} from './lib/table/tables/convert-arrow-table-wrapper';
|
|
36
|
-
|
|
37
32
|
// TABLE CATEGORY UTILS
|
|
38
33
|
|
|
39
34
|
export {deduceTableSchema} from './lib/schema/deduce-table-schema';
|
|
@@ -67,8 +62,7 @@ export {
|
|
|
67
62
|
isArrayRowTable,
|
|
68
63
|
isObjectRowTable,
|
|
69
64
|
isColumnarTable,
|
|
70
|
-
isGeoJSONTable
|
|
71
|
-
isArrowTable
|
|
65
|
+
isGeoJSONTable
|
|
72
66
|
} from './lib/table/tables/table-types';
|
|
73
67
|
|
|
74
68
|
export {
|
|
@@ -98,7 +92,7 @@ export {ArrowLikeTable} from './lib/table/arrow-api/arrow-like-table';
|
|
|
98
92
|
export {getMeshSize, getMeshBoundingBox} from './lib/mesh/mesh-utils';
|
|
99
93
|
export {
|
|
100
94
|
convertMeshToTable,
|
|
101
|
-
|
|
95
|
+
convertMeshToArrowTable,
|
|
102
96
|
makeMeshArrowTable
|
|
103
97
|
} from './lib/mesh/convert-mesh-to-table';
|
|
104
98
|
export type {MeshArrowTableOptions} from './lib/mesh/convert-mesh-to-table';
|
|
@@ -147,7 +141,7 @@ export {
|
|
|
147
141
|
// IntervalYearMonth,
|
|
148
142
|
// FixedSizeList,
|
|
149
143
|
// Struct
|
|
150
|
-
} from './lib/table/arrow-api
|
|
144
|
+
} from './lib/table/arrow-api';
|
|
151
145
|
|
|
152
146
|
// EXPERIMENTAL APIs
|
|
153
147
|
export {ArrowTableBuilder} from './lib/table/batch-builder/arrow-table-builder';
|
|
@@ -171,10 +165,10 @@ export {
|
|
|
171
165
|
snapshotArrowSchema,
|
|
172
166
|
mergeArrowSchemas,
|
|
173
167
|
updateArrowTableSchema,
|
|
174
|
-
|
|
168
|
+
updateNativeArrowTableMetadata,
|
|
175
169
|
makeArrowMetadataBatch,
|
|
176
170
|
makeArrowTableFromBatches
|
|
177
171
|
} from './lib/arrow/arrow-metadata';
|
|
178
172
|
export {refineArrowTableBatches} from './lib/arrow/arrow-metadata';
|
|
179
173
|
|
|
180
|
-
export {
|
|
174
|
+
export {isArrowRecordBatch, isArrowTable} from '../lib/loader-utils/native-arrow';
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import type {Field, DataType
|
|
6
|
+
import type {Field, DataType} from '@loaders.gl/core/schema';
|
|
7
7
|
import {serializeArrowSchema, deserializeArrowSchema} from '../schema/convert-arrow-schema';
|
|
8
8
|
|
|
9
9
|
/** Copies a schema, including nested field metadata, without retaining mutable metadata maps. */
|
|
@@ -55,13 +55,24 @@ function mergeTypeMetadata(previous: DataType, next: DataType): DataType {
|
|
|
55
55
|
return next;
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
+
/** Snapshots a batch's schema and metadata while retaining its data buffers and row count. */
|
|
59
|
+
function snapshotArrowBatch(batch: arrow.RecordBatch, schema: arrow.Schema): arrow.RecordBatch {
|
|
60
|
+
const snapshot = new arrow.RecordBatch(
|
|
61
|
+
snapshotArrowSchema(schema),
|
|
62
|
+
batch.data,
|
|
63
|
+
new Map(batch.metadata)
|
|
64
|
+
);
|
|
65
|
+
// Arrow reconstructs the Struct length from its columns, which are absent in zero-column batches.
|
|
66
|
+
if (snapshot.numRows !== batch.numRows) {
|
|
67
|
+
Object.defineProperty(snapshot, 'data', {value: batch.data});
|
|
68
|
+
}
|
|
69
|
+
return snapshot;
|
|
70
|
+
}
|
|
71
|
+
|
|
58
72
|
/** Applies a table schema snapshot to its batches while retaining batch-local custom metadata. */
|
|
59
73
|
export function updateArrowTableSchema(table: arrow.Table, schema: arrow.Schema): arrow.Table {
|
|
60
74
|
const snapshot = snapshotArrowSchema(schema);
|
|
61
|
-
const batches = table.batches.map(
|
|
62
|
-
batch =>
|
|
63
|
-
new arrow.RecordBatch(snapshotArrowSchema(snapshot), batch.data, new Map(batch.metadata))
|
|
64
|
-
);
|
|
75
|
+
const batches = table.batches.map(batch => snapshotArrowBatch(batch, snapshot));
|
|
65
76
|
// Preserve declared schemas even for schema-only empty tables.
|
|
66
77
|
return new arrow.Table(
|
|
67
78
|
snapshot,
|
|
@@ -69,17 +80,16 @@ export function updateArrowTableSchema(table: arrow.Table, schema: arrow.Schema)
|
|
|
69
80
|
);
|
|
70
81
|
}
|
|
71
82
|
|
|
72
|
-
/** Updates
|
|
73
|
-
export function
|
|
74
|
-
table:
|
|
83
|
+
/** Updates native Arrow metadata while preserving independent batch snapshots. */
|
|
84
|
+
export function updateNativeArrowTableMetadata(
|
|
85
|
+
table: arrow.Table,
|
|
75
86
|
metadata: Record<string, string>
|
|
76
|
-
):
|
|
87
|
+
): arrow.Table {
|
|
77
88
|
const schema = new arrow.Schema(
|
|
78
|
-
table.
|
|
79
|
-
new Map([...table.
|
|
89
|
+
table.schema.fields,
|
|
90
|
+
new Map([...table.schema.metadata, ...Object.entries(metadata)])
|
|
80
91
|
);
|
|
81
|
-
|
|
82
|
-
return {...table, data, schema: serializeArrowSchema(data.schema)};
|
|
92
|
+
return updateArrowTableSchema(table, schema);
|
|
83
93
|
}
|
|
84
94
|
|
|
85
95
|
/** Creates a zero-row metadata update retaining the complete declared schema. */
|
|
@@ -95,27 +105,20 @@ export async function makeArrowTableFromBatches(
|
|
|
95
105
|
const collected: arrow.RecordBatch[] = [];
|
|
96
106
|
for await (const batch of batches) {
|
|
97
107
|
schema = mergeArrowSchemas(schema, batch.schema);
|
|
98
|
-
collected.push(
|
|
99
|
-
new arrow.RecordBatch(snapshotArrowSchema(batch.schema), batch.data, new Map(batch.metadata))
|
|
100
|
-
);
|
|
108
|
+
collected.push(snapshotArrowBatch(batch, batch.schema));
|
|
101
109
|
}
|
|
102
110
|
return schema ? new arrow.Table(schema, collected) : null;
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
/**
|
|
106
|
-
export async function* refineArrowTableBatches
|
|
107
|
-
batches: AsyncIterable<
|
|
108
|
-
): AsyncIterable<
|
|
113
|
+
/** Snapshots native Arrow schemas, accumulating bounds and retaining local batch bounds. */
|
|
114
|
+
export async function* refineArrowTableBatches(
|
|
115
|
+
batches: AsyncIterable<arrow.Table> | Iterable<arrow.Table>
|
|
116
|
+
): AsyncIterable<arrow.Table> {
|
|
109
117
|
let schema: arrow.Schema | undefined;
|
|
110
118
|
let bounds: number[][] | undefined;
|
|
111
|
-
for await (const
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
yield batch;
|
|
115
|
-
continue;
|
|
116
|
-
}
|
|
117
|
-
const localBounds = table.data.schema.metadata.get('boundingBox');
|
|
118
|
-
const nextSchema = snapshotArrowSchema(table.data.schema);
|
|
119
|
+
for await (const table of batches) {
|
|
120
|
+
const localBounds = table.schema.metadata.get('boundingBox');
|
|
121
|
+
const nextSchema = snapshotArrowSchema(table.schema);
|
|
119
122
|
if (localBounds) {
|
|
120
123
|
const nextBounds = JSON.parse(localBounds) as number[][];
|
|
121
124
|
bounds = bounds
|
|
@@ -127,10 +130,10 @@ export async function* refineArrowTableBatches<T>(
|
|
|
127
130
|
nextSchema.metadata.set('boundingBox', JSON.stringify(bounds));
|
|
128
131
|
}
|
|
129
132
|
schema = mergeArrowSchemas(schema, nextSchema);
|
|
130
|
-
const data = updateArrowTableSchema(table
|
|
133
|
+
const data = updateArrowTableSchema(table, schema);
|
|
131
134
|
if (localBounds) {
|
|
132
135
|
for (const recordBatch of data.batches) recordBatch.metadata.set('boundingBox', localBounds);
|
|
133
136
|
}
|
|
134
|
-
yield
|
|
137
|
+
yield data;
|
|
135
138
|
}
|
|
136
139
|
}
|
|
@@ -3,22 +3,11 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {getFloat16Storage, isNativeFloat16Array} from '@loaders.gl/core/schema';
|
|
6
|
-
import type {
|
|
7
|
-
BigTypedArray,
|
|
8
|
-
Mesh,
|
|
9
|
-
MeshAttribute,
|
|
10
|
-
MeshArrowTable,
|
|
11
|
-
MeshTable,
|
|
12
|
-
Schema
|
|
13
|
-
} from '@loaders.gl/core/schema';
|
|
6
|
+
import type {BigTypedArray, Mesh, MeshAttribute, MeshTable, Schema} from '@loaders.gl/core/schema';
|
|
14
7
|
import {indexedMeshArrowSchema, meshArrowSchema} from '@loaders.gl/core/schema';
|
|
15
8
|
import * as arrow from 'apache-arrow';
|
|
16
9
|
import {getFixedSizeListVector} from '../arrow-utils/arrow-fixed-size-list-utils';
|
|
17
|
-
import {
|
|
18
|
-
deserializeArrowField,
|
|
19
|
-
deserializeArrowMetadata,
|
|
20
|
-
serializeArrowSchema
|
|
21
|
-
} from '../schema/convert-arrow-schema';
|
|
10
|
+
import {deserializeArrowField, deserializeArrowMetadata} from '../schema/convert-arrow-schema';
|
|
22
11
|
|
|
23
12
|
/** Arrow column inputs, including exact 64-bit integers that are not GPU attributes. */
|
|
24
13
|
export type MeshArrowAttributes = Record<
|
|
@@ -71,7 +60,7 @@ export function convertMeshToTable(
|
|
|
71
60
|
case 'columnar-table':
|
|
72
61
|
return convertMeshToColumnarTable(mesh);
|
|
73
62
|
case 'arrow':
|
|
74
|
-
return
|
|
63
|
+
return convertMeshToArrowTable(mesh);
|
|
75
64
|
default:
|
|
76
65
|
throw new Error(shape);
|
|
77
66
|
}
|
|
@@ -99,13 +88,8 @@ export function convertMeshToColumnarTable(mesh: Mesh): MeshTable {
|
|
|
99
88
|
};
|
|
100
89
|
}
|
|
101
90
|
|
|
102
|
-
/**
|
|
103
|
-
|
|
104
|
-
* @param mesh Mesh to convert.
|
|
105
|
-
* @param batchSize Reserved for future chunked Arrow conversion.
|
|
106
|
-
* @returns Mesh data as an Apache Arrow table wrapper.
|
|
107
|
-
*/
|
|
108
|
-
export function convertMeshToArrowTableWrapper(mesh: Mesh, batchSize?: number): MeshArrowTable {
|
|
91
|
+
/** Builds a native Apache Arrow mesh table, including topology, indices, and bounds. */
|
|
92
|
+
export function convertMeshToArrowTable(mesh: Mesh): arrow.Table {
|
|
109
93
|
return makeMeshArrowTable(mesh.attributes, {
|
|
110
94
|
schema: mesh.schema,
|
|
111
95
|
topology: mesh.topology,
|
|
@@ -116,15 +100,15 @@ export function convertMeshToArrowTableWrapper(mesh: Mesh, batchSize?: number):
|
|
|
116
100
|
}
|
|
117
101
|
|
|
118
102
|
/**
|
|
119
|
-
*
|
|
103
|
+
* Creates a native Apache Arrow mesh table from typed attributes.
|
|
120
104
|
* @param attributes Mesh attributes to expose as Arrow columns.
|
|
121
105
|
* @param options Mesh table metadata and optional schema.
|
|
122
|
-
* @returns
|
|
106
|
+
* @returns The Arrow table with mesh topology, bounds, and optional indices.
|
|
123
107
|
*/
|
|
124
108
|
export function makeMeshArrowTable(
|
|
125
109
|
attributes: MeshArrowAttributes,
|
|
126
110
|
options: MeshArrowTableOptions = {}
|
|
127
|
-
):
|
|
111
|
+
): arrow.Table {
|
|
128
112
|
const fields: arrow.Field[] = [];
|
|
129
113
|
const columns: {[columnName: string]: arrow.Vector} = {};
|
|
130
114
|
const attributeNames = getOrderedAttributeNames(attributes);
|
|
@@ -139,7 +123,7 @@ export function makeMeshArrowTable(
|
|
|
139
123
|
getAttributeArrowField(options.schema, attributeName, column, attribute.componentType)
|
|
140
124
|
);
|
|
141
125
|
|
|
142
|
-
if (attributeName ===
|
|
126
|
+
if (attributeName === attributeNames[0] && options.indices?.value?.length) {
|
|
143
127
|
const indicesField = indexedMeshArrowSchema.fields.find(field => field.name === 'indices')!;
|
|
144
128
|
columns.indices = getIndicesVector(options.indices.value, column.length, indicesField.type);
|
|
145
129
|
fields.push(indicesField);
|
|
@@ -149,19 +133,9 @@ export function makeMeshArrowTable(
|
|
|
149
133
|
const arrowSchema = new arrow.Schema(fields, getMeshArrowMetadata(options));
|
|
150
134
|
// Arrow's column-object constructor synthesizes an incompatible batch schema for empty
|
|
151
135
|
// fixed-size-list vectors. A schema-only table preserves the declared mesh fields instead.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
: new arrow.Table(arrowSchema, columns);
|
|
156
|
-
const schema = serializeArrowSchema(table.schema);
|
|
157
|
-
|
|
158
|
-
return {
|
|
159
|
-
shape: 'arrow-table',
|
|
160
|
-
schema,
|
|
161
|
-
data: table,
|
|
162
|
-
topology: options.topology || 'point-list',
|
|
163
|
-
indices: options.indices
|
|
164
|
-
};
|
|
136
|
+
return columns[attributeNames[0]]?.length === 0
|
|
137
|
+
? new arrow.Table(arrowSchema)
|
|
138
|
+
: new arrow.Table(arrowSchema, columns);
|
|
165
139
|
}
|
|
166
140
|
|
|
167
141
|
/** Return an Arrow vector for a mesh attribute. */
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {createFloat16Array, getFloat16Value, setFloat16Value} from '@loaders.gl/core/schema';
|
|
6
|
-
import type {Mesh, MeshAttribute, ColumnarTable,
|
|
6
|
+
import type {Mesh, MeshAttribute, ColumnarTable, Schema} from '@loaders.gl/core/schema';
|
|
7
7
|
import * as arrow from 'apache-arrow';
|
|
8
8
|
import {getFixedSizeListSize} from '../arrow-utils/arrow-fixed-size-list-utils';
|
|
9
9
|
import {serializeArrowSchema} from '../schema/convert-arrow-schema';
|
|
10
|
-
import {
|
|
10
|
+
import {isArrowTable} from '../../../lib/loader-utils/native-arrow';
|
|
11
11
|
import {getMeshBoundingBox} from './mesh-utils';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -15,26 +15,17 @@ import {getMeshBoundingBox} from './mesh-utils';
|
|
|
15
15
|
* @param table Table to convert.
|
|
16
16
|
* @returns Mesh reconstructed from the table.
|
|
17
17
|
*/
|
|
18
|
-
export function convertTableToMesh(table: ColumnarTable |
|
|
19
|
-
if (
|
|
20
|
-
|
|
21
|
-
// case 'columnar-table':
|
|
22
|
-
// return convertColumnarTableToMesh(table);
|
|
23
|
-
case 'arrow-table':
|
|
24
|
-
return convertArrowTableToMesh(table);
|
|
25
|
-
default:
|
|
26
|
-
throw new Error(table.shape);
|
|
27
|
-
}
|
|
18
|
+
export function convertTableToMesh(table: ColumnarTable | arrow.Table): Mesh {
|
|
19
|
+
if (isArrowTable(table)) return convertArrowTableToMesh(table);
|
|
20
|
+
throw new Error(table.shape);
|
|
28
21
|
}
|
|
29
22
|
|
|
30
23
|
/**
|
|
31
24
|
* Convert an Apache Arrow mesh table to a loaders.gl Mesh.
|
|
32
|
-
* @param table Native Arrow table
|
|
25
|
+
* @param table Native Arrow table.
|
|
33
26
|
* @returns Mesh reconstructed from the Arrow table.
|
|
34
27
|
*/
|
|
35
|
-
export function convertArrowTableToMesh(
|
|
36
|
-
const arrowTable = isNativeArrowTable(table) ? table : table.data;
|
|
37
|
-
|
|
28
|
+
export function convertArrowTableToMesh(arrowTable: arrow.Table): Mesh {
|
|
38
29
|
const schema = serializeArrowSchema(arrowTable.schema);
|
|
39
30
|
// Legacy mesh batches describe their own vertices, not the cumulative stream extent.
|
|
40
31
|
const localBounds =
|
|
@@ -185,14 +176,20 @@ function getAttributeTypedArray(attributeData: arrow.Vector, size: number): any
|
|
|
185
176
|
return attributeData.toArray();
|
|
186
177
|
}
|
|
187
178
|
|
|
188
|
-
|
|
179
|
+
if (attributeData.length === 0) {
|
|
180
|
+
const EmptyStorage = attributeData.type.valueType.ArrayType;
|
|
181
|
+
return new EmptyStorage(0);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
const values = attributeData.data.find(chunk => chunk.length > 0)!.children[0].values;
|
|
189
185
|
const TypedArrayConstructor = values.constructor as any;
|
|
190
186
|
const typedArray = new TypedArrayConstructor(attributeData.length * size);
|
|
191
187
|
let targetOffset = 0;
|
|
192
188
|
|
|
193
189
|
for (const data of attributeData.data) {
|
|
194
|
-
const child = data.children[0];
|
|
195
190
|
const sourceLength = data.length * size;
|
|
191
|
+
if (sourceLength === 0) continue;
|
|
192
|
+
const child = data.children[0];
|
|
196
193
|
const sourceOffset = child.offset || data.offset * size;
|
|
197
194
|
// Arrow chunks can either slice child values eagerly or retain offsets into the source buffer.
|
|
198
195
|
const sourceStart = sourceOffset + sourceLength <= child.values.length ? sourceOffset : 0;
|
|
@@ -2,13 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {
|
|
6
|
-
Mesh,
|
|
7
|
-
MeshArrowTable,
|
|
8
|
-
MeshArrowTableData,
|
|
9
|
-
MeshAttribute,
|
|
10
|
-
TypedArray
|
|
11
|
-
} from '@loaders.gl/core/schema';
|
|
5
|
+
import type {Mesh, MeshArrowTable, MeshAttribute, TypedArray} from '@loaders.gl/core/schema';
|
|
12
6
|
import {convertTableToMesh} from './convert-table-to-mesh';
|
|
13
7
|
|
|
14
8
|
/** A native-coordinate cube, with minimum and maximum XYZ corners. */
|
|
@@ -95,10 +89,7 @@ export class PointCloudTiler {
|
|
|
95
89
|
private pointByteLength = 0;
|
|
96
90
|
|
|
97
91
|
/** Starts indexing one decoded point dataset with explicit allocation limits. */
|
|
98
|
-
constructor(
|
|
99
|
-
input: Mesh | MeshArrowTable | MeshArrowTableData,
|
|
100
|
-
options: PointCloudTilerOptions = {}
|
|
101
|
-
) {
|
|
92
|
+
constructor(input: Mesh | MeshArrowTable, options: PointCloudTilerOptions = {}) {
|
|
102
93
|
this.options = {
|
|
103
94
|
nodePointLimit: options.nodePointLimit ?? 50_000,
|
|
104
95
|
maximumDepth: options.maximumDepth ?? 16,
|
|
@@ -250,10 +241,10 @@ export class PointCloudTiler {
|
|
|
250
241
|
}
|
|
251
242
|
|
|
252
243
|
/** Validates the decoded profile and creates a root cube from finite native coordinates. */
|
|
253
|
-
private async initialize(input: Mesh | MeshArrowTable
|
|
244
|
+
private async initialize(input: Mesh | MeshArrowTable): Promise<void> {
|
|
254
245
|
this.signal.throwIfAborted();
|
|
255
246
|
if (!('attributes' in input)) {
|
|
256
|
-
const table =
|
|
247
|
+
const table = input;
|
|
257
248
|
const buffers = new Set<ArrayBufferLike>();
|
|
258
249
|
let arrowBytes = 0;
|
|
259
250
|
/** Counts retained Arrow buffers and rejects null child values before conversion. */
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
// Type deduction
|
|
6
6
|
import type {Schema, Field, ArrayType, Table} from '@loaders.gl/core/schema';
|
|
7
|
+
import type {Table as ArrowTable} from 'apache-arrow';
|
|
8
|
+
import {convertArrowToSchema} from './convert-arrow-schema';
|
|
7
9
|
import {getDataTypeFromArray, getDataTypeFromValue} from './data-type';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -12,7 +14,8 @@ import {getDataTypeFromArray, getDataTypeFromValue} from './data-type';
|
|
|
12
14
|
* @param {*} schema
|
|
13
15
|
* @returns
|
|
14
16
|
*/
|
|
15
|
-
export function deduceTableSchema(table: Table): Schema {
|
|
17
|
+
export function deduceTableSchema(table: Table | ArrowTable): Schema {
|
|
18
|
+
if (!('shape' in table)) return convertArrowToSchema(table.schema);
|
|
16
19
|
switch (table.shape) {
|
|
17
20
|
case 'array-row-table':
|
|
18
21
|
case 'object-row-table':
|
|
@@ -24,7 +27,6 @@ export function deduceTableSchema(table: Table): Schema {
|
|
|
24
27
|
case 'columnar-table':
|
|
25
28
|
return deduceSchemaFromColumns(table.data);
|
|
26
29
|
|
|
27
|
-
case 'arrow-table':
|
|
28
30
|
default:
|
|
29
31
|
throw new Error('Deduce schema');
|
|
30
32
|
}
|