@loaders.gl/core 5.0.0-beta.7 → 5.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (819) hide show
  1. package/GEOARROW-README.md +6 -0
  2. package/SCAN-README.md +2 -2
  3. package/SCHEMA-UTILS-README.md +1 -1
  4. package/dist/arrow-geometry/binary-features.cjs +4 -1
  5. package/dist/arrow-geometry/binary-features.cjs.map +2 -2
  6. package/dist/arrow-geometry/binary-features.d.ts.map +1 -1
  7. package/dist/arrow-geometry/binary-features.js +1 -1
  8. package/dist/arrow-geometry/binary-features.js.map +1 -1
  9. package/dist/arrow-geometry/binary-geometry-to-wkb.cjs +2 -2
  10. package/dist/arrow-geometry/binary-geometry-to-wkb.cjs.map +2 -2
  11. package/dist/arrow-geometry/binary-geometry-to-wkb.js +1 -1
  12. package/dist/arrow-geometry/binary-geometry-to-wkb.js.map +1 -1
  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 +1 -1
  17. package/dist/arrow-geometry/feature-collection-to-arrow.js.map +1 -1
  18. package/dist/arrow-geometry/feature-table.cjs +2 -6
  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 -9
  23. package/dist/arrow-geometry/feature-table.js.map +1 -1
  24. package/dist/arrow-geometry/geojson-table.cjs +295 -18
  25. package/dist/arrow-geometry/geojson-table.cjs.map +4 -4
  26. package/dist/arrow-geometry/geojson-table.d.ts +10 -3
  27. package/dist/arrow-geometry/geojson-table.d.ts.map +1 -1
  28. package/dist/arrow-geometry/geojson-table.js +23 -13
  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 +59 -35
  59. package/dist/arrow-worker-transport.cjs.map +1 -1
  60. package/dist/arrow-worker-transport.d.ts +9 -7
  61. package/dist/arrow-worker-transport.d.ts.map +1 -1
  62. package/dist/arrow-worker-transport.js +59 -42
  63. package/dist/arrow-worker-transport.js.map +1 -1
  64. package/dist/cluster-source.cjs +274 -509
  65. package/dist/cluster-source.cjs.map +3 -3
  66. package/dist/dist.dev.js +478 -450
  67. package/dist/dist.min.js +3 -3
  68. package/dist/federated-table-scan-source.cjs +121 -485
  69. package/dist/federated-table-scan-source.cjs.map +3 -3
  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 +16 -19
  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 +13 -18
  81. package/dist/geoarrow/clustering/cluster-source.js.map +1 -1
  82. package/dist/geoarrow/convert-table-to-geoarrow.cjs +5 -12
  83. package/dist/geoarrow/convert-table-to-geoarrow.cjs.map +2 -2
  84. package/dist/geoarrow/convert-table-to-geoarrow.d.ts +6 -6
  85. package/dist/geoarrow/convert-table-to-geoarrow.d.ts.map +1 -1
  86. package/dist/geoarrow/convert-table-to-geoarrow.js +8 -14
  87. package/dist/geoarrow/convert-table-to-geoarrow.js.map +1 -1
  88. package/dist/geoarrow/geo-column/geo-column.cjs.map +1 -1
  89. package/dist/geoarrow/geo-column/geo-column.d.ts +1 -1
  90. package/dist/geoarrow/geo-column/geo-column.d.ts.map +1 -1
  91. package/dist/geoarrow/geoarrow-bounds.cjs +7 -7
  92. package/dist/geoarrow/geoarrow-bounds.cjs.map +3 -3
  93. package/dist/geoarrow/geoarrow-bounds.js +3 -3
  94. package/dist/geoarrow/geoarrow-bounds.js.map +1 -1
  95. package/dist/geoarrow/geoarrow-capabilities.cjs +2 -2
  96. package/dist/geoarrow/geoarrow-capabilities.cjs.map +2 -2
  97. package/dist/geoarrow/geoarrow-capabilities.js +1 -1
  98. package/dist/geoarrow/geoarrow-capabilities.js.map +1 -1
  99. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs +13 -15
  100. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.cjs.map +3 -3
  101. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.d.ts.map +1 -1
  102. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js +8 -11
  103. package/dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js.map +1 -1
  104. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs +6 -4
  105. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.cjs.map +2 -2
  106. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts +3 -3
  107. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.d.ts.map +1 -1
  108. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js +9 -4
  109. package/dist/geoarrow/geoarrow-converter/convert-geoarrow.js.map +1 -1
  110. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs +5 -4
  111. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.cjs.map +2 -2
  112. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts +3 -3
  113. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.d.ts.map +1 -1
  114. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js +5 -4
  115. package/dist/geoarrow/geoarrow-converter/geoarrow-converter.js.map +1 -1
  116. package/dist/geoarrow/geoarrow-inspection.cjs +2 -2
  117. package/dist/geoarrow/geoarrow-inspection.cjs.map +2 -2
  118. package/dist/geoarrow/geoarrow-inspection.js +1 -1
  119. package/dist/geoarrow/geoarrow-inspection.js.map +1 -1
  120. package/dist/geoarrow/geoarrow-stream.cjs +10 -11
  121. package/dist/geoarrow/geoarrow-stream.cjs.map +2 -2
  122. package/dist/geoarrow/geoarrow-stream.d.ts +2 -2
  123. package/dist/geoarrow/geoarrow-stream.d.ts.map +1 -1
  124. package/dist/geoarrow/geoarrow-stream.js +9 -12
  125. package/dist/geoarrow/geoarrow-stream.js.map +1 -1
  126. package/dist/geoarrow/get-geoarrow-vertex-count.cjs +2 -2
  127. package/dist/geoarrow/get-geoarrow-vertex-count.cjs.map +2 -2
  128. package/dist/geoarrow/get-geoarrow-vertex-count.js +1 -1
  129. package/dist/geoarrow/get-geoarrow-vertex-count.js.map +1 -1
  130. package/dist/geoarrow/index.cjs +0 -3
  131. package/dist/geoarrow/index.cjs.map +2 -2
  132. package/dist/geoarrow/index.d.ts +0 -2
  133. package/dist/geoarrow/index.d.ts.map +1 -1
  134. package/dist/geoarrow/index.js +0 -1
  135. package/dist/geoarrow/index.js.map +1 -1
  136. package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.cjs.map +1 -1
  137. package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js +3 -3
  138. package/dist/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.js.map +1 -1
  139. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs +8 -9
  140. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.cjs.map +2 -2
  141. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.d.ts.map +1 -1
  142. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js +5 -9
  143. package/dist/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.js.map +1 -1
  144. package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs +2 -2
  145. package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.cjs.map +2 -2
  146. package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts +1 -1
  147. package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.d.ts.map +1 -1
  148. package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js +1 -1
  149. package/dist/geoarrow/lib/geoarrow/geoarrow-union-kind.js.map +1 -1
  150. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs +4 -4
  151. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.cjs.map +2 -2
  152. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js +1 -1
  153. package/dist/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.js.map +1 -1
  154. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs +3 -3
  155. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.cjs.map +2 -2
  156. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js +1 -1
  157. package/dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js.map +1 -1
  158. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs +3 -3
  159. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.cjs.map +2 -2
  160. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js +1 -1
  161. package/dist/geoarrow/lib/kernels/encode-geoarrow-box.js.map +1 -1
  162. package/dist/geoarrow/lib/kernels/geoarrow-union.cjs +2 -2
  163. package/dist/geoarrow/lib/kernels/geoarrow-union.cjs.map +2 -2
  164. package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts +1 -1
  165. package/dist/geoarrow/lib/kernels/geoarrow-union.d.ts.map +1 -1
  166. package/dist/geoarrow/lib/kernels/geoarrow-union.js +1 -1
  167. package/dist/geoarrow/lib/kernels/geoarrow-union.js.map +1 -1
  168. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs +0 -6
  169. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.cjs.map +2 -2
  170. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts +5 -3
  171. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.d.ts.map +1 -1
  172. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js +0 -6
  173. package/dist/geoarrow/lib/table-converters/convert-geoarrow-table.js.map +1 -1
  174. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs +3 -2
  175. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.cjs.map +2 -2
  176. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts +1 -1
  177. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.d.ts.map +1 -1
  178. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js +3 -2
  179. package/dist/geoarrow/mesharrow/arrow-fixed-size-list-utils.js.map +1 -1
  180. package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.cjs.map +1 -1
  181. package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
  182. package/dist/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
  183. package/dist/geoarrow/mesharrow/get-deck-binary-data.cjs.map +1 -1
  184. package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts +1 -1
  185. package/dist/geoarrow/mesharrow/get-deck-binary-data.d.ts.map +1 -1
  186. package/dist/geoarrow/mesharrow/mesh-accessors.cjs.map +1 -1
  187. package/dist/geoarrow/mesharrow/mesh-accessors.d.ts +1 -1
  188. package/dist/geoarrow/mesharrow/mesh-accessors.d.ts.map +1 -1
  189. package/dist/geoarrow/metadata/geoarrow-metadata.cjs +44 -2
  190. package/dist/geoarrow/metadata/geoarrow-metadata.cjs.map +4 -4
  191. package/dist/geoarrow/metadata/geoarrow-metadata.d.ts.map +1 -1
  192. package/dist/geoarrow/metadata/geoarrow-metadata.js +3 -4
  193. package/dist/geoarrow/metadata/geoarrow-metadata.js.map +1 -1
  194. package/dist/index.cjs +486 -410
  195. package/dist/index.cjs.map +3 -3
  196. package/dist/index.d.ts +2 -4
  197. package/dist/index.d.ts.map +1 -1
  198. package/dist/index.js +2 -5
  199. package/dist/index.js.map +1 -1
  200. package/dist/lib/api/create-data-source.d.ts +20 -9
  201. package/dist/lib/api/create-data-source.d.ts.map +1 -1
  202. package/dist/lib/api/create-data-source.js +55 -45
  203. package/dist/lib/api/create-data-source.js.map +1 -1
  204. package/dist/lib/api/encode.d.ts +1 -1
  205. package/dist/lib/api/encode.d.ts.map +1 -1
  206. package/dist/lib/api/encode.js +11 -2
  207. package/dist/lib/api/encode.js.map +1 -1
  208. package/dist/lib/api/load-in-batches.d.ts +3 -2
  209. package/dist/lib/api/load-in-batches.d.ts.map +1 -1
  210. package/dist/lib/api/load-in-batches.js.map +1 -1
  211. package/dist/lib/api/load-loader.d.ts +3 -3
  212. package/dist/lib/api/load-loader.d.ts.map +1 -1
  213. package/dist/lib/api/load-loader.js +15 -19
  214. package/dist/lib/api/load-loader.js.map +1 -1
  215. package/dist/lib/api/load.d.ts +7 -3
  216. package/dist/lib/api/load.d.ts.map +1 -1
  217. package/dist/lib/api/load.js +15 -67
  218. package/dist/lib/api/load.js.map +1 -1
  219. package/dist/lib/api/loader-options.d.ts +6 -0
  220. package/dist/lib/api/loader-options.d.ts.map +1 -1
  221. package/dist/lib/api/loader-options.js +48 -0
  222. package/dist/lib/api/loader-options.js.map +1 -1
  223. package/dist/lib/api/parse-file.d.ts +5 -3
  224. package/dist/lib/api/parse-file.d.ts.map +1 -1
  225. package/dist/lib/api/parse-file.js +8 -6
  226. package/dist/lib/api/parse-file.js.map +1 -1
  227. package/dist/lib/api/parse-in-batches.d.ts +5 -3
  228. package/dist/lib/api/parse-in-batches.d.ts.map +1 -1
  229. package/dist/lib/api/parse-in-batches.js +60 -9
  230. package/dist/lib/api/parse-in-batches.js.map +1 -1
  231. package/dist/lib/api/parse-sync.d.ts +5 -3
  232. package/dist/lib/api/parse-sync.d.ts.map +1 -1
  233. package/dist/lib/api/parse-sync.js +3 -4
  234. package/dist/lib/api/parse-sync.js.map +1 -1
  235. package/dist/lib/api/parse.d.ts +5 -3
  236. package/dist/lib/api/parse.d.ts.map +1 -1
  237. package/dist/lib/api/parse.js +22 -14
  238. package/dist/lib/api/parse.js.map +1 -1
  239. package/dist/lib/api/select-loader.d.ts +4 -2
  240. package/dist/lib/api/select-loader.d.ts.map +1 -1
  241. package/dist/lib/api/select-loader.js +47 -53
  242. package/dist/lib/api/select-loader.js.map +1 -1
  243. package/dist/lib/api/select-source.d.ts.map +1 -1
  244. package/dist/lib/api/select-source.js +1 -1
  245. package/dist/lib/api/select-source.js.map +1 -1
  246. package/dist/lib/init.js +1 -1
  247. package/dist/lib/init.js.map +1 -1
  248. package/dist/lib/loader-utils/get-fetch-function.js +2 -2
  249. package/dist/lib/loader-utils/get-fetch-function.js.map +1 -1
  250. package/dist/lib/loader-utils/loggers.d.ts +2 -37
  251. package/dist/lib/loader-utils/loggers.d.ts.map +1 -1
  252. package/dist/lib/loader-utils/loggers.js +2 -63
  253. package/dist/lib/loader-utils/loggers.js.map +1 -1
  254. package/dist/lib/loader-utils/native-arrow.d.ts +13 -0
  255. package/dist/lib/loader-utils/native-arrow.d.ts.map +1 -0
  256. package/dist/lib/loader-utils/native-arrow.js +66 -0
  257. package/dist/lib/loader-utils/native-arrow.js.map +1 -0
  258. package/dist/lib/loader-utils/option-defaults.d.ts +3 -2
  259. package/dist/lib/loader-utils/option-defaults.d.ts.map +1 -1
  260. package/dist/lib/loader-utils/option-defaults.js +9 -10
  261. package/dist/lib/loader-utils/option-defaults.js.map +1 -1
  262. package/dist/lib/loader-utils/option-utils.d.ts +0 -6
  263. package/dist/lib/loader-utils/option-utils.d.ts.map +1 -1
  264. package/dist/lib/loader-utils/option-utils.js +31 -114
  265. package/dist/lib/loader-utils/option-utils.js.map +1 -1
  266. package/dist/loader-utils/format-types.d.ts +3 -0
  267. package/dist/loader-utils/format-types.d.ts.map +1 -1
  268. package/dist/loader-utils/index.cjs +257 -88
  269. package/dist/loader-utils/index.cjs.map +3 -3
  270. package/dist/loader-utils/index.d.ts +9 -4
  271. package/dist/loader-utils/index.d.ts.map +1 -1
  272. package/dist/loader-utils/index.js +5 -3
  273. package/dist/loader-utils/index.js.map +1 -1
  274. package/dist/loader-utils/json-loader.js +1 -1
  275. package/dist/loader-utils/json-loader.js.map +1 -1
  276. package/dist/loader-utils/lib/log-utils/log.d.ts +23 -1
  277. package/dist/loader-utils/lib/log-utils/log.d.ts.map +1 -1
  278. package/dist/loader-utils/lib/log-utils/log.js +32 -1
  279. package/dist/loader-utils/lib/log-utils/log.js.map +1 -1
  280. package/dist/loader-utils/lib/pace-batch-iterator.d.ts +14 -0
  281. package/dist/loader-utils/lib/pace-batch-iterator.d.ts.map +1 -0
  282. package/dist/loader-utils/lib/pace-batch-iterator.js +51 -0
  283. package/dist/loader-utils/lib/pace-batch-iterator.js.map +1 -0
  284. package/dist/loader-utils/lib/request-utils/request-credentials.js +1 -1
  285. package/dist/loader-utils/lib/request-utils/request-credentials.js.map +1 -1
  286. package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts +5 -0
  287. package/dist/loader-utils/lib/scan-utils/logical-table-query.d.ts.map +1 -1
  288. package/dist/loader-utils/lib/scan-utils/logical-table-query.js +13 -5
  289. package/dist/loader-utils/lib/scan-utils/logical-table-query.js.map +1 -1
  290. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts +48 -3
  291. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.d.ts.map +1 -1
  292. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js +12 -1
  293. package/dist/loader-utils/lib/scan-utils/scan-query-metadata.js.map +1 -1
  294. package/dist/loader-utils/lib/scan-utils/table-query.d.ts +22 -1
  295. package/dist/loader-utils/lib/scan-utils/table-query.d.ts.map +1 -1
  296. package/dist/loader-utils/lib/scan-utils/table-query.js +6 -0
  297. package/dist/loader-utils/lib/scan-utils/table-query.js.map +1 -1
  298. package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts +17 -11
  299. package/dist/loader-utils/lib/scan-utils/table-scan-batch.d.ts.map +1 -1
  300. package/dist/loader-utils/lib/scan-utils/table-scan-batch.js +53 -32
  301. package/dist/loader-utils/lib/scan-utils/table-scan-batch.js.map +1 -1
  302. package/dist/loader-utils/lib/sources/data-source.d.ts.map +1 -1
  303. package/dist/loader-utils/lib/sources/data-source.js +3 -13
  304. package/dist/loader-utils/lib/sources/data-source.js.map +1 -1
  305. package/dist/loader-utils/lib/sources/image-source.d.ts +1 -1
  306. package/dist/loader-utils/lib/sources/table-source-collection.d.ts +2 -1
  307. package/dist/loader-utils/lib/sources/table-source-collection.d.ts.map +1 -1
  308. package/dist/loader-utils/lib/sources/tile-grid.d.ts +6 -1
  309. package/dist/loader-utils/lib/sources/tile-grid.d.ts.map +1 -1
  310. package/dist/loader-utils/lib/sources/tile-grid.js +32 -14
  311. package/dist/loader-utils/lib/sources/tile-grid.js.map +1 -1
  312. package/dist/loader-utils/lib/sources/utils/utils.js +1 -1
  313. package/dist/loader-utils/lib/sources/utils/utils.js.map +1 -1
  314. package/dist/loader-utils/lib/sources/vector-source.d.ts +4 -3
  315. package/dist/loader-utils/lib/sources/vector-source.d.ts.map +1 -1
  316. package/dist/loader-utils/lib/sources/vector-tile-source.d.ts +4 -3
  317. package/dist/loader-utils/lib/sources/vector-tile-source.d.ts.map +1 -1
  318. package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.d.ts.map +1 -1
  319. package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js +26 -15
  320. package/dist/loader-utils/lib/worker-loader-utils/parse-with-worker.js.map +1 -1
  321. package/dist/loader-utils/loader-types.d.ts +114 -87
  322. package/dist/loader-utils/loader-types.d.ts.map +1 -1
  323. package/dist/loader-utils/loader-types.js.map +1 -1
  324. package/dist/loader-utils/source-types.d.ts +7 -5
  325. package/dist/loader-utils/source-types.d.ts.map +1 -1
  326. package/dist/loader-utils/source-types.js +9 -1
  327. package/dist/loader-utils/source-types.js.map +1 -1
  328. package/dist/loader-utils/tile-grid.cjs +21 -9
  329. package/dist/loader-utils/tile-grid.cjs.map +1 -1
  330. package/dist/null-loader.d.ts +0 -18
  331. package/dist/null-loader.d.ts.map +1 -1
  332. package/dist/null-loader.js +1 -19
  333. package/dist/null-loader.js.map +1 -1
  334. package/dist/null-worker-node.js +1 -1
  335. package/dist/null-worker.js +1 -1
  336. package/dist/polyfills/index.cjs +3 -2
  337. package/dist/polyfills/index.d.ts.map +1 -1
  338. package/dist/polyfills/index.js +2 -2
  339. package/dist/polyfills/index.js.map +1 -1
  340. package/dist/scan/arrow-execution/expressions.cjs +36 -12
  341. package/dist/scan/arrow-execution/expressions.cjs.map +3 -3
  342. package/dist/scan/arrow-execution/expressions.d.ts +7 -4
  343. package/dist/scan/arrow-execution/expressions.d.ts.map +1 -1
  344. package/dist/scan/arrow-execution/expressions.js +32 -6
  345. package/dist/scan/arrow-execution/expressions.js.map +1 -1
  346. package/dist/scan/arrow-execution/filter-arrow-table.cjs +3 -18
  347. package/dist/scan/arrow-execution/filter-arrow-table.cjs.map +2 -2
  348. package/dist/scan/arrow-execution/filter-arrow-table.d.ts.map +1 -1
  349. package/dist/scan/arrow-execution/filter-arrow-table.js +3 -9
  350. package/dist/scan/arrow-execution/filter-arrow-table.js.map +1 -1
  351. package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs +41 -0
  352. package/dist/scan/arrow-execution/portable-predicate-compatibility.cjs.map +7 -0
  353. package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts +5 -0
  354. package/dist/scan/arrow-execution/portable-predicate-compatibility.d.ts.map +1 -0
  355. package/dist/scan/arrow-execution/portable-predicate-compatibility.js +23 -0
  356. package/dist/scan/arrow-execution/portable-predicate-compatibility.js.map +1 -0
  357. package/dist/scan/arrow-query-worker-entry.cjs +121 -0
  358. package/dist/scan/arrow-query-worker-entry.cjs.map +7 -0
  359. package/dist/scan/arrow-query-worker-entry.d.ts +2 -0
  360. package/dist/scan/arrow-query-worker-entry.d.ts.map +1 -0
  361. package/dist/scan/arrow-query-worker-entry.js +7 -0
  362. package/dist/scan/arrow-query-worker-entry.js.map +1 -0
  363. package/dist/scan/arrow-query-worker.cjs +197 -0
  364. package/dist/scan/arrow-query-worker.cjs.map +7 -0
  365. package/dist/scan/arrow-query-worker.d.ts +47 -0
  366. package/dist/scan/arrow-query-worker.d.ts.map +1 -0
  367. package/dist/scan/arrow-query-worker.js +101 -0
  368. package/dist/scan/arrow-query-worker.js.map +1 -0
  369. package/dist/scan/arrow-query.cjs +6 -2
  370. package/dist/scan/arrow-query.cjs.map +2 -2
  371. package/dist/scan/arrow-query.d.ts +3 -1
  372. package/dist/scan/arrow-query.d.ts.map +1 -1
  373. package/dist/scan/arrow-query.js +3 -1
  374. package/dist/scan/arrow-query.js.map +1 -1
  375. package/dist/scan/federated-table-scan-source.cjs +38 -39
  376. package/dist/scan/federated-table-scan-source.cjs.map +2 -2
  377. package/dist/scan/federated-table-scan-source.d.ts +5 -9
  378. package/dist/scan/federated-table-scan-source.d.ts.map +1 -1
  379. package/dist/scan/federated-table-scan-source.js +35 -36
  380. package/dist/scan/federated-table-scan-source.js.map +1 -1
  381. package/dist/scan/index.cjs +36 -12
  382. package/dist/scan/index.cjs.map +3 -3
  383. package/dist/scan/index.d.ts +11 -6
  384. package/dist/scan/index.d.ts.map +1 -1
  385. package/dist/scan/index.js +8 -5
  386. package/dist/scan/index.js.map +1 -1
  387. package/dist/scan/parse-sql-predicate.cjs +2 -2
  388. package/dist/scan/parse-sql-predicate.cjs.map +2 -2
  389. package/dist/scan/parse-sql-predicate.js +1 -1
  390. package/dist/scan/parse-sql-predicate.js.map +1 -1
  391. package/dist/scan/query-arrow-table-in-batches.cjs +60 -26
  392. package/dist/scan/query-arrow-table-in-batches.cjs.map +3 -3
  393. package/dist/scan/query-arrow-table-in-batches.d.ts +3 -3
  394. package/dist/scan/query-arrow-table-in-batches.d.ts.map +1 -1
  395. package/dist/scan/query-arrow-table-in-batches.js +52 -24
  396. package/dist/scan/query-arrow-table-in-batches.js.map +1 -1
  397. package/dist/{geoarrow/get-geoarrow-native-geometry.cjs → scan/query-arrow-table-math.cjs} +18 -8
  398. package/dist/scan/query-arrow-table-math.cjs.map +7 -0
  399. package/dist/scan/query-arrow-table-math.d.ts +5 -0
  400. package/dist/scan/query-arrow-table-math.d.ts.map +1 -0
  401. package/dist/scan/query-arrow-table-math.js +14 -0
  402. package/dist/scan/query-arrow-table-math.js.map +1 -0
  403. package/dist/scan/query-arrow-table.cjs +32 -62
  404. package/dist/scan/query-arrow-table.cjs.map +2 -2
  405. package/dist/scan/query-arrow-table.d.ts +13 -8
  406. package/dist/scan/query-arrow-table.d.ts.map +1 -1
  407. package/dist/scan/query-arrow-table.js +35 -67
  408. package/dist/scan/query-arrow-table.js.map +1 -1
  409. package/dist/scan/query-grouped-sql.cjs +66 -0
  410. package/dist/scan/query-grouped-sql.cjs.map +7 -0
  411. package/dist/scan/query-grouped-sql.d.ts +5 -0
  412. package/dist/scan/query-grouped-sql.d.ts.map +1 -0
  413. package/dist/scan/query-grouped-sql.js +58 -0
  414. package/dist/scan/query-grouped-sql.js.map +1 -0
  415. package/dist/scan/query-open-source.cjs +52 -0
  416. package/dist/scan/query-open-source.cjs.map +7 -0
  417. package/dist/scan/query-open-source.d.ts +4 -0
  418. package/dist/scan/query-open-source.d.ts.map +1 -0
  419. package/dist/scan/query-open-source.js +26 -0
  420. package/dist/scan/query-open-source.js.map +1 -0
  421. package/dist/scan/query-progressive.cjs +190 -0
  422. package/dist/scan/query-progressive.cjs.map +7 -0
  423. package/dist/scan/query-progressive.d.ts +41 -0
  424. package/dist/scan/query-progressive.d.ts.map +1 -0
  425. package/dist/scan/query-progressive.js +173 -0
  426. package/dist/scan/query-progressive.js.map +1 -0
  427. package/dist/scan/query-pushdown.cjs +140 -0
  428. package/dist/scan/query-pushdown.cjs.map +7 -0
  429. package/dist/scan/query-pushdown.d.ts +14 -0
  430. package/dist/scan/query-pushdown.d.ts.map +1 -0
  431. package/dist/scan/query-pushdown.js +133 -0
  432. package/dist/scan/query-pushdown.js.map +1 -0
  433. package/dist/scan/query-scales.cjs +195 -0
  434. package/dist/scan/query-scales.cjs.map +7 -0
  435. package/dist/scan/query-scales.d.ts +47 -0
  436. package/dist/scan/query-scales.d.ts.map +1 -0
  437. package/dist/scan/query-scales.js +201 -0
  438. package/dist/scan/query-scales.js.map +1 -0
  439. package/dist/scan/query.cjs +141 -92
  440. package/dist/scan/query.cjs.map +3 -3
  441. package/dist/scan/query.d.ts +37 -10
  442. package/dist/scan/query.d.ts.map +1 -1
  443. package/dist/scan/query.js +137 -96
  444. package/dist/scan/query.js.map +1 -1
  445. package/dist/scan/rows-to-arrow.cjs +1 -28
  446. package/dist/scan/rows-to-arrow.cjs.map +2 -2
  447. package/dist/scan/rows-to-arrow.d.ts +3 -3
  448. package/dist/scan/rows-to-arrow.d.ts.map +1 -1
  449. package/dist/scan/rows-to-arrow.js +2 -32
  450. package/dist/scan/rows-to-arrow.js.map +1 -1
  451. package/dist/scan/scan-engine.cjs +1 -1
  452. package/dist/scan/scan-engine.cjs.map +2 -2
  453. package/dist/scan/scan-engine.d.ts +5 -5
  454. package/dist/scan/scan-engine.d.ts.map +1 -1
  455. package/dist/scan/scan-engine.js +1 -1
  456. package/dist/scan/scan-engine.js.map +1 -1
  457. package/dist/scan/vector-table-scan-source.cjs +24 -17
  458. package/dist/scan/vector-table-scan-source.cjs.map +4 -4
  459. package/dist/scan/vector-table-scan-source.d.ts +8 -8
  460. package/dist/scan/vector-table-scan-source.d.ts.map +1 -1
  461. package/dist/scan/vector-table-scan-source.js +19 -17
  462. package/dist/scan/vector-table-scan-source.js.map +1 -1
  463. package/dist/schema/categories/category-mesh.d.ts +3 -10
  464. package/dist/schema/categories/category-mesh.d.ts.map +1 -1
  465. package/dist/schema/categories/category-mesh.js.map +1 -1
  466. package/dist/schema/categories/category-table.d.ts +2 -19
  467. package/dist/schema/categories/category-table.d.ts.map +1 -1
  468. package/dist/schema/float16.js +1 -1
  469. package/dist/schema/float16.js.map +1 -1
  470. package/dist/schema/geometry/arrow-binary-features.d.ts +1 -1
  471. package/dist/schema/geometry/arrow-binary-features.d.ts.map +1 -1
  472. package/dist/schema/geometry/geoarrow.d.ts +2 -2
  473. package/dist/schema/geometry/geoarrow.d.ts.map +1 -1
  474. package/dist/schema/index.cjs +14 -10
  475. package/dist/schema/index.cjs.map +2 -2
  476. package/dist/schema/index.d.ts +4 -4
  477. package/dist/schema/index.d.ts.map +1 -1
  478. package/dist/schema/index.js +2 -2
  479. package/dist/schema/index.js.map +1 -1
  480. package/dist/schema/types/batch.d.ts +0 -4
  481. package/dist/schema/types/batch.d.ts.map +1 -1
  482. package/dist/schema-utils/index.cjs +410 -626
  483. package/dist/schema-utils/index.cjs.map +3 -3
  484. package/dist/schema-utils/index.d.ts +6 -6
  485. package/dist/schema-utils/index.d.ts.map +1 -1
  486. package/dist/schema-utils/index.js +6 -5
  487. package/dist/schema-utils/index.js.map +1 -1
  488. package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts +16 -0
  489. package/dist/schema-utils/lib/arrow/arrow-metadata.d.ts.map +1 -0
  490. package/dist/schema-utils/lib/arrow/arrow-metadata.js +109 -0
  491. package/dist/schema-utils/lib/arrow/arrow-metadata.js.map +1 -0
  492. package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts +1 -1
  493. package/dist/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.d.ts.map +1 -1
  494. package/dist/schema-utils/lib/converters/convert.js +9 -2
  495. package/dist/schema-utils/lib/converters/convert.js.map +1 -1
  496. package/dist/schema-utils/lib/converters/types.d.ts +2 -0
  497. package/dist/schema-utils/lib/converters/types.d.ts.map +1 -1
  498. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts +8 -12
  499. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.d.ts.map +1 -1
  500. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js +8 -21
  501. package/dist/schema-utils/lib/mesh/convert-mesh-to-table.js.map +1 -1
  502. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts +5 -4
  503. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.d.ts.map +1 -1
  504. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js +18 -13
  505. package/dist/schema-utils/lib/mesh/convert-table-to-mesh.js.map +1 -1
  506. package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts +14 -0
  507. package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.d.ts.map +1 -0
  508. package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js +39 -0
  509. package/dist/schema-utils/lib/mesh/get-mesh-bounding-box.js.map +1 -0
  510. package/dist/schema-utils/lib/mesh/mesh-utils.d.ts +2 -14
  511. package/dist/schema-utils/lib/mesh/mesh-utils.d.ts.map +1 -1
  512. package/dist/schema-utils/lib/mesh/mesh-utils.js +1 -35
  513. package/dist/schema-utils/lib/mesh/mesh-utils.js.map +1 -1
  514. package/dist/schema-utils/lib/mesh/point-cloud-tiler.d.ts.map +1 -1
  515. package/dist/schema-utils/lib/mesh/point-cloud-tiler.js +6 -5
  516. package/dist/schema-utils/lib/mesh/point-cloud-tiler.js.map +1 -1
  517. package/dist/schema-utils/lib/schema/data-type.js +1 -1
  518. package/dist/schema-utils/lib/schema/data-type.js.map +1 -1
  519. package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts +2 -1
  520. package/dist/schema-utils/lib/schema/deduce-table-schema.d.ts.map +1 -1
  521. package/dist/schema-utils/lib/schema/deduce-table-schema.js +7 -3
  522. package/dist/schema-utils/lib/schema/deduce-table-schema.js.map +1 -1
  523. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts +6 -5
  524. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.d.ts.map +1 -1
  525. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js +6 -5
  526. package/dist/schema-utils/lib/table/arrow-api/arrow-like-table.js.map +1 -1
  527. package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts +9 -9
  528. package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.d.ts.map +1 -1
  529. package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js +13 -46
  530. package/dist/schema-utils/lib/table/batch-builder/arrow-table-builder.js.map +1 -1
  531. package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts +9 -20
  532. package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.d.ts.map +1 -1
  533. package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js +61 -73
  534. package/dist/schema-utils/lib/table/batch-builder/table-batch-builder.js.map +1 -1
  535. package/dist/schema-utils/lib/table/batches/convert-batches.d.ts +4 -3
  536. package/dist/schema-utils/lib/table/batches/convert-batches.d.ts.map +1 -1
  537. package/dist/schema-utils/lib/table/batches/convert-batches.js +27 -9
  538. package/dist/schema-utils/lib/table/batches/convert-batches.js.map +1 -1
  539. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts +6 -9
  540. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.d.ts.map +1 -1
  541. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js +22 -15
  542. package/dist/schema-utils/lib/table/batches/make-arrow-batch-iterator.js.map +1 -1
  543. package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts +4 -1
  544. package/dist/schema-utils/lib/table/batches/make-table-from-batches.d.ts.map +1 -1
  545. package/dist/schema-utils/lib/table/batches/make-table-from-batches.js +13 -9
  546. package/dist/schema-utils/lib/table/batches/make-table-from-batches.js.map +1 -1
  547. package/dist/schema-utils/lib/table/query-arrow-table.d.ts +3 -3
  548. package/dist/schema-utils/lib/table/query-arrow-table.d.ts.map +1 -1
  549. package/dist/schema-utils/lib/table/query-arrow-table.js +9 -23
  550. package/dist/schema-utils/lib/table/query-arrow-table.js.map +1 -1
  551. package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts +9 -10
  552. package/dist/schema-utils/lib/table/tables/convert-arrow-table.d.ts.map +1 -1
  553. package/dist/schema-utils/lib/table/tables/convert-arrow-table.js +15 -76
  554. package/dist/schema-utils/lib/table/tables/convert-arrow-table.js.map +1 -1
  555. package/dist/schema-utils/lib/table/tables/convert-table.d.ts +6 -36
  556. package/dist/schema-utils/lib/table/tables/convert-table.d.ts.map +1 -1
  557. package/dist/schema-utils/lib/table/tables/convert-table.js +5 -42
  558. package/dist/schema-utils/lib/table/tables/convert-table.js.map +1 -1
  559. package/dist/schema-utils/lib/table/tables/make-table.d.ts +3 -55
  560. package/dist/schema-utils/lib/table/tables/make-table.d.ts.map +1 -1
  561. package/dist/schema-utils/lib/table/tables/make-table.js +3 -59
  562. package/dist/schema-utils/lib/table/tables/make-table.js.map +1 -1
  563. package/dist/schema-utils/lib/table/tables/row-utils.js +2 -2
  564. package/dist/schema-utils/lib/table/tables/row-utils.js.map +1 -1
  565. package/dist/schema-utils/lib/table/tables/table-accessors.d.ts +18 -16
  566. package/dist/schema-utils/lib/table/tables/table-accessors.d.ts.map +1 -1
  567. package/dist/schema-utils/lib/table/tables/table-accessors.js +36 -39
  568. package/dist/schema-utils/lib/table/tables/table-accessors.js.map +1 -1
  569. package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts +6 -5
  570. package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.d.ts.map +1 -1
  571. package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js +2 -2
  572. package/dist/schema-utils/lib/table/tables/table-converter/convert-tables.js.map +1 -1
  573. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts +1 -1
  574. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.d.ts.map +1 -1
  575. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js +8 -5
  576. package/dist/schema-utils/lib/table/tables/table-converter/table-converter.js.map +1 -1
  577. package/dist/schema-utils/lib/table/tables/table-types.d.ts +1 -3
  578. package/dist/schema-utils/lib/table/tables/table-types.d.ts.map +1 -1
  579. package/dist/schema-utils/lib/table/tables/table-types.js +0 -4
  580. package/dist/schema-utils/lib/table/tables/table-types.js.map +1 -1
  581. package/dist/vector-table-scan-source.cjs +241 -291
  582. package/dist/vector-table-scan-source.cjs.map +2 -2
  583. package/dist/wkt/index.cjs.map +1 -1
  584. package/dist/wkt/index.d.ts.map +1 -1
  585. package/dist/wkt/index.js.map +1 -1
  586. package/dist/worker-utils/index.cjs +51 -11
  587. package/dist/worker-utils/index.cjs.map +3 -3
  588. package/dist/worker-utils/lib/env-utils/version.js +1 -1
  589. package/dist/worker-utils/lib/env-utils/version.js.map +1 -1
  590. package/dist/worker-utils/lib/library-utils/library-utils.d.ts.map +1 -1
  591. package/dist/worker-utils/lib/library-utils/library-utils.js +2 -1
  592. package/dist/worker-utils/lib/library-utils/library-utils.js.map +1 -1
  593. package/dist/worker-utils/lib/npm-tag.d.ts.map +1 -1
  594. package/dist/worker-utils/lib/npm-tag.js.map +1 -1
  595. package/dist/worker-utils/lib/process-utils/child-process-proxy.d.ts.map +1 -1
  596. package/dist/worker-utils/lib/process-utils/child-process-proxy.js +8 -7
  597. package/dist/worker-utils/lib/process-utils/child-process-proxy.js.map +1 -1
  598. package/dist/worker-utils/lib/worker-api/get-worker-url.d.ts.map +1 -1
  599. package/dist/worker-utils/lib/worker-api/get-worker-url.js +5 -2
  600. package/dist/worker-utils/lib/worker-api/get-worker-url.js.map +1 -1
  601. package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts +4 -1
  602. package/dist/worker-utils/lib/worker-api/process-on-worker.d.ts.map +1 -1
  603. package/dist/worker-utils/lib/worker-api/process-on-worker.js +2 -2
  604. package/dist/worker-utils/lib/worker-api/process-on-worker.js.map +1 -1
  605. package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js +1 -6
  606. package/dist/worker-utils/lib/worker-utils/get-loadable-worker-url.js.map +1 -1
  607. package/dist/worker-utils/null-worker-node.js.map +1 -1
  608. package/dist/worker-utils/null-worker.js.map +1 -1
  609. package/package.json +102 -12
  610. package/src/arrow-geometry/binary-features.ts +4 -1
  611. package/src/arrow-geometry/binary-geometry-to-wkb.ts +1 -1
  612. package/src/arrow-geometry/feature-collection-to-arrow.ts +4 -3
  613. package/src/arrow-geometry/feature-table.ts +8 -17
  614. package/src/arrow-geometry/geojson-table.ts +32 -21
  615. package/src/arrow-geometry/geometry-codecs.ts +2 -2
  616. package/src/arrow-geometry/geometry-to-wkt.ts +2 -2
  617. package/src/arrow-geometry/legacy-binary/convert-flat-geojson-to-binary-features.ts +3 -1
  618. package/src/arrow-geometry/wkb-arrow-utils.ts +8 -12
  619. package/src/arrow-geometry/wkb-builder.ts +2 -2
  620. package/src/arrow-geometry/wkb-statistics.ts +2 -2
  621. package/src/arrow-worker-transport.ts +89 -50
  622. package/src/geoarrow/binary-polygon-to-geoarrow.ts +2 -2
  623. package/src/geoarrow/clustering/cluster-source.ts +20 -30
  624. package/src/geoarrow/convert-table-to-geoarrow.ts +14 -24
  625. package/src/geoarrow/geo-column/geo-column.ts +1 -1
  626. package/src/geoarrow/geoarrow-bounds.ts +3 -3
  627. package/src/geoarrow/geoarrow-capabilities.ts +1 -1
  628. package/src/geoarrow/geoarrow-converter/convert-geoarrow-geometry.ts +12 -15
  629. package/src/geoarrow/geoarrow-converter/convert-geoarrow.ts +14 -9
  630. package/src/geoarrow/geoarrow-converter/geoarrow-converter.ts +7 -6
  631. package/src/geoarrow/geoarrow-inspection.ts +2 -2
  632. package/src/geoarrow/geoarrow-stream.ts +15 -15
  633. package/src/geoarrow/get-geoarrow-vertex-count.ts +1 -1
  634. package/src/geoarrow/index.ts +0 -2
  635. package/src/geoarrow/lib/feature-collection-converters/convert-arrow-binary-feature-collection.ts +3 -3
  636. package/src/geoarrow/lib/feature-collection-converters/convert-geometry-column-to-binary-feature-collection.ts +8 -12
  637. package/src/geoarrow/lib/geoarrow/geoarrow-union-kind.ts +1 -1
  638. package/src/geoarrow/lib/geometry-converters/wkb/convert-wkb-to-binary-geometry.ts +1 -1
  639. package/src/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.ts +2 -2
  640. package/src/geoarrow/lib/kernels/encode-geoarrow-box.ts +1 -1
  641. package/src/geoarrow/lib/kernels/geoarrow-union.ts +1 -1
  642. package/src/geoarrow/lib/table-converters/convert-geoarrow-table.ts +11 -11
  643. package/src/geoarrow/mesharrow/arrow-fixed-size-list-utils.ts +4 -3
  644. package/src/geoarrow/mesharrow/arrow-list-of-fixed-size-list-utils.ts +1 -1
  645. package/src/geoarrow/mesharrow/get-deck-binary-data.ts +1 -1
  646. package/src/geoarrow/mesharrow/mesh-accessors.ts +1 -1
  647. package/src/geoarrow/metadata/geoarrow-metadata.ts +3 -4
  648. package/src/index.ts +2 -6
  649. package/src/lib/api/create-data-source.ts +148 -58
  650. package/src/lib/api/encode.ts +14 -3
  651. package/src/lib/api/load-in-batches.ts +15 -7
  652. package/src/lib/api/load-loader.ts +22 -21
  653. package/src/lib/api/load.ts +51 -127
  654. package/src/lib/api/loader-options.ts +69 -0
  655. package/src/lib/api/parse-file.ts +32 -22
  656. package/src/lib/api/parse-in-batches.ts +121 -20
  657. package/src/lib/api/parse-sync.ts +30 -16
  658. package/src/lib/api/parse.ts +46 -29
  659. package/src/lib/api/select-loader.ts +54 -69
  660. package/src/lib/api/select-source.ts +7 -1
  661. package/src/lib/loader-utils/get-fetch-function.ts +2 -2
  662. package/src/lib/loader-utils/loggers.ts +2 -70
  663. package/src/lib/loader-utils/native-arrow.ts +83 -0
  664. package/src/lib/loader-utils/option-defaults.ts +9 -10
  665. package/src/lib/loader-utils/option-utils.ts +33 -122
  666. package/src/loader-utils/format-types.ts +4 -0
  667. package/src/loader-utils/index.ts +19 -3
  668. package/src/loader-utils/lib/log-utils/log.ts +36 -1
  669. package/src/loader-utils/lib/pace-batch-iterator.ts +66 -0
  670. package/src/loader-utils/lib/request-utils/request-credentials.ts +1 -1
  671. package/src/loader-utils/lib/scan-utils/logical-table-query.ts +18 -8
  672. package/src/loader-utils/lib/scan-utils/scan-query-metadata.ts +68 -6
  673. package/src/loader-utils/lib/scan-utils/table-query.ts +28 -1
  674. package/src/loader-utils/lib/scan-utils/table-scan-batch.ts +88 -56
  675. package/src/loader-utils/lib/sources/data-source.ts +3 -15
  676. package/src/loader-utils/lib/sources/image-source.ts +1 -1
  677. package/src/loader-utils/lib/sources/table-source-collection.ts +2 -1
  678. package/src/loader-utils/lib/sources/tile-grid.ts +34 -18
  679. package/src/loader-utils/lib/sources/utils/utils.ts +1 -1
  680. package/src/loader-utils/lib/sources/vector-source.ts +3 -3
  681. package/src/loader-utils/lib/sources/vector-tile-source.ts +4 -9
  682. package/src/loader-utils/lib/worker-loader-utils/parse-with-worker.ts +27 -18
  683. package/src/loader-utils/loader-types.ts +186 -107
  684. package/src/loader-utils/source-types.ts +17 -6
  685. package/src/null-loader.ts +1 -20
  686. package/src/polyfills/index.ts +3 -3
  687. package/src/scan/arrow-execution/expressions.ts +42 -7
  688. package/src/scan/arrow-execution/filter-arrow-table.ts +3 -18
  689. package/src/scan/arrow-execution/portable-predicate-compatibility.ts +27 -0
  690. package/src/scan/arrow-query-worker-entry.ts +8 -0
  691. package/src/scan/arrow-query-worker.ts +158 -0
  692. package/src/scan/arrow-query.ts +3 -1
  693. package/src/scan/federated-table-scan-source.ts +48 -59
  694. package/src/scan/index.ts +41 -11
  695. package/src/scan/parse-sql-predicate.ts +1 -1
  696. package/src/scan/query-arrow-table-in-batches.ts +62 -33
  697. package/src/scan/query-arrow-table-math.ts +23 -0
  698. package/src/scan/query-arrow-table.ts +62 -97
  699. package/src/scan/query-grouped-sql.ts +69 -0
  700. package/src/scan/query-open-source.ts +39 -0
  701. package/src/scan/query-progressive.ts +230 -0
  702. package/src/scan/query-pushdown.ts +184 -0
  703. package/src/scan/query-scales.ts +299 -0
  704. package/src/scan/query.ts +254 -127
  705. package/src/scan/rows-to-arrow.ts +3 -39
  706. package/src/scan/scan-engine.ts +7 -7
  707. package/src/scan/vector-table-scan-source.ts +25 -26
  708. package/src/schema/categories/category-mesh.ts +3 -11
  709. package/src/schema/categories/category-table.ts +2 -28
  710. package/src/schema/float16.ts +1 -1
  711. package/src/schema/geometry/arrow-binary-features.ts +1 -1
  712. package/src/schema/geometry/geoarrow.ts +2 -2
  713. package/src/schema/index.ts +4 -5
  714. package/src/schema/types/batch.ts +0 -5
  715. package/src/schema-utils/index.ts +20 -11
  716. package/src/schema-utils/lib/arrow/arrow-metadata.ts +139 -0
  717. package/src/schema-utils/lib/arrow-utils/arrow-list-of-fixed-size-list-utils.ts +1 -1
  718. package/src/schema-utils/lib/converters/convert.ts +7 -2
  719. package/src/schema-utils/lib/converters/types.ts +2 -0
  720. package/src/schema-utils/lib/mesh/convert-mesh-to-table.ts +15 -43
  721. package/src/schema-utils/lib/mesh/convert-table-to-mesh.ts +19 -16
  722. package/src/schema-utils/lib/mesh/get-mesh-bounding-box.ts +52 -0
  723. package/src/schema-utils/lib/mesh/mesh-utils.ts +3 -49
  724. package/src/schema-utils/lib/mesh/point-cloud-tiler.ts +6 -5
  725. package/src/schema-utils/lib/schema/data-type.ts +1 -1
  726. package/src/schema-utils/lib/schema/deduce-table-schema.ts +8 -4
  727. package/src/schema-utils/lib/table/arrow-api/arrow-like-table.ts +10 -9
  728. package/src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts +21 -51
  729. package/src/schema-utils/lib/table/batch-builder/table-batch-builder.ts +68 -83
  730. package/src/schema-utils/lib/table/batches/convert-batches.ts +38 -21
  731. package/src/schema-utils/lib/table/batches/make-arrow-batch-iterator.ts +29 -19
  732. package/src/schema-utils/lib/table/batches/make-table-from-batches.ts +26 -7
  733. package/src/schema-utils/lib/table/query-arrow-table.ts +14 -32
  734. package/src/schema-utils/lib/table/tables/convert-arrow-table.ts +29 -96
  735. package/src/schema-utils/lib/table/tables/convert-table.ts +11 -57
  736. package/src/schema-utils/lib/table/tables/make-table.ts +6 -70
  737. package/src/schema-utils/lib/table/tables/row-utils.ts +2 -2
  738. package/src/schema-utils/lib/table/tables/table-accessors.ts +60 -63
  739. package/src/schema-utils/lib/table/tables/table-converter/convert-tables.ts +12 -14
  740. package/src/schema-utils/lib/table/tables/table-converter/table-converter.ts +12 -9
  741. package/src/schema-utils/lib/table/tables/table-types.ts +1 -7
  742. package/src/wkt/index.ts +1 -1
  743. package/src/worker-utils/lib/library-utils/library-utils.ts +2 -1
  744. package/src/worker-utils/lib/npm-tag.ts +1 -1
  745. package/src/worker-utils/lib/process-utils/child-process-proxy.ts +8 -7
  746. package/src/worker-utils/lib/worker-api/get-worker-url.ts +4 -3
  747. package/src/worker-utils/lib/worker-api/process-on-worker.ts +7 -4
  748. package/src/worker-utils/lib/worker-utils/get-loadable-worker-url.ts +1 -6
  749. package/dist/arrow-geometry/native-geometry.cjs +0 -215
  750. package/dist/arrow-geometry/native-geometry.cjs.map +0 -7
  751. package/dist/arrow-geometry/native-geometry.d.ts +0 -41
  752. package/dist/arrow-geometry/native-geometry.d.ts.map +0 -1
  753. package/dist/arrow-geometry/native-geometry.js +0 -224
  754. package/dist/arrow-geometry/native-geometry.js.map +0 -1
  755. package/dist/geoarrow/get-geoarrow-native-geometry.cjs.map +0 -7
  756. package/dist/geoarrow/get-geoarrow-native-geometry.d.ts +0 -2
  757. package/dist/geoarrow/get-geoarrow-native-geometry.d.ts.map +0 -1
  758. package/dist/geoarrow/get-geoarrow-native-geometry.js +0 -5
  759. package/dist/geoarrow/get-geoarrow-native-geometry.js.map +0 -1
  760. package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs +0 -290
  761. package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.cjs.map +0 -7
  762. package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts +0 -16
  763. package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.d.ts.map +0 -1
  764. package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js +0 -334
  765. package/dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js.map +0 -1
  766. package/dist/loader-utils/lib/file-provider/data-view-file.d.ts +0 -40
  767. package/dist/loader-utils/lib/file-provider/data-view-file.d.ts.map +0 -1
  768. package/dist/loader-utils/lib/file-provider/data-view-file.js +0 -68
  769. package/dist/loader-utils/lib/file-provider/data-view-file.js.map +0 -1
  770. package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts +0 -54
  771. package/dist/loader-utils/lib/file-provider/file-handle-file.d.ts.map +0 -1
  772. package/dist/loader-utils/lib/file-provider/file-handle-file.js +0 -102
  773. package/dist/loader-utils/lib/file-provider/file-handle-file.js.map +0 -1
  774. package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts +0 -45
  775. package/dist/loader-utils/lib/file-provider/file-provider-interface.d.ts.map +0 -1
  776. package/dist/loader-utils/lib/file-provider/file-provider-interface.js +0 -13
  777. package/dist/loader-utils/lib/file-provider/file-provider-interface.js.map +0 -1
  778. package/dist/loader-utils/lib/file-provider/file-provider.d.ts +0 -57
  779. package/dist/loader-utils/lib/file-provider/file-provider.d.ts.map +0 -1
  780. package/dist/loader-utils/lib/file-provider/file-provider.js +0 -114
  781. package/dist/loader-utils/lib/file-provider/file-provider.js.map +0 -1
  782. package/dist/schema/deprecated/mesh-utils.d.ts +0 -12
  783. package/dist/schema/deprecated/mesh-utils.d.ts.map +0 -1
  784. package/dist/schema/deprecated/mesh-utils.js +0 -37
  785. package/dist/schema/deprecated/mesh-utils.js.map +0 -1
  786. package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts +0 -10
  787. package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.d.ts.map +0 -1
  788. package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js +0 -71
  789. package/dist/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.js.map +0 -1
  790. package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts +0 -19
  791. package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.d.ts.map +0 -1
  792. package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js +0 -64
  793. package/dist/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.js.map +0 -1
  794. package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts +0 -20
  795. package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.d.ts.map +0 -1
  796. package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js +0 -83
  797. package/dist/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.js.map +0 -1
  798. package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts +0 -21
  799. package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.d.ts.map +0 -1
  800. package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js +0 -86
  801. package/dist/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.js.map +0 -1
  802. package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts +0 -24
  803. package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.d.ts.map +0 -1
  804. package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js +0 -5
  805. package/dist/schema-utils/lib/table/batch-builder/table-batch-aggregator.js.map +0 -1
  806. package/src/arrow-geometry/native-geometry.ts +0 -278
  807. package/src/geoarrow/get-geoarrow-native-geometry.ts +0 -8
  808. package/src/geoarrow/lib/kernels/encode-geoarrow-wkt.ts +0 -373
  809. package/src/loader-utils/lib/file-provider/data-view-file.ts +0 -83
  810. package/src/loader-utils/lib/file-provider/file-handle-file.ts +0 -114
  811. package/src/loader-utils/lib/file-provider/file-provider-interface.ts +0 -60
  812. package/src/loader-utils/lib/file-provider/file-provider.ts +0 -130
  813. package/src/schema/deprecated/mesh-utils.ts +0 -46
  814. package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator-builders.ts.disabled +0 -190
  815. package/src/schema-utils/lib/table/batch-builder/arrow-table-batch-aggregator.ts +0 -85
  816. package/src/schema-utils/lib/table/batch-builder/base-table-batch-aggregator.ts +0 -82
  817. package/src/schema-utils/lib/table/batch-builder/columnar-table-batch-aggregator.ts +0 -103
  818. package/src/schema-utils/lib/table/batch-builder/row-table-batch-aggregator.ts +0 -108
  819. package/src/schema-utils/lib/table/batch-builder/table-batch-aggregator.ts +0 -28
