@loaders.gl/core 5.0.0-beta.8 → 5.0.0-rc.2
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 +10 -10
- package/SCHEMA-UTILS-README.md +1 -1
- package/dist/arrow-geometry/binary-features.cjs +6 -3
- 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 +2 -2
- 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 +4 -2
- 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 +4 -2
- package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js.map +1 -1
- package/dist/arrow-geometry/legacy-binary/convert-geojson-to-flat-geojson.cjs +2 -2
- package/dist/arrow-geometry/legacy-binary/convert-geojson-to-flat-geojson.cjs.map +2 -2
- package/dist/arrow-geometry/legacy-binary/convert-geojson-to-flat-geojson.js +1 -1
- package/dist/arrow-geometry/legacy-binary/convert-geojson-to-flat-geojson.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 +201 -506
- package/dist/cluster-source.cjs.map +3 -3
- package/dist/dist.dev.js +269 -228
- package/dist/dist.min.js +3 -3
- package/dist/federated-table-scan-source.cjs +174 -627
- 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 +7 -4
- 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 +3 -3
- 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 +261 -207
- 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 +44 -14
- 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 +7 -7
- 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 +160 -68
- 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 +7 -2
- 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/tile-source-adapter.js +1 -1
- package/dist/loader-utils/lib/sources/tile-source-adapter.js.map +1 -1
- package/dist/loader-utils/lib/sources/tile-source.d.ts +1 -1
- package/dist/loader-utils/lib/sources/tile-source.d.ts.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 +25 -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 +24 -12
- 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 +196 -0
- package/dist/scan/query-scales.cjs.map +7 -0
- package/dist/scan/query-scales.d.ts +48 -0
- package/dist/scan/query-scales.d.ts.map +1 -0
- package/dist/scan/query-scales.js +202 -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 +6 -6
- package/dist/scan/scan-engine.d.ts.map +1 -1
- package/dist/scan/scan-engine.js +2 -2
- package/dist/scan/scan-engine.js.map +1 -1
- package/dist/scan/sql-predicate-schema.cjs +10 -94
- package/dist/scan/sql-predicate-schema.cjs.map +3 -3
- package/dist/scan/sql-predicate-schema.d.ts +1 -1
- package/dist/scan/sql-predicate-schema.d.ts.map +1 -1
- package/dist/scan/sql-predicate-schema.js +9 -103
- package/dist/scan/sql-predicate-schema.js.map +1 -1
- package/dist/scan/sql-predicate-zod.cjs.map +1 -1
- package/dist/scan/sql-predicate-zod.d.ts +1 -1
- package/dist/scan/sql-predicate-zod.js +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 +249 -388
- package/dist/vector-table-scan-source.cjs.map +3 -3
- 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 +33 -9
- 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 +8 -2
- 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 +42 -8
- 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 +38 -29
- package/src/arrow-geometry/binary-features.ts +5 -2
- 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 +4 -2
- package/src/arrow-geometry/legacy-binary/convert-geojson-to-flat-geojson.ts +1 -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 +6 -3
- 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 +53 -28
- 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 +8 -8
- 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 +39 -19
- package/src/loader-utils/lib/sources/tile-source-adapter.ts +1 -1
- package/src/loader-utils/lib/sources/tile-source.ts +1 -1
- 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 +29 -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 +298 -0
- package/src/scan/query.ts +210 -165
- package/src/scan/rows-to-arrow.ts +3 -39
- package/src/scan/scan-engine.ts +8 -8
- package/src/scan/sql-predicate-schema.ts +14 -125
- package/src/scan/sql-predicate-zod.ts +1 -1
- package/src/scan/vector-table-scan-source.ts +25 -26
- package/src/schema/categories/category-mesh.ts +3 -11
- package/src/schema/categories/category-table.ts +2 -28
- package/src/schema/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 +46 -10
- 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
|
@@ -1,224 +0,0 @@
|
|
|
1
|
-
// loaders.gl
|
|
2
|
-
// SPDX-License-Identifier: MIT
|
|
3
|
-
// Copyright (c) vis.gl contributors
|
|
4
|
-
import * as arrow from 'apache-arrow';
|
|
5
|
-
import { getGeoArrowUnionGeometryKind } from "./geoarrow-union-kind.js";
|
|
6
|
-
export { getGeoArrowUnionGeometryKind } from "./geoarrow-union-kind.js";
|
|
7
|
-
/**
|
|
8
|
-
* Reads one native GeoArrow row into a geometry-family tagged coordinate value.
|
|
9
|
-
*
|
|
10
|
-
* The result omits GeoJSON properties and preserves native coordinate nesting so callers can
|
|
11
|
-
* process geometry without creating GeoJSON feature objects. Dense unions and spec-conforming
|
|
12
|
-
* GeometryCollections are decoded recursively.
|
|
13
|
-
*
|
|
14
|
-
* @param column Native GeoArrow vector.
|
|
15
|
-
* @param rowIndex Logical row index.
|
|
16
|
-
* @param encoding Declared GeoArrow encoding.
|
|
17
|
-
* @param maximumDepth Maximum nested GeometryCollection depth.
|
|
18
|
-
* @returns Native geometry or `null` for a null/unsupported row.
|
|
19
|
-
*/
|
|
20
|
-
export function getGeoArrowNativeGeometry(column, rowIndex, encoding, maximumDepth = 64) {
|
|
21
|
-
if (rowIndex < 0 || rowIndex >= column.length || encoding === 'geoarrow.box')
|
|
22
|
-
return null;
|
|
23
|
-
if (encoding === 'geoarrow.geometry') {
|
|
24
|
-
const unionCell = getUnionCell(column, rowIndex);
|
|
25
|
-
return unionCell ? readUnionGeometry(unionCell, maximumDepth, 0) : null;
|
|
26
|
-
}
|
|
27
|
-
if (encoding === 'geoarrow.geometrycollection') {
|
|
28
|
-
const value = column.get(rowIndex);
|
|
29
|
-
return value == null
|
|
30
|
-
? null
|
|
31
|
-
: { type: 'GeometryCollection', geometries: readCollectionVector(value, maximumDepth, 0) };
|
|
32
|
-
}
|
|
33
|
-
if (!isNativeEncoding(encoding))
|
|
34
|
-
return null;
|
|
35
|
-
const coordinates = readNativeCoordinates(column.get(rowIndex), getEncodingDepth(encoding));
|
|
36
|
-
return coordinates ? makeConcreteGeometry(encoding, coordinates) : null;
|
|
37
|
-
}
|
|
38
|
-
/** Converts one concrete native encoding and coordinate nesting to a tagged geometry value. */
|
|
39
|
-
function makeConcreteGeometry(encoding, coordinates) {
|
|
40
|
-
switch (encoding) {
|
|
41
|
-
case 'geoarrow.point':
|
|
42
|
-
return { type: 'Point', coordinates: coordinates };
|
|
43
|
-
case 'geoarrow.multipoint':
|
|
44
|
-
return { type: 'MultiPoint', coordinates: coordinates };
|
|
45
|
-
case 'geoarrow.linestring':
|
|
46
|
-
return { type: 'LineString', coordinates: coordinates };
|
|
47
|
-
case 'geoarrow.multilinestring':
|
|
48
|
-
return { type: 'MultiLineString', coordinates: coordinates };
|
|
49
|
-
case 'geoarrow.polygon':
|
|
50
|
-
return { type: 'Polygon', coordinates: coordinates };
|
|
51
|
-
case 'geoarrow.multipolygon':
|
|
52
|
-
return { type: 'MultiPolygon', coordinates: coordinates };
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
/** Reads an Arrow native value recursively at the encoding's list depth. */
|
|
56
|
-
function readNativeCoordinates(value, depth) {
|
|
57
|
-
if (value == null)
|
|
58
|
-
return null;
|
|
59
|
-
if (depth === 0)
|
|
60
|
-
return readCoordinate(value);
|
|
61
|
-
const children = readChildren(value);
|
|
62
|
-
if (!children)
|
|
63
|
-
return null;
|
|
64
|
-
const coordinates = [];
|
|
65
|
-
for (const child of children) {
|
|
66
|
-
const parsed = readNativeCoordinates(child, depth - 1);
|
|
67
|
-
if (!parsed)
|
|
68
|
-
return null;
|
|
69
|
-
coordinates.push(parsed);
|
|
70
|
-
}
|
|
71
|
-
return coordinates;
|
|
72
|
-
}
|
|
73
|
-
/** Reads interleaved or separated coordinate values by position. */
|
|
74
|
-
function readCoordinate(value) {
|
|
75
|
-
if (value && typeof value === 'object' && 'x' in value && 'y' in value) {
|
|
76
|
-
const coordinate = value;
|
|
77
|
-
const values = [coordinate.x, coordinate.y];
|
|
78
|
-
if (typeof coordinate.z === 'number')
|
|
79
|
-
values.push(coordinate.z);
|
|
80
|
-
if (typeof coordinate.m === 'number')
|
|
81
|
-
values.push(coordinate.m);
|
|
82
|
-
return values.every(item => typeof item === 'number') ? values : null;
|
|
83
|
-
}
|
|
84
|
-
if (value && typeof value.toArray === 'function') {
|
|
85
|
-
return readCoordinate(value.toArray());
|
|
86
|
-
}
|
|
87
|
-
if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
|
88
|
-
const values = Array.from(value);
|
|
89
|
-
return values.every(item => typeof item === 'number') ? values : null;
|
|
90
|
-
}
|
|
91
|
-
return null;
|
|
92
|
-
}
|
|
93
|
-
/** Reads list children from Arrow values and vectors. */
|
|
94
|
-
function readChildren(value) {
|
|
95
|
-
if (value && typeof value.toArray === 'function') {
|
|
96
|
-
return Array.from(value.toArray());
|
|
97
|
-
}
|
|
98
|
-
if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
|
99
|
-
return Array.from(value);
|
|
100
|
-
}
|
|
101
|
-
if (isVectorLike(value)) {
|
|
102
|
-
const children = [];
|
|
103
|
-
for (let index = 0; index < value.length; index++)
|
|
104
|
-
children.push(value.get(index));
|
|
105
|
-
return children;
|
|
106
|
-
}
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
/** Resolves a dense-union cell from full or sliced Arrow buffers. */
|
|
110
|
-
function getUnionCell(column, rowIndex) {
|
|
111
|
-
const unionType = column.type;
|
|
112
|
-
if (!(unionType instanceof arrow.DenseUnion))
|
|
113
|
-
return null;
|
|
114
|
-
let remainingRowIndex = rowIndex;
|
|
115
|
-
for (const chunk of column.data) {
|
|
116
|
-
if (remainingRowIndex >= chunk.length) {
|
|
117
|
-
remainingRowIndex -= chunk.length;
|
|
118
|
-
continue;
|
|
119
|
-
}
|
|
120
|
-
const bufferIndex = chunk.typeIds.length <= chunk.length ? remainingRowIndex : chunk.offset + remainingRowIndex;
|
|
121
|
-
const typeId = chunk.typeIds?.[bufferIndex];
|
|
122
|
-
const valueOffset = chunk.valueOffsets?.[bufferIndex];
|
|
123
|
-
const childIndex = unionType.typeIds.indexOf(typeId);
|
|
124
|
-
const child = childIndex >= 0 ? chunk.children[childIndex] : undefined;
|
|
125
|
-
const childField = childIndex >= 0 ? unionType.children[childIndex] : undefined;
|
|
126
|
-
if (!child ||
|
|
127
|
-
!childField ||
|
|
128
|
-
valueOffset === undefined ||
|
|
129
|
-
valueOffset < 0 ||
|
|
130
|
-
valueOffset >= child.length) {
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
const childVector = arrow.makeVector(child);
|
|
134
|
-
return {
|
|
135
|
-
childName: childField.name,
|
|
136
|
-
typeId,
|
|
137
|
-
value: childVector.get(valueOffset)
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
return null;
|
|
141
|
-
}
|
|
142
|
-
/** Reads one union cell, including GeometryCollection children. */
|
|
143
|
-
function readUnionGeometry(cell, maximumDepth, depth) {
|
|
144
|
-
const unionGeometry = getGeoArrowUnionGeometryKind(cell.childName, cell.typeId);
|
|
145
|
-
if (unionGeometry === 'GeometryCollection') {
|
|
146
|
-
if (depth >= maximumDepth) {
|
|
147
|
-
throw new Error(`GeometryCollection nesting exceeds maxGeometryCollectionDepth (${maximumDepth}).`);
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
type: 'GeometryCollection',
|
|
151
|
-
geometries: readCollectionVector(cell.value, maximumDepth, depth + 1)
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
const encoding = getEncodingForUnionGeometry(unionGeometry);
|
|
155
|
-
if (!encoding)
|
|
156
|
-
return null;
|
|
157
|
-
const coordinates = readNativeCoordinates(cell.value, getEncodingDepth(encoding));
|
|
158
|
-
return coordinates ? makeConcreteGeometry(encoding, coordinates) : null;
|
|
159
|
-
}
|
|
160
|
-
/** Maps a resolved union family to its native encoding. */
|
|
161
|
-
function getEncodingForUnionGeometry(geometryFamily) {
|
|
162
|
-
switch (geometryFamily) {
|
|
163
|
-
case 'Point':
|
|
164
|
-
return 'geoarrow.point';
|
|
165
|
-
case 'LineString':
|
|
166
|
-
return 'geoarrow.linestring';
|
|
167
|
-
case 'Polygon':
|
|
168
|
-
return 'geoarrow.polygon';
|
|
169
|
-
case 'MultiPoint':
|
|
170
|
-
return 'geoarrow.multipoint';
|
|
171
|
-
case 'MultiLineString':
|
|
172
|
-
return 'geoarrow.multilinestring';
|
|
173
|
-
case 'MultiPolygon':
|
|
174
|
-
return 'geoarrow.multipolygon';
|
|
175
|
-
default:
|
|
176
|
-
return null;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
/** Reads all members of a GeometryCollection union vector. */
|
|
180
|
-
function readCollectionVector(value, maximumDepth, depth) {
|
|
181
|
-
if (!isVectorLike(value))
|
|
182
|
-
return [];
|
|
183
|
-
const geometries = [];
|
|
184
|
-
for (let rowIndex = 0; rowIndex < value.length; rowIndex++) {
|
|
185
|
-
const cell = getUnionCell(value, rowIndex);
|
|
186
|
-
if (!cell)
|
|
187
|
-
continue;
|
|
188
|
-
const geometry = readUnionGeometry(cell, maximumDepth, depth);
|
|
189
|
-
if (geometry)
|
|
190
|
-
geometries.push(geometry);
|
|
191
|
-
}
|
|
192
|
-
return geometries;
|
|
193
|
-
}
|
|
194
|
-
/** Resolves native nesting depth from a concrete encoding. */
|
|
195
|
-
function getEncodingDepth(encoding) {
|
|
196
|
-
switch (encoding) {
|
|
197
|
-
case 'geoarrow.point':
|
|
198
|
-
return 0;
|
|
199
|
-
case 'geoarrow.linestring':
|
|
200
|
-
case 'geoarrow.multipoint':
|
|
201
|
-
return 1;
|
|
202
|
-
case 'geoarrow.polygon':
|
|
203
|
-
case 'geoarrow.multilinestring':
|
|
204
|
-
return 2;
|
|
205
|
-
case 'geoarrow.multipolygon':
|
|
206
|
-
return 3;
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
/** Checks whether an encoding is a concrete native geometry encoding. */
|
|
210
|
-
function isNativeEncoding(encoding) {
|
|
211
|
-
return (encoding === 'geoarrow.point' ||
|
|
212
|
-
encoding === 'geoarrow.linestring' ||
|
|
213
|
-
encoding === 'geoarrow.polygon' ||
|
|
214
|
-
encoding === 'geoarrow.multipoint' ||
|
|
215
|
-
encoding === 'geoarrow.multilinestring' ||
|
|
216
|
-
encoding === 'geoarrow.multipolygon');
|
|
217
|
-
}
|
|
218
|
-
/** Detects Arrow vectors returned for nested list or union values. */
|
|
219
|
-
function isVectorLike(value) {
|
|
220
|
-
return Boolean(value &&
|
|
221
|
-
typeof value.length === 'number' &&
|
|
222
|
-
typeof value.get === 'function');
|
|
223
|
-
}
|
|
224
|
-
//# sourceMappingURL=native-geometry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"native-geometry.js","sourceRoot":"","sources":["../../src/arrow-geometry/native-geometry.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAC,4BAA4B,EAAiC,iCAA8B;AAEnG,OAAO,EAAC,4BAA4B,EAAiC,iCAA8B;AAsBnG;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,yBAAyB,CACvC,MAAoB,EACpB,QAAgB,EAChB,QAA0B,EAC1B,YAAY,GAAG,EAAE;IAEjB,IAAI,QAAQ,GAAG,CAAC,IAAI,QAAQ,IAAI,MAAM,CAAC,MAAM,IAAI,QAAQ,KAAK,cAAc;QAAE,OAAO,IAAI,CAAC;IAC1F,IAAI,QAAQ,KAAK,mBAAmB,EAAE,CAAC;QACrC,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACjD,OAAO,SAAS,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,EAAE,YAAY,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1E,CAAC;IACD,IAAI,QAAQ,KAAK,6BAA6B,EAAE,CAAC;QAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACnC,OAAO,KAAK,IAAI,I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Q,KAAK,qBAAqB;QAClC,QAAQ,KAAK,0BAA0B;QACvC,QAAQ,KAAK,uBAAuB,CACrC,CAAC;AACJ,CAAC;AAED,sEAAsE;AACtE,SAAS,YAAY,CAAC,KAAc;IAClC,OAAO,OAAO,CACZ,KAAK;QACH,OAAQ,KAA4B,CAAC,MAAM,KAAK,QAAQ;QACxD,OAAQ,KAAyB,CAAC,GAAG,KAAK,UAAU,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/geoarrow/get-geoarrow-native-geometry.ts"],
|
|
4
|
-
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nexport {\n getGeoArrowNativeGeometry,\n type GeoArrowNativeGeometry\n} from '@loaders.gl/core/arrow-geometry/native-geometry';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,6BAGO;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-geoarrow-native-geometry.d.ts","sourceRoot":"","sources":["../../src/geoarrow/get-geoarrow-native-geometry.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,yBAAyB,EACzB,KAAK,sBAAsB,EAC5B,MAAM,iDAAiD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-geoarrow-native-geometry.js","sourceRoot":"","sources":["../../src/geoarrow/get-geoarrow-native-geometry.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,OAAO,EACL,yBAAyB,EAE1B,MAAM,iDAAiD,CAAC"}
|
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
|
|
30
|
-
// src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts
|
|
31
|
-
var encode_geoarrow_wkt_exports = {};
|
|
32
|
-
__export(encode_geoarrow_wkt_exports, {
|
|
33
|
-
encodeGeoArrowWKTVector: () => encodeGeoArrowWKTVector
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(encode_geoarrow_wkt_exports);
|
|
36
|
-
var arrow = __toESM(require("apache-arrow"), 1);
|
|
37
|
-
var import_geoarrow_union = require("./geoarrow-union.cjs");
|
|
38
|
-
function encodeGeoArrowWKTVector(column, sourceEncoding, dimension) {
|
|
39
|
-
if (!isNativeGeometryEncoding(sourceEncoding)) return null;
|
|
40
|
-
const values = [];
|
|
41
|
-
for (let rowIndex = 0; rowIndex < column.length; rowIndex++) {
|
|
42
|
-
const value = column.get(rowIndex);
|
|
43
|
-
if (value == null) {
|
|
44
|
-
values.push(null);
|
|
45
|
-
continue;
|
|
46
|
-
}
|
|
47
|
-
const geometryKind = getRowGeometryKind(column, rowIndex, sourceEncoding);
|
|
48
|
-
const rowDimension = dimension || (sourceEncoding === "geoarrow.geometrycollection" ? inferCollectionDimension(value) : inferDimensionFromTypeId(column, rowIndex, sourceEncoding));
|
|
49
|
-
const wkt = encodeNativeValue(value, geometryKind, rowDimension, !dimension);
|
|
50
|
-
if (wkt === null) return null;
|
|
51
|
-
values.push(wkt);
|
|
52
|
-
}
|
|
53
|
-
return arrow.vectorFromArray(values, new arrow.Utf8());
|
|
54
|
-
}
|
|
55
|
-
function isNativeGeometryEncoding(encoding) {
|
|
56
|
-
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";
|
|
57
|
-
}
|
|
58
|
-
function encodeNativeValue(value, geometryKind, dimension, preserveMemberDimensions = false) {
|
|
59
|
-
switch (geometryKind) {
|
|
60
|
-
case "Point":
|
|
61
|
-
return encodePoint(value, dimension);
|
|
62
|
-
case "LineString":
|
|
63
|
-
return encodeLineString(value, dimension);
|
|
64
|
-
case "Polygon":
|
|
65
|
-
return encodePolygon(value, dimension);
|
|
66
|
-
case "MultiPoint":
|
|
67
|
-
return encodeMultiPoint(value, dimension);
|
|
68
|
-
case "MultiLineString":
|
|
69
|
-
return encodeMultiLineString(value, dimension);
|
|
70
|
-
case "MultiPolygon":
|
|
71
|
-
return encodeMultiPolygon(value, dimension);
|
|
72
|
-
case "GeometryCollection":
|
|
73
|
-
return encodeGeometryCollection(value, dimension, preserveMemberDimensions);
|
|
74
|
-
default:
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
function encodePoint(value, dimension) {
|
|
79
|
-
const coordinate = readCoordinate(value);
|
|
80
|
-
return coordinate ? `POINT${getDimensionSuffix(dimension)} (${encodeCoordinate(coordinate)})` : "POINT EMPTY";
|
|
81
|
-
}
|
|
82
|
-
function encodeLineString(value, dimension) {
|
|
83
|
-
const coordinates = readChildren(value);
|
|
84
|
-
if (!coordinates) return null;
|
|
85
|
-
const encodedCoordinates = encodeCoordinateSequence(coordinates);
|
|
86
|
-
if (encodedCoordinates === null) return null;
|
|
87
|
-
return coordinates.length === 0 ? `LINESTRING${getDimensionSuffix(dimension)} EMPTY` : `LINESTRING${getDimensionSuffix(dimension)} (${encodedCoordinates})`;
|
|
88
|
-
}
|
|
89
|
-
function encodePolygon(value, dimension) {
|
|
90
|
-
const rings = readChildren(value);
|
|
91
|
-
if (!rings) return null;
|
|
92
|
-
if (rings.length === 0) return `POLYGON${getDimensionSuffix(dimension)} EMPTY`;
|
|
93
|
-
const encodedRings = rings.map((ring) => encodeCoordinateSequenceValue(ring));
|
|
94
|
-
if (encodedRings.some((encodedRing) => encodedRing === null)) return null;
|
|
95
|
-
return `POLYGON${getDimensionSuffix(dimension)} (${encodedRings.join(", ")})`;
|
|
96
|
-
}
|
|
97
|
-
function encodeMultiPoint(value, dimension) {
|
|
98
|
-
const points = readChildren(value);
|
|
99
|
-
if (!points) return null;
|
|
100
|
-
if (points.length === 0) return `MULTIPOINT${getDimensionSuffix(dimension)} EMPTY`;
|
|
101
|
-
const encodedPoints = points.map((point) => {
|
|
102
|
-
const coordinate = readCoordinate(point);
|
|
103
|
-
return coordinate ? `(${encodeCoordinate(coordinate)})` : null;
|
|
104
|
-
});
|
|
105
|
-
if (encodedPoints.some((encodedPoint) => encodedPoint === null)) return null;
|
|
106
|
-
return `MULTIPOINT${getDimensionSuffix(dimension)} (${encodedPoints.join(", ")})`;
|
|
107
|
-
}
|
|
108
|
-
function encodeMultiLineString(value, dimension) {
|
|
109
|
-
const lines = readChildren(value);
|
|
110
|
-
if (!lines) return null;
|
|
111
|
-
if (lines.length === 0) return `MULTILINESTRING${getDimensionSuffix(dimension)} EMPTY`;
|
|
112
|
-
const encodedLines = lines.map((line) => encodeCoordinateSequenceValue(line));
|
|
113
|
-
if (encodedLines.some((encodedLine) => encodedLine === null)) return null;
|
|
114
|
-
return `MULTILINESTRING${getDimensionSuffix(dimension)} (${encodedLines.join(", ")})`;
|
|
115
|
-
}
|
|
116
|
-
function encodeMultiPolygon(value, dimension) {
|
|
117
|
-
const polygons = readChildren(value);
|
|
118
|
-
if (!polygons) return null;
|
|
119
|
-
if (polygons.length === 0) return `MULTIPOLYGON${getDimensionSuffix(dimension)} EMPTY`;
|
|
120
|
-
const encodedPolygons = polygons.map((polygon) => {
|
|
121
|
-
const rings = readChildren(polygon);
|
|
122
|
-
if (!rings) return null;
|
|
123
|
-
const encodedRings = rings.map((ring) => encodeCoordinateSequenceValue(ring));
|
|
124
|
-
return encodedRings.some((encodedRing) => encodedRing === null) ? null : `(${encodedRings.join(", ")})`;
|
|
125
|
-
});
|
|
126
|
-
if (encodedPolygons.some((encodedPolygon) => encodedPolygon === null)) return null;
|
|
127
|
-
return `MULTIPOLYGON${getDimensionSuffix(dimension)} (${encodedPolygons.join(", ")})`;
|
|
128
|
-
}
|
|
129
|
-
function encodeGeometryCollection(value, dimension, preserveMemberDimensions) {
|
|
130
|
-
if (!isVectorLike(value)) return null;
|
|
131
|
-
const geometries = [];
|
|
132
|
-
for (let rowIndex = 0; rowIndex < value.length; rowIndex++) {
|
|
133
|
-
const unionVector = value;
|
|
134
|
-
const typeId = getUnionTypeId(unionVector, rowIndex);
|
|
135
|
-
const childField = getUnionField(unionVector, rowIndex);
|
|
136
|
-
const geometryKind = (0, import_geoarrow_union.getGeoArrowUnionGeometryKind)(
|
|
137
|
-
childField?.name,
|
|
138
|
-
typeId
|
|
139
|
-
);
|
|
140
|
-
const childDimension = (0, import_geoarrow_union.getGeoArrowUnionDimension)(childField?.name, childField?.type, typeId);
|
|
141
|
-
if (!geometryKind || !childDimension) return null;
|
|
142
|
-
const geometry = encodeNativeValue(
|
|
143
|
-
unionVector.get(rowIndex),
|
|
144
|
-
geometryKind,
|
|
145
|
-
preserveMemberDimensions ? childDimension : dimension,
|
|
146
|
-
preserveMemberDimensions
|
|
147
|
-
);
|
|
148
|
-
if (geometry === null) return null;
|
|
149
|
-
geometries.push(geometry);
|
|
150
|
-
}
|
|
151
|
-
return geometries.length === 0 ? "GEOMETRYCOLLECTION EMPTY" : `GEOMETRYCOLLECTION (${geometries.join(", ")})`;
|
|
152
|
-
}
|
|
153
|
-
function encodeCoordinateSequenceValue(value) {
|
|
154
|
-
const coordinates = readChildren(value);
|
|
155
|
-
if (!coordinates) return null;
|
|
156
|
-
const encodedCoordinates = encodeCoordinateSequence(coordinates);
|
|
157
|
-
return encodedCoordinates === null ? null : `(${encodedCoordinates})`;
|
|
158
|
-
}
|
|
159
|
-
function encodeCoordinateSequence(values) {
|
|
160
|
-
const coordinates = values.map((value) => {
|
|
161
|
-
const coordinate = readCoordinate(value);
|
|
162
|
-
return coordinate ? encodeCoordinate(coordinate) : null;
|
|
163
|
-
});
|
|
164
|
-
return coordinates.every((coordinate) => coordinate !== null) ? coordinates.join(", ") : null;
|
|
165
|
-
}
|
|
166
|
-
function encodeCoordinate(coordinate) {
|
|
167
|
-
return coordinate.map((value) => String(value)).join(" ");
|
|
168
|
-
}
|
|
169
|
-
function readCoordinate(value) {
|
|
170
|
-
if (value && typeof value === "object" && "x" in value && "y" in value) {
|
|
171
|
-
const record = value;
|
|
172
|
-
const coordinate = [Number(record.x), Number(record.y)];
|
|
173
|
-
if (typeof record.z === "number") coordinate.push(record.z);
|
|
174
|
-
if (typeof record.m === "number") coordinate.push(record.m);
|
|
175
|
-
return coordinate.every(Number.isFinite) ? coordinate : null;
|
|
176
|
-
}
|
|
177
|
-
if (value && typeof value.toArray === "function") {
|
|
178
|
-
return readCoordinate(value.toArray());
|
|
179
|
-
}
|
|
180
|
-
if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
|
181
|
-
const coordinate = Array.from(value, Number);
|
|
182
|
-
return coordinate.length >= 2 && coordinate.every(Number.isFinite) ? coordinate : null;
|
|
183
|
-
}
|
|
184
|
-
return null;
|
|
185
|
-
}
|
|
186
|
-
function readChildren(value) {
|
|
187
|
-
if (isVectorLike(value)) {
|
|
188
|
-
const children = [];
|
|
189
|
-
for (let index = 0; index < value.length; index++) children.push(value.get(index));
|
|
190
|
-
return children;
|
|
191
|
-
}
|
|
192
|
-
if (Array.isArray(value) || ArrayBuffer.isView(value)) {
|
|
193
|
-
return Array.from(value);
|
|
194
|
-
}
|
|
195
|
-
return null;
|
|
196
|
-
}
|
|
197
|
-
function getUnionTypeId(vector, rowIndex) {
|
|
198
|
-
let remainingRowIndex = rowIndex;
|
|
199
|
-
for (const data of vector.data) {
|
|
200
|
-
if (remainingRowIndex >= data.length) {
|
|
201
|
-
remainingRowIndex -= data.length;
|
|
202
|
-
continue;
|
|
203
|
-
}
|
|
204
|
-
const typeIdIndex = data.typeIds.length <= data.length ? remainingRowIndex : data.offset + remainingRowIndex;
|
|
205
|
-
return data.typeIds[typeIdIndex];
|
|
206
|
-
}
|
|
207
|
-
throw new Error(`Dense union row ${rowIndex} is out of bounds.`);
|
|
208
|
-
}
|
|
209
|
-
function getUnionField(vector, rowIndex) {
|
|
210
|
-
const unionType = vector.type;
|
|
211
|
-
if (!(unionType instanceof arrow.DenseUnion)) return void 0;
|
|
212
|
-
const typeId = getUnionTypeId(vector, rowIndex);
|
|
213
|
-
const childIndex = unionType.typeIds.indexOf(typeId);
|
|
214
|
-
return childIndex >= 0 ? unionType.children[childIndex] : void 0;
|
|
215
|
-
}
|
|
216
|
-
function inferDimensionFromTypeId(column, rowIndex, sourceEncoding) {
|
|
217
|
-
if (sourceEncoding === "geoarrow.geometry") {
|
|
218
|
-
const typeId = getUnionTypeId(column, rowIndex);
|
|
219
|
-
const field = getUnionField(column, rowIndex);
|
|
220
|
-
return (0, import_geoarrow_union.getGeoArrowUnionDimension)(field?.name, field?.type, typeId) || "xy";
|
|
221
|
-
}
|
|
222
|
-
let type = column.type;
|
|
223
|
-
while (type instanceof arrow.List || type instanceof arrow.LargeList) {
|
|
224
|
-
type = type.children[0].type;
|
|
225
|
-
}
|
|
226
|
-
if (type instanceof arrow.Struct) {
|
|
227
|
-
const names = new Set(type.children.map((field) => field.name));
|
|
228
|
-
if (names.has("z") && names.has("m")) return "xyzm";
|
|
229
|
-
if (names.has("m")) return "xym";
|
|
230
|
-
if (names.has("z")) return "xyz";
|
|
231
|
-
}
|
|
232
|
-
if (type instanceof arrow.FixedSizeList) {
|
|
233
|
-
return type.listSize === 4 ? "xyzm" : type.listSize === 3 ? "xyz" : "xy";
|
|
234
|
-
}
|
|
235
|
-
return "xy";
|
|
236
|
-
}
|
|
237
|
-
function getRowGeometryKind(column, rowIndex, sourceEncoding) {
|
|
238
|
-
if (sourceEncoding === "geoarrow.geometry") {
|
|
239
|
-
const typeId = getUnionTypeId(column, rowIndex);
|
|
240
|
-
const field = getUnionField(column, rowIndex);
|
|
241
|
-
return (0, import_geoarrow_union.getGeoArrowUnionGeometryKind)(field?.name, typeId) || "GeometryCollection";
|
|
242
|
-
}
|
|
243
|
-
if (sourceEncoding === "geoarrow.geometrycollection") return "GeometryCollection";
|
|
244
|
-
return getGeometryKind(sourceEncoding);
|
|
245
|
-
}
|
|
246
|
-
function inferCollectionDimension(value) {
|
|
247
|
-
if (!isVectorLike(value)) return "xy";
|
|
248
|
-
const vector = value;
|
|
249
|
-
if (vector.length > 0) {
|
|
250
|
-
const typeId = getUnionTypeId(vector, 0);
|
|
251
|
-
const field = getUnionField(vector, 0);
|
|
252
|
-
return (0, import_geoarrow_union.getGeoArrowUnionDimension)(field?.name, field?.type, typeId) || "xy";
|
|
253
|
-
}
|
|
254
|
-
return "xy";
|
|
255
|
-
}
|
|
256
|
-
function getGeometryKind(encoding) {
|
|
257
|
-
switch (encoding) {
|
|
258
|
-
case "geoarrow.point":
|
|
259
|
-
return "Point";
|
|
260
|
-
case "geoarrow.linestring":
|
|
261
|
-
return "LineString";
|
|
262
|
-
case "geoarrow.polygon":
|
|
263
|
-
return "Polygon";
|
|
264
|
-
case "geoarrow.multipoint":
|
|
265
|
-
return "MultiPoint";
|
|
266
|
-
case "geoarrow.multilinestring":
|
|
267
|
-
return "MultiLineString";
|
|
268
|
-
case "geoarrow.multipolygon":
|
|
269
|
-
return "MultiPolygon";
|
|
270
|
-
case "geoarrow.geometry":
|
|
271
|
-
return "GeometryCollection";
|
|
272
|
-
case "geoarrow.geometrycollection":
|
|
273
|
-
return "GeometryCollection";
|
|
274
|
-
default:
|
|
275
|
-
throw new Error(`Unsupported native WKT encoding "${encoding}".`);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
function getDimensionSuffix(dimension) {
|
|
279
|
-
return dimension === "xy" ? "" : dimension === "xyzm" ? " ZM" : ` ${dimension.slice(2).toUpperCase()}`;
|
|
280
|
-
}
|
|
281
|
-
function isVectorLike(value) {
|
|
282
|
-
return Boolean(
|
|
283
|
-
value && typeof value.length === "number" && typeof value.get === "function"
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
287
|
-
0 && (module.exports = {
|
|
288
|
-
encodeGeoArrowWKTVector
|
|
289
|
-
});
|
|
290
|
-
//# sourceMappingURL=encode-geoarrow-wkt.cjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts"],
|
|
4
|
-
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport * as arrow from 'apache-arrow';\nimport type {GeoArrowDimension, GeoArrowEncoding} from '@loaders.gl/core/schema';\nimport {getGeoArrowUnionDimension, getGeoArrowUnionGeometryKind} from './geoarrow-union';\n\ntype GeometryKind =\n | 'Point'\n | 'LineString'\n | 'Polygon'\n | 'MultiPoint'\n | 'MultiLineString'\n | 'MultiPolygon'\n | 'GeometryCollection';\n\n/**\n * Writes native GeoArrow values directly to WKT strings.\n *\n * The encoder traverses native Arrow scalar and union values without constructing GeoJSON\n * geometry objects. A `null` result means the source layout is not a supported native geometry\n * layout, allowing the caller to use its compatibility path.\n *\n * @param column Native GeoArrow vector.\n * @param sourceEncoding Source GeoArrow encoding.\n * @param dimension Optional semantic coordinate dimension.\n * @returns WKT Arrow vector, or `null` for unsupported source layouts.\n */\nexport function encodeGeoArrowWKTVector(\n column: arrow.Vector,\n sourceEncoding: GeoArrowEncoding,\n dimension?: GeoArrowDimension\n): arrow.Vector | null {\n if (!isNativeGeometryEncoding(sourceEncoding)) return null;\n\n const values: (string | null)[] = [];\n for (let rowIndex = 0; rowIndex < column.length; rowIndex++) {\n const value = column.get(rowIndex);\n if (value == null) {\n values.push(null);\n continue;\n }\n const geometryKind = getRowGeometryKind(column, rowIndex, sourceEncoding);\n const rowDimension =\n dimension ||\n (sourceEncoding === 'geoarrow.geometrycollection'\n ? inferCollectionDimension(value)\n : inferDimensionFromTypeId(column, rowIndex, sourceEncoding));\n const wkt = encodeNativeValue(value, geometryKind, rowDimension, !dimension);\n if (wkt === null) return null;\n values.push(wkt);\n }\n return arrow.vectorFromArray(values, new arrow.Utf8());\n}\n\n/** Returns whether an encoding contains native geometry values that WKT can represent. */\nfunction isNativeGeometryEncoding(encoding: GeoArrowEncoding): boolean {\n return (\n encoding === 'geoarrow.point' ||\n encoding === 'geoarrow.linestring' ||\n encoding === 'geoarrow.polygon' ||\n encoding === 'geoarrow.multipoint' ||\n encoding === 'geoarrow.multilinestring' ||\n encoding === 'geoarrow.multipolygon' ||\n encoding === 'geoarrow.geometry' ||\n encoding === 'geoarrow.geometrycollection'\n );\n}\n\n/** Converts one native scalar to a WKT value using its declared family. */\nfunction encodeNativeValue(\n value: unknown,\n geometryKind: GeometryKind,\n dimension: GeoArrowDimension,\n preserveMemberDimensions = false\n): string | null {\n switch (geometryKind) {\n case 'Point':\n return encodePoint(value, dimension);\n case 'LineString':\n return encodeLineString(value, dimension);\n case 'Polygon':\n return encodePolygon(value, dimension);\n case 'MultiPoint':\n return encodeMultiPoint(value, dimension);\n case 'MultiLineString':\n return encodeMultiLineString(value, dimension);\n case 'MultiPolygon':\n return encodeMultiPolygon(value, dimension);\n case 'GeometryCollection':\n return encodeGeometryCollection(value, dimension, preserveMemberDimensions);\n default:\n return null;\n }\n}\n\n/** Encodes a Point scalar or empty point. */\nfunction encodePoint(value: unknown, dimension: GeoArrowDimension): string | null {\n const coordinate = readCoordinate(value);\n return coordinate\n ? `POINT${getDimensionSuffix(dimension)} (${encodeCoordinate(coordinate)})`\n : 'POINT EMPTY';\n}\n\n/** Encodes a LineString list. */\nfunction encodeLineString(value: unknown, dimension: GeoArrowDimension): string | null {\n const coordinates = readChildren(value);\n if (!coordinates) return null;\n const encodedCoordinates = encodeCoordinateSequence(coordinates);\n if (encodedCoordinates === null) return null;\n return coordinates.length === 0\n ? `LINESTRING${getDimensionSuffix(dimension)} EMPTY`\n : `LINESTRING${getDimensionSuffix(dimension)} (${encodedCoordinates})`;\n}\n\n/** Encodes a Polygon list of rings. */\nfunction encodePolygon(value: unknown, dimension: GeoArrowDimension): string | null {\n const rings = readChildren(value);\n if (!rings) return null;\n if (rings.length === 0) return `POLYGON${getDimensionSuffix(dimension)} EMPTY`;\n const encodedRings = rings.map(ring => encodeCoordinateSequenceValue(ring));\n if (encodedRings.some(encodedRing => encodedRing === null)) return null;\n return `POLYGON${getDimensionSuffix(dimension)} (${encodedRings.join(', ')})`;\n}\n\n/** Encodes a MultiPoint list. */\nfunction encodeMultiPoint(value: unknown, dimension: GeoArrowDimension): string | null {\n const points = readChildren(value);\n if (!points) return null;\n if (points.length === 0) return `MULTIPOINT${getDimensionSuffix(dimension)} EMPTY`;\n const encodedPoints = points.map(point => {\n const coordinate = readCoordinate(point);\n return coordinate ? `(${encodeCoordinate(coordinate)})` : null;\n });\n if (encodedPoints.some(encodedPoint => encodedPoint === null)) return null;\n return `MULTIPOINT${getDimensionSuffix(dimension)} (${encodedPoints.join(', ')})`;\n}\n\n/** Encodes a MultiLineString list of lines. */\nfunction encodeMultiLineString(value: unknown, dimension: GeoArrowDimension): string | null {\n const lines = readChildren(value);\n if (!lines) return null;\n if (lines.length === 0) return `MULTILINESTRING${getDimensionSuffix(dimension)} EMPTY`;\n const encodedLines = lines.map(line => encodeCoordinateSequenceValue(line));\n if (encodedLines.some(encodedLine => encodedLine === null)) return null;\n return `MULTILINESTRING${getDimensionSuffix(dimension)} (${encodedLines.join(', ')})`;\n}\n\n/** Encodes a MultiPolygon list of polygons. */\nfunction encodeMultiPolygon(value: unknown, dimension: GeoArrowDimension): string | null {\n const polygons = readChildren(value);\n if (!polygons) return null;\n if (polygons.length === 0) return `MULTIPOLYGON${getDimensionSuffix(dimension)} EMPTY`;\n const encodedPolygons = polygons.map(polygon => {\n const rings = readChildren(polygon);\n if (!rings) return null;\n const encodedRings = rings.map(ring => encodeCoordinateSequenceValue(ring));\n return encodedRings.some(encodedRing => encodedRing === null)\n ? null\n : `(${encodedRings.join(', ')})`;\n });\n if (encodedPolygons.some(encodedPolygon => encodedPolygon === null)) return null;\n return `MULTIPOLYGON${getDimensionSuffix(dimension)} (${encodedPolygons.join(', ')})`;\n}\n\n/** Encodes a GeometryCollection dense union recursively. */\nfunction encodeGeometryCollection(\n value: unknown,\n dimension: GeoArrowDimension,\n preserveMemberDimensions: boolean\n): string | null {\n if (!isVectorLike(value)) return null;\n const geometries: string[] = [];\n for (let rowIndex = 0; rowIndex < value.length; rowIndex++) {\n const unionVector = value as arrow.Vector;\n const typeId = getUnionTypeId(unionVector, rowIndex);\n const childField = getUnionField(unionVector, rowIndex);\n const geometryKind = getGeoArrowUnionGeometryKind(\n childField?.name,\n typeId\n ) as GeometryKind | null;\n const childDimension = getGeoArrowUnionDimension(childField?.name, childField?.type, typeId);\n if (!geometryKind || !childDimension) return null;\n const geometry = encodeNativeValue(\n unionVector.get(rowIndex),\n geometryKind,\n preserveMemberDimensions ? childDimension : dimension,\n preserveMemberDimensions\n );\n if (geometry === null) return null;\n geometries.push(geometry);\n }\n return geometries.length === 0\n ? 'GEOMETRYCOLLECTION EMPTY'\n : `GEOMETRYCOLLECTION (${geometries.join(', ')})`;\n}\n\n/** Encodes one coordinate sequence from a native list scalar. */\nfunction encodeCoordinateSequenceValue(value: unknown): string | null {\n const coordinates = readChildren(value);\n if (!coordinates) return null;\n const encodedCoordinates = encodeCoordinateSequence(coordinates);\n return encodedCoordinates === null ? null : `(${encodedCoordinates})`;\n}\n\n/** Encodes coordinate children without changing their semantic axis order. */\nfunction encodeCoordinateSequence(values: readonly unknown[]): string | null {\n const coordinates = values.map(value => {\n const coordinate = readCoordinate(value);\n return coordinate ? encodeCoordinate(coordinate) : null;\n });\n return coordinates.every(coordinate => coordinate !== null) ? coordinates.join(', ') : null;\n}\n\n/** Serializes one coordinate tuple. */\nfunction encodeCoordinate(coordinate: readonly number[]): string {\n return coordinate.map(value => String(value)).join(' ');\n}\n\n/** Reads one interleaved or separated native coordinate scalar. */\nfunction readCoordinate(value: unknown): number[] | null {\n if (value && typeof value === 'object' && 'x' in value && 'y' in value) {\n const record = value as {x: unknown; y: unknown; z?: unknown; m?: unknown};\n const coordinate = [Number(record.x), Number(record.y)];\n if (typeof record.z === 'number') coordinate.push(record.z);\n if (typeof record.m === 'number') coordinate.push(record.m);\n return coordinate.every(Number.isFinite) ? coordinate : null;\n }\n if (value && typeof (value as {toArray?: unknown}).toArray === 'function') {\n return readCoordinate((value as {toArray(): ArrayLike<unknown>}).toArray());\n }\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n const coordinate = Array.from(value as ArrayLike<unknown>, Number);\n return coordinate.length >= 2 && coordinate.every(Number.isFinite) ? coordinate : null;\n }\n return null;\n}\n\n/** Reads children from Arrow vectors, arrays, and typed-array list scalars. */\nfunction readChildren(value: unknown): unknown[] | null {\n if (isVectorLike(value)) {\n const children: unknown[] = [];\n for (let index = 0; index < value.length; index++) children.push(value.get(index));\n return children;\n }\n if (Array.isArray(value) || ArrayBuffer.isView(value)) {\n return Array.from(value as ArrayLike<unknown>);\n }\n return null;\n}\n\n/** Returns a dense union type ID for one logical row, including sliced data. */\nfunction getUnionTypeId(vector: arrow.Vector, rowIndex: number): number {\n let remainingRowIndex = rowIndex;\n for (const data of vector.data) {\n if (remainingRowIndex >= data.length) {\n remainingRowIndex -= data.length;\n continue;\n }\n const typeIdIndex =\n data.typeIds.length <= data.length ? remainingRowIndex : data.offset + remainingRowIndex;\n return data.typeIds[typeIdIndex];\n }\n throw new Error(`Dense union row ${rowIndex} is out of bounds.`);\n}\n\n/** Returns the semantic field for a dense-union row, including sliced vectors. */\nfunction getUnionField(vector: arrow.Vector, rowIndex: number): arrow.Field | undefined {\n const unionType = vector.type;\n if (!(unionType instanceof arrow.DenseUnion)) return undefined;\n const typeId = getUnionTypeId(vector, rowIndex);\n const childIndex = unionType.typeIds.indexOf(typeId);\n return childIndex >= 0 ? unionType.children[childIndex] : undefined;\n}\n\n/** Maps a standard GeoArrow union type ID to its geometry family. */\n/** Infers row dimension from a union ID or native physical type. */\nfunction inferDimensionFromTypeId(\n column: arrow.Vector,\n rowIndex: number,\n sourceEncoding: GeoArrowEncoding\n): GeoArrowDimension {\n if (sourceEncoding === 'geoarrow.geometry') {\n const typeId = getUnionTypeId(column, rowIndex);\n const field = getUnionField(column, rowIndex);\n return getGeoArrowUnionDimension(field?.name, field?.type, typeId) || 'xy';\n }\n let type = column.type;\n while (type instanceof arrow.List || type instanceof arrow.LargeList) {\n type = type.children[0].type;\n }\n if (type instanceof arrow.Struct) {\n const names = new Set(type.children.map(field => field.name));\n if (names.has('z') && names.has('m')) return 'xyzm';\n if (names.has('m')) return 'xym';\n if (names.has('z')) return 'xyz';\n }\n if (type instanceof arrow.FixedSizeList) {\n return type.listSize === 4 ? 'xyzm' : type.listSize === 3 ? 'xyz' : 'xy';\n }\n return 'xy';\n}\n\n/** Returns the geometry family for a logical native row. */\nfunction getRowGeometryKind(\n column: arrow.Vector,\n rowIndex: number,\n sourceEncoding: GeoArrowEncoding\n): GeometryKind {\n if (sourceEncoding === 'geoarrow.geometry') {\n const typeId = getUnionTypeId(column, rowIndex);\n const field = getUnionField(column, rowIndex);\n return (getGeoArrowUnionGeometryKind(field?.name, typeId) ||\n 'GeometryCollection') as GeometryKind;\n }\n if (sourceEncoding === 'geoarrow.geometrycollection') return 'GeometryCollection';\n return getGeometryKind(sourceEncoding);\n}\n\n/** Infers a collection dimension from its first dense-union member. */\nfunction inferCollectionDimension(value: unknown): GeoArrowDimension {\n if (!isVectorLike(value)) return 'xy';\n const vector = value as arrow.Vector;\n if (vector.length > 0) {\n const typeId = getUnionTypeId(vector, 0);\n const field = getUnionField(vector, 0);\n return getGeoArrowUnionDimension(field?.name, field?.type, typeId) || 'xy';\n }\n return 'xy';\n}\n\n/** Returns the geometry family represented by a concrete native encoding. */\nfunction getGeometryKind(encoding: GeoArrowEncoding): GeometryKind {\n switch (encoding) {\n case 'geoarrow.point':\n return 'Point';\n case 'geoarrow.linestring':\n return 'LineString';\n case 'geoarrow.polygon':\n return 'Polygon';\n case 'geoarrow.multipoint':\n return 'MultiPoint';\n case 'geoarrow.multilinestring':\n return 'MultiLineString';\n case 'geoarrow.multipolygon':\n return 'MultiPolygon';\n case 'geoarrow.geometry':\n return 'GeometryCollection';\n case 'geoarrow.geometrycollection':\n return 'GeometryCollection';\n default:\n throw new Error(`Unsupported native WKT encoding \"${encoding}\".`);\n }\n}\n\n/** Returns the WKT dimensionality suffix. */\nfunction getDimensionSuffix(dimension: GeoArrowDimension): string {\n return dimension === 'xy'\n ? ''\n : dimension === 'xyzm'\n ? ' ZM'\n : ` ${dimension.slice(2).toUpperCase()}`;\n}\n\n/** Tests Arrow vectors and nested list scalars. */\nfunction isVectorLike(value: unknown): value is {length: number; get(index: number): unknown} {\n return Boolean(\n value &&\n typeof (value as {length?: unknown}).length === 'number' &&\n typeof (value as {get?: unknown}).get === 'function'\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,YAAuB;AAEvB,4BAAsE;AAuB/D,SAAS,wBACd,QACA,gBACA,WACqB;AACrB,MAAI,CAAC,yBAAyB,cAAc,EAAG,QAAO;AAEtD,QAAM,SAA4B,CAAC;AACnC,WAAS,WAAW,GAAG,WAAW,OAAO,QAAQ,YAAY;AAC3D,UAAM,QAAQ,OAAO,IAAI,QAAQ;AACjC,QAAI,SAAS,MAAM;AACjB,aAAO,KAAK,IAAI;AAChB;AAAA,IACF;AACA,UAAM,eAAe,mBAAmB,QAAQ,UAAU,cAAc;AACxE,UAAM,eACJ,cACC,mBAAmB,gCAChB,yBAAyB,KAAK,IAC9B,yBAAyB,QAAQ,UAAU,cAAc;AAC/D,UAAM,MAAM,kBAAkB,OAAO,cAAc,cAAc,CAAC,SAAS;AAC3E,QAAI,QAAQ,KAAM,QAAO;AACzB,WAAO,KAAK,GAAG;AAAA,EACjB;AACA,SAAa,sBAAgB,QAAQ,IAAU,WAAK,CAAC;AACvD;AAGA,SAAS,yBAAyB,UAAqC;AACrE,SACE,aAAa,oBACb,aAAa,yBACb,aAAa,sBACb,aAAa,yBACb,aAAa,8BACb,aAAa,2BACb,aAAa,uBACb,aAAa;AAEjB;AAGA,SAAS,kBACP,OACA,cACA,WACA,2BAA2B,OACZ;AACf,UAAQ,cAAc;AAAA,IACpB,KAAK;AACH,aAAO,YAAY,OAAO,SAAS;AAAA,IACrC,KAAK;AACH,aAAO,iB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Aa,KAAK,EAAG,QAAO;AACjC,QAAM,SAAS;AACf,MAAI,OAAO,SAAS,GAAG;AACrB,UAAM,SAAS,eAAe,QAAQ,CAAC;AACvC,UAAM,QAAQ,cAAc,QAAQ,CAAC;AACrC,eAAO,iDAA0B,OAAO,MAAM,OAAO,MAAM,MAAM,KAAK;AAAA,EACxE;AACA,SAAO;AACT;AAGA,SAAS,gBAAgB,UAA0C;AACjE,UAAQ,UAAU;AAAA,IAChB,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,YAAM,IAAI,MAAM,oCAAoC,QAAQ,IAAI;AAAA,EACpE;AACF;AAGA,SAAS,mBAAmB,WAAsC;AAChE,SAAO,cAAc,OACjB,KACA,cAAc,SACZ,QACA,IAAI,UAAU,MAAM,CAAC,EAAE,YAAY,CAAC;AAC5C;AAGA,SAAS,aAAa,OAAwE;AAC5F,SAAO;AAAA,IACL,SACE,OAAQ,MAA6B,WAAW,YAChD,OAAQ,MAA0B,QAAQ;AAAA,EAC9C;AACF;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as arrow from 'apache-arrow';
|
|
2
|
-
import type { GeoArrowDimension, GeoArrowEncoding } from '@loaders.gl/core/schema';
|
|
3
|
-
/**
|
|
4
|
-
* Writes native GeoArrow values directly to WKT strings.
|
|
5
|
-
*
|
|
6
|
-
* The encoder traverses native Arrow scalar and union values without constructing GeoJSON
|
|
7
|
-
* geometry objects. A `null` result means the source layout is not a supported native geometry
|
|
8
|
-
* layout, allowing the caller to use its compatibility path.
|
|
9
|
-
*
|
|
10
|
-
* @param column Native GeoArrow vector.
|
|
11
|
-
* @param sourceEncoding Source GeoArrow encoding.
|
|
12
|
-
* @param dimension Optional semantic coordinate dimension.
|
|
13
|
-
* @returns WKT Arrow vector, or `null` for unsupported source layouts.
|
|
14
|
-
*/
|
|
15
|
-
export declare function encodeGeoArrowWKTVector(column: arrow.Vector, sourceEncoding: GeoArrowEncoding, dimension?: GeoArrowDimension): arrow.Vector | null;
|
|
16
|
-
//# sourceMappingURL=encode-geoarrow-wkt.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"encode-geoarrow-wkt.d.ts","sourceRoot":"","sources":["../../../../src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,EAAC,iBAAiB,EAAE,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAYjF;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,cAAc,EAAE,gBAAgB,EAChC,SAAS,CAAC,EAAE,iBAAiB,GAC5B,KAAK,CAAC,MAAM,GAAG,IAAI,CAqBrB"}
|