@loaders.gl/core 5.0.0-beta.10 → 5.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (441) hide show
  1. package/SCAN-README.md +2 -2
  2. package/SCHEMA-UTILS-README.md +1 -1
  3. package/dist/arrow-geometry/binary-features.cjs +4 -1
  4. package/dist/arrow-geometry/binary-features.cjs.map +2 -2
  5. package/dist/arrow-geometry/binary-features.d.ts.map +1 -1
  6. package/dist/arrow-geometry/binary-features.js +1 -1
  7. package/dist/arrow-geometry/binary-features.js.map +1 -1
  8. package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
  9. package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
  10. package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
  11. package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
  12. package/dist/arrow-geometry/feature-collection-to-arrow.cjs +1 -5
  13. package/dist/arrow-geometry/feature-collection-to-arrow.cjs.map +2 -2
  14. package/dist/arrow-geometry/feature-collection-to-arrow.d.ts +4 -3
  15. package/dist/arrow-geometry/feature-collection-to-arrow.d.ts.map +1 -1
  16. package/dist/arrow-geometry/feature-collection-to-arrow.js +2 -6
  17. package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
  18. package/dist/arrow-geometry/feature-table.cjs +2 -10
  19. package/dist/arrow-geometry/feature-table.cjs.map +2 -2
  20. package/dist/arrow-geometry/feature-table.d.ts +6 -5
  21. package/dist/arrow-geometry/feature-table.d.ts.map +1 -1
  22. package/dist/arrow-geometry/feature-table.js +5 -13
  23. package/dist/arrow-geometry/feature-table.js.map +1 -1
  24. package/dist/arrow-geometry/geojson-table.cjs +3 -3
  25. package/dist/arrow-geometry/geojson-table.cjs.map +3 -3
  26. package/dist/arrow-geometry/geojson-table.d.ts +1 -1
  27. package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
  28. package/dist/arrow-geometry/geojson-table.js +2 -2
  29. package/dist/arrow-geometry/geojson-table.js.map +1 -1
  30. package/dist/arrow-geometry/geometry-codecs.cjs +6 -6
  31. package/dist/arrow-geometry/geometry-codecs.cjs.map +2 -2
  32. package/dist/arrow-geometry/geometry-codecs.js +1 -1
  33. package/dist/arrow-geometry/geometry-codecs.js.map +1 -1
  34. package/dist/arrow-geometry/geometry-to-wkt.cjs +2 -2
  35. package/dist/arrow-geometry/geometry-to-wkt.cjs.map +2 -2
  36. package/dist/arrow-geometry/geometry-to-wkt.js +1 -1
  37. package/dist/arrow-geometry/geometry-to-wkt.js.map +1 -1
  38. package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs +3 -1
  39. package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.cjs.map +2 -2
  40. package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js +3 -1
  41. package/dist/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.js.map +1 -1
  42. package/dist/arrow-geometry/wkb-arrow-utils.cjs +1 -5
  43. package/dist/arrow-geometry/wkb-arrow-utils.cjs.map +2 -2
  44. package/dist/arrow-geometry/wkb-arrow-utils.d.ts +7 -7
  45. package/dist/arrow-geometry/wkb-arrow-utils.d.ts.map +1 -1
  46. package/dist/arrow-geometry/wkb-arrow-utils.js +4 -8
  47. package/dist/arrow-geometry/wkb-arrow-utils.js.map +1 -1
  48. package/dist/arrow-geometry/wkb-builder.cjs +3 -3
  49. package/dist/arrow-geometry/wkb-builder.cjs.map +2 -2
  50. package/dist/arrow-geometry/wkb-builder.d.ts +1 -1
  51. package/dist/arrow-geometry/wkb-builder.d.ts.map +1 -1
  52. package/dist/arrow-geometry/wkb-builder.js +1 -1
  53. package/dist/arrow-geometry/wkb-builder.js.map +1 -1
  54. package/dist/arrow-geometry/wkb-statistics.cjs +2 -2
  55. package/dist/arrow-geometry/wkb-statistics.cjs.map +2 -2
  56. package/dist/arrow-geometry/wkb-statistics.js +1 -1
  57. package/dist/arrow-geometry/wkb-statistics.js.map +1 -1
  58. package/dist/arrow-worker-transport.cjs +8 -76
  59. package/dist/arrow-worker-transport.cjs.map +1 -1
  60. package/dist/arrow-worker-transport.d.ts +4 -8
  61. package/dist/arrow-worker-transport.d.ts.map +1 -1
  62. package/dist/arrow-worker-transport.js +15 -89
  63. package/dist/arrow-worker-transport.js.map +1 -1
  64. package/dist/cluster-source.cjs +47 -45
  65. package/dist/cluster-source.cjs.map +2 -2
  66. package/dist/dist.dev.js +71 -60
  67. package/dist/dist.min.js +3 -3
  68. package/dist/federated-table-scan-source.cjs +88 -126
  69. package/dist/federated-table-scan-source.cjs.map +2 -2
  70. package/dist/geoarrow/binary-polygon-to-geoarrow.cjs +2 -2
  71. package/dist/geoarrow/binary-polygon-to-geoarrow.cjs.map +2 -2
  72. package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts +1 -1
  73. package/dist/geoarrow/binary-polygon-to-geoarrow.d.ts.map +1 -1
  74. package/dist/geoarrow/binary-polygon-to-geoarrow.js +1 -1
  75. package/dist/geoarrow/binary-polygon-to-geoarrow.js.map +1 -1
  76. package/dist/geoarrow/clustering/cluster-source.cjs +12 -12
  77. package/dist/geoarrow/clustering/cluster-source.cjs.map +2 -2
  78. package/dist/geoarrow/clustering/cluster-source.d.ts +3 -2
  79. package/dist/geoarrow/clustering/cluster-source.d.ts.map +1 -1
  80. package/dist/geoarrow/clustering/cluster-source.js +12 -14
  81. package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
  82. package/dist/geoarrow/convert-table-to-geoarrow.cjs +4 -12
  83. package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
  84. package/dist/geoarrow/convert-table-to-geoarrow.d.ts +5 -5
  85. package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
  86. package/dist/geoarrow/convert-table-to-geoarrow.js +6 -14
  87. package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
  88. package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
  89. package/dist/geoarrow/geoarrow-bounds.cjs.map +3 -3
  90. package/dist/geoarrow/geoarrow-bounds.js +3 -3
  91. package/dist/geoarrow/geoarrow-bounds.js.map +1 -1
  92. package/dist/geoarrow/geoarrow-capabilities.cjs +2 -2
  93. package/dist/geoarrow/geoarrow-capabilities.cjs.map +2 -2
  94. package/dist/geoarrow/geoarrow-capabilities.js +1 -1
  95. package/dist/geoarrow/geoarrow-capabilities.js.map +1 -1
  96. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +8 -8
  97. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +3 -3
  98. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.d.ts.map +1 -1
  99. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +2 -2
  100. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
  101. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +1 -1
  102. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
  103. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +2 -2
  104. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
  105. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +2 -3
  106. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
  107. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
  108. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
  109. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +2 -3
  110. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
  111. package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
  112. package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
  113. package/dist/geoarrow/geoarrow-inspection.js +1 -1
  114. package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
  115. package/dist/geoarrow/geoarrow-stream.cjs +10 -11
  116. package/dist/geoarrow/geoarrow-stream.cjs.map +2 -2
  117. package/dist/geoarrow/geoarrow-stream.d.ts +2 -2
  118. package/dist/geoarrow/geoarrow-stream.d.ts.map +1 -1
  119. package/dist/geoarrow/geoarrow-stream.js +9 -12
  120. package/dist/geoarrow/geoarrow-stream.js.map +1 -1
  121. package/dist/geoarrow/get-geoarrow-vertex-count.cjs +2 -2
  122. package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
  123. package/dist/geoarrow/get-geoarrow-vertex-count.js +1 -1
  124. package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
  125. package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.cjs.map +1 -1
  126. package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js +3 -3
  127. package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js.map +1 -1
  128. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs +5 -2
  129. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs.map +2 -2
  130. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +2 -2
  131. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js.map +1 -1
  132. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs +4 -4
  133. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs.map +2 -2
  134. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +1 -1
  135. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -1
  136. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -3
  137. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs.map +2 -2
  138. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +1 -1
  139. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
  140. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs +3 -3
  141. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs.map +2 -2
  142. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js +1 -1
  143. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js.map +1 -1
  144. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
  145. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -2
  146. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
  147. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
  148. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +1 -1
  149. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +1 -1
  150. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +1 -1
  151. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
  152. package/dist/index.cjs +69 -54
  153. package/dist/index.cjs.map +3 -3
  154. package/dist/index.d.ts +1 -1
  155. package/dist/index.d.ts.map +1 -1
  156. package/dist/index.js +1 -1
  157. package/dist/index.js.map +1 -1
  158. package/dist/lib/api/load.d.ts.map +1 -1
  159. package/dist/lib/api/load.js +2 -4
  160. package/dist/lib/api/load.js.map +1 -1
  161. package/dist/lib/api/loader-options.d.ts +6 -0
  162. package/dist/lib/api/loader-options.d.ts.map +1 -1
  163. package/dist/lib/api/loader-options.js +48 -0
  164. package/dist/lib/api/loader-options.js.map +1 -1
  165. package/dist/lib/api/parse-file.d.ts.map +1 -1
  166. package/dist/lib/api/parse-file.js +2 -5
  167. package/dist/lib/api/parse-file.js.map +1 -1
  168. package/dist/lib/api/parse-in-batches.js +6 -10
  169. package/dist/lib/api/parse-in-batches.js.map +1 -1
  170. package/dist/lib/api/parse-sync.d.ts.map +1 -1
  171. package/dist/lib/api/parse-sync.js +2 -5
  172. package/dist/lib/api/parse-sync.js.map +1 -1
  173. package/dist/lib/api/parse.d.ts.map +1 -1
  174. package/dist/lib/api/parse.js +2 -5
  175. package/dist/lib/api/parse.js.map +1 -1
  176. package/dist/lib/init.js +1 -1
  177. package/dist/lib/loader-utils/native-arrow.d.ts +5 -8
  178. package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -1
  179. package/dist/lib/loader-utils/native-arrow.js +13 -31
  180. package/dist/lib/loader-utils/native-arrow.js.map +1 -1
  181. package/dist/loader-utils/index.cjs +48 -31
  182. package/dist/loader-utils/index.cjs.map +1 -1
  183. package/dist/loader-utils/index.d.ts +1 -1
  184. package/dist/loader-utils/index.d.ts.map +1 -1
  185. package/dist/loader-utils/index.js +1 -1
  186. package/dist/loader-utils/index.js.map +1 -1
  187. package/dist/loader-utils/json-loader.js +1 -1
  188. package/dist/loader-utils/lib/log-utils/log.js +1 -1
  189. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +6 -2
  190. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -1
  191. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +1 -0
  192. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
  193. package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +15 -12
  194. package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -1
  195. package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +36 -22
  196. package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
  197. package/dist/loader-utils/lib/sources/table-source-collection.d.ts +2 -1
  198. package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -1
  199. package/dist/loader-utils/lib/sources/tile-grid.d.ts +6 -1
  200. package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -1
  201. package/dist/loader-utils/lib/sources/tile-grid.js +32 -14
  202. package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -1
  203. package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +3 -3
  204. package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
  205. package/dist/loader-utils/loader-types.d.ts +3 -5
  206. package/dist/loader-utils/loader-types.d.ts.map +1 -1
  207. package/dist/loader-utils/tile-grid.cjs +21 -9
  208. package/dist/loader-utils/tile-grid.cjs.map +1 -1
  209. package/dist/null-loader.js +1 -1
  210. package/dist/null-worker-node.js +1 -1
  211. package/dist/null-worker.js +1 -1
  212. package/dist/scan/arrow-execution/expressions.cjs +4 -4
  213. package/dist/scan/arrow-execution/expressions.cjs.map +2 -2
  214. package/dist/scan/arrow-execution/expressions.d.ts +4 -4
  215. package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
  216. package/dist/scan/arrow-execution/expressions.js +4 -4
  217. package/dist/scan/arrow-execution/expressions.js.map +1 -1
  218. package/dist/scan/arrow-execution/filter-arrow-table.cjs +1 -1
  219. package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +1 -1
  220. package/dist/scan/arrow-execution/filter-arrow-table.js +1 -1
  221. package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
  222. package/dist/scan/arrow-query-worker-entry.cjs +121 -0
  223. package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
  224. package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
  225. package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
  226. package/dist/scan/arrow-query-worker-entry.js +7 -0
  227. package/dist/scan/arrow-query-worker-entry.js.map +1 -0
  228. package/dist/scan/arrow-query-worker.cjs +197 -0
  229. package/dist/scan/arrow-query-worker.cjs.map +7 -0
  230. package/dist/scan/arrow-query-worker.d.ts +47 -0
  231. package/dist/scan/arrow-query-worker.d.ts.map +1 -0
  232. package/dist/scan/arrow-query-worker.js +101 -0
  233. package/dist/scan/arrow-query-worker.js.map +1 -0
  234. package/dist/scan/federated-table-scan-source.cjs +12 -13
  235. package/dist/scan/federated-table-scan-source.cjs.map +2 -2
  236. package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
  237. package/dist/scan/federated-table-scan-source.js +14 -15
  238. package/dist/scan/federated-table-scan-source.js.map +1 -1
  239. package/dist/scan/index.cjs +5 -2
  240. package/dist/scan/index.cjs.map +2 -2
  241. package/dist/scan/index.d.ts +2 -1
  242. package/dist/scan/index.d.ts.map +1 -1
  243. package/dist/scan/index.js +2 -1
  244. package/dist/scan/index.js.map +1 -1
  245. package/dist/scan/parse-sql-predicate.cjs +2 -2
  246. package/dist/scan/parse-sql-predicate.cjs.map +2 -2
  247. package/dist/scan/parse-sql-predicate.js +1 -1
  248. package/dist/scan/parse-sql-predicate.js.map +1 -1
  249. package/dist/scan/query-pushdown.cjs +6 -6
  250. package/dist/scan/query-pushdown.cjs.map +2 -2
  251. package/dist/scan/query-pushdown.d.ts +1 -1
  252. package/dist/scan/query-pushdown.d.ts.map +1 -1
  253. package/dist/scan/query-pushdown.js +3 -6
  254. package/dist/scan/query-pushdown.js.map +1 -1
  255. package/dist/scan/query-scales.cjs +195 -0
  256. package/dist/scan/query-scales.cjs.map +7 -0
  257. package/dist/scan/query-scales.d.ts +47 -0
  258. package/dist/scan/query-scales.d.ts.map +1 -0
  259. package/dist/scan/query-scales.js +201 -0
  260. package/dist/scan/query-scales.js.map +1 -0
  261. package/dist/scan/query.cjs +49 -45
  262. package/dist/scan/query.cjs.map +2 -2
  263. package/dist/scan/query.d.ts +7 -4
  264. package/dist/scan/query.d.ts.map +1 -1
  265. package/dist/scan/query.js +35 -52
  266. package/dist/scan/query.js.map +1 -1
  267. package/dist/scan/vector-table-scan-source.cjs +19 -13
  268. package/dist/scan/vector-table-scan-source.cjs.map +3 -3
  269. package/dist/scan/vector-table-scan-source.d.ts +3 -4
  270. package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
  271. package/dist/scan/vector-table-scan-source.js +11 -12
  272. package/dist/scan/vector-table-scan-source.js.map +1 -1
  273. package/dist/schema/categories/category-mesh.d.ts +3 -10
  274. package/dist/schema/categories/category-mesh.d.ts.map +1 -1
  275. package/dist/schema/categories/category-mesh.js.map +1 -1
  276. package/dist/schema/categories/category-table.d.ts +2 -19
  277. package/dist/schema/categories/category-table.d.ts.map +1 -1
  278. package/dist/schema/geometry/arrow-binary-features.d.ts +1 -1
  279. package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -1
  280. package/dist/schema/geometry/geoarrow.d.ts +2 -2
  281. package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
  282. package/dist/schema/index.cjs.map +1 -1
  283. package/dist/schema/index.d.ts +2 -2
  284. package/dist/schema/index.d.ts.map +1 -1
  285. package/dist/schema/index.js.map +1 -1
  286. package/dist/schema/types/batch.d.ts +0 -4
  287. package/dist/schema/types/batch.d.ts.map +1 -1
  288. package/dist/schema-utils/index.cjs +420 -503
  289. package/dist/schema-utils/index.cjs.map +3 -3
  290. package/dist/schema-utils/index.d.ts +4 -5
  291. package/dist/schema-utils/index.d.ts.map +1 -1
  292. package/dist/schema-utils/index.js +4 -5
  293. package/dist/schema-utils/index.js.map +1 -1
  294. package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +4 -5
  295. package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -1
  296. package/dist/schema-utils/lib/arrow/arrow-metadata.js +21 -18
  297. package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -1
  298. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +6 -11
  299. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
  300. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
  301. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
  302. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +4 -4
  303. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
  304. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +13 -15
  305. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
  306. package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts +2 -2
  307. package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
  308. package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +1 -1
  309. package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
  310. package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +2 -1
  311. package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -1
  312. package/dist/schema-utils/lib/schema/deduce-table-schema.js +3 -1
  313. package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
  314. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
  315. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
  316. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
  317. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
  318. package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
  319. package/dist/schema-utils/lib/table/batches/convert-batches.js +5 -8
  320. package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
  321. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +1 -1
  322. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
  323. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +2 -6
  324. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
  325. package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +1 -1
  326. package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
  327. package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +4 -24
  328. package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
  329. package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +3 -6
  330. package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
  331. package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +8 -58
  332. package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
  333. package/dist/schema-utils/lib/table/tables/make-table.js +2 -2
  334. package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
  335. package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
  336. package/dist/schema-utils/lib/table/tables/table-accessors.js +2 -16
  337. package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
  338. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +2 -2
  339. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
  340. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +4 -4
  341. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
  342. package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
  343. package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
  344. package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
  345. package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
  346. package/dist/vector-table-scan-source.cjs +17 -11
  347. package/dist/vector-table-scan-source.cjs.map +2 -2
  348. package/dist/wkt/index.cjs.map +1 -1
  349. package/dist/wkt/index.d.ts.map +1 -1
  350. package/dist/wkt/index.js.map +1 -1
  351. package/dist/worker-utils/index.cjs +2 -2
  352. package/dist/worker-utils/lib/env-utils/version.js +1 -1
  353. package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -1
  354. package/dist/worker-utils/lib/npm-tag.js.map +1 -1
  355. package/dist/worker-utils/null-worker-node.js.map +1 -1
  356. package/dist/worker-utils/null-worker.js.map +1 -1
  357. package/package.json +22 -8
  358. package/src/arrow-geometry/binary-features.ts +4 -1
  359. package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
  360. package/src/arrow-geometry/feature-collection-to-arrow.ts +5 -8
  361. package/src/arrow-geometry/feature-table.ts +8 -21
  362. package/src/arrow-geometry/geojson-table.ts +2 -2
  363. package/src/arrow-geometry/geometry-codecs.ts +2 -2
  364. package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
  365. package/src/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.ts +3 -1
  366. package/src/arrow-geometry/wkb-arrow-utils.ts +8 -12
  367. package/src/arrow-geometry/wkb-builder.ts +2 -2
  368. package/src/arrow-geometry/wkb-statistics.ts +2 -2
  369. package/src/arrow-worker-transport.ts +22 -121
  370. package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
  371. package/src/geoarrow/clustering/cluster-source.ts +16 -23
  372. package/src/geoarrow/convert-table-to-geoarrow.ts +11 -23
  373. package/src/geoarrow/geoarrow-bounds.ts +3 -3
  374. package/src/geoarrow/geoarrow-capabilities.ts +1 -1
  375. package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +3 -7
  376. package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +2 -2
  377. package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +2 -4
  378. package/src/geoarrow/geoarrow-inspection.ts +2 -2
  379. package/src/geoarrow/geoarrow-stream.ts +15 -15
  380. package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
  381. package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts +3 -3
  382. package/src/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.ts +5 -2
  383. package/src/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +1 -1
  384. package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +2 -2
  385. package/src/geoarrow/lib/kernels/encode-geoarrow-box.ts +1 -1
  386. package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +7 -5
  387. package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +1 -1
  388. package/src/index.ts +1 -1
  389. package/src/lib/api/load.ts +2 -12
  390. package/src/lib/api/loader-options.ts +69 -0
  391. package/src/lib/api/parse-file.ts +2 -11
  392. package/src/lib/api/parse-in-batches.ts +8 -12
  393. package/src/lib/api/parse-sync.ts +3 -7
  394. package/src/lib/api/parse.ts +2 -6
  395. package/src/lib/loader-utils/native-arrow.ts +12 -38
  396. package/src/loader-utils/index.ts +0 -1
  397. package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +7 -6
  398. package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +64 -41
  399. package/src/loader-utils/lib/sources/table-source-collection.ts +2 -1
  400. package/src/loader-utils/lib/sources/tile-grid.ts +34 -18
  401. package/src/loader-utils/lib/sources/vector-tile-source.ts +3 -9
  402. package/src/loader-utils/loader-types.ts +3 -3
  403. package/src/scan/arrow-execution/expressions.ts +7 -7
  404. package/src/scan/arrow-execution/filter-arrow-table.ts +1 -1
  405. package/src/scan/arrow-query-worker-entry.ts +8 -0
  406. package/src/scan/arrow-query-worker.ts +158 -0
  407. package/src/scan/federated-table-scan-source.ts +15 -18
  408. package/src/scan/index.ts +7 -1
  409. package/src/scan/parse-sql-predicate.ts +1 -1
  410. package/src/scan/query-pushdown.ts +7 -7
  411. package/src/scan/query-scales.ts +299 -0
  412. package/src/scan/query.ts +68 -71
  413. package/src/scan/vector-table-scan-source.ts +16 -21
  414. package/src/schema/categories/category-mesh.ts +3 -11
  415. package/src/schema/categories/category-table.ts +2 -28
  416. package/src/schema/geometry/arrow-binary-features.ts +1 -1
  417. package/src/schema/geometry/geoarrow.ts +2 -2
  418. package/src/schema/index.ts +1 -3
  419. package/src/schema/types/batch.ts +0 -5
  420. package/src/schema-utils/index.ts +5 -11
  421. package/src/schema-utils/lib/arrow/arrow-metadata.ts +33 -30
  422. package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +12 -38
  423. package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +15 -18
  424. package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +4 -13
  425. package/src/schema-utils/lib/schema/deduce-table-schema.ts +4 -2
  426. package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
  427. package/src/schema-utils/lib/table/batches/convert-batches.ts +5 -8
  428. package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +2 -6
  429. package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +5 -27
  430. package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +11 -73
  431. package/src/schema-utils/lib/table/tables/make-table.ts +2 -2
  432. package/src/schema-utils/lib/table/tables/table-accessors.ts +2 -22
  433. package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +6 -6
  434. package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
  435. package/src/wkt/index.ts +1 -1
  436. package/src/worker-utils/lib/npm-tag.ts +1 -1
  437. package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts +0 -27
  438. package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.d.ts.map +0 -1
  439. package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js +0 -23
  440. package/dist/schema-utils/lib/table/tables/convert-arrow-table-wrapper.js.map +0 -1
  441. package/src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts +0 -54