@@ -39,15 +39,45 @@ var import_log = require("probe.gl/log");
39
39
  var VERSION = typeof __VERSION__ !== "undefined" ? __VERSION__ : "latest";
40
40
  var version = VERSION[0] >= "0" && VERSION[0] <= "9" ? `v${VERSION}` : "";
41
41
  function createLog() {
42
- const log2 = new import_log.Log({ id: "loaders.gl" });
42
+ const log3 = new import_log.Log({ id: "loaders.gl" });
43
43
  globalThis.loaders ||= {};
44
- globalThis.loaders.log = log2;
44
+ globalThis.loaders.log = log3;
45
45
  globalThis.loaders.version = version;
46
46
  globalThis.probe ||= {};
47
- globalThis.probe.loaders = log2;
48
- return log2;
47
+ globalThis.probe.loaders = log3;
48
+ return log3;
49
49
  }
50
50
  var log = createLog();
51
+ var NullLog = class {
52
+ /** Discards debug messages. */
53
+ log() {
54
+ return ignoreMessage;
55
+ }
56
+ /** Discards informational messages. */
57
+ info() {
58
+ return ignoreMessage;
59
+ }
60
+ /** Discards messages marked to be emitted once. */
61
+ once() {
62
+ return ignoreMessage;
63
+ }
64
+ /** Discards warnings. */
65
+ warn() {
66
+ return ignoreMessage;
67
+ }
68
+ /** Discards errors. */
69
+ error() {
70
+ return ignoreMessage;
71
+ }
72
+ };
73
+ function ignoreMessage() {
74
+ }
75
+ var nullLog = new NullLog();
76
+ function getLoaderLog(options) {
77
+ var _a;
78
+ const logger = (_a = options == null ? void 0 : options.core) == null ? void 0 : _a.log;
79
+ return logger === null ? nullLog : logger || log;
80
+ }
51
81
 
