@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
|
@@ -447,7 +447,9 @@ function triangulatePolygon(
|
|
|
447
447
|
const holes = indices.slice(1).map((n: number) => (n - offset) / coordLength);
|
|
448
448
|
|
|
449
449
|
// Compute triangulation
|
|
450
|
-
const triangles = earcut(polygonPositions, holes, coordLength, areas
|
|
450
|
+
const triangles = earcut(polygonPositions, holes, coordLength, areas, 'xy', {
|
|
451
|
+
triangulation: 'balanced'
|
|
452
|
+
});
|
|
451
453
|
|
|
452
454
|
// Indices returned by triangulation are relative to start
|
|
453
455
|
// of polygon, so we need to offset
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import type {
|
|
6
|
+
import type {Schema as TableSchema} from '@loaders.gl/core/schema';
|
|
7
7
|
import {convertSchemaToArrow} from '@loaders.gl/core/schema-utils';
|
|
8
8
|
import {reprojectWKBInPlace, type CoordinateTransform} from './binary-geometry-to-wkb';
|
|
9
9
|
import {
|
|
@@ -26,7 +26,7 @@ export type WKBArrowGeometryValueOptions = {
|
|
|
26
26
|
export type WKBArrowGeometryWriterOptions = WKBBuilderBaseOptions;
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
|
-
* Creates
|
|
29
|
+
* Creates an Apache Arrow table containing one `geoarrow.wkb` geometry column.
|
|
30
30
|
*
|
|
31
31
|
* @param geometries - WKB geometry byte values, with nullish values encoded as null rows.
|
|
32
32
|
* @param schema - Table schema containing the WKB geometry field.
|
|
@@ -37,12 +37,12 @@ export function makeWKBGeometryArrowTable(
|
|
|
37
37
|
geometries: (WKBGeometryValue | null | undefined)[],
|
|
38
38
|
schema: TableSchema,
|
|
39
39
|
options: WKBArrowGeometryValueOptions = {}
|
|
40
|
-
):
|
|
40
|
+
): arrow.Table {
|
|
41
41
|
return makeWKBGeometryArrowTableFromData(schema, makeWKBGeometryData(geometries, options));
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
|
-
* Creates
|
|
45
|
+
* Creates an Apache Arrow table from incremental WKB writer callbacks.
|
|
46
46
|
*
|
|
47
47
|
* @param geometryWriters - Writer callbacks, with nullish values encoded as null rows.
|
|
48
48
|
* @param schema - Table schema containing the WKB geometry field.
|
|
@@ -53,7 +53,7 @@ export function makeWKBGeometryArrowTableFromWriters(
|
|
|
53
53
|
geometryWriters: (WKBGeometryWriter | null | undefined)[],
|
|
54
54
|
schema: TableSchema,
|
|
55
55
|
options: WKBArrowGeometryWriterOptions = {}
|
|
56
|
-
):
|
|
56
|
+
): arrow.Table {
|
|
57
57
|
return makeWKBGeometryArrowTableFromData(
|
|
58
58
|
schema,
|
|
59
59
|
makeWKBGeometryDataFromWriters(geometryWriters, options)
|
|
@@ -61,7 +61,7 @@ export function makeWKBGeometryArrowTableFromWriters(
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
|
-
* Wraps Arrow WKB geometry data in
|
|
64
|
+
* Wraps Arrow WKB geometry data in an Apache Arrow table.
|
|
65
65
|
*
|
|
66
66
|
* @param schema - Table schema containing the WKB geometry field.
|
|
67
67
|
* @param geometryData - Arrow Binary data for the WKB geometry column.
|
|
@@ -70,7 +70,7 @@ export function makeWKBGeometryArrowTableFromWriters(
|
|
|
70
70
|
export function makeWKBGeometryArrowTableFromData(
|
|
71
71
|
schema: TableSchema,
|
|
72
72
|
geometryData: arrow.Data<arrow.Binary>
|
|
73
|
-
):
|
|
73
|
+
): arrow.Table {
|
|
74
74
|
const arrowSchema = convertSchemaToArrow(schema);
|
|
75
75
|
const structField = new arrow.Struct(arrowSchema.fields);
|
|
76
76
|
const structData = new arrow.Data(structField, 0, geometryData.length, 0, undefined, [
|
|
@@ -78,11 +78,7 @@ export function makeWKBGeometryArrowTableFromData(
|
|
|
78
78
|
]);
|
|
79
79
|
const recordBatch = new arrow.RecordBatch(arrowSchema, structData);
|
|
80
80
|
|
|
81
|
-
return
|
|
82
|
-
shape: 'arrow-table',
|
|
83
|
-
schema,
|
|
84
|
-
data: new arrow.Table(arrowSchema, [recordBatch])
|
|
85
|
-
};
|
|
81
|
+
return new arrow.Table(arrowSchema, [recordBatch]);
|
|
86
82
|
}
|
|
87
83
|
|
|
88
84
|
/**
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {WKBBuilder as MathWKBBuilder} from '@math.gl/arrow
|
|
6
|
-
import type {WellKnownDimension, WKBGeometryType as MathWKBGeometryType} from '@math.gl/arrow
|
|
5
|
+
import {WKBBuilder as MathWKBBuilder} from '@math.gl/core/arrow';
|
|
6
|
+
import type {WellKnownDimension, WKBGeometryType as MathWKBGeometryType} from '@math.gl/core/arrow';
|
|
7
7
|
import {WKBGeometryType} from './wkb-types';
|
|
8
8
|
|
|
9
9
|
/** Function that writes one WKB geometry into a builder. */
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
-
import {scanWKB} from '@math.gl/arrow
|
|
6
|
-
import type {WellKnownDimension, WKBGeometryType} from '@math.gl/arrow
|
|
5
|
+
import {scanWKB} from '@math.gl/core/arrow';
|
|
6
|
+
import type {WellKnownDimension, WKBGeometryType} from '@math.gl/core/arrow';
|
|
7
7
|
|
|
8
8
|
/** Coordinate bounds extracted directly from one WKB geometry. */
|
|
9
9
|
export type WKBGeometryBoundingBox = {
|
|
@@ -4,17 +4,19 @@
|
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
6
|
import {
|
|
7
|
+
createRecordBatchWithMetadata,
|
|
8
|
+
getRecordBatchMetadata,
|
|
7
9
|
dehydrateArrowTable,
|
|
8
10
|
dehydrateArrowRecordBatch,
|
|
9
11
|
hydrateArrowTable,
|
|
10
12
|
hydrateArrowRecordBatch,
|
|
11
13
|
type DehydratedArrowTable,
|
|
12
14
|
type SplitArrowBuffersOptions
|
|
13
|
-
} from '@math.gl/arrow';
|
|
15
|
+
} from '@math.gl/core/arrow';
|
|
14
16
|
/** Per-batch metadata transferred alongside math.gl's column payload. */
|
|
15
17
|
type BatchMetadata = {
|
|
16
18
|
schema: Uint8Array;
|
|
17
|
-
metadata
|
|
19
|
+
metadata?: [string, string][];
|
|
18
20
|
};
|
|
19
21
|
|
|
20
22
|
type ArrowWorkerOptions = {
|
|
@@ -27,45 +29,6 @@ type ArrowWorkerColumns = {
|
|
|
27
29
|
arrowBatchMetadata?: BatchMetadata[];
|
|
28
30
|
};
|
|
29
31
|
|
|
30
|
-
/** Wire payload for callers that still carry format-specific side metadata. */
|
|
31
|
-
type ArrowWorkerEnvelope = ArrowWorkerColumns & {
|
|
32
|
-
transport: 'arrow-column-envelope';
|
|
33
|
-
metadata: Record<string, unknown>;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/** Previous envelope accepted during hydration for workers built against older releases. */
|
|
37
|
-
type LegacyArrowWorkerEnvelope = ArrowWorkerColumns & {
|
|
38
|
-
shape: 'arrow-table';
|
|
39
|
-
[key: string]: unknown;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/** Serializes Arrow columns with owned buffers so transfers cannot detach retained parser state. */
|
|
43
|
-
export function serializeArrowWorkerTable(result: unknown): unknown {
|
|
44
|
-
if (!isArrowTableWrapper(result)) {
|
|
45
|
-
throw new Error('Workers require Arrow table output');
|
|
46
|
-
}
|
|
47
|
-
const {data, shape: _shape, ...metadata} = result;
|
|
48
|
-
// Headers, sidecar indexes, and mesh indices can also retain parser-owned binary buffers.
|
|
49
|
-
// Clone only this small envelope; the Arrow table always uses column-buffer transfer.
|
|
50
|
-
return {
|
|
51
|
-
transport: 'arrow-column-envelope',
|
|
52
|
-
metadata: structuredClone(metadata),
|
|
53
|
-
...serializeWorkerColumns(data, {copy: 'all'})
|
|
54
|
-
} satisfies ArrowWorkerEnvelope;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/** Hydrates the column-buffer worker protocol; other wire formats are rejected. */
|
|
58
|
-
export function deserializeArrowWorkerTable(result: unknown): any {
|
|
59
|
-
if (isArrowWorkerEnvelope(result)) {
|
|
60
|
-
return {...result.metadata, shape: 'arrow-table', data: hydrateWorkerTable(result)};
|
|
61
|
-
}
|
|
62
|
-
if (isLegacyArrowWorkerEnvelope(result)) {
|
|
63
|
-
const {arrowBatchMetadata: _snapshots, data: _columns, ...metadata} = result;
|
|
64
|
-
return {...metadata, data: hydrateWorkerTable(result)};
|
|
65
|
-
}
|
|
66
|
-
throw new Error('Workers require Arrow column transport');
|
|
67
|
-
}
|
|
68
|
-
|
|
69
32
|
/** Serializes a native Arrow table or batch with owned column buffers for worker transport. */
|
|
70
33
|
export function serializeNativeArrowWorkerResult(
|
|
71
34
|
result: arrow.Table | arrow.RecordBatch,
|
|
@@ -101,47 +64,24 @@ export function deserializeNativeArrowWorkerResult(
|
|
|
101
64
|
return payload.transport === 'arrow-record-batch' ? data.batches[0] : data;
|
|
102
65
|
}
|
|
103
66
|
|
|
104
|
-
/**
|
|
67
|
+
/** Transfers native Arrow columns and passes other loader results through. */
|
|
105
68
|
export function serializeArrowWorkerResult(result: unknown, options?: unknown): unknown {
|
|
106
69
|
const workerOptions = options as ArrowWorkerOptions | undefined;
|
|
107
|
-
const
|
|
70
|
+
const copy =
|
|
108
71
|
workerOptions?.core?.workerTransferBufferCopy ?? workerOptions?.workerTransferBufferCopy;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
if (!isArrowTableWrapper(result)) {
|
|
113
|
-
return result;
|
|
114
|
-
}
|
|
115
|
-
const {data, shape: _shape, ...metadata} = result;
|
|
116
|
-
return {
|
|
117
|
-
transport: 'arrow-column-envelope',
|
|
118
|
-
metadata: structuredClone(metadata),
|
|
119
|
-
...serializeWorkerColumns(data, bufferCopyMode ? {copy: bufferCopyMode} : undefined)
|
|
120
|
-
} satisfies ArrowWorkerEnvelope;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** Rehydrates any loaders.gl Arrow table wrapper returned from worker postMessage transport. */
|
|
124
|
-
export function deserializeArrowWorkerResult(result: unknown): any {
|
|
125
|
-
const transport = (result as {transport?: string} | null)?.transport;
|
|
126
|
-
if (transport === 'arrow-table-columns' || transport === 'arrow-record-batch') {
|
|
127
|
-
return deserializeNativeArrowWorkerResult(result);
|
|
128
|
-
}
|
|
129
|
-
return isArrowWorkerEnvelope(result) || isLegacyArrowWorkerEnvelope(result)
|
|
130
|
-
? deserializeArrowWorkerTable(result)
|
|
72
|
+
return result instanceof arrow.Table || result instanceof arrow.RecordBatch
|
|
73
|
+
? serializeNativeArrowWorkerResult(result, {copy: copy ?? 'all'})
|
|
131
74
|
: result;
|
|
132
75
|
}
|
|
133
76
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
typeof table.data === 'object' &&
|
|
143
|
-
'batches' in table.data
|
|
144
|
-
);
|
|
77
|
+
/** Restores native Arrow worker results and passes other loader results through. */
|
|
78
|
+
export function deserializeArrowWorkerResult<ResultType = unknown>(result: unknown): ResultType {
|
|
79
|
+
const transport = (result as {transport?: string} | null)?.transport;
|
|
80
|
+
return (
|
|
81
|
+
transport === 'arrow-table-columns' || transport === 'arrow-record-batch'
|
|
82
|
+
? deserializeNativeArrowWorkerResult(result)
|
|
83
|
+
: result
|
|
84
|
+
) as ResultType;
|
|
145
85
|
}
|
|
146
86
|
|
|
147
87
|
/** Recognizes a transferable Arrow columns descriptor. */
|
|
@@ -150,22 +90,6 @@ function hasArrowWorkerColumns(value: unknown): value is ArrowWorkerColumns {
|
|
|
150
90
|
return columns?.data?.transport === 'arrow-js' && Array.isArray(columns.data.batches);
|
|
151
91
|
}
|
|
152
92
|
|
|
153
|
-
/** Recognizes payloads carrying format-specific metadata. */
|
|
154
|
-
function isArrowWorkerEnvelope(value: unknown): value is ArrowWorkerEnvelope {
|
|
155
|
-
return (
|
|
156
|
-
(value as ArrowWorkerEnvelope | null)?.transport === 'arrow-column-envelope' &&
|
|
157
|
-
hasArrowWorkerColumns(value)
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/** Recognizes wrapped column payloads from older workers. */
|
|
162
|
-
function isLegacyArrowWorkerEnvelope(value: unknown): value is LegacyArrowWorkerEnvelope {
|
|
163
|
-
return (
|
|
164
|
-
(value as LegacyArrowWorkerEnvelope | null)?.shape === 'arrow-table' &&
|
|
165
|
-
hasArrowWorkerColumns(value)
|
|
166
|
-
);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
93
|
/** Serializes columns and independent batch metadata. */
|
|
170
94
|
function serializeWorkerColumns(
|
|
171
95
|
table: arrow.Table,
|
|
@@ -173,29 +97,14 @@ function serializeWorkerColumns(
|
|
|
173
97
|
): ArrowWorkerColumns {
|
|
174
98
|
return {
|
|
175
99
|
arrowBatchMetadata: snapshotBatchMetadata(table),
|
|
176
|
-
data:
|
|
100
|
+
data: dehydrateArrowTable(table, options)
|
|
177
101
|
};
|
|
178
102
|
}
|
|
179
103
|
|
|
180
|
-
/**
|
|
181
|
-
function dehydrateWorkerTable(
|
|
182
|
-
table: arrow.Table,
|
|
183
|
-
options?: SplitArrowBuffersOptions
|
|
184
|
-
): DehydratedArrowTable {
|
|
185
|
-
const payload = dehydrateArrowTable(table, options);
|
|
186
|
-
if (table.numCols === 0) {
|
|
187
|
-
for (const [index, batch] of table.batches.entries()) {
|
|
188
|
-
payload.batches[index].length = batch.numRows;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return payload;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/** Captures batch schemas and custom metadata before transferring column buffers. */
|
|
104
|
+
/** Captures batch schemas before transferring column buffers. */
|
|
195
105
|
function snapshotBatchMetadata(table: arrow.Table): BatchMetadata[] {
|
|
196
106
|
return table.batches.map(batch => ({
|
|
197
|
-
schema: arrow.tableToIPC(new arrow.Table(batch.schema, []))
|
|
198
|
-
metadata: Array.from(batch.metadata)
|
|
107
|
+
schema: arrow.tableToIPC(new arrow.Table(batch.schema, []))
|
|
199
108
|
}));
|
|
200
109
|
}
|
|
201
110
|
|
|
@@ -205,21 +114,13 @@ function hydrateWorkerTable(result: ArrowWorkerColumns): arrow.Table {
|
|
|
205
114
|
const table = hydrateArrowTable(data);
|
|
206
115
|
const batches = table.batches.map((batch, index) => {
|
|
207
116
|
const snapshot = arrowBatchMetadata?.[index];
|
|
208
|
-
|
|
209
|
-
?
|
|
117
|
+
return snapshot
|
|
118
|
+
? createRecordBatchWithMetadata(
|
|
210
119
|
arrow.tableFromIPC(snapshot.schema).schema,
|
|
211
120
|
batch.data,
|
|
212
|
-
new Map(snapshot.metadata)
|
|
121
|
+
snapshot.metadata ? new Map(snapshot.metadata) : getRecordBatchMetadata(batch)
|
|
213
122
|
)
|
|
214
123
|
: batch;
|
|
215
|
-
// Arrow JS derives the length of a struct from its children, which can be empty.
|
|
216
|
-
const rowCount = data.batches[index].length;
|
|
217
|
-
if (restored.numCols === 0 && restored.numRows !== rowCount) {
|
|
218
|
-
Object.defineProperty(restored, 'data', {
|
|
219
|
-
value: new arrow.Data(new arrow.Struct([]), 0, rowCount, 0, undefined, [])
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
return restored;
|
|
223
124
|
});
|
|
224
125
|
return new arrow.Table(table.schema, batches);
|
|
225
126
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import type {BinaryPolygonGeometry} from '@loaders.gl/core/schema';
|
|
6
|
-
import type {GeoArrowColumn, GeoArrowDimension} from '@math.gl/arrow
|
|
7
|
-
import {getGeoArrowDimensionSize} from '@math.gl/arrow
|
|
6
|
+
import type {GeoArrowColumn, GeoArrowDimension} from '@math.gl/core/arrow';
|
|
7
|
+
import {getGeoArrowDimensionSize} from '@math.gl/core/arrow';
|
|
8
8
|
|
|
9
9
|
/** Semantic information absent from the legacy binary polygon representation. */
|
|
10
10
|
export type BinaryPolygonToGeoArrowOptions = {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// SPDX-License-Identifier: MIT
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
|
+
import type {Table} from 'apache-arrow';
|
|
5
6
|
import {DataSource} from '@loaders.gl/core/loader-utils';
|
|
6
7
|
import type {
|
|
7
8
|
GetFeaturesParameters,
|
|
@@ -10,7 +11,6 @@ import type {
|
|
|
10
11
|
VectorSourceMetadata
|
|
11
12
|
} from '@loaders.gl/core/loader-utils';
|
|
12
13
|
import type {
|
|
13
|
-
ArrowTable,
|
|
14
14
|
Feature,
|
|
15
15
|
GeoArrowEncoding,
|
|
16
16
|
GeoJSONTable,
|
|
@@ -42,7 +42,7 @@ import {getRepresentativePoint, type RepresentativePointStrategy} from './get-re
|
|
|
42
42
|
* Complete materialized input; remote viewport subsets must be collected before indexing.
|
|
43
43
|
* @experimental
|
|
44
44
|
*/
|
|
45
|
-
export type ClusterSourceData = GeoJSONTable |
|
|
45
|
+
export type ClusterSourceData = GeoJSONTable | Table;
|
|
46
46
|
|
|
47
47
|
/**
|
|
48
48
|
* Cluster source construction options; inputs must use longitude/latitude.
|
|
@@ -99,30 +99,25 @@ export class ClusterSource extends DataSource<ClusterSourceData, {}> implements
|
|
|
99
99
|
super(data, {});
|
|
100
100
|
const positions: number[] = [];
|
|
101
101
|
const rowIndices: number[] = [];
|
|
102
|
-
if (
|
|
103
|
-
const columns = getGeometryColumnsFromSchema(data.
|
|
102
|
+
if (!('shape' in data)) {
|
|
103
|
+
const columns = getGeometryColumnsFromSchema(data.schema);
|
|
104
104
|
const columnNames = Object.keys(columns);
|
|
105
105
|
this.geometryColumn =
|
|
106
106
|
options.geometryColumn ?? (columnNames.length === 1 ? columnNames[0] : undefined);
|
|
107
107
|
this.geometryEncoding = this.geometryColumn
|
|
108
108
|
? columns[this.geometryColumn]?.encoding
|
|
109
109
|
: undefined;
|
|
110
|
-
if (
|
|
111
|
-
!this.geometryColumn ||
|
|
112
|
-
!this.geometryEncoding ||
|
|
113
|
-
!data.data.getChild(this.geometryColumn)
|
|
114
|
-
) {
|
|
110
|
+
if (!this.geometryColumn || !this.geometryEncoding || !data.getChild(this.geometryColumn)) {
|
|
115
111
|
throw new Error('ClusterSource requires an explicitly identified GeoArrow geometry column');
|
|
116
112
|
}
|
|
117
113
|
}
|
|
118
|
-
const geometryVector =
|
|
119
|
-
data.shape === 'arrow-table' ? data.data.getChild(this.geometryColumn!)! : null;
|
|
114
|
+
const geometryVector = !('shape' in data) ? data.getChild(this.geometryColumn!)! : null;
|
|
120
115
|
// Native point bounds read Arrow buffers directly, including chunks, slices and nulls.
|
|
121
116
|
const pointBounds =
|
|
122
117
|
geometryVector && this.geometryEncoding === 'geoarrow.point' && !options.getClusterPosition
|
|
123
118
|
? getGeoArrowRowBounds(geometryVector, this.geometryEncoding)
|
|
124
119
|
: null;
|
|
125
|
-
const rowCount =
|
|
120
|
+
const rowCount = !('shape' in data) ? data.numRows : data.features.length;
|
|
126
121
|
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
127
122
|
let position: readonly [number, number] | null;
|
|
128
123
|
if (pointBounds) {
|
|
@@ -144,12 +139,11 @@ export class ClusterSource extends DataSource<ClusterSourceData, {}> implements
|
|
|
144
139
|
if (['cluster', 'clusterId', 'pointCount', 'rowIndex', 'geometry'].includes(name)) {
|
|
145
140
|
throw new Error(`Reserved cluster property: ${name}`);
|
|
146
141
|
}
|
|
147
|
-
const column =
|
|
142
|
+
const column = !('shape' in data) ? data.getChild(aggregation.column) : null;
|
|
148
143
|
const values = rowIndices.map(rowIndex => {
|
|
149
|
-
const value =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
: data.features[rowIndex].properties?.[aggregation.column];
|
|
144
|
+
const value = !('shape' in data)
|
|
145
|
+
? column?.get(rowIndex)
|
|
146
|
+
: data.features[rowIndex].properties?.[aggregation.column];
|
|
153
147
|
if (typeof value !== 'number' || !Number.isFinite(value))
|
|
154
148
|
throw new Error(`Cluster aggregation ${name} requires finite numeric values`);
|
|
155
149
|
return value;
|
|
@@ -239,22 +233,21 @@ export class ClusterSource extends DataSource<ClusterSourceData, {}> implements
|
|
|
239
233
|
|
|
240
234
|
/** Retrieves a member's original geometry and properties; Arrow rows are materialized on demand. */
|
|
241
235
|
getFeature(rowIndex: number): Feature<Geometry | null> {
|
|
242
|
-
const rowCount =
|
|
243
|
-
this.data.shape === 'arrow-table' ? this.data.data.numRows : this.data.features.length;
|
|
236
|
+
const rowCount = !('shape' in this.data) ? this.data.numRows : this.data.features.length;
|
|
244
237
|
if (!Number.isInteger(rowIndex) || rowIndex < 0 || rowIndex >= rowCount)
|
|
245
238
|
throw new Error('Invalid cluster source row');
|
|
246
|
-
if (this.data
|
|
247
|
-
const properties = {...this.data.
|
|
239
|
+
if ('shape' in this.data) return this.data.features[rowIndex];
|
|
240
|
+
const properties = {...this.data.get(rowIndex)!.toJSON()};
|
|
248
241
|
delete properties[this.geometryColumn!];
|
|
249
242
|
return {type: 'Feature', geometry: this.getGeometry(rowIndex), properties};
|
|
250
243
|
}
|
|
251
244
|
|
|
252
245
|
/** Decodes one geometry only when extraction or member retrieval needs it. */
|
|
253
246
|
private getGeometry(rowIndex: number): Geometry | null {
|
|
254
|
-
return this.data
|
|
247
|
+
return 'shape' in this.data
|
|
255
248
|
? this.data.features[rowIndex].geometry
|
|
256
249
|
: convertGeoArrowVectorCellToGeoJSON(
|
|
257
|
-
this.data.
|
|
250
|
+
this.data.getChild(this.geometryColumn!)!,
|
|
258
251
|
rowIndex,
|
|
259
252
|
this.geometryEncoding!
|
|
260
253
|
);
|
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
convertFeaturesToGeoArrowTable as convertGISFeaturesToGeoArrowTable
|
|
8
8
|
} from '@loaders.gl/core/arrow-geometry/feature-table';
|
|
9
9
|
import type {
|
|
10
|
-
ArrowTable,
|
|
11
10
|
Feature,
|
|
12
11
|
Geometry,
|
|
13
12
|
GeoArrowEncodingPreference,
|
|
@@ -53,17 +52,14 @@ export function convertTableToGeoArrow(
|
|
|
53
52
|
if (!('shape' in table)) return convertArrowTableToGeoArrow(table, encoding, options);
|
|
54
53
|
|
|
55
54
|
switch (table.shape) {
|
|
56
|
-
case 'arrow-table':
|
|
57
|
-
return convertArrowTableToGeoArrow(table.data, encoding, options);
|
|
58
|
-
|
|
59
55
|
case 'geojson-table':
|
|
60
|
-
return convertFeatureCollectionToGeoArrowTable(table, options)
|
|
56
|
+
return convertFeatureCollectionToGeoArrowTable(table, options);
|
|
61
57
|
|
|
62
58
|
default:
|
|
63
59
|
if (encoding) {
|
|
64
60
|
const featureTable = convertGenericGeometryTable(table, options);
|
|
65
61
|
if (featureTable) {
|
|
66
|
-
return featureTable
|
|
62
|
+
return featureTable;
|
|
67
63
|
}
|
|
68
64
|
}
|
|
69
65
|
return convertArrowTableToGeoArrow(convertTableToArrow(table, options), encoding, options);
|
|
@@ -71,46 +67,40 @@ export function convertTableToGeoArrow(
|
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
/**
|
|
74
|
-
* Converts a GeoJSON feature collection table to
|
|
70
|
+
* Converts a GeoJSON feature collection table to an Apache Arrow table with GeoArrow geometry metadata.
|
|
75
71
|
*/
|
|
76
72
|
export function convertFeatureCollectionToGeoArrowTable(
|
|
77
73
|
table: GeoJSONTable,
|
|
78
74
|
options?: GeoArrowConvertFromOptions
|
|
79
|
-
):
|
|
75
|
+
): arrow.Table {
|
|
80
76
|
const encoding = resolveGeoArrowEncoding(options);
|
|
81
77
|
const arrowTable = convertGISFeatureCollectionToGeoArrowTable(table, {
|
|
82
78
|
encoding: getGeoJSONStagingEncoding(encoding),
|
|
83
79
|
geometryColumnName: options?.geoarrow?.geometryColumnName
|
|
84
80
|
});
|
|
85
|
-
return
|
|
86
|
-
shape: 'arrow-table',
|
|
87
|
-
data: convertGeoJSONArrowTableToTarget(arrowTable.data, encoding, options)
|
|
88
|
-
};
|
|
81
|
+
return convertGeoJSONArrowTableToTarget(arrowTable, encoding, options);
|
|
89
82
|
}
|
|
90
83
|
|
|
91
84
|
/**
|
|
92
|
-
* Converts GeoJSON features into
|
|
85
|
+
* Converts GeoJSON features into an Apache Arrow table with GeoArrow geometry metadata.
|
|
93
86
|
*/
|
|
94
87
|
export function convertFeaturesToGeoArrowTable(
|
|
95
88
|
features: Feature[],
|
|
96
89
|
options?: GeoArrowConvertFromOptions
|
|
97
|
-
):
|
|
90
|
+
): arrow.Table {
|
|
98
91
|
const encoding = resolveGeoArrowEncoding(options);
|
|
99
92
|
const arrowTable = convertGISFeaturesToGeoArrowTable(features, {
|
|
100
93
|
encoding: getGeoJSONStagingEncoding(encoding),
|
|
101
94
|
geometryColumnName: options?.geoarrow?.geometryColumnName
|
|
102
95
|
});
|
|
103
|
-
return
|
|
104
|
-
shape: 'arrow-table',
|
|
105
|
-
data: convertGeoJSONArrowTableToTarget(arrowTable.data, encoding, options)
|
|
106
|
-
};
|
|
96
|
+
return convertGeoJSONArrowTableToTarget(arrowTable, encoding, options);
|
|
107
97
|
}
|
|
108
98
|
|
|
109
99
|
/** Converts generic row and column tables when they contain GeoJSON geometry values. */
|
|
110
100
|
function convertGenericGeometryTable(
|
|
111
|
-
table: Exclude<Table,
|
|
101
|
+
table: Exclude<Table, GeoJSONTable>,
|
|
112
102
|
options?: GeoArrowConvertFromOptions
|
|
113
|
-
):
|
|
103
|
+
): arrow.Table | null {
|
|
114
104
|
const geometryColumn = options?.geoarrow?.geometryColumn || 'geometry';
|
|
115
105
|
const rows = getGenericTableRows(table);
|
|
116
106
|
if (!rows.some(row => isGeoJSONGeometry(row[geometryColumn]))) {
|
|
@@ -138,9 +128,7 @@ function convertGenericGeometryTable(
|
|
|
138
128
|
}
|
|
139
129
|
|
|
140
130
|
/** Materializes generic table rows for the opt-in geometry adaptation path. */
|
|
141
|
-
function getGenericTableRows(
|
|
142
|
-
table: Exclude<Table, ArrowTable | GeoJSONTable>
|
|
143
|
-
): Record<string, unknown>[] {
|
|
131
|
+
function getGenericTableRows(table: Exclude<Table, GeoJSONTable>): Record<string, unknown>[] {
|
|
144
132
|
switch (table.shape) {
|
|
145
133
|
case 'object-row-table':
|
|
146
134
|
return table.data as Record<string, unknown>[];
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import {scanWKB} from '@math.gl/arrow
|
|
7
|
-
import {makeGeoArrowColumnFromArrowVector} from '@math.gl/arrow
|
|
6
|
+
import {scanWKB} from '@math.gl/core/arrow';
|
|
7
|
+
import {makeGeoArrowColumnFromArrowVector} from '@math.gl/core/arrow';
|
|
8
8
|
import type {BinaryPolygonGeometry, GeoArrowEncoding} from '@loaders.gl/core/schema';
|
|
9
|
-
import {getGeoArrowRowBounds as getMathGeoArrowRowBounds} from '@math.gl/arrow
|
|
9
|
+
import {getGeoArrowRowBounds as getMathGeoArrowRowBounds} from '@math.gl/core/arrow';
|
|
10
10
|
import {makeGeoArrowColumnFromBinaryPolygon} from './binary-polygon-to-geoarrow';
|
|
11
11
|
import type {BinaryPolygonToGeoArrowOptions} from './binary-polygon-to-geoarrow';
|
|
12
12
|
|
|
@@ -12,7 +12,7 @@ import type {
|
|
|
12
12
|
} from '@loaders.gl/core/schema';
|
|
13
13
|
import {getGeometryMetadataForField} from './metadata/geoarrow-metadata';
|
|
14
14
|
import {getGeoArrowGeometryInfoFromLayout} from './get-geoarrow-geometry-info';
|
|
15
|
-
import {scanWKB} from '@math.gl/arrow
|
|
15
|
+
import {scanWKB} from '@math.gl/core/arrow';
|
|
16
16
|
import {convertWKTToGeometry} from '@loaders.gl/core/arrow-geometry/geometry-codecs';
|
|
17
17
|
import {inspectGeoArrowLayout} from './geoarrow-layout';
|
|
18
18
|
|
|
@@ -3,12 +3,8 @@
|
|
|
3
3
|
// Copyright (c) vis.gl contributors
|
|
4
4
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
decodeGeoArrowWKB,
|
|
9
|
-
encodeGeoArrowWKB
|
|
10
|
-
} from '@math.gl/arrow/geoarrow-utils';
|
|
11
|
-
import type {DecodeGeoArrowWKBOptions} from '@math.gl/arrow/geoarrow-utils';
|
|
6
|
+
import {convertGeoArrowColumn, decodeGeoArrowWKB, encodeGeoArrowWKB} from '@math.gl/core/arrow';
|
|
7
|
+
import type {DecodeGeoArrowWKBOptions} from '@math.gl/core/arrow';
|
|
12
8
|
import {
|
|
13
9
|
convertGeometryToWKB,
|
|
14
10
|
convertGeometryToWKT
|
|
@@ -35,7 +31,7 @@ import {assertGeoArrowResourceLimits} from '../geoarrow-resource-limits';
|
|
|
35
31
|
import {
|
|
36
32
|
makeArrowVectorFromGeoArrowColumn,
|
|
37
33
|
makeGeoArrowColumnFromArrowVector
|
|
38
|
-
} from '@math.gl/arrow
|
|
34
|
+
} from '@math.gl/core/arrow';
|
|
39
35
|
import {getGeoArrowUnionGeometryKind} from '../lib/kernels/geoarrow-union';
|
|
40
36
|
|
|
41
37
|
type GeoArrowGeometryKind =
|
|
@@ -13,7 +13,7 @@ import type {
|
|
|
13
13
|
import {
|
|
14
14
|
convertArrowToSchema,
|
|
15
15
|
convertArrowToTable,
|
|
16
|
-
|
|
16
|
+
isArrowTable
|
|
17
17
|
} from '@loaders.gl/core/schema-utils';
|
|
18
18
|
import {convertGeoArrowToTable} from '../lib/table-converters/convert-geoarrow-table';
|
|
19
19
|
import {convertTableToGeoArrow} from '../convert-table-to-geoarrow';
|
|
@@ -44,7 +44,7 @@ export function convertGeoArrow(
|
|
|
44
44
|
| 'arrow',
|
|
45
45
|
options?: GeoArrowConvertFromOptions | GeoArrowConvertToOptions
|
|
46
46
|
): Table | arrow.Table {
|
|
47
|
-
if (
|
|
47
|
+
if (isArrowTable(input)) {
|
|
48
48
|
if (shape === 'arrow') return input;
|
|
49
49
|
if (shape === 'geojson-table' && !isGeoArrowApacheTable(input)) {
|
|
50
50
|
return convertArrowToTable(input, 'geojson-table');
|
|
@@ -42,7 +42,6 @@ export const GeoArrowTableConverter: Converter<
|
|
|
42
42
|
| 'array-row-table'
|
|
43
43
|
| 'columnar-table'
|
|
44
44
|
| 'geojson-table'
|
|
45
|
-
| 'arrow-table'
|
|
46
45
|
| 'arrow',
|
|
47
46
|
GeoArrowConvertFromOptions | GeoArrowConvertToOptions
|
|
48
47
|
> = {
|
|
@@ -54,8 +53,7 @@ export const GeoArrowTableConverter: Converter<
|
|
|
54
53
|
'array-row-table',
|
|
55
54
|
'columnar-table',
|
|
56
55
|
'geojson-table',
|
|
57
|
-
'arrow'
|
|
58
|
-
'arrow-table'
|
|
56
|
+
'arrow'
|
|
59
57
|
],
|
|
60
58
|
to: [
|
|
61
59
|
'geoarrow',
|
|
@@ -68,7 +66,7 @@ export const GeoArrowTableConverter: Converter<
|
|
|
68
66
|
canConvert(sourceShape, targetShape) {
|
|
69
67
|
const sourceIsGeoArrow = sourceShape === 'geoarrow';
|
|
70
68
|
const targetIsGeoArrow = targetShape === 'geoarrow';
|
|
71
|
-
return
|
|
69
|
+
return sourceIsGeoArrow !== targetIsGeoArrow;
|
|
72
70
|
},
|
|
73
71
|
detectInputShape(input) {
|
|
74
72
|
return isGeoArrowApacheTable(input as any) ? 'geoarrow' : null;
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
import * as arrow from 'apache-arrow';
|
|
6
6
|
import {getWKTDimension} from '@loaders.gl/core/arrow-geometry/geometry-codecs';
|
|
7
7
|
import {getWKTGeometryType} from './lib/geometry-converters/wkb/helpers/parse-wkb-header';
|
|
8
|
-
import {inspectWKBHeader} from '@math.gl/arrow
|
|
9
|
-
import type {WKBGeometryType} from '@math.gl/arrow
|
|
8
|
+
import {inspectWKBHeader} from '@math.gl/core/arrow';
|
|
9
|
+
import type {WKBGeometryType} from '@math.gl/core/arrow';
|
|
10
10
|
import type {GeoArrowEncoding, GeoParquetGeometryType} from '@loaders.gl/core/schema';
|
|
11
11
|
import {
|
|
12
12
|
getGeoArrowUnionDimension,
|