@@ -2,6 +2,7 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
+ import type * as arrow from 'apache-arrow';
5
6
  import type {Table} from '@loaders.gl/core/schema';
6
7
 
7
8
  import {ArrowLikeSchema} from './arrow-like-schema';
@@ -20,10 +21,10 @@ import {
20
21
  } from '../tables/table-accessors';
21
22
 
22
23
  class ArrowLikeVector {
23
- table: Table;
24
+ table: Table | arrow.Table;
24
25
  columnName: string;
25
26
 
26
- constructor(table: Table, columnName: string) {
27
+ constructor(table: Table | arrow.Table, columnName: string) {
27
28
  this.table = table;
28
29
  this.columnName = columnName;
29
30
  }
@@ -33,10 +34,8 @@ class ArrowLikeVector {
33
34
  }
34
35
 
35
36
  toArray(): ArrayLike<unknown> {
37
+ if (!('shape' in this.table)) return this.table.getChild(this.columnName)?.toArray();
36
38
  switch (this.table.shape) {
37
- case 'arrow-table':
38
- const arrowTable = this.table.data as any;
39
- return arrowTable.getChild(this.columnName)?.toArray();
40
39
  case 'columnar-table':
41
40
  return this.table.data[this.columnName];
42
41
  default:
@@ -51,12 +50,13 @@ class ArrowLikeVector {
51
50
  */
52
51
  export class ArrowLikeTable {
53
52
  schema: ArrowLikeSchema;
54
- table: Table;
53
+ table: Table | arrow.Table;
55
54
 
56
- constructor(table: Table) {
57
- const schema = table.schema || deduceTableSchema(table);
55
+ constructor(table: Table | arrow.Table) {
56
+ const schema =
57
+ 'shape' in table ? table.schema || deduceTableSchema(table) : deduceTableSchema(table);
58
58
  this.schema = new ArrowLikeSchema(schema.fields, schema.metadata);
59
- this.table = {...table, schema};
59
+ this.table = 'shape' in table ? {...table, schema} : table;
60
60
  }
61
61
 
62
62
  // get schema() {
@@ -64,6 +64,7 @@ export class ArrowLikeTable {
64
64
  // }
65
65
 
66
66
  get data() {
67
+ if (!('shape' in this.table)) return this.table;
67
68
  return this.table.shape === 'geojson-table' ? this.table.features : this.table.data;
68
69
  }
69
70
 
@@ -9,7 +9,7 @@ import type {
9
9
  ColumnarTableBatch
10
10
  } from '@loaders.gl/core/schema';
11
11
  import * as arrow from 'apache-arrow';
12
- import {isNativeArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
12
+ import {isArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
13
13
  import {makeArrowMetadataBatch} from '../../arrow/arrow-metadata';
14
14
  import {convertTable} from '../tables/convert-table';
15
15
 
@@ -21,12 +21,12 @@ export function convertBatch(
21
21
  shape: 'arrow'
22
22
  ): arrow.RecordBatch;
23
23
 
24
- /** Converts one batch. Use convertBatches to expand an Arrow wrapper containing multiple batches. */
24
+ /** Converts one portable batch or returns the supplied native record batch. */
25
25
  export function convertBatch(
26
26
  batch: TableBatch | arrow.RecordBatch,
27
27
  shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow'
28
28
  ): TableBatch | arrow.RecordBatch {
29
- if (isNativeArrowRecordBatch(batch)) {
29
+ if (isArrowRecordBatch(batch)) {
30
30
  if (shape === 'arrow') return batch;
31
31
  throw new Error('Convert a native RecordBatch as a table to select a row or column layout');
32
32
  }
@@ -39,9 +39,6 @@ export function convertBatch(
39
39
  return {...batch, ...convertTable(batch, 'columnar-table')};
40
40
  case 'arrow': {
41
41
  const table = convertTable(batch, 'arrow');
42
- if (table.batches.length > 1) {
43
- throw new Error('Use convertBatches to expand multiple Arrow record batches');
44
- }
45
42
  return table.batches[0] ?? makeArrowMetadataBatch(table.schema);
46
43
  }
47
44
  default:
@@ -68,14 +65,14 @@ export function convertBatches(
68
65
 
69
66
  /**
70
67
  * Converts batches in emission order. For Arrow output, yields native record batches,
71
- * expanding wrapped tables and preserving the declared schema of empty inputs.
68
+ * preserving the declared schema of empty inputs.
72
69
  */
73
70
  export async function* convertBatches(
74
71
  batches: Iterable<TableBatch | arrow.RecordBatch> | AsyncIterable<TableBatch | arrow.RecordBatch>,
75
72
  shape: 'object-row-table' | 'array-row-table' | 'columnar-table' | 'arrow'
76
73
  ): AsyncIterableIterator<TableBatch | arrow.RecordBatch> {
77
74
  for await (const batch of batches) {
78
- if (isNativeArrowRecordBatch(batch)) {
75
+ if (isArrowRecordBatch(batch)) {
79
76
  if (shape !== 'arrow') throw new Error('Expected a loaders.gl table batch');
80
77
  yield batch;
81
78
  continue;
@@ -39,18 +39,14 @@ export function* makeArrowRecordBatchIterator(
39
39
  yield* sliceNativeArrowBatches(table, options?.batchSize);
40
40
  return;
41
41
  }
42
- yield* makeWrappedTableRecordBatchIterator(table, options);
42
+ yield* makePortableTableRecordBatchIterator(table, options);
43
43
  }
44
44
 
45
45
  /** Converts loaders.gl table representations to record batches. */
46
- export function* makeWrappedTableRecordBatchIterator(
46
+ export function* makePortableTableRecordBatchIterator(
47
47
  table: Table,
48
48
  options?: {batchSize?: number}
49
49
  ): IterableIterator<arrow.RecordBatch> {
50
- if (table.shape === 'arrow-table') {
51
- yield* sliceNativeArrowBatches(table.data, options?.batchSize);
52
- return;
53
- }
54
50
  const arrowSchema = convertSchemaToArrow(table.schema!);
55
51
 
56
52
  const length = getTableLength(table);
@@ -10,14 +10,9 @@ import type {
10
10
  ArrayRowTable,
11
11
  Feature
12
12
  } from '@loaders.gl/core/schema';
13
- import * as arrow from 'apache-arrow';
14
- import {
15
- makeArrowTableFromBatches,
16
- mergeArrowSchemas,
17
- makeArrowMetadataBatch
18
- } from '../../arrow/arrow-metadata';
19
- import {convertSchemaToArrow, serializeArrowSchema} from '../../schema/convert-arrow-schema';
20
- import {isNativeArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
13
+ import type * as arrow from 'apache-arrow';
14
+ import {makeArrowTableFromBatches} from '../../arrow/arrow-metadata';
15
+ import {isArrowRecordBatch} from '../../../../lib/loader-utils/native-arrow';
21
16
  import {getTableLength} from '../tables/table-accessors';
22
17
 
23
18
  /**
@@ -44,13 +39,12 @@ export async function makeTableFromBatches(
44
39
  let shape: Table['shape'] | 'arrow' | null = null;
45
40
  let schema: Schema | undefined;
46
41
  const arrowBatches: arrow.RecordBatch[] = [];
47
- let arrowSchema: arrow.Schema | undefined;
48
42
 
49
43
  for await (const batch of batchIterator) {
50
- const batchShape = isNativeArrowRecordBatch(batch) ? 'arrow' : batch.shape;
44
+ const batchShape = isArrowRecordBatch(batch) ? 'arrow' : batch.shape;
51
45
  shape ??= batchShape;
52
46
  if (shape !== batchShape) throw new Error('Batches must have the same shape');
53
- if (isNativeArrowRecordBatch(batch)) {
47
+ if (isArrowRecordBatch(batch)) {
54
48
  arrowBatches.push(batch);
55
49
  continue;
56
50
  }
@@ -81,17 +75,6 @@ export async function makeTableFromBatches(
81
75
  }
82
76
  break;
83
77
 
84
- case 'arrow-table': {
85
- for (const recordBatch of batch.data.batches) {
86
- arrowSchema = mergeArrowSchemas(arrowSchema, recordBatch.schema);
87
- arrowBatches.push(recordBatch);
88
- }
89
- arrowSchema = mergeArrowSchemas(arrowSchema, batch.data.schema);
90
- if (batch.schema)
91
- arrowSchema = mergeArrowSchemas(arrowSchema, convertSchemaToArrow(batch.schema));
92
- if (batch.data.batches.length === 0) arrowBatches.push(makeArrowMetadataBatch(arrowSchema));
93
- break;
94
- }
95
78
  case 'columnar-table':
96
79
  default:
97
80
  throw new Error('shape');
@@ -105,11 +88,6 @@ export async function makeTableFromBatches(
105
88
  switch (shape) {
106
89
  case 'arrow':
107
90
  return makeArrowTableFromBatches(arrowBatches);
108
- case 'arrow-table': {
109
- const collected = await makeArrowTableFromBatches(arrowBatches);
110
- const data = collected && new arrow.Table(arrowSchema || collected.schema, collected.batches);
111
- return data ? {shape: 'arrow-table', data, schema: serializeArrowSchema(data.schema)} : null;
112
- }
113
91
  case 'array-row-table':
114
92
  return {shape: 'array-row-table', data: arrayRows!, schema};
115
93
 
@@ -15,38 +15,25 @@ import type {
15
15
  import {convertTable} from './convert-table';
16
16
  import {deduceTableSchema} from '../../schema/deduce-table-schema';
17
17
  import {convertArrowToSchema, convertSchemaToArrow} from '../../schema/convert-arrow-schema';
18
- import {makeWrappedTableRecordBatchIterator} from '../batches/make-arrow-batch-iterator';
18
+ import {makePortableTableRecordBatchIterator} from '../batches/make-arrow-batch-iterator';
19
19
 
20
20
  /**
21
21
  * Converts a loaders.gl table to native Arrow and preserves the schema on empty input.
22
- * Native Arrow inputs and legacy wrapped Arrow columns are reused.
22
+ * Native Arrow inputs retain their identity.
23
23
  */
24
24
  export function convertTableToArrow(
25
25
  table: Table | arrow.Table,
26
26
  options?: {batchSize?: number}
27
27
  ): arrow.Table {
28
28
  if (!('shape' in table)) return table;
29
- switch (table.shape) {
30
- case 'arrow-table':
31
- return table.data;
32
-
33
- case 'columnar-table':
34
- // TODO - optimized implementation is possible
35
- // return convertColumnarTableToArrow(table, options);
36
-
37
- // fall through
38
-
39
- default:
40
- const schema = table.schema ?? deduceTableSchema(table);
41
- return new arrow.Table(convertSchemaToArrow(schema), [
42
- ...makeWrappedTableRecordBatchIterator({...table, schema}, options)
43
- ]);
44
- }
29
+ const schema = table.schema ?? deduceTableSchema(table);
30
+ return new arrow.Table(convertSchemaToArrow(schema), [
31
+ ...makePortableTableRecordBatchIterator({...table, schema}, options)
32
+ ]);
45
33
  }
46
34
 
47
35
  /** Loader table layouts produced when converting from Arrow. */
48
- type NonArrowTable = Exclude<Table, {shape: 'arrow-table'}>;
49
- type NonArrowTableShape = NonArrowTable['shape'];
36
+ type NonArrowTableShape = Table['shape'];
50
37
 
51
38
  /**
52
39
  * Convert an Apache Arrow table to a loaders.gl Table
@@ -57,7 +44,7 @@ export function convertArrowToTable(arrow: arrow.Table, shape: 'columnar-table')
57
44
  export function convertArrowToTable(arrow: arrow.Table, shape: 'object-row-table'): ObjectRowTable;
58
45
  export function convertArrowToTable(arrow: arrow.Table, shape: 'array-row-table'): ArrayRowTable;
59
46
  export function convertArrowToTable(arrow: arrow.Table, shape: 'geojson-table'): GeoJSONTable;
60
- export function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShape): NonArrowTable;
47
+ export function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShape): Table;
61
48
 
62
49
  /**
63
50
  * Convert an Apache Arrow table to a loaders.gl Table
@@ -66,7 +53,7 @@ export function convertArrowToTable(arrow: arrow.Table, shape: NonArrowTableShap
66
53
  export function convertArrowToTable(
67
54
  arrowTable: arrow.Table,
68
55
  shape: NonArrowTableShape | 'arrow'
69
- ): NonArrowTable | arrow.Table {
56
+ ): Table | arrow.Table {
70
57
  switch (shape) {
71
58
  case 'arrow':
72
59
  return arrowTable;
@@ -106,7 +93,8 @@ function convertArrowToColumnarTable(arrowTable: arrow.Table): ColumnarTable {
106
93
  for (const field of arrowTable.schema.fields) {
107
94
  // This (is intended to) coalesce all record batches into a single typed array
108
95
  const arrowColumn = arrowTable.getChild(field.name);
109
- const values = arrowColumn?.toArray();
96
+ // Typed value buffers omit the validity bitmap; materialize nullable columns through Arrow.
97
+ const values = arrowColumn?.nullCount ? Array.from(arrowColumn) : arrowColumn?.toArray();
110
98
  columns[field.name] = values;
111
99
  }
112
100
 
@@ -141,53 +129,3 @@ function convertArrowToGeoJSONTable(arrowTable: arrow.Table): GeoJSONTable {
141
129
  features
142
130
  };
143
131
  }
144
-
145
- // /**
146
- // * Wrap an apache arrow table in a loaders.gl table wrapper.
147
- // * From this additional conversions are available.
148
- // * @param arrowTable
149
- // * @returns
150
- // */
151
- // function convertArrowToArrowTable(arrowTable: arrow.Table): ArrowTable {
152
- // return {
153
- // shape: 'arrow-table',
154
- // schema: convertArrowToSchema(arrowTable.schema),
155
- // data: arrowTable
156
- // };
157
- // }
158
-
159
- // function convertArrowToArrayRowTable(arrowTable: arrow.Table): ArrayRowTable {
160
- // const columnarTable = convertArrowToColumnarTable(arrowTable);
161
- // return convertTable(columnarTable, 'array-row-table');
162
- // }
163
-
164
- // function convertArrowToObjectRowTable(arrowTable: arrow.Table): ObjectRowTable {
165
- // const columnarTable = convertArrowToColumnarTable(arrowTable);
166
- // return convertTable(columnarTable, 'object-row-table');
167
- // }
168
-
169
- // /**
170
- // * Convert an Apache Arrow table to a ColumnarTable
171
- // * @note Currently does not convert schema
172
- // */
173
- // function convertArrowToColumnarTable(arrowTable: arrow.Table): ColumnarTable {
174
- // // TODO - avoid calling `getColumn` on columns we are not interested in?
175
- // // Add options object?
176
-
177
- // const columns: ColumnarTable['data'] = {};
178
-
179
- // for (const field of arrowTable.schema.fields) {
180
- // // This (is intended to) coalesce all record batches into a single typed array
181
- // const arrowColumn = arrowTable.getChild(field.name);
182
- // const values = arrowColumn?.toArray();
183
- // columns[field.name] = values;
184
- // }
185
-
186
- // const schema = convertArrowToSchema(arrowTable.schema);
187
-
188
- // return {
189
- // shape: 'columnar-table',
190
- // schema,
191
- // data: columns
192
- // };
193
- // }
@@ -4,7 +4,7 @@
4
4
 
5
5
  import type * as arrow from 'apache-arrow';
6
6
  import type {Table, ArrayRowTable, ObjectRowTable, ColumnarTable} from '@loaders.gl/core/schema';
7
- import {isNativeArrowTable} from '../../../../lib/loader-utils/native-arrow';
7
+ import {isArrowTable} from '../../../../lib/loader-utils/native-arrow';
8
8
  import {deduceTableSchema} from '../../schema/deduce-table-schema';
9
9
 
10
10
  /**
@@ -17,7 +17,7 @@ export function makeTableFromData(data: {[column: string]: ArrayLike<unknown>}):
17
17
  export function makeTableFromData(data: arrow.Table): arrow.Table;
18
18
 
19
19
  export function makeTableFromData(data: unknown): Table | arrow.Table {
20
- if (isNativeArrowTable(data)) return data;
20
+ if (isArrowTable(data)) return data;
21
21
  let table: Table;
22
22
  switch (getTableShapeFromData(data)) {
23
23
  case 'array-row-table':
@@ -5,13 +5,13 @@
5
5
  /* eslint-disable no-else-return */
6
6
 
7
7
  import type {Table as NativeArrowTable} from 'apache-arrow';
8
- import {isNativeArrowTable} from '../../../../lib/loader-utils/native-arrow';
8
+ import {isArrowTable} from '../../../../lib/loader-utils/native-arrow';
9
9
  import {convertArrowToSchema} from '../../schema/convert-arrow-schema';
10
10
  import type {Table, ArrayRowTable, ObjectRowTable} from '@loaders.gl/core/schema';
11
11
 
12
12
  /** Checks whether a value is a native Arrow table or a loaders.gl table. */
13
13
  export function isTable(table: any): table is Table | NativeArrowTable {
14
- if (isNativeArrowTable(table)) return true;
14
+ if (isArrowTable(table)) return true;
15
15
  const shape = typeof table === 'object' && table?.shape;
16
16
  switch (shape) {
17
17
  case 'array-row-table':
@@ -24,9 +24,6 @@ export function isTable(table: any): table is Table | NativeArrowTable {
24
24
  case 'columnar-table':
25
25
  return Boolean(table.data && typeof table.data === 'object');
26
26
 
27
- case 'arrow-table':
28
- return Boolean(table?.data?.numRows !== undefined);
29
-
30
27
  default:
31
28
  return false;
32
29
  }
@@ -45,9 +42,6 @@ export function getTableLength(table: Table | NativeArrowTable): number {
45
42
  case 'geojson-table':
46
43
  return table.features.length;
47
44
 
48
- case 'arrow-table':
49
- return getTableLength(table.data);
50
-
51
45
  case 'columnar-table':
52
46
  for (const column of Object.values(table.data)) {
53
47
  return column.length || 0;
@@ -79,8 +73,6 @@ export function getTableNumCols(table: Table | NativeArrowTable): number {
79
73
  return Object.keys(table.features[0]).length;
80
74
  case 'columnar-table':
81
75
  return Object.keys(table.data).length;
82
- case 'arrow-table':
83
- return getTableNumCols(table.data);
84
76
 
85
77
  default:
86
78
  throw new Error('table');
@@ -109,9 +101,6 @@ export function getTableCell(
109
101
  const column = table.data[columnName];
110
102
  return column[rowIndex];
111
103
 
112
- case 'arrow-table':
113
- return getTableCell(table.data, rowIndex, columnName);
114
-
115
104
  default:
116
105
  throw new Error('todo');
117
106
  }
@@ -141,9 +130,6 @@ export function getTableCellAt(
141
130
  const column = table.data[columnName3];
142
131
  return column[rowIndex];
143
132
 
144
- case 'arrow-table':
145
- return getTableCellAt(table.data, rowIndex, columnIndex);
146
-
147
133
  default:
148
134
  throw new Error('todo');
149
135
  }
@@ -248,9 +234,6 @@ export function getTableRowAsObject(
248
234
  return objectRow;
249
235
  }
250
236
 
251
- case 'arrow-table':
252
- return getTableRowAsObject(table.data, rowIndex, target, copy);
253
-
254
237
  default:
255
238
  throw new Error('shape');
256
239
  }
@@ -321,9 +304,6 @@ export function getTableRowAsArray(
321
304
  return arrayRow;
322
305
  }
323
306
 
324
- case 'arrow-table':
325
- return getTableRowAsArray(table.data, rowIndex, target, copy);
326
-
327
307
  default:
328
308
  throw new Error('shape');
329
309
  }
@@ -5,7 +5,7 @@
5
5
  import type {Converter} from '../../../converters/converters';
6
6
  import type {Table} from '@loaders.gl/core/schema';
7
7
  import type * as arrow from 'apache-arrow';
8
- import {isNativeArrowTable} from '../../../../../lib/loader-utils/native-arrow';
8
+ import {isArrowTable} from '../../../../../lib/loader-utils/native-arrow';
9
9
  import {convertTables} from './convert-tables';
10
10
 
11
11
  /**
@@ -16,23 +16,23 @@ export type TableShape = 'object-row-table' | 'array-row-table' | 'columnar-tabl
16
16
  /**
17
17
  * Leaf converter for loaders.gl table wrapper shapes.
18
18
  */
19
- export const TableConverter: Converter<TableShape | 'arrow-table'> = {
19
+ export const TableConverter: Converter<TableShape> = {
20
20
  id: 'table',
21
- from: ['object-row-table', 'array-row-table', 'columnar-table', 'arrow-table', 'arrow'],
21
+ from: ['object-row-table', 'array-row-table', 'columnar-table', 'arrow'],
22
22
  to: ['object-row-table', 'array-row-table', 'columnar-table', 'arrow'],
23
23
  canConvert(sourceShape, targetShape) {
24
24
  return sourceShape !== targetShape;
25
25
  },
26
26
  detectInputShape(input) {
27
- if (isNativeArrowTable(input)) return 'arrow';
27
+ if (isArrowTable(input)) return 'arrow';
28
28
  if (
29
29
  typeof input === 'object' &&
30
30
  input !== null &&
31
31
  'shape' in input &&
32
32
  typeof input.shape === 'string' &&
33
- ['object-row-table', 'array-row-table', 'columnar-table', 'arrow-table'].includes(input.shape)
33
+ ['object-row-table', 'array-row-table', 'columnar-table'].includes(input.shape)
34
34
  ) {
35
- return input.shape as TableShape | 'arrow-table';
35
+ return input.shape as TableShape;
36
36
  }
37
37
  return null;
38
38
  },
@@ -7,8 +7,7 @@ import type {
7
7
  ObjectRowTable,
8
8
  ArrayRowTable,
9
9
  ColumnarTable,
10
- GeoJSONTable,
11
- ArrowTable
10
+ GeoJSONTable
12
11
  } from '@loaders.gl/core/schema';
13
12
 
14
13
  /** Checks if a table is of array row layout */
@@ -30,8 +29,3 @@ export function isColumnarTable(table: Table): table is ColumnarTable {
30
29
  export function isGeoJSONTable(table: Table): table is GeoJSONTable {
31
30
  return table.shape === 'geojson-table';
32
31
  }
33
-
34
- /** Checks if table wraps an Apache Arrow table */
35
- export function isArrowTable(table: Table): table is ArrowTable {
36
- return table.shape === 'arrow-table';
37
- }
package/src/wkt/index.ts CHANGED
@@ -8,4 +8,4 @@ export {
8
8
  convertWKBToGeometry,
9
9
  convertWKTToGeometry
10
10
  } from '../arrow-geometry/geometry-codecs';
11
- export {isTWKB, convertTWKBToGeometry, convertGeometryToTWKB} from './twkb/index';
11
+ export {isTWKB, convertTWKBToGeometry, convertGeometryToTWKB} from './twkb';
@@ -2,4 +2,4 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // Copyright (c) vis.gl contributors
4
4
 
5
- export {NPM_TAG} from '../../constants/index';
5
+ export {NPM_TAG} from '../../constants';
@@ -1,27 +0,0 @@
1
- import type { ArrowTable, ArrowTableBatch, Table, TableBatch } from '@loaders.gl/core/schema';
2
- /** Table layouts supported by the Arrow wrapper adapters. */
3
- type ArrowTableShape = Exclude<Table['shape'], 'geojson-table' | 'arrow-table'>;
4
- /** A converted layout retaining the input wrapper's additional properties. */
5
- type ConvertedArrowTable<Input, Shape extends ArrowTableShape> = Omit<Input, 'shape' | 'data' | 'schema'> & Extract<Table, {
6
- shape: Shape;
7
- }>;
8
- /**
9
- * Converts an Arrow wrapper while preserving its schema and additional metadata.
10
- * Infers a schema when the wrapper omits it. Use the native Arrow table directly for Arrow output.
11
- * @param table Arrow table wrapper.
12
- * @param shape Requested table layout.
13
- * @returns Converted table with the input wrapper's metadata.
14
- */
15
- export declare function convertArrowTable<Input extends ArrowTable, Shape extends ArrowTableShape>(table: Input, shape: Shape): ConvertedArrowTable<Input, Shape>;
16
- /**
17
- * Converts an Arrow batch while retaining length, batch type, progress and metadata.
18
- * Does not combine or buffer batches.
19
- * @param batch Arrow table batch.
20
- * @param shape Requested table layout.
21
- * @returns Converted batch with the input batch's metadata.
22
- */
23
- export declare function convertArrowTableBatch<Input extends ArrowTableBatch, Shape extends ArrowTableShape>(batch: Input, shape: Shape): ConvertedArrowTable<Input, Shape> & Extract<TableBatch, {
24
- shape: Shape;
25
- }>;
26
- export {};
27
- //# sourceMappingURL=convert-arrow-table-wrapper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-arrow-table-wrapper.d.ts","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,UAAU,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,yBAAyB,CAAC;AAG5F,6DAA6D;AAC7D,KAAK,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,eAAe,GAAG,aAAa,CAAC,CAAC;AAEhF,8EAA8E;AAC9E,KAAK,mBAAmB,CAAC,KAAK,EAAE,KAAK,SAAS,eAAe,IAAI,IAAI,CACnE,KAAK,EACL,OAAO,GAAG,MAAM,GAAG,QAAQ,CAC5B,GACC,OAAO,CAAC,KAAK,EAAE;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC,CAAC;AAEjC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,UAAU,EAAE,KAAK,SAAS,eAAe,EACvF,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACX,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AAUrC;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,SAAS,eAAe,EAC7B,KAAK,SAAS,eAAe,EAE7B,KAAK,EAAE,KAAK,EACZ,KAAK,EAAE,KAAK,GACX,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,EAAE;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC,CAGzE"}
@@ -1,23 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
- import { convertArrowToTable } from "./convert-arrow-table.js";
5
- export function convertArrowTable(table, shape) {
6
- const converted = convertArrowToTable(table.data, shape);
7
- return {
8
- ...table,
9
- ...converted,
10
- schema: table.schema ?? converted.schema
11
- };
12
- }
13
- /**
14
- * Converts an Arrow batch while retaining length, batch type, progress and metadata.
15
- * Does not combine or buffer batches.
16
- * @param batch Arrow table batch.
17
- * @param shape Requested table layout.
18
- * @returns Converted batch with the input batch's metadata.
19
- */
20
- export function convertArrowTableBatch(batch, shape) {
21
- return convertArrowTable(batch, shape);
22
- }
23
- //# sourceMappingURL=convert-arrow-table-wrapper.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"convert-arrow-table-wrapper.js","sourceRoot":"","sources":["../../../../../src/schema-utils/lib/table/tables/convert-arrow-table-wrapper.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAGpC,OAAO,EAAC,mBAAmB,EAAC,iCAA8B;AAuB1D,MAAM,UAAU,iBAAiB,CAAC,KAAiB,EAAE,KAAsB;IACzE,MAAM,SAAS,GAAG,mBAAmB,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACzD,OAAO;QACL,GAAG,KAAK;QACR,GAAG,SAAS;QACZ,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM;KACzC,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB,CAIpC,KAAY,EACZ,KAAY;IAEZ,OAAO,iBAAiB,CAAC,KAAK,EAAE,KAAK,CACA,CAAC;AACxC,CAAC"}
@@ -1,54 +0,0 @@
1
- // loaders.gl
2
- // SPDX-License-Identifier: MIT
3
- // Copyright (c) vis.gl contributors
4
-
5
- import type {ArrowTable, ArrowTableBatch, Table, TableBatch} from '@loaders.gl/core/schema';
6
- import {convertArrowToTable} from './convert-arrow-table';
7
-
8
- /** Table layouts supported by the Arrow wrapper adapters. */
9
- type ArrowTableShape = Exclude<Table['shape'], 'geojson-table' | 'arrow-table'>;
10
-
11
- /** A converted layout retaining the input wrapper's additional properties. */
12
- type ConvertedArrowTable<Input, Shape extends ArrowTableShape> = Omit<
13
- Input,
14
- 'shape' | 'data' | 'schema'
15
- > &
16
- Extract<Table, {shape: Shape}>;
17
-
18
- /**
19
- * Converts an Arrow wrapper while preserving its schema and additional metadata.
20
- * Infers a schema when the wrapper omits it. Use the native Arrow table directly for Arrow output.
21
- * @param table Arrow table wrapper.
22
- * @param shape Requested table layout.
23
- * @returns Converted table with the input wrapper's metadata.
24
- */
25
- export function convertArrowTable<Input extends ArrowTable, Shape extends ArrowTableShape>(
26
- table: Input,
27
- shape: Shape
28
- ): ConvertedArrowTable<Input, Shape>;
29
- export function convertArrowTable(table: ArrowTable, shape: ArrowTableShape): Table {
30
- const converted = convertArrowToTable(table.data, shape);
31
- return {
32
- ...table,
33
- ...converted,
34
- schema: table.schema ?? converted.schema
35
- };
36
- }
37
-
38
- /**
39
- * Converts an Arrow batch while retaining length, batch type, progress and metadata.
40
- * Does not combine or buffer batches.
41
- * @param batch Arrow table batch.
42
- * @param shape Requested table layout.
43
- * @returns Converted batch with the input batch's metadata.
44
- */
45
- export function convertArrowTableBatch<
46
- Input extends ArrowTableBatch,
47
- Shape extends ArrowTableShape
48
- >(
49
- batch: Input,
50
- shape: Shape
51
- ): ConvertedArrowTable<Input, Shape> & Extract<TableBatch, {shape: Shape}> {
52
- return convertArrowTable(batch, shape) as ConvertedArrowTable<Input, Shape> &
53
- Extract<TableBatch, {shape: Shape}>;
54
- }