52
82
  // src/loader-utils/lib/javascript-utils/is-type.ts
53
83
  var isObject = (value) => value !== null && typeof value === "object";
@@ -205,7 +235,7 @@ function createAuthenticatedFetch(options) {
205
235
  }
206
236
  function getAuthenticatedFetch(options = {}) {
207
237
  var _a, _b, _c;
208
- const fetchOption = options.fetch ?? ((_a = options.core) == null ? void 0 : _a.fetch);
238
+ const fetchOption = (_a = options.core) == null ? void 0 : _a.fetch;
209
239
  let fetchFunction;
210
240
  if (typeof fetchOption === "function") {
211
241
  fetchFunction = fetchOption;
@@ -441,7 +471,7 @@ var DataSource = class _DataSource {
441
471
  if (callback) {
442
472
  callback(normalizedError, this);
443
473
  } else {
444
- log.warn(`${this.constructor.name}: ${normalizedError.message}`)();
474
+ getLoaderLog(this.options).warn(`${this.constructor.name}: ${normalizedError.message}`)();
445
475
  }
446
476
  return normalizedError;
447
477
  }
@@ -467,16 +497,6 @@ function getSourceLoaderOptions(options) {
467
497
  delete loadOptions.core;
468
498
  }
469
499
  }
470
- const topLevelBaseUri = typeof loadOptions.baseUri === "string" ? loadOptions.baseUri : void 0;
471
- const topLevelBaseUrl = typeof loadOptions.baseUrl === "string" ? loadOptions.baseUrl : void 0;
472
- if (topLevelBaseUri !== void 0 || topLevelBaseUrl !== void 0) {
473
- loadOptions.core ||= {};
474
- if (loadOptions.core.baseUrl === void 0) {
475
- loadOptions.core.baseUrl = topLevelBaseUrl ?? topLevelBaseUri;
476
- }
477
- delete loadOptions.baseUri;
478
- delete loadOptions.baseUrl;
479
- }
480
500
  return loadOptions;
481
501
  }
