@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,13 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
6
|
import type {
|
|
7
|
-
ArrowTableBatch,
|
|
8
7
|
GeoArrowDimension,
|
|
9
8
|
GeoArrowMetadata,
|
|
10
9
|
GeoMetadata,
|
|
11
10
|
GeoParquetGeometryType
|
|
12
11
|
} from '@loaders.gl/core/schema';
|
|
13
|
-
import {
|
|
12
|
+
import {makeArrowMetadataBatch} from '@loaders.gl/core/schema-utils';
|
|
14
13
|
import {
|
|
15
14
|
type GeoArrowGeometryConvertOptions,
|
|
16
15
|
type GeoArrowGeometryTarget,
|
|
@@ -41,10 +40,10 @@ export type GeoArrowStreamConvertOptions = GeoArrowGeometryConvertOptions & {
|
|
|
41
40
|
* @returns Async iterator of converted Arrow table batches.
|
|
42
41
|
*/
|
|
43
42
|
export async function* convertGeoArrowBatches(
|
|
44
|
-
batches: Iterable<
|
|
43
|
+
batches: Iterable<arrow.RecordBatch> | AsyncIterable<arrow.RecordBatch>,
|
|
45
44
|
targetEncoding: GeoArrowGeometryTarget,
|
|
46
45
|
options: GeoArrowStreamConvertOptions = {}
|
|
47
|
-
): AsyncIterableIterator<
|
|
46
|
+
): AsyncIterableIterator<arrow.RecordBatch> {
|
|
48
47
|
let stableGeometryTypes: readonly GeoParquetGeometryType[] | undefined;
|
|
49
48
|
let firstBatch = true;
|
|
50
49
|
|
|
@@ -52,28 +51,29 @@ export async function* convertGeoArrowBatches(
|
|
|
52
51
|
if (options.signal?.aborted) {
|
|
53
52
|
throw createAbortError();
|
|
54
53
|
}
|
|
55
|
-
|
|
56
|
-
throw new Error('convertGeoArrowBatches requires ArrowTableBatch inputs.');
|
|
57
|
-
}
|
|
54
|
+
const table = new arrow.Table(batch.schema, [batch]);
|
|
58
55
|
|
|
59
56
|
if (firstBatch) {
|
|
60
|
-
stableGeometryTypes = getStableGeometryTypes(
|
|
57
|
+
stableGeometryTypes = getStableGeometryTypes(table, targetEncoding, options);
|
|
61
58
|
firstBatch = false;
|
|
62
59
|
}
|
|
63
60
|
|
|
64
61
|
const conversionOptions = stableGeometryTypes
|
|
65
62
|
? {...options, geometryTypes: stableGeometryTypes}
|
|
66
63
|
: options;
|
|
67
|
-
const convertedTable = convertGeoArrowGeometry(
|
|
64
|
+
const convertedTable = convertGeoArrowGeometry(table, targetEncoding, conversionOptions);
|
|
68
65
|
const stableTable = stableGeometryTypes
|
|
69
66
|
? stabilizeGeometryUnionTable(convertedTable, stableGeometryTypes)
|
|
70
67
|
: convertedTable;
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
for (const convertedBatch of stableTable.batches.length
|
|
69
|
+
? stableTable.batches
|
|
70
|
+
: [makeArrowMetadataBatch(stableTable.schema)]) {
|
|
71
|
+
yield new arrow.RecordBatch(
|
|
72
|
+
convertedBatch.schema,
|
|
73
|
+
convertedBatch.data,
|
|
74
|
+
new Map(batch.metadata)
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import {scanWKB} from '@math.gl/arrow
|
|
6
|
+
import {scanWKB} from '@math.gl/core/arrow';
|
|
7
7
|
import type {Geometry} from '@loaders.gl/core/schema';
|
|
8
8
|
import {convertWKTToGeometry} from '@loaders.gl/core/arrow-geometry/geometry-codecs';
|
|
9
9
|
|
package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts
CHANGED
|
@@ -73,7 +73,7 @@ export function convertArrowBinaryFeatureCollectionToBinaryFeatureCollection(
|
|
|
73
73
|
};
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
/** Converts binary point features into an Arrow
|
|
76
|
+
/** Converts binary point features into an Arrow-backed geometry family. */
|
|
77
77
|
function convertPointsToArrowTable(binaryPoints: BinaryPointFeature): ArrowBinaryPointFeature {
|
|
78
78
|
const pointOffsets = derivePointOffsets(binaryPoints.featureIds.value as Uint32Array);
|
|
79
79
|
const columns: Record<string, arrow.Data> = {
|
|
@@ -112,7 +112,7 @@ function convertPointsToArrowTable(binaryPoints: BinaryPointFeature): ArrowBinar
|
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
/** Converts binary line features into an Arrow
|
|
115
|
+
/** Converts binary line features into an Arrow-backed geometry family. */
|
|
116
116
|
function convertLinesToArrowTable(binaryLines: BinaryLineFeature): ArrowBinaryLineFeature {
|
|
117
117
|
const pathOffsets = reinterpretUint32AsInt32(binaryLines.pathIndices.value as Uint32Array);
|
|
118
118
|
const columns: Record<string, arrow.Data> = {
|
|
@@ -147,7 +147,7 @@ function convertLinesToArrowTable(binaryLines: BinaryLineFeature): ArrowBinaryLi
|
|
|
147
147
|
};
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
/** Converts binary polygon features into an Arrow
|
|
150
|
+
/** Converts binary polygon features into an Arrow-backed geometry family. */
|
|
151
151
|
function convertPolygonsToArrowTable(
|
|
152
152
|
binaryPolygons: BinaryPolygonFeature
|
|
153
153
|
): ArrowBinaryPolygonFeature {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type * as arrow from 'apache-arrow';
|
|
6
|
-
import {isArrowTable} from '@math.gl/arrow';
|
|
6
|
+
import {isArrowTable} from '@math.gl/core/arrow';
|
|
7
7
|
import type {
|
|
8
8
|
BinaryFeatureCollection,
|
|
9
9
|
BinaryPointFeature,
|
|
@@ -1468,7 +1468,10 @@ function triangulatePolygons(polygons: BinaryPolygonFeature): Uint32Array | null
|
|
|
1468
1468
|
const polygonTriangles = earcut(
|
|
1469
1469
|
polygonPositions,
|
|
1470
1470
|
holeIndices.length > 0 ? holeIndices : undefined,
|
|
1471
|
-
polygons.positions.size
|
|
1471
|
+
polygons.positions.size,
|
|
1472
|
+
undefined,
|
|
1473
|
+
'xy',
|
|
1474
|
+
{triangulation: 'balanced'}
|
|
1472
1475
|
);
|
|
1473
1476
|
if (polygonTriangles.length === 0) {
|
|
1474
1477
|
throw new Error('earcut failed e.g. invalid polygon');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {BinaryGeometry} from '@loaders.gl/core/schema';
|
|
6
|
-
import {getWellKnownDimensionSize, scanWKB, visitWKB} from '@math.gl/arrow
|
|
6
|
+
import {getWellKnownDimensionSize, scanWKB, visitWKB} from '@math.gl/core/arrow';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Materializes legacy vertex-indexed binary geometry using math.gl's WKB traversal.
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {inspectWKBHeader} from '@math.gl/arrow
|
|
6
|
-
import type {WellKnownDimension, WKBGeometryType as MathWKBGeometryType} from '@math.gl/arrow
|
|
5
|
+
import {inspectWKBHeader} from '@math.gl/core/arrow';
|
|
6
|
+
import type {WellKnownDimension, WKBGeometryType as MathWKBGeometryType} from '@math.gl/core/arrow';
|
|
7
7
|
import type {WKBGeometryType, WKBHeader} from './wkb-types';
|
|
8
8
|
import {MAX_SRID, WKT_MAGIC_STRINGS, WKT_MAGIC_BYTES} from './wkb-types';
|
|
9
9
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
6
|
import {convertWKTToGeometry} from '@loaders.gl/core/arrow-geometry/geometry-codecs';
|
|
7
|
-
import {scanWKB} from '@math.gl/arrow
|
|
7
|
+
import {scanWKB} from '@math.gl/core/arrow';
|
|
8
8
|
import type {GeoArrowDimension, GeoArrowEncoding} from '@loaders.gl/core/schema';
|
|
9
9
|
|
|
10
10
|
type BoxDimension = 2 | 3 | 4;
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
6
|
import type {
|
|
7
|
-
Table,
|
|
8
7
|
ArrayRowTable,
|
|
9
8
|
ColumnarTable,
|
|
10
9
|
ObjectRowTable,
|
|
@@ -16,6 +15,9 @@ import {getGeometryColumnsFromSchema} from '../../metadata/geoarrow-metadata';
|
|
|
16
15
|
import {getGeoMetadata} from '../../metadata/geoparquet-metadata';
|
|
17
16
|
import {convertGeoArrowVectorCellToGeoJSON} from '../../geoarrow-converter/convert-geoarrow-geometry';
|
|
18
17
|
|
|
18
|
+
/** Portable row and column layouts produced from a GeoArrow table. */
|
|
19
|
+
type GeoArrowOutputTable = ArrayRowTable | ColumnarTable | ObjectRowTable | GeoJSONTable;
|
|
20
|
+
|
|
19
21
|
export function convertGeoArrowToTable(
|
|
20
22
|
arrowTable: arrow.Table,
|
|
21
23
|
shape: 'columnar-table'
|
|
@@ -34,16 +36,16 @@ export function convertGeoArrowToTable(
|
|
|
34
36
|
): GeoJSONTable;
|
|
35
37
|
export function convertGeoArrowToTable(
|
|
36
38
|
arrowTable: arrow.Table,
|
|
37
|
-
shape:
|
|
38
|
-
):
|
|
39
|
+
shape: GeoArrowOutputTable['shape']
|
|
40
|
+
): GeoArrowOutputTable;
|
|
39
41
|
|
|
40
42
|
/**
|
|
41
43
|
* Converts an Apache Arrow table with GeoArrow metadata to a loaders.gl table shape.
|
|
42
44
|
*/
|
|
43
45
|
export function convertGeoArrowToTable(
|
|
44
46
|
arrowTable: arrow.Table,
|
|
45
|
-
shape:
|
|
46
|
-
):
|
|
47
|
+
shape: GeoArrowOutputTable['shape']
|
|
48
|
+
): GeoArrowOutputTable {
|
|
47
49
|
switch (shape) {
|
|
48
50
|
case 'array-row-table':
|
|
49
51
|
return convertTable(convertArrowToColumnarTable(arrowTable), 'array-row-table');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {TypedArray} from '@math.gl/core';
|
|
6
|
-
import {isFixedSizeListArrowType} from '@math.gl/arrow';
|
|
6
|
+
import {isFixedSizeListArrowType} from '@math.gl/core/arrow';
|
|
7
7
|
import * as arrow from 'apache-arrow';
|
|
8
8
|
import {getDataTypeFromArray, deserializeArrowType} from '@loaders.gl/core/schema-utils';
|
|
9
9
|
|
package/src/index.ts
CHANGED
|
@@ -31,7 +31,7 @@ export {readArrayBuffer} from './lib/fetch/read-array-buffer';
|
|
|
31
31
|
// export {writeFile, writeFileSync} from './lib/fetch/write-file';
|
|
32
32
|
|
|
33
33
|
// CONFIGURATION
|
|
34
|
-
export {setLoaderOptions, getLoaderOptions} from './lib/api/loader-options';
|
|
34
|
+
export {setLoaderOptions, getLoaderOptions, compareLoaderOptions} from './lib/api/loader-options';
|
|
35
35
|
export {registerLoaders} from './lib/api/register-loaders';
|
|
36
36
|
export {selectLoader, selectLoaderSync} from './lib/api/select-loader';
|
|
37
37
|
|
package/src/lib/api/load.ts
CHANGED
|
@@ -11,7 +11,6 @@ import type {
|
|
|
11
11
|
Loader,
|
|
12
12
|
LoaderContext,
|
|
13
13
|
LoaderOptions,
|
|
14
|
-
StrictLoaderOptions,
|
|
15
14
|
LoaderOptionsType,
|
|
16
15
|
LoaderReturnType,
|
|
17
16
|
SourceLoader
|
|
@@ -22,7 +21,6 @@ import {
|
|
|
22
21
|
resolveLoaderAuthenticationOptions
|
|
23
22
|
} from '@loaders.gl/core/loader-utils';
|
|
24
23
|
import {isLoaderObject} from '../loader-utils/normalize-loader';
|
|
25
|
-
import {getNativeArrowOptions, unwrapArrowTable} from '../loader-utils/native-arrow';
|
|
26
24
|
import {getFetchFunction} from '../loader-utils/get-fetch-function';
|
|
27
25
|
import {
|
|
28
26
|
applySearchParamsToUrl,
|
|
@@ -152,16 +150,8 @@ export async function load(
|
|
|
152
150
|
const {parseUrl} = loaderImplementation;
|
|
153
151
|
if (parseUrl) {
|
|
154
152
|
const requestUrl = applySearchParamsToUrl(url, resolvedOptions);
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
normalizeOptions(resolvedOptions, selectedLoader, [selectedLoader], url)
|
|
158
|
-
);
|
|
159
|
-
const result = await parseUrl(
|
|
160
|
-
requestUrl,
|
|
161
|
-
(nativeOptions || resolvedOptions) as StrictLoaderOptions,
|
|
162
|
-
context
|
|
163
|
-
);
|
|
164
|
-
return nativeOptions ? unwrapArrowTable(result) : result;
|
|
153
|
+
const options = normalizeOptions(resolvedOptions, selectedLoader, [selectedLoader], url);
|
|
154
|
+
return parseUrl(requestUrl, options, context);
|
|
165
155
|
}
|
|
166
156
|
}
|
|
167
157
|
}
|
|
@@ -2,5 +2,74 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import type {LoaderOptions} from '../../loader-utils/loader-types';
|
|
6
|
+
|
|
5
7
|
export {setGlobalOptions as setLoaderOptions} from '../loader-utils/option-utils';
|
|
6
8
|
export {getGlobalLoaderOptions as getLoaderOptions} from '../loader-utils/option-utils';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Compares two option inputs without applying loader defaults or global options.
|
|
12
|
+
* Compares plain objects and arrays recursively, and callbacks and other objects by reference.
|
|
13
|
+
*/
|
|
14
|
+
export function compareLoaderOptions(
|
|
15
|
+
left: LoaderOptions | undefined,
|
|
16
|
+
right: LoaderOptions | undefined
|
|
17
|
+
): boolean {
|
|
18
|
+
return Object.is(left, right) || compareOptionValues(left, right, new WeakMap());
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Compares option values and tracks visited object pairs to handle cycles. */
|
|
22
|
+
function compareOptionValues(
|
|
23
|
+
left: unknown,
|
|
24
|
+
right: unknown,
|
|
25
|
+
visited: WeakMap<object, WeakSet<object>>
|
|
26
|
+
): boolean {
|
|
27
|
+
if (Object.is(left, right)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
if (!left || !right || typeof left !== 'object' || typeof right !== 'object') {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const leftPrototype = Object.getPrototypeOf(left);
|
|
35
|
+
if (leftPrototype !== Object.getPrototypeOf(right)) {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (Array.isArray(left)) {
|
|
39
|
+
if (!Array.isArray(right) || left.length !== right.length) {
|
|
40
|
+
return false;
|
|
41
|
+
}
|
|
42
|
+
} else if (leftPrototype !== Object.prototype && leftPrototype !== null) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
let rightValues = visited.get(left);
|
|
47
|
+
if (rightValues?.has(right)) {
|
|
48
|
+
return true;
|
|
49
|
+
}
|
|
50
|
+
if (!rightValues) {
|
|
51
|
+
rightValues = new WeakSet();
|
|
52
|
+
visited.set(left, rightValues);
|
|
53
|
+
}
|
|
54
|
+
rightValues.add(right);
|
|
55
|
+
|
|
56
|
+
const leftKeys = getEnumerableKeys(left);
|
|
57
|
+
const rightKeys = getEnumerableKeys(right);
|
|
58
|
+
const leftOptions = left as Record<PropertyKey, unknown>;
|
|
59
|
+
const rightOptions = right as Record<PropertyKey, unknown>;
|
|
60
|
+
return (
|
|
61
|
+
leftKeys.length === rightKeys.length &&
|
|
62
|
+
leftKeys.every(
|
|
63
|
+
key =>
|
|
64
|
+
Object.prototype.propertyIsEnumerable.call(right, key) &&
|
|
65
|
+
compareOptionValues(leftOptions[key], rightOptions[key], visited)
|
|
66
|
+
)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Returns own enumerable keys, including symbols. */
|
|
71
|
+
function getEnumerableKeys(value: object): PropertyKey[] {
|
|
72
|
+
return Reflect.ownKeys(value).filter(key =>
|
|
73
|
+
Object.prototype.propertyIsEnumerable.call(value, key)
|
|
74
|
+
);
|
|
75
|
+
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {getNativeArrowOptions, unwrapArrowTable} from '../loader-utils/native-arrow';
|
|
6
|
-
|
|
7
5
|
import type {
|
|
8
6
|
LoaderArrayOptionsType,
|
|
9
7
|
LoaderShapeType,
|
|
@@ -118,21 +116,14 @@ export async function parseFile(
|
|
|
118
116
|
url,
|
|
119
117
|
normalizedOptions
|
|
120
118
|
);
|
|
121
|
-
const nativeArrowOptions = getNativeArrowOptions(loader, strictOptions, false);
|
|
122
119
|
context = getLoaderContext(
|
|
123
120
|
// @ts-expect-error candidateLoaders may be a single forced loader
|
|
124
121
|
{url, _parse: parse, loaders: candidateLoaders},
|
|
125
|
-
|
|
122
|
+
strictOptions,
|
|
126
123
|
context || null
|
|
127
124
|
);
|
|
128
125
|
|
|
129
|
-
|
|
130
|
-
loader,
|
|
131
|
-
file,
|
|
132
|
-
nativeArrowOptions || strictOptions,
|
|
133
|
-
context
|
|
134
|
-
);
|
|
135
|
-
return nativeArrowOptions ? unwrapArrowTable(result) : result;
|
|
126
|
+
return parseFileWithLoader(loader, file, strictOptions, context);
|
|
136
127
|
}
|
|
137
128
|
|
|
138
129
|
/**
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
usesNativeArrowBatches,
|
|
7
|
+
isArrowTable,
|
|
8
|
+
normalizeNativeArrowBatches
|
|
9
9
|
} from '../loader-utils/native-arrow';
|
|
10
10
|
|
|
11
11
|
import type {Batch, Table} from '@loaders.gl/core/schema';
|
|
@@ -146,10 +146,10 @@ export async function parseInBatches(
|
|
|
146
146
|
url || '',
|
|
147
147
|
normalizedOptions
|
|
148
148
|
);
|
|
149
|
-
const
|
|
149
|
+
const nativeArrow = usesNativeArrowBatches(loader, strictOptions);
|
|
150
150
|
context = getLoaderContext(
|
|
151
151
|
{url, _parseInBatches: parseInBatches, _parse: parse, loaders: loaderArray},
|
|
152
|
-
|
|
152
|
+
strictOptions,
|
|
153
153
|
context || null
|
|
154
154
|
);
|
|
155
155
|
|
|
@@ -158,10 +158,10 @@ export async function parseInBatches(
|
|
|
158
158
|
loader,
|
|
159
159
|
loaderWithParser,
|
|
160
160
|
data,
|
|
161
|
-
|
|
161
|
+
strictOptions,
|
|
162
162
|
context
|
|
163
163
|
);
|
|
164
|
-
return
|
|
164
|
+
return nativeArrow ? normalizeNativeArrowBatches(batches) : batches;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
/**
|
|
@@ -289,7 +289,7 @@ async function* parseChunkInBatches(
|
|
|
289
289
|
context
|
|
290
290
|
);
|
|
291
291
|
|
|
292
|
-
if (
|
|
292
|
+
if (isArrowTable(parsedData)) {
|
|
293
293
|
yield* parsedData.batches;
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
@@ -334,8 +334,6 @@ function isTable(value: unknown): value is Table {
|
|
|
334
334
|
return Array.isArray(table.features);
|
|
335
335
|
case 'columnar-table':
|
|
336
336
|
return Boolean(table.data && typeof table.data === 'object');
|
|
337
|
-
case 'arrow-table':
|
|
338
|
-
return Boolean(table.data && typeof table.data === 'object' && 'numRows' in table.data);
|
|
339
337
|
default:
|
|
340
338
|
return false;
|
|
341
339
|
}
|
|
@@ -349,8 +347,6 @@ function getTableLength(table: Table): number {
|
|
|
349
347
|
return table.data.length;
|
|
350
348
|
case 'geojson-table':
|
|
351
349
|
return table.features.length;
|
|
352
|
-
case 'arrow-table':
|
|
353
|
-
return table.data.numRows;
|
|
354
350
|
case 'columnar-table':
|
|
355
351
|
for (const column of Object.values(table.data)) {
|
|
356
352
|
return column.length || 0;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {getNativeArrowOptions, unwrapArrowTable} from '../loader-utils/native-arrow';
|
|
6
|
-
|
|
7
5
|
import type {
|
|
8
6
|
LoaderArrayOptionsType,
|
|
9
7
|
LoaderShapeType,
|
|
@@ -116,21 +114,19 @@ export function parseSync(
|
|
|
116
114
|
const parse = () => {
|
|
117
115
|
throw new Error('parseSync called parse (which is async');
|
|
118
116
|
};
|
|
119
|
-
const nativeArrowOptions = getNativeArrowOptions(loader, strictOptions, false);
|
|
120
117
|
context = getLoaderContext(
|
|
121
118
|
{url, _parseSync: parse, _parse: parse, loaders: loaders as Loader[]},
|
|
122
|
-
|
|
119
|
+
strictOptions,
|
|
123
120
|
context || null
|
|
124
121
|
);
|
|
125
122
|
|
|
126
123
|
const loaderWithParser = getLoaderImplementationSync(loader);
|
|
127
|
-
|
|
124
|
+
return parseWithLoaderSync(
|
|
128
125
|
loaderWithParser || (loader as LoaderWithParser),
|
|
129
126
|
data,
|
|
130
|
-
|
|
127
|
+
strictOptions,
|
|
131
128
|
context
|
|
132
129
|
);
|
|
133
|
-
return nativeArrowOptions ? unwrapArrowTable(result, loader.supportsNativeArrow) : result;
|
|
134
130
|
}
|
|
135
131
|
|
|
136
132
|
// TODO - should accept loader.parseSync/parse and generate 1 chunk asyncIterator
|
package/src/lib/api/parse.ts
CHANGED
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {getNativeArrowOptions, unwrapArrowTable} from '../loader-utils/native-arrow';
|
|
6
|
-
|
|
7
5
|
import {resolveLoaderAuthenticationOptions} from '@loaders.gl/core/loader-utils';
|
|
8
6
|
import type {
|
|
9
7
|
LoaderArrayOptionsType,
|
|
@@ -146,16 +144,14 @@ export async function parse(
|
|
|
146
144
|
);
|
|
147
145
|
|
|
148
146
|
// Get a context (if already present, will be unchanged)
|
|
149
|
-
const nativeArrowOptions = getNativeArrowOptions(loader, strictOptions, false);
|
|
150
147
|
context = getLoaderContext(
|
|
151
148
|
// @ts-expect-error
|
|
152
149
|
{url, _parse: parse, loaders: candidateLoaders},
|
|
153
|
-
|
|
150
|
+
strictOptions,
|
|
154
151
|
context || null
|
|
155
152
|
);
|
|
156
153
|
|
|
157
|
-
|
|
158
|
-
return nativeArrowOptions ? unwrapArrowTable(result, loader.supportsNativeArrow) : result;
|
|
154
|
+
return parseWithLoader(loader, data, strictOptions, context);
|
|
159
155
|
}
|
|
160
156
|
|
|
161
157
|
// TODO - should accept loader.parseAsyncIterator and concatenate.
|
|
@@ -14,56 +14,28 @@ export function getShapeOptionKey(loader: Loader): string | undefined {
|
|
|
14
14
|
return keys.includes(loader.id) ? loader.id : keys.length === 1 ? keys[0] : undefined;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
/**
|
|
18
|
-
export function
|
|
19
|
-
loader: Loader,
|
|
20
|
-
options: StrictLoaderOptions,
|
|
21
|
-
inBatches = false
|
|
22
|
-
): StrictLoaderOptions | null {
|
|
17
|
+
/** Checks for an Arrow stream and validates its metadata options. */
|
|
18
|
+
export function usesNativeArrowBatches(loader: Loader, options: StrictLoaderOptions): boolean {
|
|
23
19
|
const key = getShapeOptionKey(loader);
|
|
24
20
|
const scopedOptions = key && options[key];
|
|
25
|
-
if (
|
|
26
|
-
loader.supportsNativeArrow &&
|
|
27
|
-
scopedOptions &&
|
|
28
|
-
typeof scopedOptions === 'object' &&
|
|
29
|
-
'shape' in scopedOptions &&
|
|
30
|
-
scopedOptions.shape === 'arrow-table'
|
|
31
|
-
) {
|
|
32
|
-
throw new Error('This loader uses shape: "arrow" for native Arrow output');
|
|
33
|
-
}
|
|
34
21
|
if (
|
|
35
22
|
!scopedOptions ||
|
|
36
23
|
typeof scopedOptions !== 'object' ||
|
|
37
24
|
!('shape' in scopedOptions) ||
|
|
38
25
|
scopedOptions.shape !== 'arrow'
|
|
39
26
|
) {
|
|
40
|
-
return
|
|
27
|
+
return false;
|
|
41
28
|
}
|
|
42
|
-
if (
|
|
29
|
+
if (options.core?.metadata) {
|
|
43
30
|
throw new Error(
|
|
44
31
|
'shape: "arrow" carries metadata in the Arrow schema and does not support core.metadata envelopes'
|
|
45
32
|
);
|
|
46
33
|
}
|
|
47
|
-
|
|
48
|
-
return {
|
|
49
|
-
...options,
|
|
50
|
-
core: {...options.core, ...(options.core?.shape === 'arrow' ? {shape: 'arrow-table'} : {})},
|
|
51
|
-
[key!]: {...scopedOptions, shape: 'arrow-table'}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/** Unwraps legacy tables and passes through results from native parsers. */
|
|
56
|
-
export function unwrapArrowTable(result: unknown): arrow.Table;
|
|
57
|
-
export function unwrapArrowTable(result: unknown, nativeParser: boolean | undefined): unknown;
|
|
58
|
-
export function unwrapArrowTable(result: unknown, nativeParser?: boolean): unknown {
|
|
59
|
-
const table = result as {shape?: string; data?: arrow.Table} | null;
|
|
60
|
-
if (table?.shape === 'arrow-table' && Array.isArray(table.data?.batches)) return table.data;
|
|
61
|
-
if (nativeParser || isNativeArrowTable(result)) return result;
|
|
62
|
-
throw new Error('shape: "arrow" requires a loader that supports "arrow-table" output');
|
|
34
|
+
return true;
|
|
63
35
|
}
|
|
64
36
|
|
|
65
37
|
/** Yields every record batch, preserving order and iterator cancellation. */
|
|
66
|
-
export async function*
|
|
38
|
+
export async function* normalizeNativeArrowBatches(
|
|
67
39
|
batches: AsyncIterable<unknown> | Iterable<unknown>
|
|
68
40
|
): AsyncIterable<arrow.RecordBatch> {
|
|
69
41
|
for await (const batch of batches) {
|
|
@@ -76,16 +48,18 @@ export async function* unwrapArrowBatches(
|
|
|
76
48
|
) {
|
|
77
49
|
continue;
|
|
78
50
|
}
|
|
79
|
-
if (
|
|
51
|
+
if (isArrowRecordBatch(batch)) {
|
|
80
52
|
yield batch;
|
|
53
|
+
} else if (isArrowTable(batch)) {
|
|
54
|
+
yield* batch.batches;
|
|
81
55
|
} else {
|
|
82
|
-
|
|
56
|
+
throw new Error('shape: "arrow" requires a native Arrow table or record batch');
|
|
83
57
|
}
|
|
84
58
|
}
|
|
85
59
|
}
|
|
86
60
|
|
|
87
61
|
/** Identifies native Arrow tables without loading Arrow in the core entry point. */
|
|
88
|
-
export function
|
|
62
|
+
export function isArrowTable(value: unknown): value is arrow.Table {
|
|
89
63
|
return Boolean(
|
|
90
64
|
value &&
|
|
91
65
|
typeof value === 'object' &&
|
|
@@ -100,7 +74,7 @@ export function isNativeArrowTable(value: unknown): value is arrow.Table {
|
|
|
100
74
|
}
|
|
101
75
|
|
|
102
76
|
/** Identifies native record batches across Arrow package instances. */
|
|
103
|
-
export function
|
|
77
|
+
export function isArrowRecordBatch(value: unknown): value is arrow.RecordBatch {
|
|
104
78
|
return Boolean(
|
|
105
79
|
value &&
|
|
106
80
|
typeof value === 'object' &&
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import type {SQLQuery} from '@math.gl/
|
|
5
|
+
import type {SQLQuery} from '@math.gl/sql/parser';
|
|
6
6
|
import type {DataType, FieldMetadata, Schema} from '@loaders.gl/core/schema';
|
|
7
7
|
import type {ColumnarPredicate, ColumnarPredicateProperty} from './columnar-predicate';
|
|
8
8
|
import type {
|
|
@@ -148,6 +148,8 @@ export type ScanQueryMetadata = Readonly<{
|
|
|
148
148
|
statistics?: ScanSourceStatistics;
|
|
149
149
|
/** Optional multiscale raster levels. */
|
|
150
150
|
levels?: readonly ScanRasterLevel[];
|
|
151
|
+
/** The source or a child applies a configured row window to direct reads by default. */
|
|
152
|
+
hasDefaultRowWindow?: boolean;
|
|
151
153
|
}>;
|
|
152
154
|
|
|
153
155
|
/** Options accepted by query metadata discovery methods. */
|
|
@@ -341,6 +343,8 @@ export type CreateScanQueryMetadataOptions = Readonly<{
|
|
|
341
343
|
statistics?: ScanSourceStatistics;
|
|
342
344
|
/** Optional multiscale raster levels. */
|
|
343
345
|
levels?: readonly ScanRasterLevel[];
|
|
346
|
+
/** The source or a child applies a configured row window to direct reads by default. */
|
|
347
|
+
hasDefaultRowWindow?: boolean;
|
|
344
348
|
}>;
|
|
345
349
|
|
|
346
350
|
/**
|
|
@@ -381,6 +385,7 @@ export function createScanQueryMetadata(options: CreateScanQueryMetadataOptions)
|
|
|
381
385
|
columns: Object.freeze(columns),
|
|
382
386
|
capabilities: queryCapabilities,
|
|
383
387
|
queryCapabilities,
|
|
388
|
+
...(options.hasDefaultRowWindow ? {hasDefaultRowWindow: true} : {}),
|
|
384
389
|
spatial: options.spatial
|
|
385
390
|
? Object.freeze({
|
|
386
391
|
...options.spatial,
|
|
@@ -454,11 +459,7 @@ export type TableQueryPushdownPlan = Readonly<{
|
|
|
454
459
|
/** Exact output schema, including aliases, CAST types, and nullability. */
|
|
455
460
|
schema: Schema;
|
|
456
461
|
/** Executes on demand with equivalent order, error semantics, and cancellation. */
|
|
457
|
-
read: (
|
|
458
|
-
options?: ScanQueryMetadataOptions
|
|
459
|
-
) => AsyncIterable<
|
|
460
|
-
import('apache-arrow').RecordBatch | import('@loaders.gl/core/schema').ArrowTableBatch
|
|
461
|
-
>;
|
|
462
|
+
read: (options?: ScanQueryMetadataOptions) => AsyncIterable<import('apache-arrow').RecordBatch>;
|
|
462
463
|
}>;
|
|
463
464
|
|
|
464
465
|
/** Preferred name for source discovery metadata. */
|