@loaders.gl/core 5.0.0-beta.8 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/GEOARROW-README.md +6 -0
- 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.map +2 -2
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
- package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js +1 -1
- package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
- package/dist/arrow-geometry/feature-table.cjs +2 -6
- package/dist/arrow-geometry/feature-table.cjs.map +2 -2
- package/dist/arrow-geometry/feature-table.d.ts +6 -5
- package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
- package/dist/arrow-geometry/feature-table.js +5 -9
- package/dist/arrow-geometry/feature-table.js.map +1 -1
- package/dist/arrow-geometry/geojson-table.cjs +270 -4
- package/dist/arrow-geometry/geojson-table.cjs.map +4 -4
- package/dist/arrow-geometry/geojson-table.d.ts +3 -3
- package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
- package/dist/arrow-geometry/geojson-table.js +5 -4
- 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 +59 -35
- package/dist/arrow-worker-transport.cjs.map +1 -1
- package/dist/arrow-worker-transport.d.ts +9 -7
- package/dist/arrow-worker-transport.d.ts.map +1 -1
- package/dist/arrow-worker-transport.js +59 -42
- package/dist/arrow-worker-transport.js.map +1 -1
- package/dist/cluster-source.cjs +198 -503
- package/dist/cluster-source.cjs.map +3 -3
- package/dist/dist.dev.js +211 -218
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +166 -531
- package/dist/federated-table-scan-source.cjs.map +3 -3
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
- package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.cjs +16 -19
- package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
- package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
- package/dist/geoarrow/clustering/cluster-source.js +13 -18
- package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
- package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
- package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
- package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
- package/dist/geoarrow/geo-column/geo-column.cjs.map +1 -1
- package/dist/geoarrow/geo-column/geo-column.d.ts +1 -1
- package/dist/geoarrow/geo-column/geo-column.d.ts.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 +13 -15
- 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 +8 -11
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +6 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
- package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
- package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
- package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
- package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
- package/dist/geoarrow/geoarrow-inspection.js +1 -1
- package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
- package/dist/geoarrow/geoarrow-stream.cjs +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/index.cjs +0 -3
- package/dist/geoarrow/index.cjs.map +2 -2
- package/dist/geoarrow/index.d.ts +0 -2
- package/dist/geoarrow/index.d.ts.map +1 -1
- package/dist/geoarrow/index.js +0 -1
- package/dist/geoarrow/index.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/geoarrow/geoarrow-union-kind.cjs +2 -2
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs.map +2 -2
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts.map +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js +1 -1
- package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.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/kernels/geoarrow-union.cjs +2 -2
- package/dist/geoarrow/lib/kernels/geoarrow-union.cjs.map +2 -2
- package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts.map +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.js +1 -1
- package/dist/geoarrow/lib/kernels/geoarrow-union.js.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
- package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts +1 -1
- package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.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/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
- package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts +1 -1
- package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts.map +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.cjs.map +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.d.ts +1 -1
- package/dist/geoarrow/mesharrow/mesh-accessors.d.ts.map +1 -1
- package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +1 -1
- package/dist/index.cjs +203 -197
- package/dist/index.cjs.map +3 -3
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/lib/api/create-data-source.d.ts +7 -1
- package/dist/lib/api/create-data-source.d.ts.map +1 -1
- package/dist/lib/api/create-data-source.js +2 -2
- package/dist/lib/api/create-data-source.js.map +1 -1
- package/dist/lib/api/load-loader.js +1 -1
- package/dist/lib/api/load-loader.js.map +1 -1
- package/dist/lib/api/load.d.ts.map +1 -1
- package/dist/lib/api/load.js +13 -12
- 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.d.ts.map +1 -1
- package/dist/lib/api/parse-in-batches.js +55 -15
- 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/api/select-loader.d.ts.map +1 -1
- package/dist/lib/api/select-loader.js +15 -24
- package/dist/lib/api/select-loader.js.map +1 -1
- package/dist/lib/init.js +1 -1
- package/dist/lib/init.js.map +1 -1
- package/dist/lib/loader-utils/get-fetch-function.js +2 -2
- package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
- package/dist/lib/loader-utils/native-arrow.d.ts +7 -5
- package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -1
- package/dist/lib/loader-utils/native-arrow.js +34 -20
- package/dist/lib/loader-utils/native-arrow.js.map +1 -1
- package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
- package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-defaults.js +7 -8
- package/dist/lib/loader-utils/option-defaults.js.map +1 -1
- package/dist/lib/loader-utils/option-utils.d.ts +0 -6
- package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
- package/dist/lib/loader-utils/option-utils.js +11 -105
- package/dist/lib/loader-utils/option-utils.js.map +1 -1
- package/dist/loader-utils/format-types.d.ts +3 -0
- package/dist/loader-utils/format-types.d.ts.map +1 -1
- package/dist/loader-utils/index.cjs +126 -58
- package/dist/loader-utils/index.cjs.map +3 -3
- package/dist/loader-utils/index.d.ts +7 -2
- package/dist/loader-utils/index.d.ts.map +1 -1
- package/dist/loader-utils/index.js +4 -2
- package/dist/loader-utils/index.js.map +1 -1
- package/dist/loader-utils/json-loader.js +1 -1
- package/dist/loader-utils/json-loader.js.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts +0 -1
- package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
- package/dist/loader-utils/lib/log-utils/log.js +2 -2
- package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
- package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
- package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
- package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
- package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +48 -3
- 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 +12 -1
- package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts +17 -0
- package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
- package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +15 -14
- 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/data-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/data-source.js +0 -10
- package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
- package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/table-source-collection.d.ts +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/utils/utils.js +1 -1
- package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
- package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
- package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +12 -15
- package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
- package/dist/loader-utils/loader-types.d.ts +19 -67
- package/dist/loader-utils/loader-types.d.ts.map +1 -1
- package/dist/loader-utils/loader-types.js.map +1 -1
- package/dist/loader-utils/source-types.d.ts +2 -0
- package/dist/loader-utils/source-types.d.ts.map +1 -1
- package/dist/loader-utils/source-types.js +4 -0
- package/dist/loader-utils/source-types.js.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.d.ts +0 -18
- package/dist/null-loader.d.ts.map +1 -1
- package/dist/null-loader.js +1 -19
- package/dist/null-loader.js.map +1 -1
- package/dist/null-worker-node.js +1 -1
- package/dist/null-worker.js +1 -1
- package/dist/scan/arrow-execution/expressions.cjs +32 -8
- package/dist/scan/arrow-execution/expressions.cjs.map +2 -2
- package/dist/scan/arrow-execution/expressions.d.ts +7 -4
- package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
- package/dist/scan/arrow-execution/expressions.js +32 -6
- package/dist/scan/arrow-execution/expressions.js.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.cjs +3 -18
- package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +2 -2
- package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -1
- package/dist/scan/arrow-execution/filter-arrow-table.js +3 -9
- package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs +41 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs.map +7 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts +5 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts.map +1 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js +23 -0
- package/dist/scan/arrow-execution/portable-predicate-compatibility.js.map +1 -0
- package/dist/scan/arrow-query-worker-entry.cjs +121 -0
- package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
- package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
- package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker-entry.js +7 -0
- package/dist/scan/arrow-query-worker-entry.js.map +1 -0
- package/dist/scan/arrow-query-worker.cjs +197 -0
- package/dist/scan/arrow-query-worker.cjs.map +7 -0
- package/dist/scan/arrow-query-worker.d.ts +47 -0
- package/dist/scan/arrow-query-worker.d.ts.map +1 -0
- package/dist/scan/arrow-query-worker.js +101 -0
- package/dist/scan/arrow-query-worker.js.map +1 -0
- package/dist/scan/arrow-query.cjs +6 -2
- package/dist/scan/arrow-query.cjs.map +2 -2
- package/dist/scan/arrow-query.d.ts +3 -1
- package/dist/scan/arrow-query.d.ts.map +1 -1
- package/dist/scan/arrow-query.js +3 -1
- package/dist/scan/arrow-query.js.map +1 -1
- package/dist/scan/federated-table-scan-source.cjs +38 -39
- package/dist/scan/federated-table-scan-source.cjs.map +2 -2
- package/dist/scan/federated-table-scan-source.d.ts +5 -9
- package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
- package/dist/scan/federated-table-scan-source.js +35 -36
- package/dist/scan/federated-table-scan-source.js.map +1 -1
- package/dist/scan/index.cjs +15 -6
- package/dist/scan/index.cjs.map +3 -3
- package/dist/scan/index.d.ts +9 -5
- package/dist/scan/index.d.ts.map +1 -1
- package/dist/scan/index.js +7 -4
- 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-arrow-table-in-batches.cjs +60 -26
- package/dist/scan/query-arrow-table-in-batches.cjs.map +3 -3
- package/dist/scan/query-arrow-table-in-batches.d.ts +3 -3
- package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -1
- package/dist/scan/query-arrow-table-in-batches.js +52 -24
- package/dist/scan/query-arrow-table-in-batches.js.map +1 -1
- package/dist/{geoarrow/get-geoarrow-native-geometry.cjs → scan/query-arrow-table-math.cjs} +18 -8
- package/dist/scan/query-arrow-table-math.cjs.map +7 -0
- package/dist/scan/query-arrow-table-math.d.ts +5 -0
- package/dist/scan/query-arrow-table-math.d.ts.map +1 -0
- package/dist/scan/query-arrow-table-math.js +14 -0
- package/dist/scan/query-arrow-table-math.js.map +1 -0
- package/dist/scan/query-arrow-table.cjs +32 -62
- package/dist/scan/query-arrow-table.cjs.map +2 -2
- package/dist/scan/query-arrow-table.d.ts +13 -8
- package/dist/scan/query-arrow-table.d.ts.map +1 -1
- package/dist/scan/query-arrow-table.js +35 -67
- package/dist/scan/query-arrow-table.js.map +1 -1
- package/dist/scan/query-grouped-sql.cjs +66 -0
- package/dist/scan/query-grouped-sql.cjs.map +7 -0
- package/dist/scan/query-grouped-sql.d.ts +5 -0
- package/dist/scan/query-grouped-sql.d.ts.map +1 -0
- package/dist/scan/query-grouped-sql.js +58 -0
- package/dist/scan/query-grouped-sql.js.map +1 -0
- package/dist/scan/query-open-source.cjs +52 -0
- package/dist/scan/query-open-source.cjs.map +7 -0
- package/dist/scan/query-open-source.d.ts +4 -0
- package/dist/scan/query-open-source.d.ts.map +1 -0
- package/dist/scan/query-open-source.js +26 -0
- package/dist/scan/query-open-source.js.map +1 -0
- package/dist/scan/query-progressive.cjs +7 -8
- package/dist/scan/query-progressive.cjs.map +2 -2
- package/dist/scan/query-progressive.d.ts +5 -3
- package/dist/scan/query-progressive.d.ts.map +1 -1
- package/dist/scan/query-progressive.js +7 -8
- package/dist/scan/query-progressive.js.map +1 -1
- package/dist/scan/query-pushdown.cjs +140 -0
- package/dist/scan/query-pushdown.cjs.map +7 -0
- package/dist/scan/query-pushdown.d.ts +14 -0
- package/dist/scan/query-pushdown.d.ts.map +1 -0
- package/dist/scan/query-pushdown.js +133 -0
- package/dist/scan/query-pushdown.js.map +1 -0
- package/dist/scan/query-scales.cjs +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 +118 -103
- package/dist/scan/query.cjs.map +2 -2
- package/dist/scan/query.d.ts +29 -22
- package/dist/scan/query.d.ts.map +1 -1
- package/dist/scan/query.js +111 -111
- package/dist/scan/query.js.map +1 -1
- package/dist/scan/rows-to-arrow.cjs +1 -28
- package/dist/scan/rows-to-arrow.cjs.map +2 -2
- package/dist/scan/rows-to-arrow.d.ts +3 -3
- package/dist/scan/rows-to-arrow.d.ts.map +1 -1
- package/dist/scan/rows-to-arrow.js +2 -32
- package/dist/scan/rows-to-arrow.js.map +1 -1
- package/dist/scan/scan-engine.cjs +1 -1
- package/dist/scan/scan-engine.cjs.map +2 -2
- package/dist/scan/scan-engine.d.ts +5 -5
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js +1 -1
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/vector-table-scan-source.cjs +24 -17
- package/dist/scan/vector-table-scan-source.cjs.map +4 -4
- package/dist/scan/vector-table-scan-source.d.ts +8 -8
- package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
- package/dist/scan/vector-table-scan-source.js +19 -17
- package/dist/scan/vector-table-scan-source.js.map +1 -1
- package/dist/schema/categories/category-mesh.d.ts +3 -10
- package/dist/schema/categories/category-mesh.d.ts.map +1 -1
- package/dist/schema/categories/category-mesh.js.map +1 -1
- package/dist/schema/categories/category-table.d.ts +2 -19
- package/dist/schema/categories/category-table.d.ts.map +1 -1
- package/dist/schema/float16.js +1 -1
- package/dist/schema/float16.js.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 +14 -10
- package/dist/schema/index.cjs.map +2 -2
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +2 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/schema/types/batch.d.ts +0 -4
- package/dist/schema/types/batch.d.ts.map +1 -1
- package/dist/schema-utils/index.cjs +623 -860
- package/dist/schema-utils/index.cjs.map +3 -3
- package/dist/schema-utils/index.d.ts +6 -7
- package/dist/schema-utils/index.d.ts.map +1 -1
- package/dist/schema-utils/index.js +6 -6
- package/dist/schema-utils/index.js.map +1 -1
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
- package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
- package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/converters/convert.js +9 -2
- package/dist/schema-utils/lib/converters/convert.js.map +1 -1
- package/dist/schema-utils/lib/converters/types.d.ts +2 -0
- package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
- package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
- package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
- package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
- package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
- package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
- package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
- package/dist/schema-utils/lib/schema/data-type.js +1 -1
- package/dist/schema-utils/lib/schema/data-type.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/batch-builder/arrow-table-builder.d.ts +9 -9
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
- package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
- package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
- package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
- package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
- package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
- package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
- package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +15 -76
- package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
- package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
- package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
- package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
- package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
- package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
- package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
- package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
- package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
- package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
- package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
- package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
- package/dist/vector-table-scan-source.cjs +241 -292
- 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 +4 -4
- package/dist/worker-utils/index.cjs.map +1 -1
- package/dist/worker-utils/lib/env-utils/version.js +1 -1
- package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
- package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -1
- package/dist/worker-utils/lib/npm-tag.js.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +4 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
- package/dist/worker-utils/lib/worker-api/process-on-worker.js +2 -2
- package/dist/worker-utils/lib/worker-api/process-on-worker.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 +102 -13
- 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 +4 -3
- package/src/arrow-geometry/feature-table.ts +8 -17
- package/src/arrow-geometry/geojson-table.ts +5 -4
- 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 +89 -50
- package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
- package/src/geoarrow/clustering/cluster-source.ts +20 -30
- package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
- package/src/geoarrow/geo-column/geo-column.ts +1 -1
- 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 +12 -15
- package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
- package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
- package/src/geoarrow/geoarrow-inspection.ts +2 -2
- package/src/geoarrow/geoarrow-stream.ts +15 -15
- package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
- package/src/geoarrow/index.ts +0 -2
- 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/geoarrow/geoarrow-union-kind.ts +1 -1
- 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/kernels/geoarrow-union.ts +1 -1
- package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +11 -11
- package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +2 -2
- package/src/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.ts +1 -1
- package/src/geoarrow/mesharrow/get-deck-binary-data.ts +1 -1
- package/src/geoarrow/mesharrow/mesh-accessors.ts +1 -1
- package/src/index.ts +1 -5
- package/src/lib/api/create-data-source.ts +15 -3
- package/src/lib/api/load-loader.ts +1 -1
- package/src/lib/api/load.ts +21 -25
- 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 +81 -17
- package/src/lib/api/parse-sync.ts +3 -7
- package/src/lib/api/parse.ts +2 -6
- package/src/lib/api/select-loader.ts +15 -33
- package/src/lib/loader-utils/get-fetch-function.ts +2 -2
- package/src/lib/loader-utils/native-arrow.ts +38 -25
- package/src/lib/loader-utils/option-defaults.ts +7 -8
- package/src/lib/loader-utils/option-utils.ts +12 -112
- package/src/loader-utils/format-types.ts +4 -0
- package/src/loader-utils/index.ts +17 -2
- package/src/loader-utils/lib/log-utils/log.ts +2 -5
- package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
- package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
- package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +68 -6
- package/src/loader-utils/lib/scan-utils/table-query.ts +18 -0
- package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +64 -43
- package/src/loader-utils/lib/sources/data-source.ts +0 -12
- package/src/loader-utils/lib/sources/image-source.ts +1 -1
- 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/utils/utils.ts +1 -1
- package/src/loader-utils/lib/sources/vector-source.ts +3 -3
- package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
- package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +12 -18
- package/src/loader-utils/loader-types.ts +23 -69
- package/src/loader-utils/source-types.ts +5 -0
- package/src/null-loader.ts +1 -20
- package/src/scan/arrow-execution/expressions.ts +42 -7
- package/src/scan/arrow-execution/filter-arrow-table.ts +3 -18
- package/src/scan/arrow-execution/portable-predicate-compatibility.ts +27 -0
- package/src/scan/arrow-query-worker-entry.ts +8 -0
- package/src/scan/arrow-query-worker.ts +158 -0
- package/src/scan/arrow-query.ts +3 -1
- package/src/scan/federated-table-scan-source.ts +48 -59
- package/src/scan/index.ts +34 -10
- package/src/scan/parse-sql-predicate.ts +1 -1
- package/src/scan/query-arrow-table-in-batches.ts +62 -33
- package/src/scan/query-arrow-table-math.ts +23 -0
- package/src/scan/query-arrow-table.ts +62 -97
- package/src/scan/query-grouped-sql.ts +69 -0
- package/src/scan/query-open-source.ts +39 -0
- package/src/scan/query-progressive.ts +12 -13
- package/src/scan/query-pushdown.ts +184 -0
- package/src/scan/query-scales.ts +299 -0
- package/src/scan/query.ts +210 -165
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +7 -7
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/float16.ts +1 -1
- package/src/schema/geometry/arrow-binary-features.ts +1 -1
- package/src/schema/geometry/geoarrow.ts +2 -2
- package/src/schema/index.ts +4 -5
- package/src/schema/types/batch.ts +0 -5
- package/src/schema-utils/index.ts +20 -16
- package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
- package/src/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.ts +1 -1
- package/src/schema-utils/lib/converters/convert.ts +7 -2
- package/src/schema-utils/lib/converters/types.ts +2 -0
- package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
- package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
- package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
- package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
- package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
- package/src/schema-utils/lib/schema/data-type.ts +1 -1
- 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/batch-builder/arrow-table-builder.ts +21 -51
- package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
- package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
- package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
- package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
- package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
- package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +29 -96
- package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
- package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
- package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
- package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
- package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
- package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
- package/src/wkt/index.ts +1 -1
- package/src/worker-utils/lib/npm-tag.ts +1 -1
- package/src/worker-utils/lib/worker-api/process-on-worker.ts +7 -4
- package/dist/arrow-geometry/native-geometry.cjs +0 -215
- package/dist/arrow-geometry/native-geometry.cjs.map +0 -7
- package/dist/arrow-geometry/native-geometry.d.ts +0 -41
- package/dist/arrow-geometry/native-geometry.d.ts.map +0 -1
- package/dist/arrow-geometry/native-geometry.js +0 -224
- package/dist/arrow-geometry/native-geometry.js.map +0 -1
- package/dist/geoarrow/get-geoarrow-native-geometry.cjs.map +0 -7
- package/dist/geoarrow/get-geoarrow-native-geometry.d.ts +0 -2
- package/dist/geoarrow/get-geoarrow-native-geometry.d.ts.map +0 -1
- package/dist/geoarrow/get-geoarrow-native-geometry.js +0 -5
- package/dist/geoarrow/get-geoarrow-native-geometry.js.map +0 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs +0 -290
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs.map +0 -7
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts +0 -16
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts.map +0 -1
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js +0 -334
- package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
- package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
- package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
- package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
- package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
- package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
- package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
- package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
- package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
- package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
- package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
- package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
- package/dist/schema/deprecated/mesh-utils.js +0 -37
- package/dist/schema/deprecated/mesh-utils.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
- package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
- package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
- package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
- package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js +0 -5
- package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts +0 -28
- 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 -26
- package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js.map +0 -1
- package/src/arrow-geometry/native-geometry.ts +0 -278
- package/src/geoarrow/get-geoarrow-native-geometry.ts +0 -8
- package/src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts +0 -373
- package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
- package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
- package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
- package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
- package/src/schema/deprecated/mesh-utils.ts +0 -46
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
- package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
- package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
- package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
- package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
- package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
- package/src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts +0 -58
package/dist/cluster-source.cjs
CHANGED
|
@@ -75,7 +75,7 @@ function ignoreMessage() {
|
|
|
75
75
|
var nullLog = new NullLog();
|
|
76
76
|
function getLoaderLog(options) {
|
|
77
77
|
var _a;
|
|
78
|
-
const logger = (
|
|
78
|
+
const logger = (_a = options == null ? void 0 : options.core) == null ? void 0 : _a.log;
|
|
79
79
|
return logger === null ? nullLog : logger || log;
|
|
80
80
|
}
|
|
81
81
|
|
|
@@ -235,7 +235,7 @@ function createAuthenticatedFetch(options) {
|
|
|
235
235
|
}
|
|
236
236
|
function getAuthenticatedFetch(options = {}) {
|
|
237
237
|
var _a, _b, _c;
|
|
238
|
-
const fetchOption =
|
|
238
|
+
const fetchOption = (_a = options.core) == null ? void 0 : _a.fetch;
|
|
239
239
|
let fetchFunction;
|
|
240
240
|
if (typeof fetchOption === "function") {
|
|
241
241
|
fetchFunction = fetchOption;
|
|
@@ -497,16 +497,6 @@ function getSourceLoaderOptions(options) {
|
|
|
497
497
|
delete loadOptions.core;
|
|
498
498
|
}
|
|
499
499
|
}
|
|
500
|
-
const topLevelBaseUri = typeof loadOptions.baseUri === "string" ? loadOptions.baseUri : void 0;
|
|
501
|
-
const topLevelBaseUrl = typeof loadOptions.baseUrl === "string" ? loadOptions.baseUrl : void 0;
|
|
502
|
-
if (topLevelBaseUri !== void 0 || topLevelBaseUrl !== void 0) {
|
|
503
|
-
loadOptions.core ||= {};
|
|
504
|
-
if (loadOptions.core.baseUrl === void 0) {
|
|
505
|
-
loadOptions.core.baseUrl = topLevelBaseUrl ?? topLevelBaseUri;
|
|
506
|
-
}
|
|
507
|
-
delete loadOptions.baseUri;
|
|
508
|
-
delete loadOptions.baseUrl;
|
|
509
|
-
}
|
|
510
500
|
return loadOptions;
|
|
511
501
|
}
|
|
512
502
|
function normalizeError(error, message) {
|
|
@@ -565,7 +555,7 @@ function removeFileExtension(name) {
|
|
|
565
555
|
}
|
|
566
556
|
|
|
567
557
|
// src/arrow-geometry/geometry-codecs.ts
|
|
568
|
-
var
|
|
558
|
+
var import_arrow2 = require("@math.gl/core/arrow");
|
|
569
559
|
|
|
570
560
|
// src/arrow-geometry/geometry-utils.ts
|
|
571
561
|
function normalizeEmptyPoints(geometry) {
|
|
@@ -586,14 +576,14 @@ function normalizeEmptyPoints(geometry) {
|
|
|
586
576
|
}
|
|
587
577
|
|
|
588
578
|
// src/arrow-geometry/geometry-to-wkt.ts
|
|
589
|
-
var
|
|
579
|
+
var import_arrow = require("@math.gl/core/arrow");
|
|
590
580
|
function convertGeometryToWKT(geometry, options) {
|
|
591
581
|
const dimension = getWKTDimension(geometry, options);
|
|
592
582
|
if (geometry.type === "GeometryCollection" && !(options == null ? void 0 : options.dimension) && !(options == null ? void 0 : options.hasZ) && !(options == null ? void 0 : options.hasM) && (hasMixedChildDimensions(geometry) || hasDeclaredChildDimensions(geometry))) {
|
|
593
583
|
if (geometry.geometries.length === 0) return "GEOMETRYCOLLECTION EMPTY";
|
|
594
584
|
return `GEOMETRYCOLLECTION (${geometry.geometries.map((child) => convertGeometryToWKT(child)).join(", ")})`;
|
|
595
585
|
}
|
|
596
|
-
return (0,
|
|
586
|
+
return (0, import_arrow.formatWKT)(normalizeGeometryDimension(geometry, dimension), dimension);
|
|
597
587
|
}
|
|
598
588
|
function normalizeGeometryDimension(geometry, dimension) {
|
|
599
589
|
if (geometry.type === "GeometryCollection") {
|
|
@@ -656,7 +646,7 @@ function getDimensionSize(dimension) {
|
|
|
656
646
|
// src/arrow-geometry/geometry-codecs.ts
|
|
657
647
|
function convertWKBToGeometry(input) {
|
|
658
648
|
const bytes = ArrayBuffer.isView(input) ? new Uint8Array(input.buffer, input.byteOffset, input.byteLength) : new Uint8Array(input);
|
|
659
|
-
return normalizeEmptyPoints((0,
|
|
649
|
+
return normalizeEmptyPoints((0, import_arrow2.parseWKB)(bytes).geometry);
|
|
660
650
|
}
|
|
661
651
|
function convertGeometryToWKB(input, options = {}) {
|
|
662
652
|
const geometry = input.type === "Feature" ? input.geometry : input;
|
|
@@ -667,7 +657,7 @@ function convertGeometryToWKB(input, options = {}) {
|
|
|
667
657
|
}
|
|
668
658
|
function encodeGeometry(geometry, dimension) {
|
|
669
659
|
if (geometry.type !== "GeometryCollection") {
|
|
670
|
-
return (0,
|
|
660
|
+
return (0, import_arrow2.writeWKB)(geometry, dimension);
|
|
671
661
|
}
|
|
672
662
|
const children = geometry.geometries.map(
|
|
673
663
|
(child) => encodeGeometry(
|
|
@@ -675,13 +665,13 @@ function encodeGeometry(geometry, dimension) {
|
|
|
675
665
|
child.__geoarrowDimension ?? dimension
|
|
676
666
|
)
|
|
677
667
|
);
|
|
678
|
-
const headerBuilder = new
|
|
668
|
+
const headerBuilder = new import_arrow2.WKBBuilder({ mode: "measure", dimension });
|
|
679
669
|
headerBuilder.beginGeometry("GeometryCollection", children.length);
|
|
680
670
|
const headerLength = headerBuilder.finishGeometry();
|
|
681
671
|
const bytes = new Uint8Array(
|
|
682
672
|
headerLength + children.reduce((total, child) => total + child.length, 0)
|
|
683
673
|
);
|
|
684
|
-
const writer = new
|
|
674
|
+
const writer = new import_arrow2.WKBBuilder({ mode: "write", target: bytes, dimension });
|
|
685
675
|
writer.beginGeometry("GeometryCollection", children.length);
|
|
686
676
|
let byteOffset = writer.finishGeometry();
|
|
687
677
|
for (const child of children) {
|
|
@@ -707,7 +697,7 @@ function convertWKTToGeometry(input, options) {
|
|
|
707
697
|
}
|
|
708
698
|
const collectionHeader = text.match(/^(\s*GEOMETRYCOLLECTION)\s+(?:ZM|Z|M)(?=\s|\()/i);
|
|
709
699
|
const parseText = collectionHeader && dimension !== "xym" ? text.replace(collectionHeader[0], collectionHeader[1]) : text;
|
|
710
|
-
const parsed = (0,
|
|
700
|
+
const parsed = (0, import_arrow2.parseWKTWithMetadata)(parseText, { inferDimensions: true });
|
|
711
701
|
const geometry = toGeometryWithDimensionMetadata(
|
|
712
702
|
parsed,
|
|
713
703
|
collectionHeader ? dimension : void 0
|
|
@@ -1220,7 +1210,9 @@ function triangulatePolygon(polygons, areas, indices, {
|
|
|
1220
1210
|
const polygonPositions = polygons.positions.subarray(start, end);
|
|
1221
1211
|
const offset = indices[0];
|
|
1222
1212
|
const holes = indices.slice(1).map((n) => (n - offset) / coordLength);
|
|
1223
|
-
const triangles = (0, import_geometry2.earcut)(polygonPositions, holes, coordLength, areas
|
|
1213
|
+
const triangles = (0, import_geometry2.earcut)(polygonPositions, holes, coordLength, areas, "xy", {
|
|
1214
|
+
triangulation: "balanced"
|
|
1215
|
+
});
|
|
1224
1216
|
for (let t = 0, tl = triangles.length; t < tl; ++t) {
|
|
1225
1217
|
polygons.triangles.push(startPosition + triangles[t]);
|
|
1226
1218
|
}
|
|
@@ -1549,13 +1541,13 @@ function deserializeArrowType(dataType, options) {
|
|
|
1549
1541
|
}
|
|
1550
1542
|
case "large-list": {
|
|
1551
1543
|
const field = deserializeArrowField(dataType.children[0], options);
|
|
1552
|
-
const
|
|
1553
|
-
if (!
|
|
1544
|
+
const LargeList8 = getOptionalArrowConstructor("LargeList");
|
|
1545
|
+
if (!LargeList8) {
|
|
1554
1546
|
throw new Error(
|
|
1555
1547
|
"LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
|
|
1556
1548
|
);
|
|
1557
1549
|
}
|
|
1558
|
-
return new
|
|
1550
|
+
return new LargeList8(field);
|
|
1559
1551
|
}
|
|
1560
1552
|
case "fixed-size-list": {
|
|
1561
1553
|
const child = deserializeArrowField(dataType.children[0], options);
|
|
@@ -1739,8 +1731,14 @@ function deserializeArrowDictionaryKeyType(keyType) {
|
|
|
1739
1731
|
}
|
|
1740
1732
|
}
|
|
1741
1733
|
|
|
1742
|
-
// src/schema-utils/lib/
|
|
1734
|
+
// src/schema-utils/lib/arrow/arrow-metadata.ts
|
|
1743
1735
|
var arrow2 = __toESM(require("apache-arrow"), 1);
|
|
1736
|
+
function snapshotArrowSchema(schema) {
|
|
1737
|
+
return deserializeArrowSchema(serializeArrowSchema(schema));
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
// src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts
|
|
1741
|
+
var arrow3 = __toESM(require("apache-arrow"), 1);
|
|
1744
1742
|
var ArrowTableBuilder = class {
|
|
1745
1743
|
schema;
|
|
1746
1744
|
arrowSchema;
|
|
@@ -1750,7 +1748,7 @@ var ArrowTableBuilder = class {
|
|
|
1750
1748
|
this.arrowSchema = convertSchemaToArrow(schema, options);
|
|
1751
1749
|
this.schema = (options == null ? void 0 : options.viewTypes) && options.viewTypes !== "never" ? convertArrowToSchema(this.arrowSchema) : schema;
|
|
1752
1750
|
this.arrowBuilders = this.arrowSchema.fields.map(
|
|
1753
|
-
(field) =>
|
|
1751
|
+
(field) => arrow3.makeBuilder({ type: field.type, nullValues: [null, void 0] })
|
|
1754
1752
|
);
|
|
1755
1753
|
this.length = 0;
|
|
1756
1754
|
}
|
|
@@ -1768,58 +1766,25 @@ var ArrowTableBuilder = class {
|
|
|
1768
1766
|
}
|
|
1769
1767
|
this.length++;
|
|
1770
1768
|
}
|
|
1771
|
-
/**
|
|
1769
|
+
/** Emits the declared schema before any rows are buffered. */
|
|
1772
1770
|
firstBatch() {
|
|
1773
|
-
|
|
1774
|
-
if (arrowRecordBatch.numCols !== 0) {
|
|
1775
|
-
return null;
|
|
1776
|
-
}
|
|
1777
|
-
return {
|
|
1778
|
-
shape: "arrow-table",
|
|
1779
|
-
batchType: "data",
|
|
1780
|
-
length: arrowRecordBatch.numRows,
|
|
1781
|
-
schema: this.schema,
|
|
1782
|
-
data: new arrow2.Table(arrowRecordBatch)
|
|
1783
|
-
};
|
|
1771
|
+
return this.length === 0 ? this._getArrowRecordBatch() : null;
|
|
1784
1772
|
}
|
|
1785
|
-
/**
|
|
1773
|
+
/** Flushes the buffered rows as a native record batch. */
|
|
1786
1774
|
flushBatch() {
|
|
1787
|
-
|
|
1788
|
-
if (arrowRecordBatch.numCols === 0) {
|
|
1789
|
-
return null;
|
|
1790
|
-
}
|
|
1791
|
-
return {
|
|
1792
|
-
shape: "arrow-table",
|
|
1793
|
-
batchType: "data",
|
|
1794
|
-
length: arrowRecordBatch.numRows,
|
|
1795
|
-
schema: this.schema,
|
|
1796
|
-
data: new arrow2.Table(arrowRecordBatch)
|
|
1797
|
-
};
|
|
1775
|
+
return this.length === 0 ? null : this._getArrowRecordBatch();
|
|
1798
1776
|
}
|
|
1799
|
-
/**
|
|
1777
|
+
/** Finishes the builders and returns the final native batch when it has rows or fields. */
|
|
1800
1778
|
finishBatch() {
|
|
1801
|
-
const
|
|
1779
|
+
const batch = this._getArrowRecordBatch();
|
|
1802
1780
|
this.arrowBuilders.forEach((builder) => builder.finish());
|
|
1803
|
-
|
|
1804
|
-
return null;
|
|
1805
|
-
}
|
|
1806
|
-
return {
|
|
1807
|
-
shape: "arrow-table",
|
|
1808
|
-
batchType: "data",
|
|
1809
|
-
length: arrowRecordBatch.numRows,
|
|
1810
|
-
schema: this.schema,
|
|
1811
|
-
data: new arrow2.Table(arrowRecordBatch)
|
|
1812
|
-
};
|
|
1781
|
+
return batch.numCols || batch.numRows ? batch : null;
|
|
1813
1782
|
}
|
|
1814
|
-
/**
|
|
1783
|
+
/** Finishes the builders and returns a native Arrow table. */
|
|
1815
1784
|
finishTable() {
|
|
1816
|
-
const
|
|
1785
|
+
const batch = this._getArrowRecordBatch();
|
|
1817
1786
|
this.arrowBuilders.forEach((builder) => builder.finish());
|
|
1818
|
-
return
|
|
1819
|
-
shape: "arrow-table",
|
|
1820
|
-
schema: this.schema,
|
|
1821
|
-
data: new arrow2.Table(arrowRecordBatch)
|
|
1822
|
-
};
|
|
1787
|
+
return new arrow3.Table(batch);
|
|
1823
1788
|
}
|
|
1824
1789
|
/** Extract a record batch flushing the currently accumulated data in the builders */
|
|
1825
1790
|
_getArrowRecordBatch() {
|
|
@@ -1828,16 +1793,19 @@ var ArrowTableBuilder = class {
|
|
|
1828
1793
|
const arrowDatas = arrowBuilders.map((builder) => builder.flush());
|
|
1829
1794
|
const length = ((_a = arrowDatas[0]) == null ? void 0 : _a.length) || this.length;
|
|
1830
1795
|
this.length = 0;
|
|
1831
|
-
const structField = new
|
|
1832
|
-
const arrowStructData = new
|
|
1833
|
-
const arrowRecordBatch = new
|
|
1796
|
+
const structField = new arrow3.Struct(arrowSchema.fields);
|
|
1797
|
+
const arrowStructData = new arrow3.Data(structField, 0, length, 0, void 0, arrowDatas);
|
|
1798
|
+
const arrowRecordBatch = new arrow3.RecordBatch(
|
|
1799
|
+
snapshotArrowSchema(arrowSchema),
|
|
1800
|
+
arrowStructData
|
|
1801
|
+
);
|
|
1834
1802
|
return arrowRecordBatch;
|
|
1835
1803
|
}
|
|
1836
1804
|
};
|
|
1837
1805
|
|
|
1838
1806
|
// dist/loader-utils/lib/log-utils/log.js
|
|
1839
1807
|
var import_log3 = require("probe.gl/log");
|
|
1840
|
-
var VERSION2 = true ? "5.0.0-
|
|
1808
|
+
var VERSION2 = true ? "5.0.0-rc.1" : "latest";
|
|
1841
1809
|
var version2 = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
|
|
1842
1810
|
function createLog2() {
|
|
1843
1811
|
const log3 = new import_log3.Log({ id: "loaders.gl" });
|
|
@@ -2072,8 +2040,8 @@ function parseGeoArrowMetadata(value) {
|
|
|
2072
2040
|
}
|
|
2073
2041
|
|
|
2074
2042
|
// dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js
|
|
2075
|
-
var
|
|
2076
|
-
var
|
|
2043
|
+
var arrow13 = __toESM(require("apache-arrow"), 1);
|
|
2044
|
+
var import_arrow7 = require("@math.gl/core/arrow");
|
|
2077
2045
|
|
|
2078
2046
|
// dist/geoarrow/lib/geometry-converters/convert-geoarrow-to-geojson.js
|
|
2079
2047
|
function convertGeoArrowGeometryToGeoJSON(arrowCellValue, encoding) {
|
|
@@ -2206,7 +2174,7 @@ function isEmptyArrowCoordinate(arrowCoordinate) {
|
|
|
2206
2174
|
var arrow5 = __toESM(require("apache-arrow"), 1);
|
|
2207
2175
|
|
|
2208
2176
|
// dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js
|
|
2209
|
-
var
|
|
2177
|
+
var import_arrow3 = require("@math.gl/core/arrow");
|
|
2210
2178
|
|
|
2211
2179
|
// dist/geoarrow/lib/geometry-converters/wkb/helpers/wkb-types.js
|
|
2212
2180
|
var WKBGeometryType;
|
|
@@ -2246,25 +2214,30 @@ function getWKTGeometryType(input) {
|
|
|
2246
2214
|
}
|
|
2247
2215
|
|
|
2248
2216
|
// dist/geoarrow/geoarrow-inspection.js
|
|
2249
|
-
var
|
|
2217
|
+
var import_arrow4 = require("@math.gl/core/arrow");
|
|
2250
2218
|
|
|
2251
2219
|
// dist/geoarrow/lib/kernels/geoarrow-union.js
|
|
2252
2220
|
var arrow4 = __toESM(require("apache-arrow"), 1);
|
|
2253
2221
|
|
|
2254
|
-
//
|
|
2255
|
-
var arrow3 = __toESM(require("apache-arrow"), 1);
|
|
2256
|
-
|
|
2257
|
-
// src/arrow-geometry/geoarrow-union-kind.ts
|
|
2222
|
+
// dist/arrow-geometry/geoarrow-union-kind.js
|
|
2258
2223
|
function getGeoArrowUnionGeometryKind(fieldName, typeId) {
|
|
2259
2224
|
const normalizedName = (fieldName || "").toLowerCase().replace(/[^a-z]/g, "");
|
|
2260
|
-
if (normalizedName.includes("geometrycollection"))
|
|
2261
|
-
|
|
2262
|
-
if (normalizedName.includes("
|
|
2263
|
-
|
|
2264
|
-
if (normalizedName.includes("
|
|
2265
|
-
|
|
2266
|
-
if (normalizedName.includes("
|
|
2267
|
-
|
|
2225
|
+
if (normalizedName.includes("geometrycollection"))
|
|
2226
|
+
return "GeometryCollection";
|
|
2227
|
+
if (normalizedName.includes("multipolygon"))
|
|
2228
|
+
return "MultiPolygon";
|
|
2229
|
+
if (normalizedName.includes("multilinestring"))
|
|
2230
|
+
return "MultiLineString";
|
|
2231
|
+
if (normalizedName.includes("multipoint"))
|
|
2232
|
+
return "MultiPoint";
|
|
2233
|
+
if (normalizedName.includes("polygon"))
|
|
2234
|
+
return "Polygon";
|
|
2235
|
+
if (normalizedName.includes("linestring"))
|
|
2236
|
+
return "LineString";
|
|
2237
|
+
if (normalizedName.includes("line"))
|
|
2238
|
+
return "LineString";
|
|
2239
|
+
if (normalizedName.includes("point"))
|
|
2240
|
+
return "Point";
|
|
2268
2241
|
switch (typeId % 10) {
|
|
2269
2242
|
case 1:
|
|
2270
2243
|
return "Point";
|
|
@@ -2390,7 +2363,7 @@ function inspectGeoArrowVector(column, encoding) {
|
|
|
2390
2363
|
if (encoding === "geoarrow.wkb") {
|
|
2391
2364
|
const bytes = value;
|
|
2392
2365
|
try {
|
|
2393
|
-
const header = (0,
|
|
2366
|
+
const header = (0, import_arrow4.inspectWKBHeader)(bytes);
|
|
2394
2367
|
dimensions.add(header.dimension);
|
|
2395
2368
|
geometryTypes.add(getGeometryTypeName(header.geometryType, header.dimension));
|
|
2396
2369
|
} catch {
|
|
@@ -3023,13 +2996,13 @@ function makeListData(child, offsets, fieldName, offsetType) {
|
|
|
3023
2996
|
});
|
|
3024
2997
|
}
|
|
3025
2998
|
function makeLargeListType(field) {
|
|
3026
|
-
const
|
|
3027
|
-
if (!
|
|
2999
|
+
const LargeList8 = getOptionalArrowConstructor2("LargeList");
|
|
3000
|
+
if (!LargeList8) {
|
|
3028
3001
|
throw new Error(
|
|
3029
3002
|
"64-bit GeoArrow offsets require an Apache Arrow runtime that exports LargeList"
|
|
3030
3003
|
);
|
|
3031
3004
|
}
|
|
3032
|
-
return new
|
|
3005
|
+
return new LargeList8(field);
|
|
3033
3006
|
}
|
|
3034
3007
|
function getOptionalArrowConstructor2(typeName) {
|
|
3035
3008
|
return arrow6[typeName];
|
|
@@ -3672,7 +3645,7 @@ function isCoordinate(value) {
|
|
|
3672
3645
|
|
|
3673
3646
|
// dist/geoarrow/lib/kernels/encode-geoarrow-box.js
|
|
3674
3647
|
var arrow8 = __toESM(require("apache-arrow"), 1);
|
|
3675
|
-
var
|
|
3648
|
+
var import_arrow5 = require("@math.gl/core/arrow");
|
|
3676
3649
|
function encodeGeoArrowBoxVector(column, sourceEncoding, dimension) {
|
|
3677
3650
|
const coordinateSize = dimension ? getDimensionSize2(dimension) : inferDimension2(column, sourceEncoding);
|
|
3678
3651
|
const effectiveDimension = dimension || getDimensionName(coordinateSize);
|
|
@@ -3709,7 +3682,7 @@ function getRowBounds(value, sourceEncoding, dimension) {
|
|
|
3709
3682
|
return null;
|
|
3710
3683
|
if (sourceEncoding === "geoarrow.wkb") {
|
|
3711
3684
|
const bytes = value;
|
|
3712
|
-
const statistics = (0,
|
|
3685
|
+
const statistics = (0, import_arrow5.scanWKB)(bytes);
|
|
3713
3686
|
return statistics.bounds ? boundsFromRecord(statistics.bounds, dimension) : null;
|
|
3714
3687
|
}
|
|
3715
3688
|
if (sourceEncoding === "geoarrow.wkt") {
|
|
@@ -3832,7 +3805,7 @@ function inferDimension2(column, sourceEncoding) {
|
|
|
3832
3805
|
if (value == null)
|
|
3833
3806
|
continue;
|
|
3834
3807
|
const bytes = value;
|
|
3835
|
-
const statistics = (0,
|
|
3808
|
+
const statistics = (0, import_arrow5.scanWKB)(bytes);
|
|
3836
3809
|
const hasZ = ((_a = statistics.bounds) == null ? void 0 : _a.zmin) !== void 0;
|
|
3837
3810
|
const hasM = ((_b = statistics.bounds) == null ? void 0 : _b.mmin) !== void 0;
|
|
3838
3811
|
coordinateSize = Math.max(coordinateSize, hasZ && hasM ? 4 : hasZ || hasM ? 3 : 2);
|
|
@@ -3890,283 +3863,12 @@ function getBoxFieldNames2(dimension) {
|
|
|
3890
3863
|
return [...minimumNames, ...maximumNames];
|
|
3891
3864
|
}
|
|
3892
3865
|
|
|
3893
|
-
// dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js
|
|
3894
|
-
var arrow9 = __toESM(require("apache-arrow"), 1);
|
|
3895
|
-
function encodeGeoArrowWKTVector(column, sourceEncoding, dimension) {
|
|
3896
|
-
if (!isNativeGeometryEncoding(sourceEncoding))
|
|
3897
|
-
return null;
|
|
3898
|
-
const values = [];
|
|
3899
|
-
for (let rowIndex = 0; rowIndex < column.length; rowIndex++) {
|
|
3900
|
-
const value = column.get(rowIndex);
|
|
3901
|
-
if (value == null) {
|
|
3902
|
-
values.push(null);
|
|
3903
|
-
continue;
|
|
3904
|
-
}
|
|
3905
|
-
const geometryKind = getRowGeometryKind(column, rowIndex, sourceEncoding);
|
|
3906
|
-
const rowDimension = dimension || (sourceEncoding === "geoarrow.geometrycollection" ? inferCollectionDimension(value) : inferDimensionFromTypeId(column, rowIndex, sourceEncoding));
|
|
3907
|
-
const wkt = encodeNativeValue(value, geometryKind, rowDimension, !dimension);
|
|
3908
|
-
if (wkt === null)
|
|
3909
|
-
return null;
|
|
3910
|
-
values.push(wkt);
|
|
3911
|
-
}
|
|
3912
|
-
return arrow9.vectorFromArray(values, new arrow9.Utf8());
|
|
3913
|
-
}
|
|
3914
|
-
function isNativeGeometryEncoding(encoding) {
|
|
3915
|
-
return encoding === "geoarrow.point" || encoding === "geoarrow.linestring" || encoding === "geoarrow.polygon" || encoding === "geoarrow.multipoint" || encoding === "geoarrow.multilinestring" || encoding === "geoarrow.multipolygon" || encoding === "geoarrow.geometry" || encoding === "geoarrow.geometrycollection";
|
|
3916
|
-
}
|
|
3917
|
-
function encodeNativeValue(value, geometryKind, dimension, preserveMemberDimensions = false) {
|
|
3918
|
-
switch (geometryKind) {
|
|
3919
|
-
case "Point":
|
|
3920
|
-
return encodePoint(value, dimension);
|
|
3921
|
-
case "LineString":
|
|
3922
|
-
return encodeLineString(value, dimension);
|
|
3923
|
-
case "Polygon":
|
|
3924
|
-
return encodePolygon(value, dimension);
|
|
3925
|
-
case "MultiPoint":
|
|
3926
|
-
return encodeMultiPoint(value, dimension);
|
|
3927
|
-
case "MultiLineString":
|
|
3928
|
-
return encodeMultiLineString(value, dimension);
|
|
3929
|
-
case "MultiPolygon":
|
|
3930
|
-
return encodeMultiPolygon(value, dimension);
|
|
3931
|
-
case "GeometryCollection":
|
|
3932
|
-
return encodeGeometryCollection(value, dimension, preserveMemberDimensions);
|
|
3933
|
-
default:
|
|
3934
|
-
return null;
|
|
3935
|
-
}
|
|
3936
|
-
}
|
|
3937
|
-
function encodePoint(value, dimension) {
|
|
3938
|
-
const coordinate = readCoordinate(value);
|
|
3939
|
-
return coordinate ? `POINT${getDimensionSuffix(dimension)} (${encodeCoordinate(coordinate)})` : "POINT EMPTY";
|
|
3940
|
-
}
|
|
3941
|
-
function encodeLineString(value, dimension) {
|
|
3942
|
-
const coordinates = readChildren(value);
|
|
3943
|
-
if (!coordinates)
|
|
3944
|
-
return null;
|
|
3945
|
-
const encodedCoordinates = encodeCoordinateSequence(coordinates);
|
|
3946
|
-
if (encodedCoordinates === null)
|
|
3947
|
-
return null;
|
|
3948
|
-
return coordinates.length === 0 ? `LINESTRING${getDimensionSuffix(dimension)} EMPTY` : `LINESTRING${getDimensionSuffix(dimension)} (${encodedCoordinates})`;
|
|
3949
|
-
}
|
|
3950
|
-
function encodePolygon(value, dimension) {
|
|
3951
|
-
const rings = readChildren(value);
|
|
3952
|
-
if (!rings)
|
|
3953
|
-
return null;
|
|
3954
|
-
if (rings.length === 0)
|
|
3955
|
-
return `POLYGON${getDimensionSuffix(dimension)} EMPTY`;
|
|
3956
|
-
const encodedRings = rings.map((ring) => encodeCoordinateSequenceValue(ring));
|
|
3957
|
-
if (encodedRings.some((encodedRing) => encodedRing === null))
|
|
3958
|
-
return null;
|
|
3959
|
-
return `POLYGON${getDimensionSuffix(dimension)} (${encodedRings.join(", ")})`;
|
|
3960
|
-
}
|
|
3961
|
-
function encodeMultiPoint(value, dimension) {
|
|
3962
|
-
const points = readChildren(value);
|
|
3963
|
-
if (!points)
|
|
3964
|
-
return null;
|
|
3965
|
-
if (points.length === 0)
|
|
3966
|
-
return `MULTIPOINT${getDimensionSuffix(dimension)} EMPTY`;
|
|
3967
|
-
const encodedPoints = points.map((point) => {
|
|
3968
|
-
const coordinate = readCoordinate(point);
|
|
3969
|
-
return coordinate ? `(${encodeCoordinate(coordinate)})` : null;
|
|
3970
|
-
});
|
|
3971
|
-
if (encodedPoints.some((encodedPoint) => encodedPoint === null))
|
|
3972
|
-
return null;
|
|
3973
|
-
return `MULTIPOINT${getDimensionSuffix(dimension)} (${encodedPoints.join(", ")})`;
|
|
3974
|
-
}
|
|
3975
|
-
function encodeMultiLineString(value, dimension) {
|
|
3976
|
-
const lines = readChildren(value);
|
|
3977
|
-
if (!lines)
|
|
3978
|
-
return null;
|
|
3979
|
-
if (lines.length === 0)
|
|
3980
|
-
return `MULTILINESTRING${getDimensionSuffix(dimension)} EMPTY`;
|
|
3981
|
-
const encodedLines = lines.map((line) => encodeCoordinateSequenceValue(line));
|
|
3982
|
-
if (encodedLines.some((encodedLine) => encodedLine === null))
|
|
3983
|
-
return null;
|
|
3984
|
-
return `MULTILINESTRING${getDimensionSuffix(dimension)} (${encodedLines.join(", ")})`;
|
|
3985
|
-
}
|
|
3986
|
-
function encodeMultiPolygon(value, dimension) {
|
|
3987
|
-
const polygons = readChildren(value);
|
|
3988
|
-
if (!polygons)
|
|
3989
|
-
return null;
|
|
3990
|
-
if (polygons.length === 0)
|
|
3991
|
-
return `MULTIPOLYGON${getDimensionSuffix(dimension)} EMPTY`;
|
|
3992
|
-
const encodedPolygons = polygons.map((polygon) => {
|
|
3993
|
-
const rings = readChildren(polygon);
|
|
3994
|
-
if (!rings)
|
|
3995
|
-
return null;
|
|
3996
|
-
const encodedRings = rings.map((ring) => encodeCoordinateSequenceValue(ring));
|
|
3997
|
-
return encodedRings.some((encodedRing) => encodedRing === null) ? null : `(${encodedRings.join(", ")})`;
|
|
3998
|
-
});
|
|
3999
|
-
if (encodedPolygons.some((encodedPolygon) => encodedPolygon === null))
|
|
4000
|
-
return null;
|
|
4001
|
-
return `MULTIPOLYGON${getDimensionSuffix(dimension)} (${encodedPolygons.join(", ")})`;
|
|
4002
|
-
}
|
|
4003
|
-
function encodeGeometryCollection(value, dimension, preserveMemberDimensions) {
|
|
4004
|
-
if (!isVectorLike3(value))
|
|
4005
|
-
return null;
|
|
4006
|
-
const geometries = [];
|
|
4007
|
-
for (let rowIndex = 0; rowIndex < value.length; rowIndex++) {
|
|
4008
|
-
const unionVector = value;
|
|
4009
|
-
const typeId = getUnionTypeId2(unionVector, rowIndex);
|
|
4010
|
-
const childField = getUnionField(unionVector, rowIndex);
|
|
4011
|
-
const geometryKind = getGeoArrowUnionGeometryKind(childField == null ? void 0 : childField.name, typeId);
|
|
4012
|
-
const childDimension = getGeoArrowUnionDimension(childField == null ? void 0 : childField.name, childField == null ? void 0 : childField.type, typeId);
|
|
4013
|
-
if (!geometryKind || !childDimension)
|
|
4014
|
-
return null;
|
|
4015
|
-
const geometry = encodeNativeValue(unionVector.get(rowIndex), geometryKind, preserveMemberDimensions ? childDimension : dimension, preserveMemberDimensions);
|
|
4016
|
-
if (geometry === null)
|
|
4017
|
-
return null;
|
|
4018
|
-
geometries.push(geometry);
|
|
4019
|
-
}
|
|
4020
|
-
return geometries.length === 0 ? "GEOMETRYCOLLECTION EMPTY" : `GEOMETRYCOLLECTION (${geometries.join(", ")})`;
|
|
4021
|
-
}
|
|
4022
|
-
function encodeCoordinateSequenceValue(value) {
|
|
4023
|
-
const coordinates = readChildren(value);
|
|
4024
|
-
if (!coordinates)
|
|
4025
|
-
return null;
|
|
4026
|
-
const encodedCoordinates = encodeCoordinateSequence(coordinates);
|
|
4027
|
-
return encodedCoordinates === null ? null : `(${encodedCoordinates})`;
|
|
4028
|
-
}
|
|
4029
|
-
function encodeCoordinateSequence(values) {
|
|
4030
|
-
const coordinates = values.map((value) => {
|
|
4031
|
-
const coordinate = readCoordinate(value);
|
|
4032
|
-
return coordinate ? encodeCoordinate(coordinate) : null;
|
|
4033
|
-
});
|
|
4034
|
-
return coordinates.every((coordinate) => coordinate !== null) ? coordinates.join(", ") : null;
|
|
4035
|
-
}
|
|
4036
|
-
function encodeCoordinate(coordinate) {
|
|
4037
|
-
return coordinate.map((value) => String(value)).join(" ");
|
|
4038
|
-
}
|
|
4039
|
-
function readCoordinate(value) {
|
|
4040
|
-
if (value && typeof value === "object" && "x" in value && "y" in value) {
|
|
4041
|
-
const record = value;
|
|
4042
|
-
const coordinate = [Number(record.x), Number(record.y)];
|
|
4043
|
-
if (typeof record.z === "number")
|
|
4044
|
-
coordinate.push(record.z);
|
|
4045
|
-
if (typeof record.m === "number")
|
|
4046
|
-
coordinate.push(record.m);
|
|
4047
|
-
return coordinate.every(Number.isFinite) ? coordinate : null;
|
|
4048
|
-
}
|
|
4049
|
-
if (value && typeof value.toArray === "function") {
|
|
4050
|
-
return readCoordinate(value.toArray());
|
|
4051
|
-
}
|
|
4052
|
-
if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
|
4053
|
-
const coordinate = Array.from(value, Number);
|
|
4054
|
-
return coordinate.length >= 2 && coordinate.every(Number.isFinite) ? coordinate : null;
|
|
4055
|
-
}
|
|
4056
|
-
return null;
|
|
4057
|
-
}
|
|
4058
|
-
function readChildren(value) {
|
|
4059
|
-
if (isVectorLike3(value)) {
|
|
4060
|
-
const children = [];
|
|
4061
|
-
for (let index = 0; index < value.length; index++)
|
|
4062
|
-
children.push(value.get(index));
|
|
4063
|
-
return children;
|
|
4064
|
-
}
|
|
4065
|
-
if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
|
4066
|
-
return Array.from(value);
|
|
4067
|
-
}
|
|
4068
|
-
return null;
|
|
4069
|
-
}
|
|
4070
|
-
function getUnionTypeId2(vector, rowIndex) {
|
|
4071
|
-
let remainingRowIndex = rowIndex;
|
|
4072
|
-
for (const data of vector.data) {
|
|
4073
|
-
if (remainingRowIndex >= data.length) {
|
|
4074
|
-
remainingRowIndex -= data.length;
|
|
4075
|
-
continue;
|
|
4076
|
-
}
|
|
4077
|
-
const typeIdIndex = data.typeIds.length <= data.length ? remainingRowIndex : data.offset + remainingRowIndex;
|
|
4078
|
-
return data.typeIds[typeIdIndex];
|
|
4079
|
-
}
|
|
4080
|
-
throw new Error(`Dense union row ${rowIndex} is out of bounds.`);
|
|
4081
|
-
}
|
|
4082
|
-
function getUnionField(vector, rowIndex) {
|
|
4083
|
-
const unionType = vector.type;
|
|
4084
|
-
if (!(unionType instanceof arrow9.DenseUnion))
|
|
4085
|
-
return void 0;
|
|
4086
|
-
const typeId = getUnionTypeId2(vector, rowIndex);
|
|
4087
|
-
const childIndex = unionType.typeIds.indexOf(typeId);
|
|
4088
|
-
return childIndex >= 0 ? unionType.children[childIndex] : void 0;
|
|
4089
|
-
}
|
|
4090
|
-
function inferDimensionFromTypeId(column, rowIndex, sourceEncoding) {
|
|
4091
|
-
if (sourceEncoding === "geoarrow.geometry") {
|
|
4092
|
-
const typeId = getUnionTypeId2(column, rowIndex);
|
|
4093
|
-
const field = getUnionField(column, rowIndex);
|
|
4094
|
-
return getGeoArrowUnionDimension(field == null ? void 0 : field.name, field == null ? void 0 : field.type, typeId) || "xy";
|
|
4095
|
-
}
|
|
4096
|
-
let type = column.type;
|
|
4097
|
-
while (type instanceof arrow9.List || type instanceof arrow9.LargeList) {
|
|
4098
|
-
type = type.children[0].type;
|
|
4099
|
-
}
|
|
4100
|
-
if (type instanceof arrow9.Struct) {
|
|
4101
|
-
const names = new Set(type.children.map((field) => field.name));
|
|
4102
|
-
if (names.has("z") && names.has("m"))
|
|
4103
|
-
return "xyzm";
|
|
4104
|
-
if (names.has("m"))
|
|
4105
|
-
return "xym";
|
|
4106
|
-
if (names.has("z"))
|
|
4107
|
-
return "xyz";
|
|
4108
|
-
}
|
|
4109
|
-
if (type instanceof arrow9.FixedSizeList) {
|
|
4110
|
-
return type.listSize === 4 ? "xyzm" : type.listSize === 3 ? "xyz" : "xy";
|
|
4111
|
-
}
|
|
4112
|
-
return "xy";
|
|
4113
|
-
}
|
|
4114
|
-
function getRowGeometryKind(column, rowIndex, sourceEncoding) {
|
|
4115
|
-
if (sourceEncoding === "geoarrow.geometry") {
|
|
4116
|
-
const typeId = getUnionTypeId2(column, rowIndex);
|
|
4117
|
-
const field = getUnionField(column, rowIndex);
|
|
4118
|
-
return getGeoArrowUnionGeometryKind(field == null ? void 0 : field.name, typeId) || "GeometryCollection";
|
|
4119
|
-
}
|
|
4120
|
-
if (sourceEncoding === "geoarrow.geometrycollection")
|
|
4121
|
-
return "GeometryCollection";
|
|
4122
|
-
return getGeometryKind2(sourceEncoding);
|
|
4123
|
-
}
|
|
4124
|
-
function inferCollectionDimension(value) {
|
|
4125
|
-
if (!isVectorLike3(value))
|
|
4126
|
-
return "xy";
|
|
4127
|
-
const vector = value;
|
|
4128
|
-
if (vector.length > 0) {
|
|
4129
|
-
const typeId = getUnionTypeId2(vector, 0);
|
|
4130
|
-
const field = getUnionField(vector, 0);
|
|
4131
|
-
return getGeoArrowUnionDimension(field == null ? void 0 : field.name, field == null ? void 0 : field.type, typeId) || "xy";
|
|
4132
|
-
}
|
|
4133
|
-
return "xy";
|
|
4134
|
-
}
|
|
4135
|
-
function getGeometryKind2(encoding) {
|
|
4136
|
-
switch (encoding) {
|
|
4137
|
-
case "geoarrow.point":
|
|
4138
|
-
return "Point";
|
|
4139
|
-
case "geoarrow.linestring":
|
|
4140
|
-
return "LineString";
|
|
4141
|
-
case "geoarrow.polygon":
|
|
4142
|
-
return "Polygon";
|
|
4143
|
-
case "geoarrow.multipoint":
|
|
4144
|
-
return "MultiPoint";
|
|
4145
|
-
case "geoarrow.multilinestring":
|
|
4146
|
-
return "MultiLineString";
|
|
4147
|
-
case "geoarrow.multipolygon":
|
|
4148
|
-
return "MultiPolygon";
|
|
4149
|
-
case "geoarrow.geometry":
|
|
4150
|
-
return "GeometryCollection";
|
|
4151
|
-
case "geoarrow.geometrycollection":
|
|
4152
|
-
return "GeometryCollection";
|
|
4153
|
-
default:
|
|
4154
|
-
throw new Error(`Unsupported native WKT encoding "${encoding}".`);
|
|
4155
|
-
}
|
|
4156
|
-
}
|
|
4157
|
-
function getDimensionSuffix(dimension) {
|
|
4158
|
-
return dimension === "xy" ? "" : dimension === "xyzm" ? " ZM" : ` ${dimension.slice(2).toUpperCase()}`;
|
|
4159
|
-
}
|
|
4160
|
-
function isVectorLike3(value) {
|
|
4161
|
-
return Boolean(value && typeof value.length === "number" && typeof value.get === "function");
|
|
4162
|
-
}
|
|
4163
|
-
|
|
4164
3866
|
// dist/geoarrow/get-geoarrow-vertex-count.js
|
|
4165
|
-
var
|
|
4166
|
-
var
|
|
3867
|
+
var arrow12 = __toESM(require("apache-arrow"), 1);
|
|
3868
|
+
var import_arrow6 = require("@math.gl/core/arrow");
|
|
4167
3869
|
|
|
4168
3870
|
// dist/geoarrow/geoarrow-functions.js
|
|
4169
|
-
var
|
|
3871
|
+
var arrow9 = __toESM(require("apache-arrow"), 1);
|
|
4170
3872
|
var import_type = require("apache-arrow/type");
|
|
4171
3873
|
function isGeoArrowBox(type) {
|
|
4172
3874
|
if (!import_type.DataType.isStruct(type))
|
|
@@ -4248,18 +3950,18 @@ function isGeoArrowMultiPolygon(type) {
|
|
|
4248
3950
|
return true;
|
|
4249
3951
|
}
|
|
4250
3952
|
function isGeoArrowList(type) {
|
|
4251
|
-
const
|
|
4252
|
-
return type instanceof import_type.List || Boolean(
|
|
3953
|
+
const LargeList8 = getOptionalArrowListConstructor("LargeList");
|
|
3954
|
+
return type instanceof import_type.List || Boolean(LargeList8 && type instanceof LargeList8);
|
|
4253
3955
|
}
|
|
4254
3956
|
function getOptionalArrowListConstructor(typeName) {
|
|
4255
|
-
return
|
|
3957
|
+
return arrow9[typeName];
|
|
4256
3958
|
}
|
|
4257
3959
|
|
|
4258
3960
|
// dist/geoarrow/get-geoarrow-geometry-info.js
|
|
4259
|
-
var
|
|
3961
|
+
var arrow11 = __toESM(require("apache-arrow"), 1);
|
|
4260
3962
|
|
|
4261
3963
|
// dist/geoarrow/geoarrow-layout.js
|
|
4262
|
-
var
|
|
3964
|
+
var arrow10 = __toESM(require("apache-arrow"), 1);
|
|
4263
3965
|
var NATIVE_LAYOUTS = {
|
|
4264
3966
|
point: { depth: 0, encoding: "geoarrow.point" },
|
|
4265
3967
|
linestring: { depth: 1, encoding: "geoarrow.linestring" },
|
|
@@ -4323,11 +4025,11 @@ function inspectGeoArrowLayout(field) {
|
|
|
4323
4025
|
function visitType(type, path, state) {
|
|
4324
4026
|
const storage = getStorageKind(type);
|
|
4325
4027
|
state.storageKinds.push(storage);
|
|
4326
|
-
if (type instanceof
|
|
4327
|
-
state.offsetTypes.push(type instanceof
|
|
4328
|
-
} else if (type instanceof
|
|
4329
|
-
state.offsetTypes.push(type instanceof
|
|
4330
|
-
} else if (type instanceof
|
|
4028
|
+
if (type instanceof arrow10.List || type instanceof arrow10.LargeList) {
|
|
4029
|
+
state.offsetTypes.push(type instanceof arrow10.LargeList ? "int64" : "int32");
|
|
4030
|
+
} else if (type instanceof arrow10.Binary || type instanceof arrow10.LargeBinary) {
|
|
4031
|
+
state.offsetTypes.push(type instanceof arrow10.LargeBinary ? "int64" : "int32");
|
|
4032
|
+
} else if (type instanceof arrow10.DenseUnion) {
|
|
4331
4033
|
state.unionTypeIds.push(...Array.from(type.typeIds));
|
|
4332
4034
|
for (let childIndex = 0; childIndex < type.children.length; childIndex++) {
|
|
4333
4035
|
const child = type.children[childIndex];
|
|
@@ -4363,10 +4065,10 @@ function visitType(type, path, state) {
|
|
|
4363
4065
|
}
|
|
4364
4066
|
function classifyField(type, encoding, path, state, issues) {
|
|
4365
4067
|
var _a;
|
|
4366
|
-
if (type instanceof
|
|
4068
|
+
if (type instanceof arrow10.Binary || type instanceof arrow10.LargeBinary || type instanceof arrow10.BinaryView) {
|
|
4367
4069
|
return "wkb";
|
|
4368
4070
|
}
|
|
4369
|
-
if (type instanceof
|
|
4071
|
+
if (type instanceof arrow10.Utf8 || type instanceof arrow10.LargeUtf8 || type instanceof arrow10.Utf8View) {
|
|
4370
4072
|
return "wkt";
|
|
4371
4073
|
}
|
|
4372
4074
|
if (isBoxType(type)) {
|
|
@@ -4375,7 +4077,7 @@ function classifyField(type, encoding, path, state, issues) {
|
|
|
4375
4077
|
recordCoordinateSemantics(type, state, "separated");
|
|
4376
4078
|
return "box";
|
|
4377
4079
|
}
|
|
4378
|
-
if (type instanceof
|
|
4080
|
+
if (type instanceof arrow10.DenseUnion) {
|
|
4379
4081
|
validateUnionType(type, path, state, issues);
|
|
4380
4082
|
if (encoding === "geoarrow.geometrycollection") {
|
|
4381
4083
|
issues.push({
|
|
@@ -4387,7 +4089,7 @@ function classifyField(type, encoding, path, state, issues) {
|
|
|
4387
4089
|
validateUnionChildren(type, path, issues, true);
|
|
4388
4090
|
return "geometry-union";
|
|
4389
4091
|
}
|
|
4390
|
-
if ((type instanceof
|
|
4092
|
+
if ((type instanceof arrow10.List || type instanceof arrow10.LargeList) && ((_a = type.children[0]) == null ? void 0 : _a.type) instanceof arrow10.DenseUnion) {
|
|
4391
4093
|
validateUnionType(type.children[0].type, `${path}.child[0]`, state, issues);
|
|
4392
4094
|
validateUnionChildren(type.children[0].type, `${path}.child[0]`, issues, false);
|
|
4393
4095
|
return "geometrycollection";
|
|
@@ -4446,8 +4148,8 @@ function validateDeclaredEncoding(type, encoding, path, state, issues) {
|
|
|
4446
4148
|
});
|
|
4447
4149
|
}
|
|
4448
4150
|
}
|
|
4449
|
-
if (encoding === "geoarrow.geometrycollection" && type instanceof
|
|
4450
|
-
if (!(((_a = type.children[0]) == null ? void 0 : _a.type) instanceof
|
|
4151
|
+
if (encoding === "geoarrow.geometrycollection" && type instanceof arrow10.List) {
|
|
4152
|
+
if (!(((_a = type.children[0]) == null ? void 0 : _a.type) instanceof arrow10.DenseUnion)) {
|
|
4451
4153
|
addWrongPhysicalType(path, encoding, issues);
|
|
4452
4154
|
}
|
|
4453
4155
|
}
|
|
@@ -4455,7 +4157,7 @@ function validateDeclaredEncoding(type, encoding, path, state, issues) {
|
|
|
4455
4157
|
function validateNativeType(type, expectedDepth, path, state, issues) {
|
|
4456
4158
|
let current = type;
|
|
4457
4159
|
for (let depth = 0; depth < expectedDepth; depth++) {
|
|
4458
|
-
if (!(current instanceof
|
|
4160
|
+
if (!(current instanceof arrow10.List || current instanceof arrow10.LargeList)) {
|
|
4459
4161
|
issues.push({
|
|
4460
4162
|
code: "wrong-child-count",
|
|
4461
4163
|
path,
|
|
@@ -4476,7 +4178,7 @@ function validateNativeType(type, expectedDepth, path, state, issues) {
|
|
|
4476
4178
|
validateCoordinateType(current, path, state, issues);
|
|
4477
4179
|
}
|
|
4478
4180
|
function validateCoordinateType(type, path, state, issues) {
|
|
4479
|
-
if (type instanceof
|
|
4181
|
+
if (type instanceof arrow10.FixedSizeList) {
|
|
4480
4182
|
if (type.children.length !== 1 || !type.children[0]) {
|
|
4481
4183
|
issues.push({
|
|
4482
4184
|
code: "wrong-child-count",
|
|
@@ -4498,7 +4200,7 @@ function validateCoordinateType(type, path, state, issues) {
|
|
|
4498
4200
|
recordFloatPrecision(type.children[0].type, `${path}.child[0]`, state, issues);
|
|
4499
4201
|
return;
|
|
4500
4202
|
}
|
|
4501
|
-
if (type instanceof
|
|
4203
|
+
if (type instanceof arrow10.Struct) {
|
|
4502
4204
|
const names = type.children.map((child) => child.name);
|
|
4503
4205
|
const dimension = getSeparatedDimension(names);
|
|
4504
4206
|
if (!dimension) {
|
|
@@ -4530,7 +4232,7 @@ function validateCoordinateType(type, path, state, issues) {
|
|
|
4530
4232
|
});
|
|
4531
4233
|
}
|
|
4532
4234
|
function recordFloatPrecision(type, path, state, issues) {
|
|
4533
|
-
if (!(type instanceof
|
|
4235
|
+
if (!(type instanceof arrow10.Float)) {
|
|
4534
4236
|
issues.push({
|
|
4535
4237
|
code: "wrong-coordinate-precision",
|
|
4536
4238
|
path,
|
|
@@ -4538,7 +4240,7 @@ function recordFloatPrecision(type, path, state, issues) {
|
|
|
4538
4240
|
});
|
|
4539
4241
|
return;
|
|
4540
4242
|
}
|
|
4541
|
-
const precision = type.precision ===
|
|
4243
|
+
const precision = type.precision === arrow10.Precision.HALF ? "float16" : type.precision === arrow10.Precision.SINGLE ? "float32" : "float64";
|
|
4542
4244
|
state.precisions.push(precision);
|
|
4543
4245
|
if (precision === "float16") {
|
|
4544
4246
|
issues.push({
|
|
@@ -4549,7 +4251,7 @@ function recordFloatPrecision(type, path, state, issues) {
|
|
|
4549
4251
|
}
|
|
4550
4252
|
}
|
|
4551
4253
|
function validateBoxType(type, path, issues) {
|
|
4552
|
-
if (!(type instanceof
|
|
4254
|
+
if (!(type instanceof arrow10.Struct))
|
|
4553
4255
|
return;
|
|
4554
4256
|
const names = type.children.map((child) => child.name);
|
|
4555
4257
|
if (!getBoxDimension(names)) {
|
|
@@ -4560,7 +4262,7 @@ function validateBoxType(type, path, issues) {
|
|
|
4560
4262
|
});
|
|
4561
4263
|
}
|
|
4562
4264
|
for (let childIndex = 0; childIndex < type.children.length; childIndex++) {
|
|
4563
|
-
if (!(type.children[childIndex].type instanceof
|
|
4265
|
+
if (!(type.children[childIndex].type instanceof arrow10.Float)) {
|
|
4564
4266
|
issues.push({
|
|
4565
4267
|
code: "wrong-coordinate-precision",
|
|
4566
4268
|
path: `${path}.child[${childIndex}]`,
|
|
@@ -4615,7 +4317,7 @@ function validateUnionChildren(type, path, issues, allowGeometryCollection) {
|
|
|
4615
4317
|
});
|
|
4616
4318
|
continue;
|
|
4617
4319
|
}
|
|
4618
|
-
if (!(child.type instanceof
|
|
4320
|
+
if (!(child.type instanceof arrow10.List || child.type instanceof arrow10.LargeList) || !(((_a = child.type.children[0]) == null ? void 0 : _a.type) instanceof arrow10.DenseUnion)) {
|
|
4619
4321
|
issues.push({
|
|
4620
4322
|
code: "wrong-physical-type",
|
|
4621
4323
|
path: childPath,
|
|
@@ -4644,27 +4346,27 @@ function validateUnionChildren(type, path, issues, allowGeometryCollection) {
|
|
|
4644
4346
|
}
|
|
4645
4347
|
}
|
|
4646
4348
|
function recordCoordinateSemantics(type, state, coordinates) {
|
|
4647
|
-
if (!(type instanceof
|
|
4349
|
+
if (!(type instanceof arrow10.Struct))
|
|
4648
4350
|
return;
|
|
4649
4351
|
const dimension = getBoxDimension(type.children.map((child) => child.name));
|
|
4650
4352
|
if (dimension) {
|
|
4651
4353
|
state.dimensions.push(dimension);
|
|
4652
4354
|
state.coordinates.push(coordinates);
|
|
4653
4355
|
for (const child of type.children) {
|
|
4654
|
-
if (child.type instanceof
|
|
4655
|
-
state.precisions.push(child.type.precision ===
|
|
4356
|
+
if (child.type instanceof arrow10.Float) {
|
|
4357
|
+
state.precisions.push(child.type.precision === arrow10.Precision.SINGLE ? "float32" : "float64");
|
|
4656
4358
|
}
|
|
4657
4359
|
}
|
|
4658
4360
|
}
|
|
4659
4361
|
}
|
|
4660
4362
|
function isPotentialNativeType(type) {
|
|
4661
|
-
return type instanceof
|
|
4363
|
+
return type instanceof arrow10.FixedSizeList || type instanceof arrow10.Struct || type instanceof arrow10.List || type instanceof arrow10.LargeList;
|
|
4662
4364
|
}
|
|
4663
4365
|
function getListDepth(type) {
|
|
4664
4366
|
var _a;
|
|
4665
4367
|
let depth = 0;
|
|
4666
4368
|
let current = type;
|
|
4667
|
-
while (current instanceof
|
|
4369
|
+
while (current instanceof arrow10.List || current instanceof arrow10.LargeList) {
|
|
4668
4370
|
depth++;
|
|
4669
4371
|
current = (_a = current.children[0]) == null ? void 0 : _a.type;
|
|
4670
4372
|
if (!current)
|
|
@@ -4676,7 +4378,7 @@ function getNativeKind(type, encoding) {
|
|
|
4676
4378
|
const encodingKind = encoding ? encodingToKind(encoding) : null;
|
|
4677
4379
|
if (isNativeLayoutKind(encodingKind))
|
|
4678
4380
|
return encodingKind;
|
|
4679
|
-
if (type instanceof
|
|
4381
|
+
if (type instanceof arrow10.FixedSizeList || isCoordinateStruct(type))
|
|
4680
4382
|
return "point";
|
|
4681
4383
|
return null;
|
|
4682
4384
|
}
|
|
@@ -4721,34 +4423,34 @@ function addWrongPhysicalType(path, encoding, issues) {
|
|
|
4721
4423
|
});
|
|
4722
4424
|
}
|
|
4723
4425
|
function getStorageKind(type) {
|
|
4724
|
-
if (type instanceof
|
|
4426
|
+
if (type instanceof arrow10.FixedSizeList)
|
|
4725
4427
|
return "fixed-size-list";
|
|
4726
|
-
if (type instanceof
|
|
4428
|
+
if (type instanceof arrow10.List)
|
|
4727
4429
|
return "list";
|
|
4728
|
-
if (type instanceof
|
|
4430
|
+
if (type instanceof arrow10.LargeList)
|
|
4729
4431
|
return "large-list";
|
|
4730
|
-
if (type instanceof
|
|
4432
|
+
if (type instanceof arrow10.Struct)
|
|
4731
4433
|
return "struct";
|
|
4732
|
-
if (type instanceof
|
|
4434
|
+
if (type instanceof arrow10.DenseUnion)
|
|
4733
4435
|
return "dense-union";
|
|
4734
|
-
if (type instanceof
|
|
4436
|
+
if (type instanceof arrow10.Binary)
|
|
4735
4437
|
return "binary";
|
|
4736
|
-
if (type instanceof
|
|
4438
|
+
if (type instanceof arrow10.LargeBinary)
|
|
4737
4439
|
return "large-binary";
|
|
4738
|
-
if (type instanceof
|
|
4440
|
+
if (type instanceof arrow10.BinaryView)
|
|
4739
4441
|
return "binary-view";
|
|
4740
|
-
if (type instanceof
|
|
4442
|
+
if (type instanceof arrow10.Utf8)
|
|
4741
4443
|
return "utf8";
|
|
4742
|
-
if (type instanceof
|
|
4444
|
+
if (type instanceof arrow10.LargeUtf8)
|
|
4743
4445
|
return "large-utf8";
|
|
4744
|
-
if (type instanceof
|
|
4446
|
+
if (type instanceof arrow10.Utf8View)
|
|
4745
4447
|
return "utf8-view";
|
|
4746
|
-
if (type instanceof
|
|
4448
|
+
if (type instanceof arrow10.Float || type instanceof arrow10.Int)
|
|
4747
4449
|
return "scalar";
|
|
4748
4450
|
return "unknown";
|
|
4749
4451
|
}
|
|
4750
4452
|
function isCoordinateStruct(type) {
|
|
4751
|
-
return type instanceof
|
|
4453
|
+
return type instanceof arrow10.Struct && getSeparatedDimension(type.children.map((child) => child.name)) !== null;
|
|
4752
4454
|
}
|
|
4753
4455
|
function getSeparatedDimension(names) {
|
|
4754
4456
|
if (sameNames(names, ["x", "y"]))
|
|
@@ -4774,7 +4476,7 @@ function getBoxDimension(names) {
|
|
|
4774
4476
|
return null;
|
|
4775
4477
|
}
|
|
4776
4478
|
function isBoxType(type) {
|
|
4777
|
-
return type instanceof
|
|
4479
|
+
return type instanceof arrow10.Struct && getBoxDimension(type.children.map((child) => child.name)) !== null && type.children.every((child) => child.type instanceof arrow10.Float);
|
|
4778
4480
|
}
|
|
4779
4481
|
function getCommonValue(values) {
|
|
4780
4482
|
const firstValue = values[0];
|
|
@@ -4852,7 +4554,7 @@ function getNesting(kind, type) {
|
|
|
4852
4554
|
function getListDepth2(type) {
|
|
4853
4555
|
let depth = 0;
|
|
4854
4556
|
let currentType = type;
|
|
4855
|
-
while (currentType instanceof
|
|
4557
|
+
while (currentType instanceof arrow11.List || currentType instanceof arrow11.LargeList) {
|
|
4856
4558
|
depth++;
|
|
4857
4559
|
currentType = currentType.children[0].type;
|
|
4858
4560
|
}
|
|
@@ -4861,13 +4563,13 @@ function getListDepth2(type) {
|
|
|
4861
4563
|
|
|
4862
4564
|
// dist/geoarrow/get-geoarrow-vertex-count.js
|
|
4863
4565
|
function getGeoarrowVertexCount(input) {
|
|
4864
|
-
if (input instanceof
|
|
4566
|
+
if (input instanceof arrow12.Table) {
|
|
4865
4567
|
return getGeoarrowTableVertexCount(input);
|
|
4866
4568
|
}
|
|
4867
|
-
if (input instanceof
|
|
4569
|
+
if (input instanceof arrow12.Vector) {
|
|
4868
4570
|
return getGeoarrowVectorVertexCount(input);
|
|
4869
4571
|
}
|
|
4870
|
-
if (input instanceof
|
|
4572
|
+
if (input instanceof arrow12.Data) {
|
|
4871
4573
|
return getGeoarrowDataVertexCount(input);
|
|
4872
4574
|
}
|
|
4873
4575
|
throw new Error("Expected an Apache Arrow Table, Vector, or Data instance.");
|
|
@@ -4894,16 +4596,16 @@ function getGeoarrowVectorVertexCount(vector) {
|
|
|
4894
4596
|
}
|
|
4895
4597
|
function getGeoarrowDataVertexCount(data) {
|
|
4896
4598
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
4897
|
-
if (data.type instanceof
|
|
4599
|
+
if (data.type instanceof arrow12.Binary || data.type instanceof arrow12.LargeBinary || data.type instanceof arrow12.BinaryView) {
|
|
4898
4600
|
return getWKBDataVertexCount(data);
|
|
4899
4601
|
}
|
|
4900
|
-
if (data.type instanceof
|
|
4602
|
+
if (data.type instanceof arrow12.Utf8 || data.type instanceof arrow12.LargeUtf8 || data.type instanceof arrow12.Utf8View) {
|
|
4901
4603
|
throw new Error("WKT vertex counting is not supported.");
|
|
4902
4604
|
}
|
|
4903
|
-
if (data.type instanceof
|
|
4605
|
+
if (data.type instanceof arrow12.DenseUnion) {
|
|
4904
4606
|
return data.children.reduce((vertexCount, child) => vertexCount + getGeoarrowDataVertexCount(child), 0);
|
|
4905
4607
|
}
|
|
4906
|
-
if ((data.type instanceof
|
|
4608
|
+
if ((data.type instanceof arrow12.List || data.type instanceof arrow12.LargeList) && ((_a = data.children[0]) == null ? void 0 : _a.type) instanceof arrow12.DenseUnion) {
|
|
4907
4609
|
return getGeoarrowDataVertexCount(data.children[0]);
|
|
4908
4610
|
}
|
|
4909
4611
|
if (isGeoArrowBox(data.type)) {
|
|
@@ -4924,16 +4626,16 @@ function getGeoarrowDataVertexCount(data) {
|
|
|
4924
4626
|
throw new Error(`Unsupported GeoArrow data type: ${data.type}`);
|
|
4925
4627
|
}
|
|
4926
4628
|
function getGeoarrowWKTVertexCount(input) {
|
|
4927
|
-
if (input instanceof
|
|
4629
|
+
if (input instanceof arrow12.Vector) {
|
|
4928
4630
|
return input.data.reduce((vertexCount, data) => vertexCount + getWKTDataVertexCount(data), 0);
|
|
4929
4631
|
}
|
|
4930
|
-
if (input instanceof
|
|
4632
|
+
if (input instanceof arrow12.Data) {
|
|
4931
4633
|
return getWKTDataVertexCount(input);
|
|
4932
4634
|
}
|
|
4933
4635
|
throw new Error("Expected an Apache Arrow Vector or Data instance.");
|
|
4934
4636
|
}
|
|
4935
4637
|
function getWKTDataVertexCount(data) {
|
|
4936
|
-
const vector = new
|
|
4638
|
+
const vector = new arrow12.Vector([data]);
|
|
4937
4639
|
let vertexCount = 0;
|
|
4938
4640
|
for (let rowIndex = 0; rowIndex < vector.length; rowIndex++) {
|
|
4939
4641
|
const value = vector.get(rowIndex);
|
|
@@ -4964,7 +4666,7 @@ function countGeometryVertices(geometry) {
|
|
|
4964
4666
|
}
|
|
4965
4667
|
}
|
|
4966
4668
|
function getWKBDataVertexCount(data) {
|
|
4967
|
-
const vector = new
|
|
4669
|
+
const vector = new arrow12.Vector([data]);
|
|
4968
4670
|
let vertexCount = 0;
|
|
4969
4671
|
for (let rowIndex = 0; rowIndex < vector.length; rowIndex++) {
|
|
4970
4672
|
const value = vector.get(rowIndex);
|
|
@@ -4976,7 +4678,7 @@ function getWKBDataVertexCount(data) {
|
|
|
4976
4678
|
}
|
|
4977
4679
|
function getWKBVertexCount(wkb) {
|
|
4978
4680
|
try {
|
|
4979
|
-
return (0,
|
|
4681
|
+
return (0, import_arrow6.scanWKB)(wkb).coordinateCount;
|
|
4980
4682
|
} catch (error) {
|
|
4981
4683
|
if (error instanceof Error && error.message.startsWith("Unsupported WKB geometry type")) {
|
|
4982
4684
|
throw new Error("Unsupported geometry type");
|
|
@@ -5033,7 +4735,7 @@ function getVariableLengthByteCount(column, sourceEncoding) {
|
|
|
5033
4735
|
}
|
|
5034
4736
|
|
|
5035
4737
|
// dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js
|
|
5036
|
-
var
|
|
4738
|
+
var import_arrow8 = require("@math.gl/core/arrow");
|
|
5037
4739
|
var DEFAULT_MAX_GEOMETRY_COLLECTION_DEPTH = 64;
|
|
5038
4740
|
function convertGeoArrowVector(column, sourceEncoding, targetEncoding, options) {
|
|
5039
4741
|
const maxGeometryCollectionDepth = getMaxGeometryCollectionDepth(options);
|
|
@@ -5118,7 +4820,7 @@ function convertGeoArrowGeometry(table, targetEncoding, options) {
|
|
|
5118
4820
|
const convertedVector = convertedColumns.get(field.name);
|
|
5119
4821
|
return convertedEncoding && convertedVector ? createConvertedField(field, convertedVector.type, convertedEncoding, (_a2 = conversionOptions.get(field.name)) == null ? void 0 : _a2.geometryTypes, conversionOptions.get(field.name), (_b2 = geoMetadata == null ? void 0 : geoMetadata.columns) == null ? void 0 : _b2[field.name]) : field;
|
|
5120
4822
|
});
|
|
5121
|
-
const nextSchema = new
|
|
4823
|
+
const nextSchema = new arrow13.Schema(nextFields, nextSchemaMetadata);
|
|
5122
4824
|
let rowOffset = 0;
|
|
5123
4825
|
const nextBatches = table.batches.map((batch) => {
|
|
5124
4826
|
const children = table.schema.fields.map((field) => {
|
|
@@ -5137,14 +4839,14 @@ function convertGeoArrowGeometry(table, targetEncoding, options) {
|
|
|
5137
4839
|
return batchVector.data[0];
|
|
5138
4840
|
});
|
|
5139
4841
|
rowOffset += batch.numRows;
|
|
5140
|
-
return new
|
|
5141
|
-
type: new
|
|
4842
|
+
return new arrow13.RecordBatch(nextSchema, arrow13.makeData({
|
|
4843
|
+
type: new arrow13.Struct(nextFields),
|
|
5142
4844
|
length: batch.numRows,
|
|
5143
4845
|
nullCount: 0,
|
|
5144
4846
|
children
|
|
5145
4847
|
}));
|
|
5146
4848
|
});
|
|
5147
|
-
return new
|
|
4849
|
+
return new arrow13.Table(nextSchema, nextBatches);
|
|
5148
4850
|
}
|
|
5149
4851
|
function inferGeometryTypes(table, geometryColumn, sourceEncoding) {
|
|
5150
4852
|
if (sourceEncoding !== "geoarrow.wkb" && sourceEncoding !== "geoarrow.wkt") {
|
|
@@ -5173,11 +4875,6 @@ function convertGeometryColumn(column, sourceEncoding, targetEncoding, geometryC
|
|
|
5173
4875
|
const mathGeoArrowVector = convertGeometryColumnWithMath(column, sourceEncoding, targetEncoding, options);
|
|
5174
4876
|
if (mathGeoArrowVector)
|
|
5175
4877
|
return mathGeoArrowVector;
|
|
5176
|
-
if (targetEncoding === "geoarrow.wkt") {
|
|
5177
|
-
const directWKTVector = encodeGeoArrowWKTVector(column, sourceEncoding, options == null ? void 0 : options.dimension);
|
|
5178
|
-
if (directWKTVector)
|
|
5179
|
-
return directWKTVector;
|
|
5180
|
-
}
|
|
5181
4878
|
if (sourceEncoding === "geoarrow.wkt" && isConcreteNativeEncoding(targetEncoding)) {
|
|
5182
4879
|
const directWKTVector = decodeWKTNativeVector(column, targetEncoding, options == null ? void 0 : options.dimension, options == null ? void 0 : options.coordinates, options == null ? void 0 : options.offsetType, options == null ? void 0 : options.maxGeometryCollectionDepth);
|
|
5183
4880
|
if (directWKTVector)
|
|
@@ -5211,29 +4908,29 @@ function convertGeometryColumn(column, sourceEncoding, targetEncoding, geometryC
|
|
|
5211
4908
|
}
|
|
5212
4909
|
const targetValues = geometries.map((geometry) => convertGeometryValue(geometry, targetEncoding, targetDimension, geometryColumn, options));
|
|
5213
4910
|
const nativeValues = (options == null ? void 0 : options.coordinates) === "separated" ? targetValues.map((value) => separateCoordinateValues(value, targetDimension, targetDimensionName)) : targetValues;
|
|
5214
|
-
return
|
|
4911
|
+
return arrow13.vectorFromArray(nativeValues, getTargetArrowType(targetEncoding, targetDimension, options, (options == null ? void 0 : options.dimension) || getDimensionFromGeometryTypes(options == null ? void 0 : options.geometryTypes)));
|
|
5215
4912
|
}
|
|
5216
4913
|
function convertGeometryColumnWithMath(column, sourceEncoding, targetEncoding, options) {
|
|
5217
4914
|
const sourceIsNative = isMathGeoArrowNativeEncoding(sourceEncoding);
|
|
5218
4915
|
const targetIsNative = isMathGeoArrowNativeEncoding(targetEncoding);
|
|
5219
|
-
const supportsConversion = sourceEncoding === "geoarrow.wkb" && targetIsNative || sourceIsNative && targetEncoding === "geoarrow.wkb" || sourceIsNative && targetIsNative;
|
|
4916
|
+
const supportsConversion = sourceEncoding === "geoarrow.wkb" && targetIsNative || sourceIsNative && (targetEncoding === "geoarrow.wkb" || targetEncoding === "geoarrow.wkt") || sourceIsNative && targetIsNative;
|
|
5220
4917
|
if (!supportsConversion)
|
|
5221
4918
|
return null;
|
|
5222
4919
|
const declaredDimension = getDimensionFromGeometryTypes(options == null ? void 0 : options.geometryTypes);
|
|
5223
|
-
const sourceColumn = (0,
|
|
4920
|
+
const sourceColumn = (0, import_arrow8.makeGeoArrowColumnFromArrowVector)(column, {
|
|
5224
4921
|
encoding: sourceEncoding,
|
|
5225
4922
|
dimension: sourceEncoding === "geoarrow.wkb" ? declaredDimension || "xy" : declaredDimension || (targetEncoding === "geoarrow.wkb" ? options == null ? void 0 : options.dimension : void 0)
|
|
5226
4923
|
});
|
|
5227
4924
|
if (sourceEncoding === "geoarrow.wkb") {
|
|
5228
4925
|
try {
|
|
5229
|
-
const decodedColumn = (0,
|
|
4926
|
+
const decodedColumn = (0, import_arrow7.decodeGeoArrowWKB)(sourceColumn, {
|
|
5230
4927
|
encoding: targetEncoding,
|
|
5231
4928
|
dimension: (options == null ? void 0 : options.dimension) || declaredDimension || "infer",
|
|
5232
4929
|
coordinateLayout: (options == null ? void 0 : options.coordinates) || "interleaved",
|
|
5233
4930
|
offsetType: (options == null ? void 0 : options.offsetType) || "int32",
|
|
5234
4931
|
traversal: { maximumDepth: options == null ? void 0 : options.maxGeometryCollectionDepth }
|
|
5235
4932
|
});
|
|
5236
|
-
return (0,
|
|
4933
|
+
return (0, import_arrow8.makeArrowVectorFromGeoArrowColumn)(decodedColumn);
|
|
5237
4934
|
} catch (error) {
|
|
5238
4935
|
if ((options == null ? void 0 : options.maxGeometryCollectionDepth) !== void 0 && error instanceof Error && error.message.includes("nesting exceeds maximumDepth")) {
|
|
5239
4936
|
throw new Error(`GeometryCollection nesting exceeds maxGeometryCollectionDepth (${options.maxGeometryCollectionDepth}).`);
|
|
@@ -5241,16 +4938,17 @@ function convertGeometryColumnWithMath(column, sourceEncoding, targetEncoding, o
|
|
|
5241
4938
|
throw error;
|
|
5242
4939
|
}
|
|
5243
4940
|
}
|
|
5244
|
-
if (targetEncoding === "geoarrow.wkb") {
|
|
5245
|
-
|
|
4941
|
+
if (targetEncoding === "geoarrow.wkb" || targetEncoding === "geoarrow.wkt") {
|
|
4942
|
+
const nativeColumn = targetEncoding === "geoarrow.wkt" && (options == null ? void 0 : options.dimension) ? (0, import_arrow7.convertGeoArrowColumn)(sourceColumn, { dimension: options.dimension }) : sourceColumn;
|
|
4943
|
+
return (0, import_arrow8.makeArrowVectorFromGeoArrowColumn)((0, import_arrow7.convertGeoArrowColumn)(nativeColumn, { encoding: targetEncoding }));
|
|
5246
4944
|
}
|
|
5247
|
-
const convertedColumn = (0,
|
|
4945
|
+
const convertedColumn = (0, import_arrow7.convertGeoArrowColumn)(sourceColumn, {
|
|
5248
4946
|
encoding: targetEncoding,
|
|
5249
4947
|
dimension: options == null ? void 0 : options.dimension,
|
|
5250
4948
|
coordinateLayout: (options == null ? void 0 : options.coordinates) || "preserve",
|
|
5251
4949
|
offsetType: (options == null ? void 0 : options.offsetType) || "preserve"
|
|
5252
4950
|
});
|
|
5253
|
-
return convertedColumn === sourceColumn ? column : (0,
|
|
4951
|
+
return convertedColumn === sourceColumn ? column : (0, import_arrow8.makeArrowVectorFromGeoArrowColumn)(convertedColumn);
|
|
5254
4952
|
}
|
|
5255
4953
|
function isMathGeoArrowNativeEncoding(encoding) {
|
|
5256
4954
|
return encoding === "geoarrow.point" || encoding === "geoarrow.linestring" || encoding === "geoarrow.polygon" || encoding === "geoarrow.multipoint" || encoding === "geoarrow.multilinestring" || encoding === "geoarrow.multipolygon" || encoding === "geoarrow.geometry" || encoding === "geoarrow.geometrycollection";
|
|
@@ -5380,17 +5078,17 @@ function createGeometryUnionVector(geometries, targetDimension, allowGeometryCol
|
|
|
5380
5078
|
usedKinds.add(childKind);
|
|
5381
5079
|
childValues[childKind] ||= [];
|
|
5382
5080
|
valueOffsets.push(childValues[childKind].length);
|
|
5383
|
-
typeIds.push(
|
|
5081
|
+
typeIds.push(getUnionTypeId2(childKind, targetDimension, targetDimensionName));
|
|
5384
5082
|
childValues[childKind].push(geometry ? convertGeometryToUnionChildValue(geometry, targetDimension, geometryColumn) : null);
|
|
5385
5083
|
}
|
|
5386
|
-
const orderedKinds = [...usedKinds].sort((leftKind, rightKind) =>
|
|
5387
|
-
const fields = orderedKinds.map((kind) => new
|
|
5084
|
+
const orderedKinds = [...usedKinds].sort((leftKind, rightKind) => getUnionTypeId2(leftKind, targetDimension, targetDimensionName) - getUnionTypeId2(rightKind, targetDimension, targetDimensionName));
|
|
5085
|
+
const fields = orderedKinds.map((kind) => new arrow13.Field(getUnionFieldName(kind, targetDimension, targetDimensionName), getUnionChildType(kind, targetDimension, options, geometryCollectionDepth, targetDimensionName), true));
|
|
5388
5086
|
const children = orderedKinds.map((kind) => {
|
|
5389
5087
|
const values = childValues[kind] || [];
|
|
5390
5088
|
return createUnionChildVector(kind, values, targetDimension, geometryColumn, options, geometryCollectionDepth, targetDimensionName).data[0];
|
|
5391
5089
|
});
|
|
5392
|
-
const unionType = new
|
|
5393
|
-
return
|
|
5090
|
+
const unionType = new arrow13.DenseUnion(orderedKinds.map((kind) => getUnionTypeId2(kind, targetDimension, targetDimensionName)), fields);
|
|
5091
|
+
return arrow13.makeVector(arrow13.makeData({
|
|
5394
5092
|
type: unionType,
|
|
5395
5093
|
length: geometries.length,
|
|
5396
5094
|
nullCount: 0,
|
|
@@ -5417,7 +5115,7 @@ function createGeometryCollectionVector(geometries, targetDimension, geometryCol
|
|
|
5417
5115
|
valueOffsets.push(flattenedGeometries.length);
|
|
5418
5116
|
}
|
|
5419
5117
|
const memberUnionVector = createGeometryUnionVector(flattenedGeometries, targetDimension, false, geometryColumn, options, 0, targetDimensionName);
|
|
5420
|
-
const listType = createListType(new
|
|
5118
|
+
const listType = createListType(new arrow13.Field("geometries", memberUnionVector.type, true), options == null ? void 0 : options.offsetType);
|
|
5421
5119
|
const listData = {
|
|
5422
5120
|
length: geometries.length,
|
|
5423
5121
|
nullCount: validity.filter((isValid) => !isValid).length,
|
|
@@ -5425,16 +5123,16 @@ function createGeometryCollectionVector(geometries, targetDimension, geometryCol
|
|
|
5425
5123
|
valueOffsets: createOffsetArray(valueOffsets, options == null ? void 0 : options.offsetType),
|
|
5426
5124
|
child: memberUnionVector.data[0]
|
|
5427
5125
|
};
|
|
5428
|
-
const listDataValue = listType instanceof
|
|
5126
|
+
const listDataValue = listType instanceof arrow13.LargeList ? arrow13.makeData({
|
|
5429
5127
|
type: listType,
|
|
5430
5128
|
...listData,
|
|
5431
5129
|
valueOffsets: BigInt64Array.from(valueOffsets, BigInt)
|
|
5432
|
-
}) :
|
|
5130
|
+
}) : arrow13.makeData({
|
|
5433
5131
|
type: listType,
|
|
5434
5132
|
...listData,
|
|
5435
5133
|
valueOffsets: Int32Array.from(valueOffsets)
|
|
5436
5134
|
});
|
|
5437
|
-
return
|
|
5135
|
+
return arrow13.makeVector(listDataValue);
|
|
5438
5136
|
}
|
|
5439
5137
|
function convertGeometryToUnionChildValue(geometry, targetDimension, geometryColumn) {
|
|
5440
5138
|
switch (geometry.type) {
|
|
@@ -5459,7 +5157,7 @@ function createUnionChildVector(geometryKind, values, targetDimension, geometryC
|
|
|
5459
5157
|
return createGeometryCollectionVector(values, targetDimension, geometryColumn, options, Math.max(geometryCollectionDepth - 1, 0), dimensionName);
|
|
5460
5158
|
}
|
|
5461
5159
|
const nativeValues = (options == null ? void 0 : options.coordinates) === "separated" ? values.map((value) => separateCoordinateValues(value, targetDimension, dimensionName)) : values;
|
|
5462
|
-
return
|
|
5160
|
+
return arrow13.vectorFromArray(nativeValues, getUnionChildType(geometryKind, targetDimension, options, geometryCollectionDepth, dimensionName));
|
|
5463
5161
|
}
|
|
5464
5162
|
function convertUnionValueToGeometry(value, geometryKind) {
|
|
5465
5163
|
if (value == null)
|
|
@@ -5516,7 +5214,7 @@ function getUnionBufferIndex(bufferLength, offset, rowIndex, useLogicalIndex) {
|
|
|
5516
5214
|
}
|
|
5517
5215
|
function getDenseUnionGeometryKind(vector, rowIndex) {
|
|
5518
5216
|
var _a;
|
|
5519
|
-
if (!(vector.type instanceof
|
|
5217
|
+
if (!(vector.type instanceof arrow13.DenseUnion)) {
|
|
5520
5218
|
throw new Error("GeoArrow geometry storage requires a DenseUnion vector.");
|
|
5521
5219
|
}
|
|
5522
5220
|
const { typeId } = getDenseUnionCellInfo(vector, rowIndex);
|
|
@@ -5564,7 +5262,7 @@ function getGeometryCollectionDepth(geometries) {
|
|
|
5564
5262
|
}
|
|
5565
5263
|
return maximumDepth;
|
|
5566
5264
|
}
|
|
5567
|
-
function
|
|
5265
|
+
function getUnionTypeId2(geometryKind, targetDimension, dimensionName = getDimensionName2(targetDimension)) {
|
|
5568
5266
|
const baseTypeId = getUnionBaseTypeId(geometryKind);
|
|
5569
5267
|
switch (dimensionName) {
|
|
5570
5268
|
case "xy":
|
|
@@ -5643,7 +5341,7 @@ function createConvertedField(field, type, targetEncoding, geometryTypes, option
|
|
|
5643
5341
|
extensionMetadata.geometry_types = [...effectiveGeometryTypes];
|
|
5644
5342
|
metadata.set("ARROW:extension:metadata", JSON.stringify(extensionMetadata));
|
|
5645
5343
|
}
|
|
5646
|
-
return new
|
|
5344
|
+
return new arrow13.Field(field.name, type, field.nullable, metadata);
|
|
5647
5345
|
}
|
|
5648
5346
|
function getPreservedFieldMetadata(sourceGeoColumnMetadata) {
|
|
5649
5347
|
if (!sourceGeoColumnMetadata)
|
|
@@ -5751,18 +5449,18 @@ function getTargetArrowType(targetEncoding, targetDimension, options, dimensionN
|
|
|
5751
5449
|
return coordinateType;
|
|
5752
5450
|
case "geoarrow.linestring":
|
|
5753
5451
|
case "geoarrow.multipoint":
|
|
5754
|
-
return createList(new
|
|
5452
|
+
return createList(new arrow13.Field("value", coordinateType, true));
|
|
5755
5453
|
case "geoarrow.polygon":
|
|
5756
5454
|
case "geoarrow.multilinestring":
|
|
5757
|
-
return createList(new
|
|
5455
|
+
return createList(new arrow13.Field("value", createList(new arrow13.Field("value", coordinateType, true)), true));
|
|
5758
5456
|
case "geoarrow.multipolygon":
|
|
5759
|
-
return createList(new
|
|
5457
|
+
return createList(new arrow13.Field("value", createList(new arrow13.Field("value", createList(new arrow13.Field("value", coordinateType, true)), true)), true));
|
|
5760
5458
|
case "geoarrow.box":
|
|
5761
|
-
return new
|
|
5459
|
+
return new arrow13.Struct(getBoxFieldNames3((options == null ? void 0 : options.dimension) || getDimensionName2(targetDimension)).map((name) => new arrow13.Field(name, new arrow13.Float64(), true)));
|
|
5762
5460
|
case "geoarrow.wkb":
|
|
5763
|
-
return new
|
|
5461
|
+
return new arrow13.Binary();
|
|
5764
5462
|
case "geoarrow.wkt":
|
|
5765
|
-
return new
|
|
5463
|
+
return new arrow13.Utf8();
|
|
5766
5464
|
default:
|
|
5767
5465
|
throw new Error(`Unsupported GeoArrow target encoding "${targetEncoding}".`);
|
|
5768
5466
|
}
|
|
@@ -5786,9 +5484,9 @@ function canReuseGeoArrowVector(column, encoding, options) {
|
|
|
5786
5484
|
return true;
|
|
5787
5485
|
}
|
|
5788
5486
|
function getCoordinateLayout(type) {
|
|
5789
|
-
if (type instanceof
|
|
5487
|
+
if (type instanceof arrow13.FixedSizeList)
|
|
5790
5488
|
return "interleaved";
|
|
5791
|
-
if (type instanceof
|
|
5489
|
+
if (type instanceof arrow13.Struct) {
|
|
5792
5490
|
const names = type.children.map((child) => child.name);
|
|
5793
5491
|
if (names[0] === "x" && names[1] === "y")
|
|
5794
5492
|
return "separated";
|
|
@@ -5799,10 +5497,10 @@ function getCoordinateLayout(type) {
|
|
|
5799
5497
|
}
|
|
5800
5498
|
return null;
|
|
5801
5499
|
}
|
|
5802
|
-
if (type instanceof
|
|
5500
|
+
if (type instanceof arrow13.List || type instanceof arrow13.LargeList) {
|
|
5803
5501
|
return getCoordinateLayout(type.children[0].type);
|
|
5804
5502
|
}
|
|
5805
|
-
if (type instanceof
|
|
5503
|
+
if (type instanceof arrow13.DenseUnion) {
|
|
5806
5504
|
for (const child of type.children) {
|
|
5807
5505
|
const layout = getCoordinateLayout(child.type);
|
|
5808
5506
|
if (layout)
|
|
@@ -5812,18 +5510,18 @@ function getCoordinateLayout(type) {
|
|
|
5812
5510
|
return null;
|
|
5813
5511
|
}
|
|
5814
5512
|
function getVectorOffsetType(type) {
|
|
5815
|
-
if (type instanceof
|
|
5513
|
+
if (type instanceof arrow13.List)
|
|
5816
5514
|
return "int32";
|
|
5817
|
-
if (type instanceof
|
|
5515
|
+
if (type instanceof arrow13.LargeList)
|
|
5818
5516
|
return "int64";
|
|
5819
|
-
if (type instanceof
|
|
5517
|
+
if (type instanceof arrow13.Struct) {
|
|
5820
5518
|
for (const child of type.children) {
|
|
5821
5519
|
const offsetType = getVectorOffsetType(child.type);
|
|
5822
5520
|
if (offsetType)
|
|
5823
5521
|
return offsetType;
|
|
5824
5522
|
}
|
|
5825
5523
|
}
|
|
5826
|
-
if (type instanceof
|
|
5524
|
+
if (type instanceof arrow13.DenseUnion) {
|
|
5827
5525
|
for (const child of type.children) {
|
|
5828
5526
|
const offsetType = getVectorOffsetType(child.type);
|
|
5829
5527
|
if (offsetType)
|
|
@@ -5907,10 +5605,10 @@ function buildGeometryUnionType(targetDimension, allowGeometryCollections, optio
|
|
|
5907
5605
|
if (allowGeometryCollections && geometryCollectionDepth > 0) {
|
|
5908
5606
|
geometryKinds.push("GeometryCollection");
|
|
5909
5607
|
}
|
|
5910
|
-
return new
|
|
5608
|
+
return new arrow13.DenseUnion(geometryKinds.map((geometryKind) => getUnionTypeId2(geometryKind, targetDimension, dimensionName)), geometryKinds.map((geometryKind) => new arrow13.Field(getUnionFieldName(geometryKind, targetDimension, dimensionName), getUnionChildType(geometryKind, targetDimension, options, geometryCollectionDepth, dimensionName), true)));
|
|
5911
5609
|
}
|
|
5912
5610
|
function buildGeometryCollectionType(targetDimension, options, geometryCollectionDepth = 0, dimensionName = getDimensionName2(targetDimension)) {
|
|
5913
|
-
return createListType(new
|
|
5611
|
+
return createListType(new arrow13.Field("geometries", buildGeometryUnionType(targetDimension, geometryCollectionDepth > 0, options, geometryCollectionDepth, dimensionName), true), options == null ? void 0 : options.offsetType);
|
|
5914
5612
|
}
|
|
5915
5613
|
function getUnionBaseTypeId(geometryKind) {
|
|
5916
5614
|
switch (geometryKind) {
|
|
@@ -6003,13 +5701,13 @@ function getBoxFieldNames3(dimension) {
|
|
|
6003
5701
|
}
|
|
6004
5702
|
function getCoordinateType(targetDimension, coordinates = "interleaved", dimensionName = getDimensionName2(targetDimension)) {
|
|
6005
5703
|
if (coordinates === "interleaved") {
|
|
6006
|
-
return new
|
|
5704
|
+
return new arrow13.FixedSizeList(targetDimension, new arrow13.Field("value", new arrow13.Float64(), true));
|
|
6007
5705
|
}
|
|
6008
5706
|
const coordinateNames = dimensionName === "xy" ? ["x", "y"] : dimensionName === "xyz" ? ["x", "y", "z"] : dimensionName === "xym" ? ["x", "y", "m"] : ["x", "y", "z", "m"];
|
|
6009
|
-
return new
|
|
5707
|
+
return new arrow13.Struct(coordinateNames.map((name) => new arrow13.Field(name, new arrow13.Float64(), true)));
|
|
6010
5708
|
}
|
|
6011
5709
|
function createListType(field, offsetType = "int32") {
|
|
6012
|
-
return offsetType === "int64" ? new
|
|
5710
|
+
return offsetType === "int64" ? new arrow13.LargeList(field) : new arrow13.List(field);
|
|
6013
5711
|
}
|
|
6014
5712
|
function createOffsetArray(offsets, offsetType = "int32") {
|
|
6015
5713
|
return offsetType === "int64" ? BigInt64Array.from(offsets, BigInt) : Int32Array.from(offsets);
|
|
@@ -6106,18 +5804,18 @@ function padPosition(position, targetDimension) {
|
|
|
6106
5804
|
}
|
|
6107
5805
|
|
|
6108
5806
|
// dist/geoarrow/geoarrow-bounds.js
|
|
6109
|
-
var
|
|
6110
|
-
var
|
|
6111
|
-
var
|
|
5807
|
+
var import_arrow10 = require("@math.gl/core/arrow");
|
|
5808
|
+
var import_arrow11 = require("@math.gl/core/arrow");
|
|
5809
|
+
var import_arrow12 = require("@math.gl/core/arrow");
|
|
6112
5810
|
|
|
6113
5811
|
// dist/geoarrow/binary-polygon-to-geoarrow.js
|
|
6114
|
-
var
|
|
5812
|
+
var import_arrow9 = require("@math.gl/core/arrow");
|
|
6115
5813
|
function makeGeoArrowColumnFromBinaryPolygon(geometry, options) {
|
|
6116
5814
|
const { dimension } = options;
|
|
6117
5815
|
if (!["xy", "xyz", "xym", "xyzm"].includes(dimension)) {
|
|
6118
5816
|
throw new Error("Binary polygon dimension must be xy, xyz, xym, or xyzm.");
|
|
6119
5817
|
}
|
|
6120
|
-
const coordinateSize = (0,
|
|
5818
|
+
const coordinateSize = (0, import_arrow9.getGeoArrowDimensionSize)(dimension);
|
|
6121
5819
|
const positions = geometry.positions.value;
|
|
6122
5820
|
if (!(positions instanceof Float32Array || positions instanceof Float64Array) || geometry.positions.size !== coordinateSize || positions.length % coordinateSize !== 0) {
|
|
6123
5821
|
throw new Error("Binary polygon positions must be floating-point tuples matching dimension.");
|
|
@@ -6186,7 +5884,7 @@ function getGeoArrowRowBounds(column, encodingOrOptions) {
|
|
|
6186
5884
|
if (typeof encodingOrOptions === "string") {
|
|
6187
5885
|
throw new Error("Binary polygon bounds require an explicit dimension option.");
|
|
6188
5886
|
}
|
|
6189
|
-
return (0,
|
|
5887
|
+
return (0, import_arrow12.getGeoArrowRowBounds)(makeGeoArrowColumnFromBinaryPolygon(column, encodingOrOptions));
|
|
6190
5888
|
}
|
|
6191
5889
|
if (typeof encodingOrOptions !== "string") {
|
|
6192
5890
|
throw new Error("Arrow vector bounds require a GeoArrow encoding.");
|
|
@@ -6195,7 +5893,7 @@ function getGeoArrowRowBounds(column, encodingOrOptions) {
|
|
|
6195
5893
|
if (encoding !== "geoarrow.wkb" && encoding !== "geoarrow.wkt") {
|
|
6196
5894
|
const names = encoding === "geoarrow.box" ? column.type.children.map((field) => field.name) : [];
|
|
6197
5895
|
const dimension = encoding === "geoarrow.box" ? names.includes("zmin") ? names.includes("mmin") ? "xyzm" : "xyz" : names.includes("mmin") ? "xym" : "xy" : void 0;
|
|
6198
|
-
return (0,
|
|
5896
|
+
return (0, import_arrow12.getGeoArrowRowBounds)((0, import_arrow11.makeGeoArrowColumnFromArrowVector)(column, { encoding, dimension }));
|
|
6199
5897
|
}
|
|
6200
5898
|
const bounds = [];
|
|
6201
5899
|
for (let rowIndex = 0; rowIndex < column.length; rowIndex++) {
|
|
@@ -6208,7 +5906,7 @@ function getGeoArrowBounds(value, encoding) {
|
|
|
6208
5906
|
return null;
|
|
6209
5907
|
if (encoding === "geoarrow.wkb") {
|
|
6210
5908
|
const bytes = value;
|
|
6211
|
-
const statistics = (0,
|
|
5909
|
+
const statistics = (0, import_arrow10.scanWKB)(bytes);
|
|
6212
5910
|
return statistics.bounds ? [
|
|
6213
5911
|
statistics.bounds.xmin,
|
|
6214
5912
|
statistics.bounds.ymin,
|
|
@@ -6236,7 +5934,7 @@ function visitCoordinates(value, bounds) {
|
|
|
6236
5934
|
updateBounds2(bounds, coordinate[0], coordinate[1]);
|
|
6237
5935
|
return;
|
|
6238
5936
|
}
|
|
6239
|
-
if (
|
|
5937
|
+
if (isVectorLike3(value)) {
|
|
6240
5938
|
for (let index = 0; index < value.length; index++)
|
|
6241
5939
|
visitCoordinates(value.get(index), bounds);
|
|
6242
5940
|
return;
|
|
@@ -6266,7 +5964,7 @@ function isBoxValue(value) {
|
|
|
6266
5964
|
function getNumericCoordinate(value) {
|
|
6267
5965
|
return typeof value[0] === "number" && typeof value[1] === "number" ? [value[0], value[1]] : null;
|
|
6268
5966
|
}
|
|
6269
|
-
function
|
|
5967
|
+
function isVectorLike3(value) {
|
|
6270
5968
|
return Boolean(value && typeof value.length === "number" && typeof value.get === "function");
|
|
6271
5969
|
}
|
|
6272
5970
|
function updateBounds2(bounds, x, y) {
|
|
@@ -6763,18 +6461,18 @@ var ClusterSource = class extends DataSource {
|
|
|
6763
6461
|
super(data, {});
|
|
6764
6462
|
const positions = [];
|
|
6765
6463
|
const rowIndices = [];
|
|
6766
|
-
if (
|
|
6767
|
-
const columns = getGeometryColumnsFromSchema(data.
|
|
6464
|
+
if (!("shape" in data)) {
|
|
6465
|
+
const columns = getGeometryColumnsFromSchema(data.schema);
|
|
6768
6466
|
const columnNames = Object.keys(columns);
|
|
6769
6467
|
this.geometryColumn = options.geometryColumn ?? (columnNames.length === 1 ? columnNames[0] : void 0);
|
|
6770
6468
|
this.geometryEncoding = this.geometryColumn ? (_a = columns[this.geometryColumn]) == null ? void 0 : _a.encoding : void 0;
|
|
6771
|
-
if (!this.geometryColumn || !this.geometryEncoding || !data.
|
|
6469
|
+
if (!this.geometryColumn || !this.geometryEncoding || !data.getChild(this.geometryColumn)) {
|
|
6772
6470
|
throw new Error("ClusterSource requires an explicitly identified GeoArrow geometry column");
|
|
6773
6471
|
}
|
|
6774
6472
|
}
|
|
6775
|
-
const geometryVector =
|
|
6473
|
+
const geometryVector = !("shape" in data) ? data.getChild(this.geometryColumn) : null;
|
|
6776
6474
|
const pointBounds = geometryVector && this.geometryEncoding === "geoarrow.point" && !options.getClusterPosition ? getGeoArrowRowBounds(geometryVector, this.geometryEncoding) : null;
|
|
6777
|
-
const rowCount =
|
|
6475
|
+
const rowCount = !("shape" in data) ? data.numRows : data.features.length;
|
|
6778
6476
|
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
6779
6477
|
let position;
|
|
6780
6478
|
if (pointBounds) {
|
|
@@ -6794,10 +6492,10 @@ var ClusterSource = class extends DataSource {
|
|
|
6794
6492
|
if (["cluster", "clusterId", "pointCount", "rowIndex", "geometry"].includes(name)) {
|
|
6795
6493
|
throw new Error(`Reserved cluster property: ${name}`);
|
|
6796
6494
|
}
|
|
6797
|
-
const column =
|
|
6495
|
+
const column = !("shape" in data) ? data.getChild(aggregation.column) : null;
|
|
6798
6496
|
const values = rowIndices.map((rowIndex) => {
|
|
6799
6497
|
var _a2;
|
|
6800
|
-
const value =
|
|
6498
|
+
const value = !("shape" in data) ? column == null ? void 0 : column.get(rowIndex) : (_a2 = data.features[rowIndex].properties) == null ? void 0 : _a2[aggregation.column];
|
|
6801
6499
|
if (typeof value !== "number" || !Number.isFinite(value))
|
|
6802
6500
|
throw new Error(`Cluster aggregation ${name} requires finite numeric values`);
|
|
6803
6501
|
return value;
|
|
@@ -6871,27 +6569,24 @@ var ClusterSource = class extends DataSource {
|
|
|
6871
6569
|
const table = builder.finishTable();
|
|
6872
6570
|
const preference = (_b = parameters.geoarrow) == null ? void 0 : _b.encodingPreference;
|
|
6873
6571
|
if (preference && preference !== "geoarrow.wkb") {
|
|
6874
|
-
return
|
|
6875
|
-
shape: "arrow-table",
|
|
6876
|
-
data: convertGeoArrowGeometry(table.data, preference === "optimized" ? "geoarrow.point" : "geoarrow.geometry")
|
|
6877
|
-
};
|
|
6572
|
+
return convertGeoArrowGeometry(table, preference === "optimized" ? "geoarrow.point" : "geoarrow.geometry");
|
|
6878
6573
|
}
|
|
6879
6574
|
return table;
|
|
6880
6575
|
}
|
|
6881
6576
|
/** Retrieves a member's original geometry and properties; Arrow rows are materialized on demand. */
|
|
6882
6577
|
getFeature(rowIndex) {
|
|
6883
|
-
const rowCount = this.data
|
|
6578
|
+
const rowCount = !("shape" in this.data) ? this.data.numRows : this.data.features.length;
|
|
6884
6579
|
if (!Number.isInteger(rowIndex) || rowIndex < 0 || rowIndex >= rowCount)
|
|
6885
6580
|
throw new Error("Invalid cluster source row");
|
|
6886
|
-
if (this.data
|
|
6581
|
+
if ("shape" in this.data)
|
|
6887
6582
|
return this.data.features[rowIndex];
|
|
6888
|
-
const properties = { ...this.data.
|
|
6583
|
+
const properties = { ...this.data.get(rowIndex).toJSON() };
|
|
6889
6584
|
delete properties[this.geometryColumn];
|
|
6890
6585
|
return { type: "Feature", geometry: this.getGeometry(rowIndex), properties };
|
|
6891
6586
|
}
|
|
6892
6587
|
/** Decodes one geometry only when extraction or member retrieval needs it. */
|
|
6893
6588
|
getGeometry(rowIndex) {
|
|
6894
|
-
return this.data
|
|
6589
|
+
return "shape" in this.data ? this.data.features[rowIndex].geometry : convertGeoArrowVectorCellToGeoJSON(this.data.getChild(this.geometryColumn), rowIndex, this.geometryEncoding);
|
|
6895
6590
|
}
|
|
6896
6591
|
};
|
|
6897
6592
|
function createClusterFeature(node) {
|