482
502
  function normalizeError(error, message) {
@@ -491,7 +511,7 @@ function normalizeError(error, message) {
491
511
  function unavailableCoreApiMethod(methodName) {
492
512
  return () => {
493
513
  throw new Error(
494
- `CoreAPI.${methodName} is unavailable. Use @loaders.gl/core.createDataSource().`
514
+ `CoreAPI.${methodName} is unavailable. Use @loaders.gl/core.createDataSourceSync().`
495
515
  );
496
516
  };
497
517
  }
@@ -535,7 +555,7 @@ function removeFileExtension(name) {
535
555
  }
536
556
 
537
557
  // src/arrow-geometry/geometry-codecs.ts
538
- var import_wkb2 = require("@math.gl/arrow/wkb");
558
+ var import_arrow2 = require("@math.gl/core/arrow");
539
559
 
540
560
  // src/arrow-geometry/geometry-utils.ts
541
561
  function normalizeEmptyPoints(geometry) {
@@ -556,14 +576,14 @@ function normalizeEmptyPoints(geometry) {
556
576
  }
557
577
 
558
578
  // src/arrow-geometry/geometry-to-wkt.ts
559
- var import_wkb = require("@math.gl/arrow/wkb");
579
+ var import_arrow = require("@math.gl/core/arrow");
560
580
  function convertGeometryToWKT(geometry, options) {
561
581
  const dimension = getWKTDimension(geometry, options);
562
582
  if (geometry.type === "GeometryCollection" && !(options == null ? void 0 : options.dimension) && !(options == null ? void 0 : options.hasZ) && !(options == null ? void 0 : options.hasM) && (hasMixedChildDimensions(geometry) || hasDeclaredChildDimensions(geometry))) {
563
583
  if (geometry.geometries.length === 0) return "GEOMETRYCOLLECTION EMPTY";
564
584
  return `GEOMETRYCOLLECTION (${geometry.geometries.map((child) => convertGeometryToWKT(child)).join(", ")})`;
565
585
  }
566
- return (0, import_wkb.formatWKT)(normalizeGeometryDimension(geometry, dimension), dimension);
586
+ return (0, import_arrow.formatWKT)(normalizeGeometryDimension(geometry, dimension), dimension);
567
587
  }
568
588
  function normalizeGeometryDimension(geometry, dimension) {
569
589
  if (geometry.type === "GeometryCollection") {
@@ -626,7 +646,7 @@ function getDimensionSize(dimension) {
626
646
  // src/arrow-geometry/geometry-codecs.ts
627
647
  function convertWKBToGeometry(input) {
628
648
  const bytes = ArrayBuffer.isView(input) ? new Uint8Array(input.buffer, input.byteOffset, input.byteLength) : new Uint8Array(input);
629
- return normalizeEmptyPoints((0, import_wkb2.parseWKB)(bytes).geometry);
649
+ return normalizeEmptyPoints((0, import_arrow2.parseWKB)(bytes).geometry);
630
650
  }
631
651
  function convertGeometryToWKB(input, options = {}) {
632
652
  const geometry = input.type === "Feature" ? input.geometry : input;
@@ -637,7 +657,7 @@ function convertGeometryToWKB(input, options = {}) {
637
657
  }
638
658
  function encodeGeometry(geometry, dimension) {
639
659
  if (geometry.type !== "GeometryCollection") {
640
- return (0, import_wkb2.writeWKB)(geometry, dimension);
660
+ return (0, import_arrow2.writeWKB)(geometry, dimension);
641
661
  }
642
662
  const children = geometry.geometries.map(
643
663
  (child) => encodeGeometry(
@@ -645,13 +665,13 @@ function encodeGeometry(geometry, dimension) {
645
665
  child.__geoarrowDimension ?? dimension
646
666
  )
647
667
  );
648
- const headerBuilder = new import_wkb2.WKBBuilder({ mode: "measure", dimension });
668
+ const headerBuilder = new import_arrow2.WKBBuilder({ mode: "measure", dimension });
649
669
  headerBuilder.beginGeometry("GeometryCollection", children.length);
650
670
  const headerLength = headerBuilder.finishGeometry();
651
671
  const bytes = new Uint8Array(
652
672
  headerLength + children.reduce((total, child) => total + child.length, 0)
653
673
  );
654
- const writer = new import_wkb2.WKBBuilder({ mode: "write", target: bytes, dimension });
674
+ const writer = new import_arrow2.WKBBuilder({ mode: "write", target: bytes, dimension });
655
675
  writer.beginGeometry("GeometryCollection", children.length);
656
676
  let byteOffset = writer.finishGeometry();
657
677
  for (const child of children) {
@@ -677,7 +697,7 @@ function convertWKTToGeometry(input, options) {
677
697
  }
678
698
  const collectionHeader = text.match(/^(\s*GEOMETRYCOLLECTION)\s+(?:ZM|Z|M)(?=\s|\()/i);
679
699
  const parseText = collectionHeader && dimension !== "xym" ? text.replace(collectionHeader[0], collectionHeader[1]) : text;
680
- const parsed = (0, import_wkb2.parseWKTWithMetadata)(parseText, { inferDimensions: true });
700
+ const parsed = (0, import_arrow2.parseWKTWithMetadata)(parseText, { inferDimensions: true });
681
701
  const geometry = toGeometryWithDimensionMetadata(
682
702
  parsed,
683
703
  collectionHeader ? dimension : void 0
@@ -1190,7 +1210,9 @@ function triangulatePolygon(polygons, areas, indices, {
1190
1210
  const polygonPositions = polygons.positions.subarray(start, end);
1191
1211
  const offset = indices[0];
1192
1212
  const holes = indices.slice(1).map((n) => (n - offset) / coordLength);
1193
- const triangles = (0, import_geometry2.earcut)(polygonPositions, holes, coordLength, areas);
1213
+ const triangles = (0, import_geometry2.earcut)(polygonPositions, holes, coordLength, areas, "xy", {
1214
+ triangulation: "balanced"
1215
+ });
1194
1216
  for (let t = 0, tl = triangles.length; t < tl; ++t) {
1195
1217
  polygons.triangles.push(startPosition + triangles[t]);
1196
1218
  }
@@ -1519,13 +1541,13 @@ function deserializeArrowType(dataType, options) {
1519
1541
  }
1520
1542
  case "large-list": {
1521
1543
  const field = deserializeArrowField(dataType.children[0], options);
1522
- const LargeList9 = getOptionalArrowConstructor("LargeList");
1523
- if (!LargeList9) {
1544
+ const LargeList8 = getOptionalArrowConstructor("LargeList");
1545
+ if (!LargeList8) {
1524
1546
  throw new Error(
1525
1547
  "LargeList requires an Apache Arrow runtime that exports the LargeList constructor"
1526
1548
  );
1527
1549
  }
1528
- return new LargeList9(field);
1550
+ return new LargeList8(field);
1529
1551
  }
1530
1552
  case "fixed-size-list": {
1531
1553
  const child = deserializeArrowField(dataType.children[0], options);
@@ -1709,8 +1731,14 @@ function deserializeArrowDictionaryKeyType(keyType) {
1709
1731
  }
1710
1732
  }
1711
1733
 
1712
- // src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts
1734
+ // src/schema-utils/lib/arrow/arrow-metadata.ts
1713
1735
  var arrow2 = __toESM(require("apache-arrow"), 1);
1736
+ function snapshotArrowSchema(schema) {
1737
+ return deserializeArrowSchema(serializeArrowSchema(schema));
1738
+ }
1739
+
1740
+ // src/schema-utils/lib/table/batch-builder/arrow-table-builder.ts
1741
+ var arrow3 = __toESM(require("apache-arrow"), 1);
1714
1742
  var ArrowTableBuilder = class {
1715
1743
  schema;
1716
1744
  arrowSchema;
@@ -1720,7 +1748,7 @@ var ArrowTableBuilder = class {
1720
1748
  this.arrowSchema = convertSchemaToArrow(schema, options);
1721
1749
  this.schema = (options == null ? void 0 : options.viewTypes) && options.viewTypes !== "never" ? convertArrowToSchema(this.arrowSchema) : schema;
1722
1750
  this.arrowBuilders = this.arrowSchema.fields.map(
1723
- (field) => arrow2.makeBuilder({ type: field.type, nullValues: [null] })
1751
+ (field) => arrow3.makeBuilder({ type: field.type, nullValues: [null, void 0] })
1724
1752
  );
1725
1753
  this.length = 0;
1726
1754
  }
@@ -1738,58 +1766,25 @@ var ArrowTableBuilder = class {
1738
1766
  }
1739
1767
  this.length++;
1740
1768
  }
1741
- /** Makes sure that a first batch with schema is sent even if no rows */
1769
+ /** Emits the declared schema before any rows are buffered. */
1742
1770
  firstBatch() {
1743
- const arrowRecordBatch = this._getArrowRecordBatch();
1744
- if (arrowRecordBatch.numCols !== 0) {
1745
- return null;
1746
- }
1747
- return {
1748
- shape: "arrow-table",
1749
- batchType: "data",
1750
- length: arrowRecordBatch.numRows,
1751
- schema: this.schema,
1752
- data: new arrow2.Table(arrowRecordBatch)
1753
- };
1771
+ return this.length === 0 ? this._getArrowRecordBatch() : null;
1754
1772
  }
1755
- /** Flush the current batch if conditions are right */
1773
+ /** Flushes the buffered rows as a native record batch. */
1756
1774
  flushBatch() {
1757
- const arrowRecordBatch = this._getArrowRecordBatch();
1758
- if (arrowRecordBatch.numCols === 0) {
1759
- return null;
1760
- }
1761
- return {
1762
- shape: "arrow-table",
1763
- batchType: "data",
1764
- length: arrowRecordBatch.numRows,
1765
- schema: this.schema,
1766
- data: new arrow2.Table(arrowRecordBatch)
1767
- };
1775
+ return this.length === 0 ? null : this._getArrowRecordBatch();
1768
1776
  }
1769
- /** Get a last batch if any data is left */
1777
+ /** Finishes the builders and returns the final native batch when it has rows or fields. */
1770
1778
  finishBatch() {
1771
- const arrowRecordBatch = this._getArrowRecordBatch();
1779
+ const batch = this._getArrowRecordBatch();
1772
1780
  this.arrowBuilders.forEach((builder) => builder.finish());
1773
- if (arrowRecordBatch.numCols === 0 && arrowRecordBatch.numRows === 0) {
1774
- return null;
1775
- }
1776
- return {
1777
- shape: "arrow-table",
1778
- batchType: "data",
1779
- length: arrowRecordBatch.numRows,
1780
- schema: this.schema,
1781
- data: new arrow2.Table(arrowRecordBatch)
1782
- };
1781
+ return batch.numCols || batch.numRows ? batch : null;
1783
1782
  }
1784
- /** Return a table with all the accumulated data */
1783
+ /** Finishes the builders and returns a native Arrow table. */
1785
1784
  finishTable() {
1786
- const arrowRecordBatch = this._getArrowRecordBatch();
1785
+ const batch = this._getArrowRecordBatch();
1787
1786
  this.arrowBuilders.forEach((builder) => builder.finish());
1788
- return {
1789
- shape: "arrow-table",
1790
- schema: this.schema,
1791
- data: new arrow2.Table(arrowRecordBatch)
1792
- };
1787
+ return new arrow3.Table(batch);
1793
1788
  }
1794
1789
  /** Extract a record batch flushing the currently accumulated data in the builders */
1795
1790
  _getArrowRecordBatch() {
@@ -1798,13 +1793,56 @@ var ArrowTableBuilder = class {
1798
1793
  const arrowDatas = arrowBuilders.map((builder) => builder.flush());
1799
1794
  const length = ((_a = arrowDatas[0]) == null ? void 0 : _a.length) || this.length;
1800
1795
  this.length = 0;
1801
- const structField = new arrow2.Struct(arrowSchema.fields);
1802
- const arrowStructData = new arrow2.Data(structField, 0, length, 0, void 0, arrowDatas);
1803
- const arrowRecordBatch = new arrow2.RecordBatch(arrowSchema, arrowStructData);
1796
+ const structField = new arrow3.Struct(arrowSchema.fields);
1797
+ const arrowStructData = new arrow3.Data(structField, 0, length, 0, void 0, arrowDatas);
1798
+ const arrowRecordBatch = new arrow3.RecordBatch(
1799
+ snapshotArrowSchema(arrowSchema),
1800
+ arrowStructData
1801
+ );
1804
1802
  return arrowRecordBatch;
1805
1803
  }
1806
1804
  };
1807
1805
 
1806
+ // dist/loader-utils/lib/log-utils/log.js
1807
+ var import_log3 = require("probe.gl/log");
1808
+ var VERSION2 = true ? "5.0.0-rc.1" : "latest";
1809
+ var version2 = VERSION2[0] >= "0" && VERSION2[0] <= "9" ? `v${VERSION2}` : "";
1810
+ function createLog2() {
1811
+ const log3 = new import_log3.Log({ id: "loaders.gl" });
1812
+ globalThis.loaders ||= {};
1813
+ globalThis.loaders.log = log3;
1814
+ globalThis.loaders.version = version2;
1815
+ globalThis.probe ||= {};
1816
+ globalThis.probe.loaders = log3;
1817
+ return log3;
1818
+ }
1819
+ var log2 = createLog2();
1820
+ var NullLog2 = class {
1821
+ /** Discards debug messages. */
1822
+ log() {
1823
+ return ignoreMessage2;
1824
+ }
1825
+ /** Discards informational messages. */
1826
+ info() {
1827
+ return ignoreMessage2;
1828
+ }
1829
+ /** Discards messages marked to be emitted once. */
1830
+ once() {
1831
+ return ignoreMessage2;
1832
+ }
1833
+ /** Discards warnings. */
1834
+ warn() {
1835
+ return ignoreMessage2;
1836
+ }
1837
+ /** Discards errors. */
1838
+ error() {
1839
+ return ignoreMessage2;
1840
+ }
1841
+ };
1842
+ function ignoreMessage2() {
1843
+ }
1844
+ var nullLog2 = new NullLog2();
1845
+
1808
1846
  // src/schema/geospatial-metadata-zod-schema.ts
1809
1847
  var import_zod = require("zod");
1810
1848
  var GeoParquetGeometryTypeSchema = import_zod.z.enum([
@@ -1966,7 +2004,7 @@ function getGeometryMetadataForField(fieldMetadata) {
1966
2004
  geoEncoding = "geoarrow.wkt";
1967
2005
  }
1968
2006
  if (!GEOARROW_ENCODINGS.includes(geoEncoding)) {
1969
- console.warn(`Invalid GeoArrow encoding: ${geoEncoding}`);
2007
+ log2.warn(`Invalid GeoArrow encoding: ${geoEncoding}`)();
1970
2008
  } else {
1971
2009
  metadata ||= {};
1972
2010
  metadata.encoding = geoEncoding;
@@ -1981,7 +2019,7 @@ function getGeometryMetadataForField(fieldMetadata) {
1981
2019
  ...parsedMetadata
1982
2020
  };
1983
2021
  } catch (error) {
1984
- console.warn("Failed to parse GeoArrow metadata", error);
2022
+ log2.warn("Failed to parse GeoArrow metadata", error)();
1985
2023
  }
1986
2024
  }
1987
2025
  return metadata || null;
@@ -2002,8 +2040,8 @@ function parseGeoArrowMetadata(value) {
2002
2040
  }
2003
2041
 
2004
2042
  // dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js
2005
- var arrow14 = __toESM(require("apache-arrow"), 1);
2006
- var import_geoarrow_utils = require("@math.gl/arrow/geoarrow-utils");
2043
+ var arrow13 = __toESM(require("apache-arrow"), 1);
2044
+ var import_arrow7 = require("@math.gl/core/arrow");
2007
2045
 
2008
2046
  // dist/geoarrow/lib/geometry-converters/convert-geoarrow-to-geojson.js
2009
2047
  function convertGeoArrowGeometryToGeoJSON(arrowCellValue, encoding) {
@@ -2136,7 +2174,7 @@ function isEmptyArrowCoordinate(arrowCoordinate) {
2136
2174
  var arrow5 = __toESM(require("apache-arrow"), 1);
2137
2175
 
2138
2176
  // dist/geoarrow/lib/geometry-converters/wkb/helpers/parse-wkb-header.js
2139
- var import_wkb3 = require("@math.gl/arrow/wkb");
2177
+ var import_arrow3 = require("@math.gl/core/arrow");
2140
2178
 
2141
2179
  // dist/geoarrow/lib/geometry-converters/wkb/helpers/wkb-types.js
2142
2180
  var WKBGeometryType;
@@ -2176,25 +2214,30 @@ function getWKTGeometryType(input) {
2176
2214
  }
2177
2215
 
2178
2216
  // dist/geoarrow/geoarrow-inspection.js
2179
- var import_wkb4 = require("@math.gl/arrow/wkb");
2217
+ var import_arrow4 = require("@math.gl/core/arrow");
2180
2218
 
2181
2219
  // dist/geoarrow/lib/kernels/geoarrow-union.js
2182
2220
  var arrow4 = __toESM(require("apache-arrow"), 1);
2183
2221
 
2184
- // src/arrow-geometry/native-geometry.ts
2185
- var arrow3 = __toESM(require("apache-arrow"), 1);
2186
-
2187
- // src/arrow-geometry/geoarrow-union-kind.ts
2222
+ // dist/arrow-geometry/geoarrow-union-kind.js
2188
2223
  function getGeoArrowUnionGeometryKind(fieldName, typeId) {
2189
2224
  const normalizedName = (fieldName || "").toLowerCase().replace(/[^a-z]/g, "");
2190
- if (normalizedName.includes("geometrycollection")) return "GeometryCollection";
2191
- if (normalizedName.includes("multipolygon")) return "MultiPolygon";
2192
- if (normalizedName.includes("multilinestring")) return "MultiLineString";
2193
- if (normalizedName.includes("multipoint")) return "MultiPoint";
2194
- if (normalizedName.includes("polygon")) return "Polygon";
2195
- if (normalizedName.includes("linestring")) return "LineString";
2196
- if (normalizedName.includes("line")) return "LineString";
2197
- if (normalizedName.includes("point")) return "Point";
2225
+ if (normalizedName.includes("geometrycollection"))
2226
+ return "GeometryCollection";
2227
+ if (normalizedName.includes("multipolygon"))
2228
+ return "MultiPolygon";
2229
+ if (normalizedName.includes("multilinestring"))
2230
+ return "MultiLineString";
2231
+ if (normalizedName.includes("multipoint"))
2232
+ return "MultiPoint";
2233
+ if (normalizedName.includes("polygon"))
2234
+ return "Polygon";
2235
+ if (normalizedName.includes("linestring"))
2236
+ return "LineString";
2237
+ if (normalizedName.includes("line"))
2238
+ return "LineString";
2239
+ if (normalizedName.includes("point"))
2240
+ return "Point";
2198
2241
  switch (typeId % 10) {
2199
2242
  case 1:
2200
2243
  return "Point";
@@ -2320,7 +2363,7 @@ function inspectGeoArrowVector(column, encoding) {
2320
2363
  if (encoding === "geoarrow.wkb") {
2321
2364
  const bytes = value;
2322
2365
  try {
2323
- const header = (0, import_wkb4.inspectWKBHeader)(bytes);
2366
+ const header = (0, import_arrow4.inspectWKBHeader)(bytes);
2324
2367
  dimensions.add(header.dimension);
2325
2368
  geometryTypes.add(getGeometryTypeName(header.geometryType, header.dimension));
2326
2369
  } catch {
@@ -2953,13 +2996,13 @@ function makeListData(child, offsets, fieldName, offsetType) {
2953
2996
  });
2954
2997
  }
2955
2998
  function makeLargeListType(field) {
2956
- const LargeList9 = getOptionalArrowConstructor2("LargeList");
2957
- if (!LargeList9) {
2999
+ const LargeList8 = getOptionalArrowConstructor2("LargeList");
3000
+ if (!LargeList8) {
2958
3001
  throw new Error(
2959
3002
  "64-bit GeoArrow offsets require an Apache Arrow runtime that exports LargeList"
2960
3003
  );
2961
3004
  }
2962
- return new LargeList9(field);
3005
+ return new LargeList8(field);
2963
3006
  }
2964
3007
  function getOptionalArrowConstructor2(typeName) {
2965
3008
  return arrow6[typeName];
@@ -3602,7 +3645,7 @@ function isCoordinate(value) {
3602
3645
 
3603
3646
  // dist/geoarrow/lib/kernels/encode-geoarrow-box.js
3604
3647
  var arrow8 = __toESM(require("apache-arrow"), 1);
3605
- var import_wkb5 = require("@math.gl/arrow/wkb");
3648
+ var import_arrow5 = require("@math.gl/core/arrow");
3606
3649
  function encodeGeoArrowBoxVector(column, sourceEncoding, dimension) {
3607
3650
  const coordinateSize = dimension ? getDimensionSize2(dimension) : inferDimension2(column, sourceEncoding);
3608
3651
  const effectiveDimension = dimension || getDimensionName(coordinateSize);
@@ -3639,7 +3682,7 @@ function getRowBounds(value, sourceEncoding, dimension) {
3639
3682
  return null;
3640
3683
  if (sourceEncoding === "geoarrow.wkb") {
3641
3684
  const bytes = value;
3642
- const statistics = (0, import_wkb5.scanWKB)(bytes);
3685
+ const statistics = (0, import_arrow5.scanWKB)(bytes);
3643
3686
  return statistics.bounds ? boundsFromRecord(statistics.bounds, dimension) : null;
3644
3687
  }
3645
3688
  if (sourceEncoding === "geoarrow.wkt") {
@@ -3762,7 +3805,7 @@ function inferDimension2(column, sourceEncoding) {
3762
3805
  if (value == null)
3763
3806
  continue;
3764
3807
  const bytes = value;
3765
- const statistics = (0, import_wkb5.scanWKB)(bytes);
3808
+ const statistics = (0, import_arrow5.scanWKB)(bytes);
3766
3809
  const hasZ = ((_a = statistics.bounds) == null ? void 0 : _a.zmin) !== void 0;
3767
3810
  const hasM = ((_b = statistics.bounds) == null ? void 0 : _b.mmin) !== void 0;
3768
3811
  coordinateSize = Math.max(coordinateSize, hasZ && hasM ? 4 : hasZ || hasM ? 3 : 2);
@@ -3820,283 +3863,12 @@ function getBoxFieldNames2(dimension) {
3820
3863
  return [...minimumNames, ...maximumNames];
3821
3864
  }
3822
3865
 
3823
- // dist/geoarrow/lib/kernels/encode-geoarrow-wkt.js
3824
- var arrow9 = __toESM(require("apache-arrow"), 1);
3825
- function encodeGeoArrowWKTVector(column, sourceEncoding, dimension) {
3826
- if (!isNativeGeometryEncoding(sourceEncoding))
3827
- return null;
3828
- const values = [];
3829
- for (let rowIndex = 0; rowIndex < column.length; rowIndex++) {
3830
- const value = column.get(rowIndex);
3831
- if (value == null) {
3832
- values.push(null);
3833
- continue;
3834
- }
3835
- const geometryKind = getRowGeometryKind(column, rowIndex, sourceEncoding);
3836
- const rowDimension = dimension || (sourceEncoding === "geoarrow.geometrycollection" ? inferCollectionDimension(value) : inferDimensionFromTypeId(column, rowIndex, sourceEncoding));
3837
- const wkt = encodeNativeValue(value, geometryKind, rowDimension, !dimension);
3838
- if (wkt === null)
3839
- return null;
3840
- values.push(wkt);
3841
- }
3842
- return arrow9.vectorFromArray(values, new arrow9.Utf8());
3843
- }
3844
- function isNativeGeometryEncoding(encoding) {
3845
- 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";
3846
- }
3847
- function encodeNativeValue(value, geometryKind, dimension, preserveMemberDimensions = false) {
3848
- switch (geometryKind) {
3849
- case "Point":
3850
- return encodePoint(value, dimension);
3851
- case "LineString":
3852
- return encodeLineString(value, dimension);
3853
- case "Polygon":
3854
- return encodePolygon(value, dimension);
3855
- case "MultiPoint":
3856
- return encodeMultiPoint(value, dimension);
3857
- case "MultiLineString":
3858
- return encodeMultiLineString(value, dimension);
3859
- case "MultiPolygon":
3860
- return encodeMultiPolygon(value, dimension);
3861
- case "GeometryCollection":
3862
- return encodeGeometryCollection(value, dimension, preserveMemberDimensions);
3863
- default:
3864
- return null;
3865
- }
3866
- }
3867
- function encodePoint(value, dimension) {
3868
- const coordinate = readCoordinate(value);
3869
- return coordinate ? `POINT${getDimensionSuffix(dimension)} (${encodeCoordinate(coordinate)})` : "POINT EMPTY";
3870
- }
3871
- function encodeLineString(value, dimension) {
3872
- const coordinates = readChildren(value);
3873
- if (!coordinates)
3874
- return null;
3875
- const encodedCoordinates = encodeCoordinateSequence(coordinates);
3876
- if (encodedCoordinates === null)
3877
- return null;
3878
- return coordinates.length === 0 ? `LINESTRING${getDimensionSuffix(dimension)} EMPTY` : `LINESTRING${getDimensionSuffix(dimension)} (${encodedCoordinates})`;
3879
- }
3880
- function encodePolygon(value, dimension) {
3881
- const rings = readChildren(value);
3882
- if (!rings)
3883
- return null;
3884
- if (rings.length === 0)
3885
- return `POLYGON${getDimensionSuffix(dimension)} EMPTY`;
3886
- const encodedRings = rings.map((ring) => encodeCoordinateSequenceValue(ring));
3887
- if (encodedRings.some((encodedRing) => encodedRing === null))
3888
- return null;
3889
- return `POLYGON${getDimensionSuffix(dimension)} (${encodedRings.join(", ")})`;
3890
- }
3891
- function encodeMultiPoint(value, dimension) {
3892
- const points = readChildren(value);
3893
- if (!points)
3894
- return null;
3895
- if (points.length === 0)
3896
- return `MULTIPOINT${getDimensionSuffix(dimension)} EMPTY`;
3897
- const encodedPoints = points.map((point) => {
3898
- const coordinate = readCoordinate(point);
3899
- return coordinate ? `(${encodeCoordinate(coordinate)})` : null;
3900
- });
3901
- if (encodedPoints.some((encodedPoint) => encodedPoint === null))
3902
- return null;
3903
- return `MULTIPOINT${getDimensionSuffix(dimension)} (${encodedPoints.join(", ")})`;
3904
- }
3905
- function encodeMultiLineString(value, dimension) {
3906
- const lines = readChildren(value);
3907
- if (!lines)
3908
- return null;
3909
- if (lines.length === 0)
3910
- return `MULTILINESTRING${getDimensionSuffix(dimension)} EMPTY`;
3911
- const encodedLines = lines.map((line) => encodeCoordinateSequenceValue(line));
3912
- if (encodedLines.some((encodedLine) => encodedLine === null))
3913
- return null;
3914
- return `MULTILINESTRING${getDimensionSuffix(dimension)} (${encodedLines.join(", ")})`;
3915
- }
3916
- function encodeMultiPolygon(value, dimension) {
3917
- const polygons = readChildren(value);
3918
- if (!polygons)
3919
- return null;
3920
- if (polygons.length === 0)
3921
- return `MULTIPOLYGON${getDimensionSuffix(dimension)} EMPTY`;
3922
- const encodedPolygons = polygons.map((polygon) => {
3923
- const rings = readChildren(polygon);
3924
- if (!rings)
3925
- return null;
3926
- const encodedRings = rings.map((ring) => encodeCoordinateSequenceValue(ring));
3927
- return encodedRings.some((encodedRing) => encodedRing === null) ? null : `(${encodedRings.join(", ")})`;
3928
- });
3929
- if (encodedPolygons.some((encodedPolygon) => encodedPolygon === null))
3930
- return null;
3931
- return `MULTIPOLYGON${getDimensionSuffix(dimension)} (${encodedPolygons.join(", ")})`;
3932
- }
3933
- function encodeGeometryCollection(value, dimension, preserveMemberDimensions) {
3934
- if (!isVectorLike3(value))
3935
- return null;
3936
- const geometries = [];
3937
- for (let rowIndex = 0; rowIndex < value.length; rowIndex++) {
3938
- const unionVector = value;
3939
- const typeId = getUnionTypeId2(unionVector, rowIndex);
3940
- const childField = getUnionField(unionVector, rowIndex);
3941
- const geometryKind = getGeoArrowUnionGeometryKind(childField == null ? void 0 : childField.name, typeId);
3942
- const childDimension = getGeoArrowUnionDimension(childField == null ? void 0 : childField.name, childField == null ? void 0 : childField.type, typeId);
3943
- if (!geometryKind || !childDimension)
3944
- return null;
3945
- const geometry = encodeNativeValue(unionVector.get(rowIndex), geometryKind, preserveMemberDimensions ? childDimension : dimension, preserveMemberDimensions);
3946
- if (geometry === null)
3947
- return null;
3948
- geometries.push(geometry);
3949
- }
3950
- return geometries.length === 0 ? "GEOMETRYCOLLECTION EMPTY" : `GEOMETRYCOLLECTION (${geometries.join(", ")})`;
3951
- }
3952
- function encodeCoordinateSequenceValue(value) {
3953
- const coordinates = readChildren(value);
3954
- if (!coordinates)
3955
- return null;
3956
- const encodedCoordinates = encodeCoordinateSequence(coordinates);
3957
- return encodedCoordinates === null ? null : `(${encodedCoordinates})`;
3958
- }
3959
- function encodeCoordinateSequence(values) {
3960
- const coordinates = values.map((value) => {
3961
- const coordinate = readCoordinate(value);
3962
- return coordinate ? encodeCoordinate(coordinate) : null;
3963
- });
3964
- return coordinates.every((coordinate) => coordinate !== null) ? coordinates.join(", ") : null;
3965
- }
3966
- function encodeCoordinate(coordinate) {
3967
- return coordinate.map((value) => String(value)).join(" ");
3968
- }
3969
- function readCoordinate(value) {
3970
- if (value && typeof value === "object" && "x" in value && "y" in value) {
3971
- const record = value;
3972
- const coordinate = [Number(record.x), Number(record.y)];
3973
- if (typeof record.z === "number")
3974
- coordinate.push(record.z);
3975
- if (typeof record.m === "number")
3976
- coordinate.push(record.m);
3977
- return coordinate.every(Number.isFinite) ? coordinate : null;
3978
- }
3979
- if (value && typeof value.toArray === "function") {
3980
- return readCoordinate(value.toArray());
3981
- }
3982
- if (Array.isArray(value) || ArrayBuffer.isView(value)) {
3983
- const coordinate = Array.from(value, Number);
3984
- return coordinate.length >= 2 && coordinate.every(Number.isFinite) ? coordinate : null;
3985
- }
3986
- return null;
3987
- }
3988
- function readChildren(value) {
3989
- if (isVectorLike3(value)) {
3990
- const children = [];
3991
- for (let index = 0; index < value.length; index++)
3992
- children.push(value.get(index));
3993
- return children;
3994
- }
3995
- if (Array.isArray(value) || ArrayBuffer.isView(value)) {
3996
- return Array.from(value);
3997
- }
3998
- return null;
3999
- }
4000
- function getUnionTypeId2(vector, rowIndex) {
4001
- let remainingRowIndex = rowIndex;
4002
- for (const data of vector.data) {
4003
- if (remainingRowIndex >= data.length) {
4004
- remainingRowIndex -= data.length;
4005
- continue;
4006
- }
4007
- const typeIdIndex = data.typeIds.length <= data.length ? remainingRowIndex : data.offset + remainingRowIndex;
4008
- return data.typeIds[typeIdIndex];
4009
- }
4010
- throw new Error(`Dense union row ${rowIndex} is out of bounds.`);
4011
- }
4012
- function getUnionField(vector, rowIndex) {
4013
- const unionType = vector.type;
4014
- if (!(unionType instanceof arrow9.DenseUnion))
4015
- return void 0;
4016
- const typeId = getUnionTypeId2(vector, rowIndex);
4017
- const childIndex = unionType.typeIds.indexOf(typeId);
4018
- return childIndex >= 0 ? unionType.children[childIndex] : void 0;
4019
- }
4020
- function inferDimensionFromTypeId(column, rowIndex, sourceEncoding) {
4021
- if (sourceEncoding === "geoarrow.geometry") {
4022
- const typeId = getUnionTypeId2(column, rowIndex);
4023
- const field = getUnionField(column, rowIndex);
4024
- return getGeoArrowUnionDimension(field == null ? void 0 : field.name, field == null ? void 0 : field.type, typeId) || "xy";
4025
- }
4026
- let type = column.type;
4027
- while (type instanceof arrow9.List || type instanceof arrow9.LargeList) {
4028
- type = type.children[0].type;
4029
- }
4030
- if (type instanceof arrow9.Struct) {
4031
- const names = new Set(type.children.map((field) => field.name));
4032
- if (names.has("z") && names.has("m"))
4033
- return "xyzm";
4034
- if (names.has("m"))
4035
- return "xym";
4036
- if (names.has("z"))
4037
- return "xyz";
4038
- }
4039
- if (type instanceof arrow9.FixedSizeList) {
4040
- return type.listSize === 4 ? "xyzm" : type.listSize === 3 ? "xyz" : "xy";
4041
- }
4042
- return "xy";
4043
- }
4044
- function getRowGeometryKind(column, rowIndex, sourceEncoding) {
4045
- if (sourceEncoding === "geoarrow.geometry") {
4046
- const typeId = getUnionTypeId2(column, rowIndex);
4047
- const field = getUnionField(column, rowIndex);
4048
- return getGeoArrowUnionGeometryKind(field == null ? void 0 : field.name, typeId) || "GeometryCollection";
4049
- }
4050
- if (sourceEncoding === "geoarrow.geometrycollection")
4051
- return "GeometryCollection";
4052
- return getGeometryKind2(sourceEncoding);
4053
- }
4054
- function inferCollectionDimension(value) {
4055
- if (!isVectorLike3(value))
4056
- return "xy";
4057
- const vector = value;
4058
- if (vector.length > 0) {
4059
- const typeId = getUnionTypeId2(vector, 0);
4060
- const field = getUnionField(vector, 0);
4061
- return getGeoArrowUnionDimension(field == null ? void 0 : field.name, field == null ? void 0 : field.type, typeId) || "xy";
4062
- }
4063
- return "xy";
4064
- }
4065
- function getGeometryKind2(encoding) {
4066
- switch (encoding) {
4067
- case "geoarrow.point":
4068
- return "Point";
4069
- case "geoarrow.linestring":
4070
- return "LineString";
4071
- case "geoarrow.polygon":
4072
- return "Polygon";
4073
- case "geoarrow.multipoint":
4074
- return "MultiPoint";
4075
- case "geoarrow.multilinestring":
4076
- return "MultiLineString";
4077
- case "geoarrow.multipolygon":
4078
- return "MultiPolygon";
4079
- case "geoarrow.geometry":
4080
- return "GeometryCollection";
4081
- case "geoarrow.geometrycollection":
4082
- return "GeometryCollection";
4083
- default:
4084
- throw new Error(`Unsupported native WKT encoding "${encoding}".`);
4085
- }
4086
- }
4087
- function getDimensionSuffix(dimension) {
4088
- return dimension === "xy" ? "" : dimension === "xyzm" ? " ZM" : ` ${dimension.slice(2).toUpperCase()}`;
4089
- }
4090
- function isVectorLike3(value) {
4091
- return Boolean(value && typeof value.length === "number" && typeof value.get === "function");
4092
- }
4093
-
4094
3866
  // dist/geoarrow/get-geoarrow-vertex-count.js
4095
- var arrow13 = __toESM(require("apache-arrow"), 1);
4096
- var import_wkb6 = require("@math.gl/arrow/wkb");
3867
+ var arrow12 = __toESM(require("apache-arrow"), 1);
3868
+ var import_arrow6 = require("@math.gl/core/arrow");
4097
3869
 
4098
3870
  // dist/geoarrow/geoarrow-functions.js
4099
- var arrow10 = __toESM(require("apache-arrow"), 1);
3871
+ var arrow9 = __toESM(require("apache-arrow"), 1);
4100
3872
  var import_type = require("apache-arrow/type");
4101
3873
  function isGeoArrowBox(type) {
4102
3874
  if (!import_type.DataType.isStruct(type))
@@ -4178,18 +3950,18 @@ function isGeoArrowMultiPolygon(type) {
4178
3950
  return true;
4179
3951
  }
4180
3952
  function isGeoArrowList(type) {
4181
- const LargeList9 = getOptionalArrowListConstructor("LargeList");
4182
- return type instanceof import_type.List || Boolean(LargeList9 && type instanceof LargeList9);
3953
+ const LargeList8 = getOptionalArrowListConstructor("LargeList");
3954
+ return type instanceof import_type.List || Boolean(LargeList8 && type instanceof LargeList8);
4183
3955
  }
4184
3956
  function getOptionalArrowListConstructor(typeName) {
4185
- return arrow10[typeName];
3957
+ return arrow9[typeName];
4186
3958
  }
4187
3959
 
4188
3960
  // dist/geoarrow/get-geoarrow-geometry-info.js
4189
- var arrow12 = __toESM(require("apache-arrow"), 1);
3961
+ var arrow11 = __toESM(require("apache-arrow"), 1);
4190
3962
 
4191
3963
  // dist/geoarrow/geoarrow-layout.js
4192
- var arrow11 = __toESM(require("apache-arrow"), 1);
3964
+ var arrow10 = __toESM(require("apache-arrow"), 1);
4193
3965
  var NATIVE_LAYOUTS = {
4194
3966
  point: { depth: 0, encoding: "geoarrow.point" },
4195
3967
  linestring: { depth: 1, encoding: "geoarrow.linestring" },
@@ -4253,11 +4025,11 @@ function inspectGeoArrowLayout(field) {
4253
4025
  function visitType(type, path, state) {
4254
4026
  const storage = getStorageKind(type);
4255
4027
  state.storageKinds.push(storage);
4256
- if (type instanceof arrow11.List || type instanceof arrow11.LargeList) {
4257
- state.offsetTypes.push(type instanceof arrow11.LargeList ? "int64" : "int32");
4258
- } else if (type instanceof arrow11.Binary || type instanceof arrow11.LargeBinary) {
4259
- state.offsetTypes.push(type instanceof arrow11.LargeBinary ? "int64" : "int32");
4260
- } else if (type instanceof arrow11.DenseUnion) {
4028
+ if (type instanceof arrow10.List || type instanceof arrow10.LargeList) {
4029
+ state.offsetTypes.push(type instanceof arrow10.LargeList ? "int64" : "int32");
4030
+ } else if (type instanceof arrow10.Binary || type instanceof arrow10.LargeBinary) {
4031
+ state.offsetTypes.push(type instanceof arrow10.LargeBinary ? "int64" : "int32");
4032
+ } else if (type instanceof arrow10.DenseUnion) {
4261
4033
  state.unionTypeIds.push(...Array.from(type.typeIds));
4262
4034
  for (let childIndex = 0; childIndex < type.children.length; childIndex++) {
4263
4035
  const child = type.children[childIndex];
@@ -4293,10 +4065,10 @@ function visitType(type, path, state) {
4293
4065
  }
4294
4066
  function classifyField(type, encoding, path, state, issues) {
4295
4067
  var _a;
4296
- if (type instanceof arrow11.Binary || type instanceof arrow11.LargeBinary || type instanceof arrow11.BinaryView) {
4068
+ if (type instanceof arrow10.Binary || type instanceof arrow10.LargeBinary || type instanceof arrow10.BinaryView) {
4297
4069
  return "wkb";
4298
4070
  }
4299
- if (type instanceof arrow11.Utf8 || type instanceof arrow11.LargeUtf8 || type instanceof arrow11.Utf8View) {
4071
+ if (type instanceof arrow10.Utf8 || type instanceof arrow10.LargeUtf8 || type instanceof arrow10.Utf8View) {
4300
4072
  return "wkt";
4301
4073
  }
4302
4074
  if (isBoxType(type)) {
@@ -4305,7 +4077,7 @@ function classifyField(type, encoding, path, state, issues) {
4305
4077
  recordCoordinateSemantics(type, state, "separated");
4306
4078
  return "box";
4307
4079
  }
4308
- if (type instanceof arrow11.DenseUnion) {
4080
+ if (type instanceof arrow10.DenseUnion) {
4309
4081
  validateUnionType(type, path, state, issues);
4310
4082
  if (encoding === "geoarrow.geometrycollection") {
4311
4083
  issues.push({
@@ -4317,7 +4089,7 @@ function classifyField(type, encoding, path, state, issues) {
4317
4089
  validateUnionChildren(type, path, issues, true);
4318
4090
  return "geometry-union";
4319
4091
  }
4320
- if ((type instanceof arrow11.List || type instanceof arrow11.LargeList) && ((_a = type.children[0]) == null ? void 0 : _a.type) instanceof arrow11.DenseUnion) {
4092
+ if ((type instanceof arrow10.List || type instanceof arrow10.LargeList) && ((_a = type.children[0]) == null ? void 0 : _a.type) instanceof arrow10.DenseUnion) {
4321
4093
  validateUnionType(type.children[0].type, `${path}.child[0]`, state, issues);
4322
4094
  validateUnionChildren(type.children[0].type, `${path}.child[0]`, issues, false);
4323
4095
  return "geometrycollection";
@@ -4376,8 +4148,8 @@ function validateDeclaredEncoding(type, encoding, path, state, issues) {
4376
4148
  });
4377
4149
  }
4378
4150
  }
4379
- if (encoding === "geoarrow.geometrycollection" && type instanceof arrow11.List) {
4380
- if (!(((_a = type.children[0]) == null ? void 0 : _a.type) instanceof arrow11.DenseUnion)) {
4151
+ if (encoding === "geoarrow.geometrycollection" && type instanceof arrow10.List) {
4152
+ if (!(((_a = type.children[0]) == null ? void 0 : _a.type) instanceof arrow10.DenseUnion)) {
4381
4153
  addWrongPhysicalType(path, encoding, issues);
4382
4154
  }
4383
4155
  }
@@ -4385,7 +4157,7 @@ function validateDeclaredEncoding(type, encoding, path, state, issues) {
4385
4157
  function validateNativeType(type, expectedDepth, path, state, issues) {
4386
4158
  let current = type;
4387
4159
  for (let depth = 0; depth < expectedDepth; depth++) {
4388
- if (!(current instanceof arrow11.List || current instanceof arrow11.LargeList)) {
4160
+ if (!(current instanceof arrow10.List || current instanceof arrow10.LargeList)) {
4389
4161
  issues.push({
4390
4162
  code: "wrong-child-count",
4391
4163
  path,
@@ -4406,7 +4178,7 @@ function validateNativeType(type, expectedDepth, path, state, issues) {
4406
4178
  validateCoordinateType(current, path, state, issues);
4407
4179
  }
4408
4180
  function validateCoordinateType(type, path, state, issues) {
4409
- if (type instanceof arrow11.FixedSizeList) {
4181
+ if (type instanceof arrow10.FixedSizeList) {
4410
4182
  if (type.children.length !== 1 || !type.children[0]) {
4411
4183
  issues.push({
4412
4184
  code: "wrong-child-count",
@@ -4428,7 +4200,7 @@ function validateCoordinateType(type, path, state, issues) {
4428
4200
  recordFloatPrecision(type.children[0].type, `${path}.child[0]`, state, issues);
4429
4201
  return;
4430
4202
  }
4431
- if (type instanceof arrow11.Struct) {
4203
+ if (type instanceof arrow10.Struct) {
4432
4204
  const names = type.children.map((child) => child.name);
4433
4205
  const dimension = getSeparatedDimension(names);
4434
4206
  if (!dimension) {
@@ -4460,7 +4232,7 @@ function validateCoordinateType(type, path, state, issues) {
4460
4232
  });
4461
4233
  }
4462
4234
  function recordFloatPrecision(type, path, state, issues) {
4463
- if (!(type instanceof arrow11.Float)) {
4235
+ if (!(type instanceof arrow10.Float)) {
4464
4236
  issues.push({
4465
4237
  code: "wrong-coordinate-precision",
4466
4238
  path,
@@ -4468,7 +4240,7 @@ function recordFloatPrecision(type, path, state, issues) {
4468
4240
  });
4469
4241
  return;
4470
4242
  }
4471
- const precision = type.precision === arrow11.Precision.HALF ? "float16" : type.precision === arrow11.Precision.SINGLE ? "float32" : "float64";
4243
+ const precision = type.precision === arrow10.Precision.HALF ? "float16" : type.precision === arrow10.Precision.SINGLE ? "float32" : "float64";
4472
4244
  state.precisions.push(precision);
4473
4245
  if (precision === "float16") {
4474
4246
  issues.push({
@@ -4479,7 +4251,7 @@ function recordFloatPrecision(type, path, state, issues) {
4479
4251
  }
4480
4252
  }
4481
4253
  function validateBoxType(type, path, issues) {
4482
- if (!(type instanceof arrow11.Struct))
4254
+ if (!(type instanceof arrow10.Struct))
4483
4255
  return;
4484
4256
  const names = type.children.map((child) => child.name);
4485
4257
  if (!getBoxDimension(names)) {
@@ -4490,7 +4262,7 @@ function validateBoxType(type, path, issues) {
4490
4262
  });
4491
4263
  }
4492
4264
  for (let childIndex = 0; childIndex < type.children.length; childIndex++) {
4493
- if (!(type.children[childIndex].type instanceof arrow11.Float)) {
4265
+ if (!(type.children[childIndex].type instanceof arrow10.Float)) {
4494
4266
  issues.push({
4495
4267
  code: "wrong-coordinate-precision",
4496
4268
  path: `${path}.child[${childIndex}]`,
@@ -4545,7 +4317,7 @@ function validateUnionChildren(type, path, issues, allowGeometryCollection) {
4545
4317
  });
4546
4318
  continue;
4547
4319
  }
4548
- if (!(child.type instanceof arrow11.List || child.type instanceof arrow11.LargeList) || !(((_a = child.type.children[0]) == null ? void 0 : _a.type) instanceof arrow11.DenseUnion)) {
4320
+ if (!(child.type instanceof arrow10.List || child.type instanceof arrow10.LargeList) || !(((_a = child.type.children[0]) == null ? void 0 : _a.type) instanceof arrow10.DenseUnion)) {
4549
4321
  issues.push({
4550
4322
  code: "wrong-physical-type",
4551
4323
  path: childPath,
@@ -4574,27 +4346,27 @@ function validateUnionChildren(type, path, issues, allowGeometryCollection) {
4574
4346
  }
4575
4347
  }
4576
4348
  function recordCoordinateSemantics(type, state, coordinates) {
4577
- if (!(type instanceof arrow11.Struct))
4349
+ if (!(type instanceof arrow10.Struct))
4578
4350
  return;
4579
4351
  const dimension = getBoxDimension(type.children.map((child) => child.name));
4580
4352
  if (dimension) {
4581
4353
  state.dimensions.push(dimension);
4582
4354
  state.coordinates.push(coordinates);
4583
4355
  for (const child of type.children) {
4584
- if (child.type instanceof arrow11.Float) {
4585
- state.precisions.push(child.type.precision === arrow11.Precision.SINGLE ? "float32" : "float64");
4356
+ if (child.type instanceof arrow10.Float) {
4357
+ state.precisions.push(child.type.precision === arrow10.Precision.SINGLE ? "float32" : "float64");
4586
4358
  }
4587
4359
  }
4588
4360
  }
4589
4361
  }
4590
4362
  function isPotentialNativeType(type) {
4591
- return type instanceof arrow11.FixedSizeList || type instanceof arrow11.Struct || type instanceof arrow11.List || type instanceof arrow11.LargeList;
4363
+ return type instanceof arrow10.FixedSizeList || type instanceof arrow10.Struct || type instanceof arrow10.List || type instanceof arrow10.LargeList;
4592
4364
  }
4593
4365
  function getListDepth(type) {
4594
4366
  var _a;
4595
4367
  let depth = 0;
4596
4368
  let current = type;
4597
- while (current instanceof arrow11.List || current instanceof arrow11.LargeList) {
4369
+ while (current instanceof arrow10.List || current instanceof arrow10.LargeList) {
4598
4370
  depth++;
4599
4371
  current = (_a = current.children[0]) == null ? void 0 : _a.type;
4600
4372
  if (!current)
@@ -4606,7 +4378,7 @@ function getNativeKind(type, encoding) {
4606
4378
  const encodingKind = encoding ? encodingToKind(encoding) : null;
4607
4379
  if (isNativeLayoutKind(encodingKind))
4608
4380
  return encodingKind;
4609
- if (type instanceof arrow11.FixedSizeList || isCoordinateStruct(type))
4381
+ if (type instanceof arrow10.FixedSizeList || isCoordinateStruct(type))
4610
4382
  return "point";
4611
4383
  return null;
4612
4384
  }
@@ -4651,34 +4423,34 @@ function addWrongPhysicalType(path, encoding, issues) {
4651
4423
  });
4652
4424
  }
4653
4425
  function getStorageKind(type) {
4654
- if (type instanceof arrow11.FixedSizeList)
4426
+ if (type instanceof arrow10.FixedSizeList)
4655
4427
  return "fixed-size-list";
4656
- if (type instanceof arrow11.List)
4428
+ if (type instanceof arrow10.List)
4657
4429
  return "list";
4658
- if (type instanceof arrow11.LargeList)
4430
+ if (type instanceof arrow10.LargeList)
4659
4431
  return "large-list";
4660
- if (type instanceof arrow11.Struct)
4432
+ if (type instanceof arrow10.Struct)
4661
4433
  return "struct";
4662
- if (type instanceof arrow11.DenseUnion)
4434
+ if (type instanceof arrow10.DenseUnion)
4663
4435
  return "dense-union";
4664
- if (type instanceof arrow11.Binary)
4436
+ if (type instanceof arrow10.Binary)
4665
4437
  return "binary";
4666
- if (type instanceof arrow11.LargeBinary)
4438
+ if (type instanceof arrow10.LargeBinary)
4667
4439
  return "large-binary";
4668
- if (type instanceof arrow11.BinaryView)
4440
+ if (type instanceof arrow10.BinaryView)
4669
4441
  return "binary-view";
4670
- if (type instanceof arrow11.Utf8)
4442
+ if (type instanceof arrow10.Utf8)
4671
4443
  return "utf8";
4672
- if (type instanceof arrow11.LargeUtf8)
4444
+ if (type instanceof arrow10.LargeUtf8)
4673
4445
  return "large-utf8";
4674
- if (type instanceof arrow11.Utf8View)
4446
+ if (type instanceof arrow10.Utf8View)
4675
4447
  return "utf8-view";
4676
- if (type instanceof arrow11.Float || type instanceof arrow11.Int)
4448
+ if (type instanceof arrow10.Float || type instanceof arrow10.Int)
4677
4449
  return "scalar";
4678
4450
  return "unknown";
4679
4451
  }
4680
4452
  function isCoordinateStruct(type) {
4681
- return type instanceof arrow11.Struct && getSeparatedDimension(type.children.map((child) => child.name)) !== null;
4453
+ return type instanceof arrow10.Struct && getSeparatedDimension(type.children.map((child) => child.name)) !== null;
4682
4454
  }
4683
4455
  function getSeparatedDimension(names) {
4684
4456
  if (sameNames(names, ["x", "y"]))
@@ -4704,7 +4476,7 @@ function getBoxDimension(names) {
4704
4476
  return null;
4705
4477
  }
4706
4478
  function isBoxType(type) {
4707
- return type instanceof arrow11.Struct && getBoxDimension(type.children.map((child) => child.name)) !== null && type.children.every((child) => child.type instanceof arrow11.Float);
4479
+ return type instanceof arrow10.Struct && getBoxDimension(type.children.map((child) => child.name)) !== null && type.children.every((child) => child.type instanceof arrow10.Float);
4708
4480
  }
4709
4481
  function getCommonValue(values) {
4710
4482
  const firstValue = values[0];
@@ -4782,7 +4554,7 @@ function getNesting(kind, type) {
4782
4554
  function getListDepth2(type) {
4783
4555
  let depth = 0;
4784
4556
  let currentType = type;
4785
- while (currentType instanceof arrow12.List || currentType instanceof arrow12.LargeList) {
4557
+ while (currentType instanceof arrow11.List || currentType instanceof arrow11.LargeList) {
4786
4558
  depth++;
4787
4559
  currentType = currentType.children[0].type;
4788
4560
  }
@@ -4791,13 +4563,13 @@ function getListDepth2(type) {
4791
4563
 
4792
4564
  // dist/geoarrow/get-geoarrow-vertex-count.js
4793
4565
  function getGeoarrowVertexCount(input) {
4794
- if (input instanceof arrow13.Table) {
4566
+ if (input instanceof arrow12.Table) {
4795
4567
  return getGeoarrowTableVertexCount(input);
4796
4568
  }
4797
- if (input instanceof arrow13.Vector) {
4569
+ if (input instanceof arrow12.Vector) {
4798
4570
  return getGeoarrowVectorVertexCount(input);
4799
4571
  }
4800
- if (input instanceof arrow13.Data) {
4572
+ if (input instanceof arrow12.Data) {
4801
4573
  return getGeoarrowDataVertexCount(input);
4802
4574
  }
4803
4575
  throw new Error("Expected an Apache Arrow Table, Vector, or Data instance.");
@@ -4824,16 +4596,16 @@ function getGeoarrowVectorVertexCount(vector) {
4824
4596
  }
4825
4597
  function getGeoarrowDataVertexCount(data) {
4826
4598
  var _a, _b, _c, _d, _e, _f, _g;
4827
- if (data.type instanceof arrow13.Binary || data.type instanceof arrow13.LargeBinary || data.type instanceof arrow13.BinaryView) {
4599
+ if (data.type instanceof arrow12.Binary || data.type instanceof arrow12.LargeBinary || data.type instanceof arrow12.BinaryView) {
4828
4600
  return getWKBDataVertexCount(data);
4829
4601
  }
4830
- if (data.type instanceof arrow13.Utf8 || data.type instanceof arrow13.LargeUtf8 || data.type instanceof arrow13.Utf8View) {
4602
+ if (data.type instanceof arrow12.Utf8 || data.type instanceof arrow12.LargeUtf8 || data.type instanceof arrow12.Utf8View) {
4831
4603
  throw new Error("WKT vertex counting is not supported.");
4832
4604
  }
4833
- if (data.type instanceof arrow13.DenseUnion) {
4605
+ if (data.type instanceof arrow12.DenseUnion) {
4834
4606
  return data.children.reduce((vertexCount, child) => vertexCount + getGeoarrowDataVertexCount(child), 0);
4835
4607
  }
4836
- if ((data.type instanceof arrow13.List || data.type instanceof arrow13.LargeList) && ((_a = data.children[0]) == null ? void 0 : _a.type) instanceof arrow13.DenseUnion) {
4608
+ if ((data.type instanceof arrow12.List || data.type instanceof arrow12.LargeList) && ((_a = data.children[0]) == null ? void 0 : _a.type) instanceof arrow12.DenseUnion) {
4837
4609
  return getGeoarrowDataVertexCount(data.children[0]);
4838
4610
  }
4839
4611
  if (isGeoArrowBox(data.type)) {
@@ -4854,16 +4626,16 @@ function getGeoarrowDataVertexCount(data) {
4854
4626
  throw new Error(`Unsupported GeoArrow data type: ${data.type}`);
4855
4627
  }
4856
4628
  function getGeoarrowWKTVertexCount(input) {
4857
- if (input instanceof arrow13.Vector) {
4629
+ if (input instanceof arrow12.Vector) {
4858
4630
  return input.data.reduce((vertexCount, data) => vertexCount + getWKTDataVertexCount(data), 0);
4859
4631
  }
4860
- if (input instanceof arrow13.Data) {
4632
+ if (input instanceof arrow12.Data) {
4861
4633
  return getWKTDataVertexCount(input);
4862
4634
  }
4863
4635
  throw new Error("Expected an Apache Arrow Vector or Data instance.");
4864
4636
  }
4865
4637
  function getWKTDataVertexCount(data) {
4866
- const vector = new arrow13.Vector([data]);
4638
+ const vector = new arrow12.Vector([data]);
4867
4639
  let vertexCount = 0;
4868
4640
  for (let rowIndex = 0; rowIndex < vector.length; rowIndex++) {
4869
4641
  const value = vector.get(rowIndex);
@@ -4894,7 +4666,7 @@ function countGeometryVertices(geometry) {
4894
4666
  }
4895
4667
  }
4896
4668
  function getWKBDataVertexCount(data) {
4897
- const vector = new arrow13.Vector([data]);
4669
+ const vector = new arrow12.Vector([data]);
4898
4670
  let vertexCount = 0;
4899
4671
  for (let rowIndex = 0; rowIndex < vector.length; rowIndex++) {
4900
4672
  const value = vector.get(rowIndex);
@@ -4906,7 +4678,7 @@ function getWKBDataVertexCount(data) {
4906
4678
  }
4907
4679
  function getWKBVertexCount(wkb) {
4908
4680
  try {
4909
- return (0, import_wkb6.scanWKB)(wkb).coordinateCount;
4681
+ return (0, import_arrow6.scanWKB)(wkb).coordinateCount;
4910
4682
  } catch (error) {
4911
4683
  if (error instanceof Error && error.message.startsWith("Unsupported WKB geometry type")) {
4912
4684
  throw new Error("Unsupported geometry type");
@@ -4963,7 +4735,7 @@ function getVariableLengthByteCount(column, sourceEncoding) {
4963
4735
  }
4964
4736
 
4965
4737
  // dist/geoarrow/geoarrow-converter/convert-geoarrow-geometry.js
4966
- var import_geoarrow = require("@math.gl/arrow/geoarrow");
4738
+ var import_arrow8 = require("@math.gl/core/arrow");
4967
4739
  var DEFAULT_MAX_GEOMETRY_COLLECTION_DEPTH = 64;
4968
4740
  function convertGeoArrowVector(column, sourceEncoding, targetEncoding, options) {
4969
4741
  const maxGeometryCollectionDepth = getMaxGeometryCollectionDepth(options);
@@ -5048,7 +4820,7 @@ function convertGeoArrowGeometry(table, targetEncoding, options) {
5048
4820
  const convertedVector = convertedColumns.get(field.name);
5049
4821
  return convertedEncoding && convertedVector ? createConvertedField(field, convertedVector.type, convertedEncoding, (_a2 = conversionOptions.get(field.name)) == null ? void 0 : _a2.geometryTypes, conversionOptions.get(field.name), (_b2 = geoMetadata == null ? void 0 : geoMetadata.columns) == null ? void 0 : _b2[field.name]) : field;
5050
4822
  });
5051
- const nextSchema = new arrow14.Schema(nextFields, nextSchemaMetadata);
4823
+ const nextSchema = new arrow13.Schema(nextFields, nextSchemaMetadata);
5052
4824
  let rowOffset = 0;
5053
4825
  const nextBatches = table.batches.map((batch) => {
5054
4826
  const children = table.schema.fields.map((field) => {
@@ -5067,14 +4839,14 @@ function convertGeoArrowGeometry(table, targetEncoding, options) {
5067
4839
  return batchVector.data[0];
5068
4840
  });
5069
4841
  rowOffset += batch.numRows;
5070
- return new arrow14.RecordBatch(nextSchema, arrow14.makeData({
5071
- type: new arrow14.Struct(nextFields),
4842
+ return new arrow13.RecordBatch(nextSchema, arrow13.makeData({
4843
+ type: new arrow13.Struct(nextFields),
5072
4844
  length: batch.numRows,
5073
4845
  nullCount: 0,
5074
4846
  children
5075
4847
  }));
5076
4848
  });
5077
- return new arrow14.Table(nextSchema, nextBatches);
4849
+ return new arrow13.Table(nextSchema, nextBatches);
5078
4850
  }
5079
4851
  function inferGeometryTypes(table, geometryColumn, sourceEncoding) {
5080
4852
  if (sourceEncoding !== "geoarrow.wkb" && sourceEncoding !== "geoarrow.wkt") {
@@ -5103,11 +4875,6 @@ function convertGeometryColumn(column, sourceEncoding, targetEncoding, geometryC
5103
4875
  const mathGeoArrowVector = convertGeometryColumnWithMath(column, sourceEncoding, targetEncoding, options);
5104
4876
  if (mathGeoArrowVector)
5105
4877
  return mathGeoArrowVector;
5106
- if (targetEncoding === "geoarrow.wkt") {
5107
- const directWKTVector = encodeGeoArrowWKTVector(column, sourceEncoding, options == null ? void 0 : options.dimension);
5108
- if (directWKTVector)
5109
- return directWKTVector;
5110
- }
5111
4878
  if (sourceEncoding === "geoarrow.wkt" && isConcreteNativeEncoding(targetEncoding)) {
5112
4879
  const directWKTVector = decodeWKTNativeVector(column, targetEncoding, options == null ? void 0 : options.dimension, options == null ? void 0 : options.coordinates, options == null ? void 0 : options.offsetType, options == null ? void 0 : options.maxGeometryCollectionDepth);
5113
4880
  if (directWKTVector)
@@ -5141,29 +4908,29 @@ function convertGeometryColumn(column, sourceEncoding, targetEncoding, geometryC
5141
4908
  }
5142
4909
  const targetValues = geometries.map((geometry) => convertGeometryValue(geometry, targetEncoding, targetDimension, geometryColumn, options));
5143
4910
  const nativeValues = (options == null ? void 0 : options.coordinates) === "separated" ? targetValues.map((value) => separateCoordinateValues(value, targetDimension, targetDimensionName)) : targetValues;
5144
- return arrow14.vectorFromArray(nativeValues, getTargetArrowType(targetEncoding, targetDimension, options, (options == null ? void 0 : options.dimension) || getDimensionFromGeometryTypes(options == null ? void 0 : options.geometryTypes)));
4911
+ return arrow13.vectorFromArray(nativeValues, getTargetArrowType(targetEncoding, targetDimension, options, (options == null ? void 0 : options.dimension) || getDimensionFromGeometryTypes(options == null ? void 0 : options.geometryTypes)));
5145
4912
  }
5146
4913
  function convertGeometryColumnWithMath(column, sourceEncoding, targetEncoding, options) {
5147
4914
  const sourceIsNative = isMathGeoArrowNativeEncoding(sourceEncoding);
5148
4915
  const targetIsNative = isMathGeoArrowNativeEncoding(targetEncoding);
5149
- const supportsConversion = sourceEncoding === "geoarrow.wkb" && targetIsNative || sourceIsNative && targetEncoding === "geoarrow.wkb" || sourceIsNative && targetIsNative;
4916
+ const supportsConversion = sourceEncoding === "geoarrow.wkb" && targetIsNative || sourceIsNative && (targetEncoding === "geoarrow.wkb" || targetEncoding === "geoarrow.wkt") || sourceIsNative && targetIsNative;
5150
4917
  if (!supportsConversion)
5151
4918
  return null;
5152
4919
  const declaredDimension = getDimensionFromGeometryTypes(options == null ? void 0 : options.geometryTypes);
5153
- const sourceColumn = (0, import_geoarrow.makeGeoArrowColumnFromArrowVector)(column, {
4920
+ const sourceColumn = (0, import_arrow8.makeGeoArrowColumnFromArrowVector)(column, {
5154
4921
  encoding: sourceEncoding,
5155
4922
  dimension: sourceEncoding === "geoarrow.wkb" ? declaredDimension || "xy" : declaredDimension || (targetEncoding === "geoarrow.wkb" ? options == null ? void 0 : options.dimension : void 0)
5156
4923
  });
5157
4924
  if (sourceEncoding === "geoarrow.wkb") {
5158
4925
  try {
5159
- const decodedColumn = (0, import_geoarrow_utils.decodeGeoArrowWKB)(sourceColumn, {
4926
+ const decodedColumn = (0, import_arrow7.decodeGeoArrowWKB)(sourceColumn, {
5160
4927
  encoding: targetEncoding,
5161
4928
  dimension: (options == null ? void 0 : options.dimension) || declaredDimension || "infer",
5162
4929
  coordinateLayout: (options == null ? void 0 : options.coordinates) || "interleaved",
5163
4930
  offsetType: (options == null ? void 0 : options.offsetType) || "int32",
5164
4931
  traversal: { maximumDepth: options == null ? void 0 : options.maxGeometryCollectionDepth }
5165
4932
  });
5166
- return (0, import_geoarrow.makeArrowVectorFromGeoArrowColumn)(decodedColumn);
4933
+ return (0, import_arrow8.makeArrowVectorFromGeoArrowColumn)(decodedColumn);
5167
4934
  } catch (error) {
5168
4935
  if ((options == null ? void 0 : options.maxGeometryCollectionDepth) !== void 0 && error instanceof Error && error.message.includes("nesting exceeds maximumDepth")) {
5169
4936
  throw new Error(`GeometryCollection nesting exceeds maxGeometryCollectionDepth (${options.maxGeometryCollectionDepth}).`);
@@ -5171,16 +4938,17 @@ function convertGeometryColumnWithMath(column, sourceEncoding, targetEncoding, o
5171
4938
  throw error;
5172
4939
  }
5173
4940
  }
5174
- if (targetEncoding === "geoarrow.wkb") {
5175
- return (0, import_geoarrow.makeArrowVectorFromGeoArrowColumn)((0, import_geoarrow_utils.encodeGeoArrowWKB)(sourceColumn));
4941
+ if (targetEncoding === "geoarrow.wkb" || targetEncoding === "geoarrow.wkt") {
4942
+ const nativeColumn = targetEncoding === "geoarrow.wkt" && (options == null ? void 0 : options.dimension) ? (0, import_arrow7.convertGeoArrowColumn)(sourceColumn, { dimension: options.dimension }) : sourceColumn;
4943
+ return (0, import_arrow8.makeArrowVectorFromGeoArrowColumn)((0, import_arrow7.convertGeoArrowColumn)(nativeColumn, { encoding: targetEncoding }));
5176
4944
  }
5177
- const convertedColumn = (0, import_geoarrow_utils.convertGeoArrowColumn)(sourceColumn, {
4945
+ const convertedColumn = (0, import_arrow7.convertGeoArrowColumn)(sourceColumn, {
5178
4946
  encoding: targetEncoding,
5179
4947
  dimension: options == null ? void 0 : options.dimension,
5180
4948
  coordinateLayout: (options == null ? void 0 : options.coordinates) || "preserve",
5181
4949
  offsetType: (options == null ? void 0 : options.offsetType) || "preserve"
5182
4950
  });
5183
- return convertedColumn === sourceColumn ? column : (0, import_geoarrow.makeArrowVectorFromGeoArrowColumn)(convertedColumn);
4951
+ return convertedColumn === sourceColumn ? column : (0, import_arrow8.makeArrowVectorFromGeoArrowColumn)(convertedColumn);
5184
4952
  }
5185
4953
  function isMathGeoArrowNativeEncoding(encoding) {
5186
4954
  return encoding === "geoarrow.point" || encoding === "geoarrow.linestring" || encoding === "geoarrow.polygon" || encoding === "geoarrow.multipoint" || encoding === "geoarrow.multilinestring" || encoding === "geoarrow.multipolygon" || encoding === "geoarrow.geometry" || encoding === "geoarrow.geometrycollection";
@@ -5310,17 +5078,17 @@ function createGeometryUnionVector(geometries, targetDimension, allowGeometryCol
5310
5078
  usedKinds.add(childKind);
5311
5079
  childValues[childKind] ||= [];
5312
5080
  valueOffsets.push(childValues[childKind].length);
5313
- typeIds.push(getUnionTypeId3(childKind, targetDimension, targetDimensionName));
5081
+ typeIds.push(getUnionTypeId2(childKind, targetDimension, targetDimensionName));
5314
5082
  childValues[childKind].push(geometry ? convertGeometryToUnionChildValue(geometry, targetDimension, geometryColumn) : null);
5315
5083
  }
5316
- const orderedKinds = [...usedKinds].sort((leftKind, rightKind) => getUnionTypeId3(leftKind, targetDimension, targetDimensionName) - getUnionTypeId3(rightKind, targetDimension, targetDimensionName));
5317
- const fields = orderedKinds.map((kind) => new arrow14.Field(getUnionFieldName(kind, targetDimension, targetDimensionName), getUnionChildType(kind, targetDimension, options, geometryCollectionDepth, targetDimensionName), true));
5084
+ const orderedKinds = [...usedKinds].sort((leftKind, rightKind) => getUnionTypeId2(leftKind, targetDimension, targetDimensionName) - getUnionTypeId2(rightKind, targetDimension, targetDimensionName));
5085
+ const fields = orderedKinds.map((kind) => new arrow13.Field(getUnionFieldName(kind, targetDimension, targetDimensionName), getUnionChildType(kind, targetDimension, options, geometryCollectionDepth, targetDimensionName), true));
5318
5086
  const children = orderedKinds.map((kind) => {
5319
5087
  const values = childValues[kind] || [];
5320
5088
  return createUnionChildVector(kind, values, targetDimension, geometryColumn, options, geometryCollectionDepth, targetDimensionName).data[0];
5321
5089
  });
5322
- const unionType = new arrow14.DenseUnion(orderedKinds.map((kind) => getUnionTypeId3(kind, targetDimension, targetDimensionName)), fields);
5323
- return arrow14.makeVector(arrow14.makeData({
5090
+ const unionType = new arrow13.DenseUnion(orderedKinds.map((kind) => getUnionTypeId2(kind, targetDimension, targetDimensionName)), fields);
5091
+ return arrow13.makeVector(arrow13.makeData({
5324
5092
  type: unionType,
5325
5093
  length: geometries.length,
5326
5094
  nullCount: 0,
@@ -5347,7 +5115,7 @@ function createGeometryCollectionVector(geometries, targetDimension, geometryCol
5347
5115
  valueOffsets.push(flattenedGeometries.length);
5348
5116
  }
5349
5117
  const memberUnionVector = createGeometryUnionVector(flattenedGeometries, targetDimension, false, geometryColumn, options, 0, targetDimensionName);
5350
- const listType = createListType(new arrow14.Field("geometries", memberUnionVector.type, true), options == null ? void 0 : options.offsetType);
5118
+ const listType = createListType(new arrow13.Field("geometries", memberUnionVector.type, true), options == null ? void 0 : options.offsetType);
5351
5119
  const listData = {
5352
5120
  length: geometries.length,
5353
5121
  nullCount: validity.filter((isValid) => !isValid).length,
@@ -5355,16 +5123,16 @@ function createGeometryCollectionVector(geometries, targetDimension, geometryCol
5355
5123
  valueOffsets: createOffsetArray(valueOffsets, options == null ? void 0 : options.offsetType),
5356
5124
  child: memberUnionVector.data[0]
5357
5125
  };
5358
- const listDataValue = listType instanceof arrow14.LargeList ? arrow14.makeData({
5126
+ const listDataValue = listType instanceof arrow13.LargeList ? arrow13.makeData({
5359
5127
  type: listType,
5360
5128
  ...listData,
5361
5129
  valueOffsets: BigInt64Array.from(valueOffsets, BigInt)
5362
- }) : arrow14.makeData({
5130
+ }) : arrow13.makeData({
5363
5131
  type: listType,
5364
5132
  ...listData,
5365
5133
  valueOffsets: Int32Array.from(valueOffsets)
5366
5134
  });
5367
- return arrow14.makeVector(listDataValue);
5135
+ return arrow13.makeVector(listDataValue);
5368
5136
  }
5369
5137
  function convertGeometryToUnionChildValue(geometry, targetDimension, geometryColumn) {
5370
5138
  switch (geometry.type) {
@@ -5389,7 +5157,7 @@ function createUnionChildVector(geometryKind, values, targetDimension, geometryC
5389
5157
  return createGeometryCollectionVector(values, targetDimension, geometryColumn, options, Math.max(geometryCollectionDepth - 1, 0), dimensionName);
5390
5158
  }
5391
5159
  const nativeValues = (options == null ? void 0 : options.coordinates) === "separated" ? values.map((value) => separateCoordinateValues(value, targetDimension, dimensionName)) : values;
5392
- return arrow14.vectorFromArray(nativeValues, getUnionChildType(geometryKind, targetDimension, options, geometryCollectionDepth, dimensionName));
5160
+ return arrow13.vectorFromArray(nativeValues, getUnionChildType(geometryKind, targetDimension, options, geometryCollectionDepth, dimensionName));
5393
5161
  }
5394
5162
  function convertUnionValueToGeometry(value, geometryKind) {
5395
5163
  if (value == null)
@@ -5446,7 +5214,7 @@ function getUnionBufferIndex(bufferLength, offset, rowIndex, useLogicalIndex) {
5446
5214
  }
5447
5215
  function getDenseUnionGeometryKind(vector, rowIndex) {
5448
5216
  var _a;
5449
- if (!(vector.type instanceof arrow14.DenseUnion)) {
5217
+ if (!(vector.type instanceof arrow13.DenseUnion)) {
5450
5218
  throw new Error("GeoArrow geometry storage requires a DenseUnion vector.");
5451
5219
  }
5452
5220
  const { typeId } = getDenseUnionCellInfo(vector, rowIndex);
@@ -5494,7 +5262,7 @@ function getGeometryCollectionDepth(geometries) {
5494
5262
  }
5495
5263
  return maximumDepth;
5496
5264
  }
5497
- function getUnionTypeId3(geometryKind, targetDimension, dimensionName = getDimensionName2(targetDimension)) {
5265
+ function getUnionTypeId2(geometryKind, targetDimension, dimensionName = getDimensionName2(targetDimension)) {
5498
5266
  const baseTypeId = getUnionBaseTypeId(geometryKind);
5499
5267
  switch (dimensionName) {
5500
5268
  case "xy":
@@ -5573,7 +5341,7 @@ function createConvertedField(field, type, targetEncoding, geometryTypes, option
5573
5341
  extensionMetadata.geometry_types = [...effectiveGeometryTypes];
5574
5342
  metadata.set("ARROW:extension:metadata", JSON.stringify(extensionMetadata));
5575
5343
  }
5576
- return new arrow14.Field(field.name, type, field.nullable, metadata);
5344
+ return new arrow13.Field(field.name, type, field.nullable, metadata);
5577
5345
  }
5578
5346
  function getPreservedFieldMetadata(sourceGeoColumnMetadata) {
5579
5347
  if (!sourceGeoColumnMetadata)
@@ -5681,18 +5449,18 @@ function getTargetArrowType(targetEncoding, targetDimension, options, dimensionN
5681
5449
  return coordinateType;
5682
5450
  case "geoarrow.linestring":
5683
5451
  case "geoarrow.multipoint":
5684
- return createList(new arrow14.Field("value", coordinateType, true));
5452
+ return createList(new arrow13.Field("value", coordinateType, true));
5685
5453
  case "geoarrow.polygon":
5686
5454
  case "geoarrow.multilinestring":
5687
- return createList(new arrow14.Field("value", createList(new arrow14.Field("value", coordinateType, true)), true));
5455
+ return createList(new arrow13.Field("value", createList(new arrow13.Field("value", coordinateType, true)), true));
5688
5456
  case "geoarrow.multipolygon":
5689
- return createList(new arrow14.Field("value", createList(new arrow14.Field("value", createList(new arrow14.Field("value", coordinateType, true)), true)), true));
5457
+ return createList(new arrow13.Field("value", createList(new arrow13.Field("value", createList(new arrow13.Field("value", coordinateType, true)), true)), true));
5690
5458
  case "geoarrow.box":
5691
- return new arrow14.Struct(getBoxFieldNames3((options == null ? void 0 : options.dimension) || getDimensionName2(targetDimension)).map((name) => new arrow14.Field(name, new arrow14.Float64(), true)));
5459
+ return new arrow13.Struct(getBoxFieldNames3((options == null ? void 0 : options.dimension) || getDimensionName2(targetDimension)).map((name) => new arrow13.Field(name, new arrow13.Float64(), true)));
5692
5460
  case "geoarrow.wkb":
5693
- return new arrow14.Binary();
5461
+ return new arrow13.Binary();
5694
5462
  case "geoarrow.wkt":
5695
- return new arrow14.Utf8();
5463
+ return new arrow13.Utf8();
5696
5464
  default:
5697
5465
  throw new Error(`Unsupported GeoArrow target encoding "${targetEncoding}".`);
5698
5466
  }
@@ -5716,9 +5484,9 @@ function canReuseGeoArrowVector(column, encoding, options) {
5716
5484
  return true;
5717
5485
  }
5718
5486
  function getCoordinateLayout(type) {
5719
- if (type instanceof arrow14.FixedSizeList)
5487
+ if (type instanceof arrow13.FixedSizeList)
5720
5488
  return "interleaved";
5721
- if (type instanceof arrow14.Struct) {
5489
+ if (type instanceof arrow13.Struct) {
5722
5490
  const names = type.children.map((child) => child.name);
5723
5491
  if (names[0] === "x" && names[1] === "y")
5724
5492
  return "separated";
@@ -5729,10 +5497,10 @@ function getCoordinateLayout(type) {
5729
5497
  }
5730
5498
  return null;
5731
5499
  }
5732
- if (type instanceof arrow14.List || type instanceof arrow14.LargeList) {
5500
+ if (type instanceof arrow13.List || type instanceof arrow13.LargeList) {
5733
5501
  return getCoordinateLayout(type.children[0].type);
5734
5502
  }
5735
- if (type instanceof arrow14.DenseUnion) {
5503
+ if (type instanceof arrow13.DenseUnion) {
5736
5504
  for (const child of type.children) {
5737
5505
  const layout = getCoordinateLayout(child.type);
5738
5506
  if (layout)
@@ -5742,18 +5510,18 @@ function getCoordinateLayout(type) {
5742
5510
  return null;
5743
5511
  }
5744
5512
  function getVectorOffsetType(type) {
5745
- if (type instanceof arrow14.List)
5513
+ if (type instanceof arrow13.List)
5746
5514
  return "int32";
5747
- if (type instanceof arrow14.LargeList)
5515
+ if (type instanceof arrow13.LargeList)
5748
5516
  return "int64";
5749
- if (type instanceof arrow14.Struct) {
5517
+ if (type instanceof arrow13.Struct) {
5750
5518
  for (const child of type.children) {
5751
5519
  const offsetType = getVectorOffsetType(child.type);
5752
5520
  if (offsetType)
5753
5521
  return offsetType;
5754
5522
  }
5755
5523
  }
5756
- if (type instanceof arrow14.DenseUnion) {
5524
+ if (type instanceof arrow13.DenseUnion) {
5757
5525
  for (const child of type.children) {
5758
5526
  const offsetType = getVectorOffsetType(child.type);
5759
5527
  if (offsetType)
@@ -5837,10 +5605,10 @@ function buildGeometryUnionType(targetDimension, allowGeometryCollections, optio
5837
5605
  if (allowGeometryCollections && geometryCollectionDepth > 0) {
5838
5606
  geometryKinds.push("GeometryCollection");
5839
5607
  }
5840
- return new arrow14.DenseUnion(geometryKinds.map((geometryKind) => getUnionTypeId3(geometryKind, targetDimension, dimensionName)), geometryKinds.map((geometryKind) => new arrow14.Field(getUnionFieldName(geometryKind, targetDimension, dimensionName), getUnionChildType(geometryKind, targetDimension, options, geometryCollectionDepth, dimensionName), true)));
5608
+ return new arrow13.DenseUnion(geometryKinds.map((geometryKind) => getUnionTypeId2(geometryKind, targetDimension, dimensionName)), geometryKinds.map((geometryKind) => new arrow13.Field(getUnionFieldName(geometryKind, targetDimension, dimensionName), getUnionChildType(geometryKind, targetDimension, options, geometryCollectionDepth, dimensionName), true)));
5841
5609
  }
5842
5610
  function buildGeometryCollectionType(targetDimension, options, geometryCollectionDepth = 0, dimensionName = getDimensionName2(targetDimension)) {
5843
- return createListType(new arrow14.Field("geometries", buildGeometryUnionType(targetDimension, geometryCollectionDepth > 0, options, geometryCollectionDepth, dimensionName), true), options == null ? void 0 : options.offsetType);
5611
+ return createListType(new arrow13.Field("geometries", buildGeometryUnionType(targetDimension, geometryCollectionDepth > 0, options, geometryCollectionDepth, dimensionName), true), options == null ? void 0 : options.offsetType);
5844
5612
  }
5845
5613
  function getUnionBaseTypeId(geometryKind) {
5846
5614
  switch (geometryKind) {
@@ -5933,13 +5701,13 @@ function getBoxFieldNames3(dimension) {
5933
5701
  }
5934
5702
  function getCoordinateType(targetDimension, coordinates = "interleaved", dimensionName = getDimensionName2(targetDimension)) {
5935
5703
  if (coordinates === "interleaved") {
5936
- return new arrow14.FixedSizeList(targetDimension, new arrow14.Field("value", new arrow14.Float64(), true));
5704
+ return new arrow13.FixedSizeList(targetDimension, new arrow13.Field("value", new arrow13.Float64(), true));
5937
5705
  }
5938
5706
  const coordinateNames = dimensionName === "xy" ? ["x", "y"] : dimensionName === "xyz" ? ["x", "y", "z"] : dimensionName === "xym" ? ["x", "y", "m"] : ["x", "y", "z", "m"];
5939
- return new arrow14.Struct(coordinateNames.map((name) => new arrow14.Field(name, new arrow14.Float64(), true)));
5707
+ return new arrow13.Struct(coordinateNames.map((name) => new arrow13.Field(name, new arrow13.Float64(), true)));
5940
5708
  }
5941
5709
  function createListType(field, offsetType = "int32") {
5942
- return offsetType === "int64" ? new arrow14.LargeList(field) : new arrow14.List(field);
5710
+ return offsetType === "int64" ? new arrow13.LargeList(field) : new arrow13.List(field);
5943
5711
  }
5944
5712
  function createOffsetArray(offsets, offsetType = "int32") {
5945
5713
  return offsetType === "int64" ? BigInt64Array.from(offsets, BigInt) : Int32Array.from(offsets);
@@ -6036,18 +5804,18 @@ function padPosition(position, targetDimension) {
6036
5804
  }
6037
5805
 
6038
5806
  // dist/geoarrow/geoarrow-bounds.js
6039
- var import_wkb7 = require("@math.gl/arrow/wkb");
6040
- var import_geoarrow2 = require("@math.gl/arrow/geoarrow");
6041
- var import_geoarrow_utils3 = require("@math.gl/arrow/geoarrow-utils");
5807
+ var import_arrow10 = require("@math.gl/core/arrow");
5808
+ var import_arrow11 = require("@math.gl/core/arrow");
5809
+ var import_arrow12 = require("@math.gl/core/arrow");
6042
5810
 
6043
5811
  // dist/geoarrow/binary-polygon-to-geoarrow.js
6044
- var import_geoarrow_utils2 = require("@math.gl/arrow/geoarrow-utils");
5812
+ var import_arrow9 = require("@math.gl/core/arrow");
6045
5813
  function makeGeoArrowColumnFromBinaryPolygon(geometry, options) {
6046
5814
  const { dimension } = options;
6047
5815
  if (!["xy", "xyz", "xym", "xyzm"].includes(dimension)) {
6048
5816
  throw new Error("Binary polygon dimension must be xy, xyz, xym, or xyzm.");
6049
5817
  }
6050
- const coordinateSize = (0, import_geoarrow_utils2.getGeoArrowDimensionSize)(dimension);
5818
+ const coordinateSize = (0, import_arrow9.getGeoArrowDimensionSize)(dimension);
6051
5819
  const positions = geometry.positions.value;
6052
5820
  if (!(positions instanceof Float32Array || positions instanceof Float64Array) || geometry.positions.size !== coordinateSize || positions.length % coordinateSize !== 0) {
6053
5821
  throw new Error("Binary polygon positions must be floating-point tuples matching dimension.");
@@ -6116,7 +5884,7 @@ function getGeoArrowRowBounds(column, encodingOrOptions) {
6116
5884
  if (typeof encodingOrOptions === "string") {
6117
5885
  throw new Error("Binary polygon bounds require an explicit dimension option.");
6118
5886
  }
6119
- return (0, import_geoarrow_utils3.getGeoArrowRowBounds)(makeGeoArrowColumnFromBinaryPolygon(column, encodingOrOptions));
5887
+ return (0, import_arrow12.getGeoArrowRowBounds)(makeGeoArrowColumnFromBinaryPolygon(column, encodingOrOptions));
6120
5888
  }
6121
5889
  if (typeof encodingOrOptions !== "string") {
6122
5890
  throw new Error("Arrow vector bounds require a GeoArrow encoding.");
@@ -6125,7 +5893,7 @@ function getGeoArrowRowBounds(column, encodingOrOptions) {
6125
5893
  if (encoding !== "geoarrow.wkb" && encoding !== "geoarrow.wkt") {
6126
5894
  const names = encoding === "geoarrow.box" ? column.type.children.map((field) => field.name) : [];
6127
5895
  const dimension = encoding === "geoarrow.box" ? names.includes("zmin") ? names.includes("mmin") ? "xyzm" : "xyz" : names.includes("mmin") ? "xym" : "xy" : void 0;
6128
- return (0, import_geoarrow_utils3.getGeoArrowRowBounds)((0, import_geoarrow2.makeGeoArrowColumnFromArrowVector)(column, { encoding, dimension }));
5896
+ return (0, import_arrow12.getGeoArrowRowBounds)((0, import_arrow11.makeGeoArrowColumnFromArrowVector)(column, { encoding, dimension }));
6129
5897
  }
6130
5898
  const bounds = [];
6131
5899
  for (let rowIndex = 0; rowIndex < column.length; rowIndex++) {
@@ -6138,7 +5906,7 @@ function getGeoArrowBounds(value, encoding) {
6138
5906
  return null;
6139
5907
  if (encoding === "geoarrow.wkb") {
6140
5908
  const bytes = value;
6141
- const statistics = (0, import_wkb7.scanWKB)(bytes);
5909
+ const statistics = (0, import_arrow10.scanWKB)(bytes);
6142
5910
  return statistics.bounds ? [
6143
5911
  statistics.bounds.xmin,
6144
5912
  statistics.bounds.ymin,
@@ -6166,7 +5934,7 @@ function visitCoordinates(value, bounds) {
6166
5934
  updateBounds2(bounds, coordinate[0], coordinate[1]);
6167
5935
  return;
6168
5936
  }
6169
- if (isVectorLike4(value)) {
5937
+ if (isVectorLike3(value)) {
6170
5938
  for (let index = 0; index < value.length; index++)
6171
5939
  visitCoordinates(value.get(index), bounds);
6172
5940
  return;
@@ -6196,7 +5964,7 @@ function isBoxValue(value) {
6196
5964
  function getNumericCoordinate(value) {
6197
5965
  return typeof value[0] === "number" && typeof value[1] === "number" ? [value[0], value[1]] : null;
6198
5966
  }
6199
- function isVectorLike4(value) {
5967
+ function isVectorLike3(value) {
6200
5968
  return Boolean(value && typeof value.length === "number" && typeof value.get === "function");
6201
5969
  }
6202
5970
  function updateBounds2(bounds, x, y) {
@@ -6693,18 +6461,18 @@ var ClusterSource = class extends DataSource {
6693
6461
  super(data, {});
6694
6462
  const positions = [];
6695
6463
  const rowIndices = [];
6696
- if (data.shape === "arrow-table") {
6697
- const columns = getGeometryColumnsFromSchema(data.data.schema);
6464
+ if (!("shape" in data)) {
6465
+ const columns = getGeometryColumnsFromSchema(data.schema);
6698
6466
  const columnNames = Object.keys(columns);
6699
6467
  this.geometryColumn = options.geometryColumn ?? (columnNames.length === 1 ? columnNames[0] : void 0);
6700
6468
  this.geometryEncoding = this.geometryColumn ? (_a = columns[this.geometryColumn]) == null ? void 0 : _a.encoding : void 0;
6701
- if (!this.geometryColumn || !this.geometryEncoding || !data.data.getChild(this.geometryColumn)) {
6469
+ if (!this.geometryColumn || !this.geometryEncoding || !data.getChild(this.geometryColumn)) {
6702
6470
  throw new Error("ClusterSource requires an explicitly identified GeoArrow geometry column");
6703
6471
  }
6704
6472
  }
6705
- const geometryVector = data.shape === "arrow-table" ? data.data.getChild(this.geometryColumn) : null;
6473
+ const geometryVector = !("shape" in data) ? data.getChild(this.geometryColumn) : null;
6706
6474
  const pointBounds = geometryVector && this.geometryEncoding === "geoarrow.point" && !options.getClusterPosition ? getGeoArrowRowBounds(geometryVector, this.geometryEncoding) : null;
6707
- const rowCount = data.shape === "arrow-table" ? data.data.numRows : data.features.length;
6475
+ const rowCount = !("shape" in data) ? data.numRows : data.features.length;
6708
6476
  for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
6709
6477
  let position;
6710
6478
  if (pointBounds) {
@@ -6724,10 +6492,10 @@ var ClusterSource = class extends DataSource {
6724
6492
  if (["cluster", "clusterId", "pointCount", "rowIndex", "geometry"].includes(name)) {
6725
6493
  throw new Error(`Reserved cluster property: ${name}`);
6726
6494
  }
6727
- const column = data.shape === "arrow-table" ? data.data.getChild(aggregation.column) : null;
6495
+ const column = !("shape" in data) ? data.getChild(aggregation.column) : null;
6728
6496
  const values = rowIndices.map((rowIndex) => {
6729
6497
  var _a2;
6730
- const value = data.shape === "arrow-table" ? column == null ? void 0 : column.get(rowIndex) : (_a2 = data.features[rowIndex].properties) == null ? void 0 : _a2[aggregation.column];
6498
+ const value = !("shape" in data) ? column == null ? void 0 : column.get(rowIndex) : (_a2 = data.features[rowIndex].properties) == null ? void 0 : _a2[aggregation.column];
6731
6499
  if (typeof value !== "number" || !Number.isFinite(value))
6732
6500
  throw new Error(`Cluster aggregation ${name} requires finite numeric values`);
6733
6501
  return value;
@@ -6801,27 +6569,24 @@ var ClusterSource = class extends DataSource {
6801
6569
  const table = builder.finishTable();
6802
6570
  const preference = (_b = parameters.geoarrow) == null ? void 0 : _b.encodingPreference;
6803
6571
  if (preference && preference !== "geoarrow.wkb") {
6804
- return {
6805
- shape: "arrow-table",
6806
- data: convertGeoArrowGeometry(table.data, preference === "optimized" ? "geoarrow.point" : "geoarrow.geometry")
6807
- };
6572
+ return convertGeoArrowGeometry(table, preference === "optimized" ? "geoarrow.point" : "geoarrow.geometry");
6808
6573
  }
6809
6574
  return table;
6810
6575
  }
6811
6576
  /** Retrieves a member's original geometry and properties; Arrow rows are materialized on demand. */
6812
6577
  getFeature(rowIndex) {
6813
- const rowCount = this.data.shape === "arrow-table" ? this.data.data.numRows : this.data.features.length;
6578
+ const rowCount = !("shape" in this.data) ? this.data.numRows : this.data.features.length;
6814
6579
  if (!Number.isInteger(rowIndex) || rowIndex < 0 || rowIndex >= rowCount)
6815
6580
  throw new Error("Invalid cluster source row");
6816
- if (this.data.shape === "geojson-table")
6581
+ if ("shape" in this.data)
6817
6582
  return this.data.features[rowIndex];
6818
- const properties = { ...this.data.data.get(rowIndex).toJSON() };
6583
+ const properties = { ...this.data.get(rowIndex).toJSON() };
6819
6584
  delete properties[this.geometryColumn];
6820
6585
  return { type: "Feature", geometry: this.getGeometry(rowIndex), properties };
6821
6586
  }
6822
6587
  /** Decodes one geometry only when extraction or member retrieval needs it. */
6823
6588
  getGeometry(rowIndex) {
6824
- return this.data.shape === "geojson-table" ? this.data.features[rowIndex].geometry : convertGeoArrowVectorCellToGeoJSON(this.data.data.getChild(this.geometryColumn), rowIndex, this.geometryEncoding);
6589
+ return "shape" in this.data ? this.data.features[rowIndex].geometry : convertGeoArrowVectorCellToGeoJSON(this.data.getChild(this.geometryColumn), rowIndex, this.geometryEncoding);
6825
6590
  }
6826
6591
  };
6827
6592
  function createClusterFeature(node) {