@math.gl/geospatial 5.0.0-beta.10 → 5.0.0-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) hide show
  1. package/README.md +3 -3
  2. package/dist/crs/index.cjs +54 -0
  3. package/dist/crs/index.cjs.map +2 -2
  4. package/dist/crs/index.d.ts +1 -0
  5. package/dist/crs/index.d.ts.map +1 -1
  6. package/dist/crs/index.js +1 -0
  7. package/dist/crs/index.js.map +1 -1
  8. package/dist/crs/spatial-reference-metadata.d.ts +20 -0
  9. package/dist/crs/spatial-reference-metadata.d.ts.map +1 -0
  10. package/dist/crs/spatial-reference-metadata.js +86 -0
  11. package/dist/crs/spatial-reference-metadata.js.map +1 -0
  12. package/dist/expressions.d.ts +1 -1
  13. package/dist/expressions.d.ts.map +1 -1
  14. package/dist/index.cjs +1738 -316
  15. package/dist/index.cjs.map +3 -3
  16. package/dist/index.d.ts +14 -1
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +12 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/projection/experimental/core.cjs.map +1 -1
  21. package/dist/projection/experimental/crs/spatial-reference.d.ts.map +1 -1
  22. package/dist/projection/experimental/crs/spatial-reference.js.map +1 -1
  23. package/dist/projection/experimental/crs/types.d.ts.map +1 -1
  24. package/dist/projection/experimental/lazy-projections/aea.cjs +4 -1
  25. package/dist/projection/experimental/lazy-projections/aea.cjs.map +1 -1
  26. package/dist/projection/experimental/lazy-projections/aea.d.ts.map +1 -1
  27. package/dist/projection/experimental/lazy-projections/aea.js +4 -1
  28. package/dist/projection/experimental/lazy-projections/aea.js.map +1 -1
  29. package/dist/projection/experimental/lazy-projections/bonne.cjs +4 -1
  30. package/dist/projection/experimental/lazy-projections/bonne.cjs.map +1 -1
  31. package/dist/projection/experimental/lazy-projections/bonne.d.ts.map +1 -1
  32. package/dist/projection/experimental/lazy-projections/bonne.js +4 -1
  33. package/dist/projection/experimental/lazy-projections/bonne.js.map +1 -1
  34. package/dist/projection/experimental/lazy-projections/cass.cjs +4 -1
  35. package/dist/projection/experimental/lazy-projections/cass.cjs.map +1 -1
  36. package/dist/projection/experimental/lazy-projections/cass.d.ts.map +1 -1
  37. package/dist/projection/experimental/lazy-projections/cass.js +4 -1
  38. package/dist/projection/experimental/lazy-projections/cass.js.map +1 -1
  39. package/dist/projection/experimental/lazy-projections/eck6.cjs +4 -1
  40. package/dist/projection/experimental/lazy-projections/eck6.cjs.map +1 -1
  41. package/dist/projection/experimental/lazy-projections/eck6.d.ts.map +1 -1
  42. package/dist/projection/experimental/lazy-projections/eck6.js +4 -1
  43. package/dist/projection/experimental/lazy-projections/eck6.js.map +1 -1
  44. package/dist/projection/experimental/lazy-projections/eqdc.cjs +4 -1
  45. package/dist/projection/experimental/lazy-projections/eqdc.cjs.map +1 -1
  46. package/dist/projection/experimental/lazy-projections/eqdc.d.ts.map +1 -1
  47. package/dist/projection/experimental/lazy-projections/eqdc.js +4 -1
  48. package/dist/projection/experimental/lazy-projections/eqdc.js.map +1 -1
  49. package/dist/projection/experimental/lazy-projections/eqearth.cjs +4 -1
  50. package/dist/projection/experimental/lazy-projections/eqearth.cjs.map +1 -1
  51. package/dist/projection/experimental/lazy-projections/eqearth.d.ts.map +1 -1
  52. package/dist/projection/experimental/lazy-projections/eqearth.js +4 -1
  53. package/dist/projection/experimental/lazy-projections/eqearth.js.map +1 -1
  54. package/dist/projection/experimental/lazy-projections/equi.cjs +4 -1
  55. package/dist/projection/experimental/lazy-projections/equi.cjs.map +1 -1
  56. package/dist/projection/experimental/lazy-projections/equi.d.ts.map +1 -1
  57. package/dist/projection/experimental/lazy-projections/equi.js +4 -1
  58. package/dist/projection/experimental/lazy-projections/equi.js.map +1 -1
  59. package/dist/projection/experimental/lazy-projections/geocent.cjs +4 -1
  60. package/dist/projection/experimental/lazy-projections/geocent.cjs.map +1 -1
  61. package/dist/projection/experimental/lazy-projections/geocent.d.ts.map +1 -1
  62. package/dist/projection/experimental/lazy-projections/geocent.js +4 -1
  63. package/dist/projection/experimental/lazy-projections/geocent.js.map +1 -1
  64. package/dist/projection/experimental/lazy-projections/geos.cjs +4 -1
  65. package/dist/projection/experimental/lazy-projections/geos.cjs.map +1 -1
  66. package/dist/projection/experimental/lazy-projections/geos.d.ts.map +1 -1
  67. package/dist/projection/experimental/lazy-projections/geos.js +4 -1
  68. package/dist/projection/experimental/lazy-projections/geos.js.map +1 -1
  69. package/dist/projection/experimental/lazy-projections/gnom.cjs +4 -1
  70. package/dist/projection/experimental/lazy-projections/gnom.cjs.map +1 -1
  71. package/dist/projection/experimental/lazy-projections/gnom.d.ts.map +1 -1
  72. package/dist/projection/experimental/lazy-projections/gnom.js +4 -1
  73. package/dist/projection/experimental/lazy-projections/gnom.js.map +1 -1
  74. package/dist/projection/experimental/lazy-projections/index.cjs +92 -23
  75. package/dist/projection/experimental/lazy-projections/index.cjs.map +1 -1
  76. package/dist/projection/experimental/lazy-projections/krovak.cjs +4 -1
  77. package/dist/projection/experimental/lazy-projections/krovak.cjs.map +1 -1
  78. package/dist/projection/experimental/lazy-projections/krovak.d.ts.map +1 -1
  79. package/dist/projection/experimental/lazy-projections/krovak.js +4 -1
  80. package/dist/projection/experimental/lazy-projections/krovak.js.map +1 -1
  81. package/dist/projection/experimental/lazy-projections/merc.cjs +4 -1
  82. package/dist/projection/experimental/lazy-projections/merc.cjs.map +1 -1
  83. package/dist/projection/experimental/lazy-projections/merc.d.ts.map +1 -1
  84. package/dist/projection/experimental/lazy-projections/merc.js +4 -1
  85. package/dist/projection/experimental/lazy-projections/merc.js.map +1 -1
  86. package/dist/projection/experimental/lazy-projections/mill.cjs +4 -1
  87. package/dist/projection/experimental/lazy-projections/mill.cjs.map +1 -1
  88. package/dist/projection/experimental/lazy-projections/mill.d.ts.map +1 -1
  89. package/dist/projection/experimental/lazy-projections/mill.js +4 -1
  90. package/dist/projection/experimental/lazy-projections/mill.js.map +1 -1
  91. package/dist/projection/experimental/lazy-projections/moll.cjs +4 -1
  92. package/dist/projection/experimental/lazy-projections/moll.cjs.map +1 -1
  93. package/dist/projection/experimental/lazy-projections/moll.d.ts.map +1 -1
  94. package/dist/projection/experimental/lazy-projections/moll.js +4 -1
  95. package/dist/projection/experimental/lazy-projections/moll.js.map +1 -1
  96. package/dist/projection/experimental/lazy-projections/nzmg.cjs +4 -1
  97. package/dist/projection/experimental/lazy-projections/nzmg.cjs.map +1 -1
  98. package/dist/projection/experimental/lazy-projections/nzmg.d.ts.map +1 -1
  99. package/dist/projection/experimental/lazy-projections/nzmg.js +4 -1
  100. package/dist/projection/experimental/lazy-projections/nzmg.js.map +1 -1
  101. package/dist/projection/experimental/lazy-projections/omerc.cjs +4 -1
  102. package/dist/projection/experimental/lazy-projections/omerc.cjs.map +1 -1
  103. package/dist/projection/experimental/lazy-projections/omerc.d.ts.map +1 -1
  104. package/dist/projection/experimental/lazy-projections/omerc.js +4 -1
  105. package/dist/projection/experimental/lazy-projections/omerc.js.map +1 -1
  106. package/dist/projection/experimental/lazy-projections/ortho.cjs +4 -1
  107. package/dist/projection/experimental/lazy-projections/ortho.cjs.map +1 -1
  108. package/dist/projection/experimental/lazy-projections/ortho.d.ts.map +1 -1
  109. package/dist/projection/experimental/lazy-projections/ortho.js +4 -1
  110. package/dist/projection/experimental/lazy-projections/ortho.js.map +1 -1
  111. package/dist/projection/experimental/lazy-projections/poly.cjs +4 -1
  112. package/dist/projection/experimental/lazy-projections/poly.cjs.map +1 -1
  113. package/dist/projection/experimental/lazy-projections/poly.d.ts.map +1 -1
  114. package/dist/projection/experimental/lazy-projections/poly.js +4 -1
  115. package/dist/projection/experimental/lazy-projections/poly.js.map +1 -1
  116. package/dist/projection/experimental/lazy-projections/robin.cjs +4 -1
  117. package/dist/projection/experimental/lazy-projections/robin.cjs.map +1 -1
  118. package/dist/projection/experimental/lazy-projections/robin.d.ts.map +1 -1
  119. package/dist/projection/experimental/lazy-projections/robin.js +4 -1
  120. package/dist/projection/experimental/lazy-projections/robin.js.map +1 -1
  121. package/dist/projection/experimental/lazy-projections/sinu.cjs +4 -1
  122. package/dist/projection/experimental/lazy-projections/sinu.cjs.map +1 -1
  123. package/dist/projection/experimental/lazy-projections/sinu.d.ts.map +1 -1
  124. package/dist/projection/experimental/lazy-projections/sinu.js +4 -1
  125. package/dist/projection/experimental/lazy-projections/sinu.js.map +1 -1
  126. package/dist/projection/experimental/lazy-projections/stere.cjs +4 -1
  127. package/dist/projection/experimental/lazy-projections/stere.cjs.map +1 -1
  128. package/dist/projection/experimental/lazy-projections/stere.d.ts.map +1 -1
  129. package/dist/projection/experimental/lazy-projections/stere.js +4 -1
  130. package/dist/projection/experimental/lazy-projections/stere.js.map +1 -1
  131. package/dist/projection/experimental/lazy-projections/tpers.cjs +4 -1
  132. package/dist/projection/experimental/lazy-projections/tpers.cjs.map +1 -1
  133. package/dist/projection/experimental/lazy-projections/tpers.d.ts.map +1 -1
  134. package/dist/projection/experimental/lazy-projections/tpers.js +4 -1
  135. package/dist/projection/experimental/lazy-projections/tpers.js.map +1 -1
  136. package/dist/projection/experimental/lazy-projections/vandg.cjs +4 -1
  137. package/dist/projection/experimental/lazy-projections/vandg.cjs.map +1 -1
  138. package/dist/projection/experimental/lazy-projections/vandg.d.ts.map +1 -1
  139. package/dist/projection/experimental/lazy-projections/vandg.js +4 -1
  140. package/dist/projection/experimental/lazy-projections/vandg.js.map +1 -1
  141. package/dist/projection/index.cjs.map +1 -1
  142. package/dist/projection/index.d.ts.map +1 -1
  143. package/dist/projection/index.js.map +1 -1
  144. package/dist/projection/lib/projection.js.map +1 -1
  145. package/dist/projection/pipeline.cjs.map +1 -1
  146. package/dist/projection/transform-analysis.cjs.map +1 -1
  147. package/dist/tasks/index.cjs +181 -84
  148. package/dist/tasks/index.cjs.map +2 -2
  149. package/dist/tasks/terrain-residency.d.ts.map +1 -1
  150. package/dist/tasks/terrain-residency.js +80 -18
  151. package/dist/tasks/terrain-residency.js.map +1 -1
  152. package/dist/terrain/cutout-polygons.d.ts +21 -0
  153. package/dist/terrain/cutout-polygons.d.ts.map +1 -0
  154. package/dist/terrain/cutout-polygons.js +172 -0
  155. package/dist/terrain/cutout-polygons.js.map +1 -0
  156. package/dist/terrain/cutout-region.d.ts +34 -0
  157. package/dist/terrain/cutout-region.d.ts.map +1 -0
  158. package/dist/terrain/cutout-region.js +33 -0
  159. package/dist/terrain/cutout-region.js.map +1 -0
  160. package/dist/terrain/cutout-skirts.d.ts +34 -0
  161. package/dist/terrain/cutout-skirts.d.ts.map +1 -0
  162. package/dist/terrain/cutout-skirts.js +29 -0
  163. package/dist/terrain/cutout-skirts.js.map +1 -0
  164. package/dist/terrain/depression-fill.d.ts +25 -0
  165. package/dist/terrain/depression-fill.d.ts.map +1 -0
  166. package/dist/terrain/depression-fill.js +106 -0
  167. package/dist/terrain/depression-fill.js.map +1 -0
  168. package/dist/terrain/geographic-cutout.d.ts +38 -0
  169. package/dist/terrain/geographic-cutout.d.ts.map +1 -0
  170. package/dist/terrain/geographic-cutout.js +120 -0
  171. package/dist/terrain/geographic-cutout.js.map +1 -0
  172. package/dist/terrain/hydrology.d.ts +42 -0
  173. package/dist/terrain/hydrology.d.ts.map +1 -0
  174. package/dist/terrain/hydrology.js +112 -0
  175. package/dist/terrain/hydrology.js.map +1 -0
  176. package/dist/terrain/index.cjs +1529 -107
  177. package/dist/terrain/index.cjs.map +3 -3
  178. package/dist/terrain/index.d.ts +15 -1
  179. package/dist/terrain/index.d.ts.map +1 -1
  180. package/dist/terrain/index.js +13 -0
  181. package/dist/terrain/index.js.map +1 -1
  182. package/dist/terrain/lod-screen-error.d.ts +28 -0
  183. package/dist/terrain/lod-screen-error.d.ts.map +1 -0
  184. package/dist/terrain/lod-screen-error.js +95 -0
  185. package/dist/terrain/lod-screen-error.js.map +1 -0
  186. package/dist/terrain/lod-select.d.ts +26 -10
  187. package/dist/terrain/lod-select.d.ts.map +1 -1
  188. package/dist/terrain/lod-select.js +27 -14
  189. package/dist/terrain/lod-select.js.map +1 -1
  190. package/dist/terrain/mesh-cutout.d.ts +45 -0
  191. package/dist/terrain/mesh-cutout.d.ts.map +1 -0
  192. package/dist/terrain/mesh-cutout.js +336 -0
  193. package/dist/terrain/mesh-cutout.js.map +1 -0
  194. package/dist/terrain/mesh-skirts.d.ts +8 -2
  195. package/dist/terrain/mesh-skirts.d.ts.map +1 -1
  196. package/dist/terrain/mesh-skirts.js +5 -4
  197. package/dist/terrain/mesh-skirts.js.map +1 -1
  198. package/dist/terrain/mixed-halo-update.d.ts.map +1 -1
  199. package/dist/terrain/mixed-halo-update.js +58 -23
  200. package/dist/terrain/mixed-halo-update.js.map +1 -1
  201. package/dist/terrain/mixed-vertex-halos.d.ts +24 -1
  202. package/dist/terrain/mixed-vertex-halos.d.ts.map +1 -1
  203. package/dist/terrain/mixed-vertex-halos.js +75 -58
  204. package/dist/terrain/mixed-vertex-halos.js.map +1 -1
  205. package/dist/terrain/regional-viewshed.d.ts +55 -0
  206. package/dist/terrain/regional-viewshed.d.ts.map +1 -0
  207. package/dist/terrain/regional-viewshed.js +119 -0
  208. package/dist/terrain/regional-viewshed.js.map +1 -0
  209. package/dist/terrain/sweep-polytope.d.ts +4 -0
  210. package/dist/terrain/sweep-polytope.d.ts.map +1 -1
  211. package/dist/terrain/sweep-polytope.js +15 -5
  212. package/dist/terrain/sweep-polytope.js.map +1 -1
  213. package/dist/terrain/sweep-rotating-capsule.d.ts +17 -0
  214. package/dist/terrain/sweep-rotating-capsule.d.ts.map +1 -0
  215. package/dist/terrain/sweep-rotating-capsule.js +118 -0
  216. package/dist/terrain/sweep-rotating-capsule.js.map +1 -0
  217. package/dist/terrain/sweep-rotation.d.ts +35 -0
  218. package/dist/terrain/sweep-rotation.d.ts.map +1 -0
  219. package/dist/terrain/sweep-rotation.js +114 -0
  220. package/dist/terrain/sweep-rotation.js.map +1 -0
  221. package/dist/terrain/tile-cutout-update.d.ts +73 -0
  222. package/dist/terrain/tile-cutout-update.d.ts.map +1 -0
  223. package/dist/terrain/tile-cutout-update.js +181 -0
  224. package/dist/terrain/tile-cutout-update.js.map +1 -0
  225. package/dist/terrain/tile-cutout.d.ts +33 -0
  226. package/dist/terrain/tile-cutout.d.ts.map +1 -0
  227. package/dist/terrain/tile-cutout.js +93 -0
  228. package/dist/terrain/tile-cutout.js.map +1 -0
  229. package/dist/terrain/watershed-accumulation.d.ts +20 -0
  230. package/dist/terrain/watershed-accumulation.d.ts.map +1 -0
  231. package/dist/terrain/watershed-accumulation.js +53 -0
  232. package/dist/terrain/watershed-accumulation.js.map +1 -0
  233. package/dist/turf/expressions.cjs +4 -4
  234. package/dist/turf/expressions.cjs.map +2 -2
  235. package/dist/turf/expressions.d.ts +2 -2
  236. package/dist/turf/expressions.d.ts.map +1 -1
  237. package/dist/turf/expressions.js +2 -2
  238. package/dist/turf/expressions.js.map +1 -1
  239. package/dist/turf.cjs +25 -25
  240. package/dist/turf.cjs.map +2 -2
  241. package/dist/turf.d.ts +1 -1
  242. package/dist/turf.d.ts.map +1 -1
  243. package/dist/turf.js +2 -2
  244. package/dist/turf.js.map +1 -1
  245. package/dist/web-mercator/assert.d.ts +2 -0
  246. package/dist/web-mercator/assert.d.ts.map +1 -0
  247. package/dist/web-mercator/assert.js +12 -0
  248. package/dist/web-mercator/assert.js.map +1 -0
  249. package/dist/web-mercator/fit-bounds.d.ts +52 -0
  250. package/dist/web-mercator/fit-bounds.d.ts.map +1 -0
  251. package/dist/web-mercator/fit-bounds.js +70 -0
  252. package/dist/web-mercator/fit-bounds.js.map +1 -0
  253. package/dist/web-mercator/fly-to-viewport.d.ts +19 -0
  254. package/dist/web-mercator/fly-to-viewport.d.ts.map +1 -0
  255. package/dist/web-mercator/fly-to-viewport.js +94 -0
  256. package/dist/web-mercator/fly-to-viewport.js.map +1 -0
  257. package/dist/web-mercator/get-bounds.d.ts +3 -0
  258. package/dist/web-mercator/get-bounds.d.ts.map +1 -0
  259. package/dist/web-mercator/get-bounds.js +56 -0
  260. package/dist/web-mercator/get-bounds.js.map +1 -0
  261. package/dist/web-mercator/index.cjs +705 -0
  262. package/dist/web-mercator/index.cjs.map +6 -0
  263. package/dist/web-mercator/index.d.ts +14 -0
  264. package/dist/web-mercator/index.d.ts.map +1 -0
  265. package/dist/web-mercator/index.js +14 -0
  266. package/dist/web-mercator/index.js.map +1 -0
  267. package/dist/web-mercator/math-utils.d.ts +7 -0
  268. package/dist/web-mercator/math-utils.d.ts.map +1 -0
  269. package/dist/web-mercator/math-utils.js +30 -0
  270. package/dist/web-mercator/math-utils.js.map +1 -0
  271. package/dist/web-mercator/mercator-meters.d.ts +29 -0
  272. package/dist/web-mercator/mercator-meters.d.ts.map +1 -0
  273. package/dist/web-mercator/mercator-meters.js +61 -0
  274. package/dist/web-mercator/mercator-meters.js.map +1 -0
  275. package/dist/web-mercator/normalize-viewport-props.d.ts +16 -0
  276. package/dist/web-mercator/normalize-viewport-props.d.ts.map +1 -0
  277. package/dist/web-mercator/normalize-viewport-props.js +45 -0
  278. package/dist/web-mercator/normalize-viewport-props.js.map +1 -0
  279. package/dist/web-mercator/web-mercator-utils.d.ts +192 -0
  280. package/dist/web-mercator/web-mercator-utils.d.ts.map +1 -0
  281. package/dist/web-mercator/web-mercator-utils.js +321 -0
  282. package/dist/web-mercator/web-mercator-utils.js.map +1 -0
  283. package/dist/web-mercator/web-mercator-viewport.d.ts +177 -0
  284. package/dist/web-mercator/web-mercator-viewport.d.ts.map +1 -0
  285. package/dist/web-mercator/web-mercator-viewport.js +276 -0
  286. package/dist/web-mercator/web-mercator-viewport.js.map +1 -0
  287. package/dist/web-mercator.d.ts +1 -1
  288. package/dist/web-mercator.d.ts.map +1 -1
  289. package/dist/web-mercator.js +1 -1
  290. package/dist/web-mercator.js.map +1 -1
  291. package/package.json +19 -458
  292. package/src/crs/index.ts +7 -0
  293. package/src/crs/spatial-reference-metadata.ts +118 -0
  294. package/src/expressions.ts +1 -1
  295. package/src/index.ts +92 -4
  296. package/src/projection/experimental/crs/spatial-reference.ts +1 -6
  297. package/src/projection/experimental/crs/types.ts +1 -1
  298. package/src/projection/experimental/crs/wkt.ts +1 -1
  299. package/src/projection/experimental/crs-descriptor.ts +1 -1
  300. package/src/projection/experimental/lazy-projections/aea.ts +4 -1
  301. package/src/projection/experimental/lazy-projections/bonne.ts +4 -1
  302. package/src/projection/experimental/lazy-projections/cass.ts +4 -1
  303. package/src/projection/experimental/lazy-projections/eck6.ts +4 -1
  304. package/src/projection/experimental/lazy-projections/eqdc.ts +4 -1
  305. package/src/projection/experimental/lazy-projections/eqearth.ts +4 -1
  306. package/src/projection/experimental/lazy-projections/equi.ts +4 -1
  307. package/src/projection/experimental/lazy-projections/geocent.ts +4 -1
  308. package/src/projection/experimental/lazy-projections/geos.ts +4 -1
  309. package/src/projection/experimental/lazy-projections/gnom.ts +4 -1
  310. package/src/projection/experimental/lazy-projections/krovak.ts +4 -1
  311. package/src/projection/experimental/lazy-projections/merc.ts +4 -1
  312. package/src/projection/experimental/lazy-projections/mill.ts +4 -1
  313. package/src/projection/experimental/lazy-projections/moll.ts +4 -1
  314. package/src/projection/experimental/lazy-projections/nzmg.ts +4 -1
  315. package/src/projection/experimental/lazy-projections/omerc.ts +4 -1
  316. package/src/projection/experimental/lazy-projections/ortho.ts +4 -1
  317. package/src/projection/experimental/lazy-projections/poly.ts +4 -1
  318. package/src/projection/experimental/lazy-projections/robin.ts +4 -1
  319. package/src/projection/experimental/lazy-projections/sinu.ts +4 -1
  320. package/src/projection/experimental/lazy-projections/stere.ts +4 -1
  321. package/src/projection/experimental/lazy-projections/tpers.ts +4 -1
  322. package/src/projection/experimental/lazy-projections/vandg.ts +4 -1
  323. package/src/projection/index.ts +1 -1
  324. package/src/projection/lib/projection.ts +1 -1
  325. package/src/tasks/terrain-residency.ts +86 -21
  326. package/src/terrain/cutout-polygons.ts +202 -0
  327. package/src/terrain/cutout-region.ts +54 -0
  328. package/src/terrain/cutout-skirts.ts +52 -0
  329. package/src/terrain/depression-fill.ts +125 -0
  330. package/src/terrain/geographic-cutout.ts +154 -0
  331. package/src/terrain/hydrology.ts +149 -0
  332. package/src/terrain/index.ts +85 -1
  333. package/src/terrain/lod-screen-error.ts +128 -0
  334. package/src/terrain/lod-select.ts +65 -31
  335. package/src/terrain/mesh-cutout.ts +420 -0
  336. package/src/terrain/mesh-skirts.ts +10 -7
  337. package/src/terrain/mixed-halo-update.ts +54 -20
  338. package/src/terrain/mixed-vertex-halos.ts +94 -78
  339. package/src/terrain/regional-viewshed.ts +177 -0
  340. package/src/terrain/sweep-polytope.ts +49 -25
  341. package/src/terrain/sweep-rotating-capsule.ts +139 -0
  342. package/src/terrain/sweep-rotation.ts +149 -0
  343. package/src/terrain/tile-cutout-update.ts +293 -0
  344. package/src/terrain/tile-cutout.ts +123 -0
  345. package/src/terrain/watershed-accumulation.ts +67 -0
  346. package/src/turf/expressions.ts +3 -3
  347. package/src/turf.ts +3 -7
  348. package/src/web-mercator/assert.ts +11 -0
  349. package/src/web-mercator/fit-bounds.ts +132 -0
  350. package/src/web-mercator/fly-to-viewport.ts +157 -0
  351. package/src/web-mercator/get-bounds.ts +62 -0
  352. package/src/web-mercator/index.ts +49 -0
  353. package/src/web-mercator/math-utils.ts +35 -0
  354. package/src/web-mercator/mercator-meters.ts +83 -0
  355. package/src/web-mercator/normalize-viewport-props.ts +58 -0
  356. package/src/web-mercator/web-mercator-utils.ts +468 -0
  357. package/src/web-mercator/web-mercator-viewport.ts +406 -0
  358. package/src/web-mercator.ts +1 -1
  359. package/dist/projection/experimental/index.cjs +0 -11707
  360. package/dist/projection/experimental/index.cjs.map +0 -6
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile-cutout.d.ts","sourceRoot":"","sources":["../../src/terrain/tile-cutout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,mBAAmB,EAAC,2BAAwB;AAEzD,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,yBAAsB;AAEvB,oFAAoF;AACpF,MAAM,MAAM,iBAAiB,GAAG,kBAAkB,CAAC;AAEnD,wDAAwD;AACxD,MAAM,MAAM,iBAAiB,GAAG,aAAa,GAAG;IAC9C,uEAAuE;IACvE,WAAW,EAAE,WAAW,CAAC;IACzB,mFAAmF;IACnF,eAAe,EAAE,WAAW,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,iBAAiB,EAAE,EACnC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,GAAE,oBAAyB,GACjC,iBAAiB,CAOnB;AAED,2EAA2E;AAC3E,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,OAAO,GAAE,oBAAyB;;;;;;;;EAwEnC"}
@@ -0,0 +1,93 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { splitTerrainMesh } from "./mesh-cutout.js";
5
+ /** Split a conforming resident tile set, with paired walls only along the cut.
6
+ *
7
+ * Vertices with identical XYZ are welded before clipping. Mixed-level neighbors
8
+ * must first be reconciled with stitchTerrainMeshEdges or stitchTerrainLodCut;
9
+ * hanging vertices, overlapping tiles and conflicting elevations are rejected.
10
+ * No snapping, height adjustment, missing-tile filling or tile caching occurs.
11
+ * Recompute from the new resident set after arrival or eviction. Source triangle
12
+ * and barycentric references retain the original tile face's corner order.
13
+ * Limits apply to the total input (including duplicate vertices) and the splitter.
14
+ */
15
+ export function splitTerrainMeshTiles(tiles, polygon, options = {}) {
16
+ const assembled = assembleTerrainCutoutTiles(tiles, options);
17
+ return {
18
+ ...splitTerrainMesh(assembled.mesh, polygon, { ...options, maxWork: assembled.remainingWork }),
19
+ sourceTiles: assembled.sourceTiles,
20
+ sourceTileFaces: assembled.sourceTileFaces
21
+ };
22
+ }
23
+ /** @internal Assemble a bounded, exact-welded mesh without clipping it. */
24
+ export function assembleTerrainCutoutTiles(tiles, options = {}) {
25
+ const maxVertices = options.maxVertices ?? 500000;
26
+ const maxTriangles = options.maxTriangles ?? 500000;
27
+ const maxWork = options.maxWork ?? 4000000;
28
+ if (![maxVertices, maxTriangles, maxWork].every(n => Number.isSafeInteger(n) && n >= 0) ||
29
+ maxVertices > 0xffffffff ||
30
+ maxTriangles > 0xffffffff)
31
+ throw new RangeError('Invalid terrain tile cutout limits');
32
+ let vertexCount = 0;
33
+ let faceCount = 0;
34
+ let work = 0;
35
+ for (const tile of tiles) {
36
+ if (!(tile.positions instanceof Float32Array || tile.positions instanceof Float64Array) ||
37
+ !(tile.indices instanceof Uint16Array || tile.indices instanceof Uint32Array) ||
38
+ tile.positions.length % 3 ||
39
+ tile.indices.length % 3)
40
+ throw new RangeError('Invalid terrain tile cutout mesh');
41
+ vertexCount += tile.positions.length / 3;
42
+ faceCount += tile.indices.length / 3;
43
+ work += 1 + tile.positions.length / 3 + tile.indices.length;
44
+ if (vertexCount > maxVertices || faceCount > maxTriangles || work > maxWork)
45
+ throw new RangeError('Terrain tile cutout input budget exceeded');
46
+ }
47
+ const positions = new Float64Array(vertexCount * 3);
48
+ const indices = new Uint32Array(faceCount * 3);
49
+ const sourceTiles = new Uint32Array(faceCount);
50
+ const sourceTileFaces = new Uint32Array(faceCount);
51
+ const vertices = new Map();
52
+ let vertexOffset = 0;
53
+ let faceOffset = 0;
54
+ for (let tileIndex = 0; tileIndex < tiles.length; tileIndex++) {
55
+ const tile = tiles[tileIndex];
56
+ const remap = new Uint32Array(tile.positions.length / 3);
57
+ for (let i = 0; i < remap.length; i++) {
58
+ const x = tile.positions[i * 3];
59
+ const y = tile.positions[i * 3 + 1];
60
+ const z = tile.positions[i * 3 + 2];
61
+ if (!Number.isFinite(x) || !Number.isFinite(y) || !Number.isFinite(z))
62
+ throw new RangeError('Invalid terrain tile cutout coordinate');
63
+ const key = `${x},${y},${z}`;
64
+ let id = vertices.get(key);
65
+ if (id === undefined) {
66
+ id = vertexOffset++;
67
+ vertices.set(key, id);
68
+ positions[id * 3] = x;
69
+ positions[id * 3 + 1] = y;
70
+ positions[id * 3 + 2] = z;
71
+ }
72
+ remap[i] = id;
73
+ }
74
+ for (let i = 0; i < tile.indices.length; i++) {
75
+ const id = tile.indices[i];
76
+ if (id >= remap.length)
77
+ throw new RangeError('Invalid terrain tile cutout index');
78
+ indices[faceOffset * 3 + i] = remap[id];
79
+ }
80
+ for (let i = 0; i < tile.indices.length / 3; i++) {
81
+ sourceTiles[faceOffset + i] = tileIndex;
82
+ sourceTileFaces[faceOffset + i] = i;
83
+ }
84
+ faceOffset += tile.indices.length / 3;
85
+ }
86
+ return {
87
+ mesh: { positions: positions.subarray(0, vertexOffset * 3), indices },
88
+ sourceTiles,
89
+ sourceTileFaces,
90
+ remainingWork: maxWork - work
91
+ };
92
+ }
93
+ //# sourceMappingURL=tile-cutout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tile-cutout.js","sourceRoot":"","sources":["../../src/terrain/tile-cutout.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAI5D,OAAO,EACL,gBAAgB,EAIjB,yBAAsB;AAavB;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAmC,EACnC,OAA4B,EAC5B,UAAgC,EAAE;IAElC,MAAM,SAAS,GAAG,0BAA0B,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC7D,OAAO;QACL,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,EAAC,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,aAAa,EAAC,CAAC;QAC5F,WAAW,EAAE,SAAS,CAAC,WAAW;QAClC,eAAe,EAAE,SAAS,CAAC,eAAe;KAC3C,CAAC;AACJ,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,0BAA0B,CACxC,KAAoC,EACpC,UAAgC,EAAE;IAElC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,MAAO,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AU,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IACxC,CAAC;IACD,OAAO;QACL,IAAI,EAAE,EAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,CAAC,EAAE,OAAO,EAAC;QACnE,WAAW;QACX,eAAe;QACf,aAAa,EAAE,OAAO,GAAG,IAAI;KAC9B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /** Outlet labels and upstream counts for a terrain receiver forest. */
2
+ export type TerrainWatershedAccumulation = {
3
+ /** Row-major outlet index, or -1 for excluded cells. */
4
+ terminal: Int32Array;
5
+ /** Number of contributing cells, including the cell itself. Excluded cells have zero. */
6
+ contributingCells: Uint32Array;
7
+ };
8
+ /** Controls allocation for watershed accumulation. */
9
+ export type TerrainWatershedAccumulationOptions = {
10
+ /** Limit before allocating working buffers. */
11
+ maxCells?: number;
12
+ };
13
+ /**
14
+ * Accumulates a receiver forest such as that returned by fillTerrainDepressions.
15
+ * Each entry is a receiver index, -1 for an outlet, or -2 for an excluded cell.
16
+ * createTerrainDrainage uses -1 for nodata. Map nodata cells to -2 before calling.
17
+ * Rejects cycles and links to excluded cells. Time and storage are O(cell count).
18
+ */
19
+ export declare function accumulateTerrainWatersheds(receiver: Int32Array, { maxCells }?: TerrainWatershedAccumulationOptions): TerrainWatershedAccumulation;
20
+ //# sourceMappingURL=watershed-accumulation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watershed-accumulation.d.ts","sourceRoot":"","sources":["../../src/terrain/watershed-accumulation.ts"],"names":[],"mappings":"AAIA,uEAAuE;AACvE,MAAM,MAAM,4BAA4B,GAAG;IACzC,wDAAwD;IACxD,QAAQ,EAAE,UAAU,CAAC;IACrB,yFAAyF;IACzF,iBAAiB,EAAE,WAAW,CAAC;CAChC,CAAC;AAEF,sDAAsD;AACtD,MAAM,MAAM,mCAAmC,GAAG;IAChD,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,UAAU,EACpB,EAAC,QAAoB,EAAC,GAAE,mCAAwC,GAC/D,4BAA4B,CAuC9B"}
@@ -0,0 +1,53 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ /**
5
+ * Accumulates a receiver forest such as that returned by fillTerrainDepressions.
6
+ * Each entry is a receiver index, -1 for an outlet, or -2 for an excluded cell.
7
+ * createTerrainDrainage uses -1 for nodata. Map nodata cells to -2 before calling.
8
+ * Rejects cycles and links to excluded cells. Time and storage are O(cell count).
9
+ */
10
+ export function accumulateTerrainWatersheds(receiver, { maxCells = 4194304 } = {}) {
11
+ const count = receiver.length;
12
+ if (!Number.isSafeInteger(maxCells) || maxCells < 0 || count > maxCells || count > 0x7fffffff)
13
+ throw new RangeError('Terrain watershed accumulation exceeds its cell budget');
14
+ const incoming = new Uint32Array(count);
15
+ const contributingCells = new Uint32Array(count);
16
+ const terminal = new Int32Array(count).fill(-1);
17
+ const queue = new Int32Array(count);
18
+ let active = 0;
19
+ for (let i = 0; i < count; i++) {
20
+ const next = receiver[i];
21
+ if (next === -2)
22
+ continue;
23
+ if (next < -1 || next >= count || (next >= 0 && receiver[next] === -2))
24
+ throw new RangeError('Invalid terrain watershed receiver');
25
+ active++;
26
+ contributingCells[i] = 1;
27
+ if (next >= 0)
28
+ incoming[next]++;
29
+ }
30
+ let end = 0;
31
+ for (let i = 0; i < count; i++) {
32
+ if (contributingCells[i] && !incoming[i])
33
+ queue[end++] = i;
34
+ }
35
+ for (let cursor = 0; cursor < end; cursor++) {
36
+ const i = queue[cursor];
37
+ const next = receiver[i];
38
+ if (next < 0)
39
+ continue;
40
+ contributingCells[next] += contributingCells[i];
41
+ if (--incoming[next] === 0)
42
+ queue[end++] = next;
43
+ }
44
+ if (end !== active)
45
+ throw new RangeError('Terrain watershed receiver graph contains a cycle');
46
+ for (let cursor = end - 1; cursor >= 0; cursor--) {
47
+ const i = queue[cursor];
48
+ const next = receiver[i];
49
+ terminal[i] = next < 0 ? i : terminal[next];
50
+ }
51
+ return { terminal, contributingCells };
52
+ }
53
+ //# sourceMappingURL=watershed-accumulation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"watershed-accumulation.js","sourceRoot":"","sources":["../../src/terrain/watershed-accumulation.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAgB5D;;;;;GAKG;AACH,MAAM,UAAU,2BAA2B,CACzC,QAAoB,EACpB,EAAC,QAAQ,GAAG,OAAS,KAAyC,EAAE;IAEhE,MAAM,KAAK,GAAG,QAAQ,CAAC,MAAM,CAAC;IAC9B,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,IAAI,KAAK,GAAG,QAAQ,IAAI,KAAK,GAAG,UAAU;QAC3F,MAAM,IAAI,UAAU,CAAC,wDAAwD,CAAC,CAAC;IAEjF,MAAM,QAAQ,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,iBAAiB,GAAG,IAAI,WAAW,CAAC,KAAK,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACzB,IAAI,IAAI,KAAK,CAAC,CAAC;YAAE,SAAS;QAC1B,IAAI,IAAI,GAAG,CAAC,CAAC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KAAK,CAAC,MAAM,CAAC,CAAC;QACxB,MAAM,IAAI,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;QACzB,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,EAAC,QAAQ,EAAE,iBAAiB,EAAC,CAAC;AACvC,CAAC"}
@@ -23,8 +23,8 @@ __export(expressions_exports, {
23
23
  });
24
24
  module.exports = __toCommonJS(expressions_exports);
25
25
  var import_apache_arrow = require("apache-arrow");
26
- var import_geoarrow = require("@math.gl/arrow/geoarrow");
27
- var import_geoarrow_utils = require("@math.gl/arrow/geoarrow-utils");
26
+ var import_arrow = require("@math.gl/core/arrow");
27
+ var import_arrow2 = require("@math.gl/core/arrow");
28
28
  function createTurfArrowFunction(options) {
29
29
  const { result, evaluate } = options;
30
30
  const fields = [...options.arguments];
@@ -42,14 +42,14 @@ function createTurfArrowFunction(options) {
42
42
  nullHandling: "propagate",
43
43
  evaluate(vectors, { activeRows, length }) {
44
44
  const columns = vectors.map((vector, index) => {
45
- const column = (0, import_geoarrow.makeGeoArrowColumnFromArrowVector)(vector, { field: fields[index] });
45
+ const column = (0, import_arrow.makeGeoArrowColumnFromArrowVector)(vector, { field: fields[index] });
46
46
  let offset = 0;
47
47
  return {
48
48
  ...column,
49
49
  chunks: column.chunks.map((chunk) => {
50
50
  const validity2 = new Uint8Array(Math.ceil(chunk.length / 8));
51
51
  for (let row = 0; row < chunk.length; row++) {
52
- if (activeRows[offset + row] && (0, import_geoarrow_utils.isGeoArrowValueValid)(chunk.validity, row))
52
+ if (activeRows[offset + row] && (0, import_arrow2.isGeoArrowValueValid)(chunk.validity, row))
53
53
  validity2[row >> 3] |= 1 << (row & 7);
54
54
  }
55
55
  offset += chunk.length;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/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validity"]
6
6
  }
@@ -1,6 +1,6 @@
1
1
  import { type Field } from 'apache-arrow';
2
- import type { ArrowTableFunction } from '@math.gl/expressions/arrow';
3
- import { type GeoArrowColumn } from '@math.gl/arrow/geoarrow-utils';
2
+ import type { ArrowTableFunction } from '@math.gl/sql/arrow';
3
+ import { type GeoArrowColumn } from '@math.gl/core/arrow';
4
4
  import type { TurfBatchResult } from "../turf.js";
5
5
  /** Adapter for row-preserving numeric/Boolean functions from @math.gl/geospatial/turf. */
6
6
  export type TurfArrowFunctionOptions<Fields extends readonly Field[] = readonly Field[]> = {
@@ -1 +1 @@
1
- {"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../src/turf/expressions.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4C,KAAK,KAAK,EAAC,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAuB,KAAK,cAAc,EAAC,MAAM,+BAA+B,CAAC;AACxF,OAAO,KAAK,EAAC,eAAe,EAAC,mBAAgB;AAE7C,0FAA0F;AAC1F,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,SAAS,KAAK,EAAE,GAAG,SAAS,KAAK,EAAE,IAAI;IACzF,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,MAAM,EAAE,KAAK,CAAC;IACd,+FAA+F;IAC/F,QAAQ,EAAE,CACR,GAAG,OAAO,EAAE;SAAE,KAAK,IAAI,MAAM,MAAM,GAAG,cAAc;KAAC,KAClD,eAAe,CAAC,YAAY,GAAG,UAAU,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,MAAM,SAAS,SAAS,KAAK,EAAE,EAC3E,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACxC,kBAAkB,CAiEpB"}
1
+ {"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../src/turf/expressions.ts"],"names":[],"mappings":"AAIA,OAAO,EAA4C,KAAK,KAAK,EAAC,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,oBAAoB,CAAC;AAE3D,OAAO,EAAuB,KAAK,cAAc,EAAC,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EAAC,eAAe,EAAC,mBAAgB;AAE7C,0FAA0F;AAC1F,MAAM,MAAM,wBAAwB,CAAC,MAAM,SAAS,SAAS,KAAK,EAAE,GAAG,SAAS,KAAK,EAAE,IAAI;IACzF,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,uFAAuF;IACvF,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,MAAM,EAAE,KAAK,CAAC;IACd,+FAA+F;IAC/F,QAAQ,EAAE,CACR,GAAG,OAAO,EAAE;SAAE,KAAK,IAAI,MAAM,MAAM,GAAG,cAAc;KAAC,KAClD,eAAe,CAAC,YAAY,GAAG,UAAU,CAAC,CAAC;CACjD,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,CAAC,MAAM,SAAS,SAAS,KAAK,EAAE,EAC3E,OAAO,EAAE,wBAAwB,CAAC,MAAM,CAAC,GACxC,kBAAkB,CAiEpB"}
@@ -2,8 +2,8 @@
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
4
  import { DataType, Precision, makeData, makeVector } from 'apache-arrow';
5
- import { makeGeoArrowColumnFromArrowVector } from '@math.gl/arrow/geoarrow';
6
- import { isGeoArrowValueValid } from '@math.gl/arrow/geoarrow-utils';
5
+ import { makeGeoArrowColumnFromArrowVector } from '@math.gl/core/arrow';
6
+ import { isGeoArrowValueValid } from '@math.gl/core/arrow';
7
7
  /**
8
8
  * Wraps a scalar-result Turf batch function as an Arrow expression vector kernel. Bind options
9
9
  * in the evaluate closure. Only selected Turf imports are bundled; this adapter imports no Turf
@@ -1 +1 @@
1
- {"version":3,"file":"expressions.js","sourceRoot":"","sources":["../../src/turf/expressions.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EAAC,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAa,MAAM,cAAc,CAAC;AAEnF,OAAO,EAAC,iCAAiC,EAAC,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAC,oBAAoB,EAAsB,MAAM,+BAA+B,CAAC;AAiBxF;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAyC;IAEzC,MAAM,EAAC,MAAM,EAAE,QAAQ,EAAC,GAAG,OAAO,CAAC;IACnC,MAAM,MAAM,GAAG,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IACtC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IAC7C,IAAI,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,SAAS,KAAK,SAAS,CAAC,MAAM,CAAC;QAC5F,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,IAAI,CAAC,MAAM,CAAC,QAAQ;QAAE,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAClF,OAAO;QACL,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,UAAU,EAAE;YACV;gBACE,SAAS,EAAE,MAAM;gBACjB,MAAM;gBACN,YAAY,EAAE,WAAW;gBACzB,QAAQ,CAAC,OAAO,EAAE,EAAC,UAAU,EAAE,MAAM,EAAC;oBACpC,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;wBAC5C,MAAM,MA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O,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC;oBAC/E,IAAI,SAAS,GAAG,CAAC,CAAC;oBAClB,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;wBACtC,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC;wBAC3B,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAE,GAAG,GAAG,EAAE,CAAC;4BACxD,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;4BAC1B,IAAI,OAAO,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC;gCAAE,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,GAAG,CAAC;wBAC7D,CAAC;;4BAAM,SAAS,EAAE,CAAC;oBACrB,CAAC;oBACD,OAAO,UAAU,CACf,QAAQ,CAAC;wBACP,IAAI,EAAE,MAAM,CAAC,IAAI;wBACjB,IAAI,EAAE,MAAM;wBACZ,MAAM;wBACN,UAAU,EAAE,QAAQ;wBACpB,SAAS;qBACH,CAAC,CACV,CAAC;gBACJ,CAAC;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
package/dist/turf.cjs CHANGED
@@ -58,8 +58,8 @@ __export(turf_exports, {
58
58
  truncate: () => truncate
59
59
  });
60
60
  module.exports = __toCommonJS(turf_exports);
61
- var import_geoarrow_utils = require("@math.gl/arrow/geoarrow-utils");
62
- var import_geoarrow_utils2 = require("@math.gl/arrow/geoarrow-utils");
61
+ var import_arrow = require("@math.gl/core/arrow");
62
+ var import_arrow2 = require("@math.gl/core/arrow");
63
63
  var RADIUS = 63710088e-1;
64
64
  var RAD = Math.PI / 180;
65
65
  var depths = {
@@ -76,7 +76,7 @@ function rows(column, allowed) {
76
76
  const result2 = [];
77
77
  for (const array of column.chunks)
78
78
  for (let index = 0; index < array.length; index++)
79
- result2.push({ array, index, valid: (0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index) });
79
+ result2.push({ array, index, valid: (0, import_arrow.isGeoArrowValueValid)(array.validity, index) });
80
80
  return result2;
81
81
  }
82
82
  function range(array, index) {
@@ -92,12 +92,12 @@ function range(array, index) {
92
92
  function scalar(array, index) {
93
93
  if (array.kind !== "primitive")
94
94
  throw new Error("Invalid GeoArrow coordinate");
95
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
95
+ if (!(0, import_arrow.isGeoArrowValueValid)(array.validity, index))
96
96
  return NaN;
97
97
  return Number(array.values[(array.offset || 0) + index * (array.stride || 1)]);
98
98
  }
99
99
  function point(array, index) {
100
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
100
+ if (!(0, import_arrow.isGeoArrowValueValid)(array.validity, index))
101
101
  return null;
102
102
  if (array.kind === "fixed-size-list") {
103
103
  const i = ((array.offset || 0) + index) * array.size;
@@ -112,7 +112,7 @@ function point(array, index) {
112
112
  throw new Error("Invalid GeoArrow coordinate storage");
113
113
  }
114
114
  function walk(array, index, depth, visit) {
115
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
115
+ if (!(0, import_arrow.isGeoArrowValueValid)(array.validity, index))
116
116
  return;
117
117
  if (!depth) {
118
118
  const p = point(array, index);
@@ -127,7 +127,7 @@ function walk(array, index, depth, visit) {
127
127
  walk(array.child, i, depth - 1, visit);
128
128
  }
129
129
  function lines(array, index, depth, visit) {
130
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.validity, index))
130
+ if (!(0, import_arrow.isGeoArrowValueValid)(array.validity, index))
131
131
  return;
132
132
  const [a, b] = range(array, index);
133
133
  if (array.kind !== "list")
@@ -184,7 +184,7 @@ var points = ["geoarrow.point"];
184
184
  var polygons = ["geoarrow.polygon", "geoarrow.multipolygon"];
185
185
  function bbox(column) {
186
186
  rows(column, native);
187
- const bounds = (0, import_geoarrow_utils2.getGeoArrowRowBounds)(column), out = {
187
+ const bounds = (0, import_arrow2.getGeoArrowRowBounds)(column), out = {
188
188
  values: new Float64Array(bounds.length * 4),
189
189
  validity: new Uint8Array(Math.ceil(bounds.length / 8))
190
190
  };
@@ -255,11 +255,11 @@ function polygonArea(array, index) {
255
255
  const [a, b] = range(array, index);
256
256
  if (array.kind !== "list")
257
257
  throw new Error("Invalid polygon");
258
- if (a === b || !(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, a))
258
+ if (a === b || !(0, import_arrow.isGeoArrowValueValid)(array.child.validity, a))
259
259
  return 0;
260
260
  let sum = 0;
261
261
  for (let i = a; i < b; i++) {
262
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, i))
262
+ if (!(0, import_arrow.isGeoArrowValueValid)(array.child.validity, i))
263
263
  continue;
264
264
  const [x, y] = range(array.child, i);
265
265
  if (array.child.kind !== "list")
@@ -282,7 +282,7 @@ function area(column) {
282
282
  if (row.array.kind !== "list")
283
283
  throw new Error("Invalid multipolygon");
284
284
  for (let j = a; j < b; j++)
285
- if ((0, import_geoarrow_utils.isGeoArrowValueValid)(row.array.child.validity, j))
285
+ if ((0, import_arrow.isGeoArrowValueValid)(row.array.child.validity, j))
286
286
  sum += polygonArea(row.array.child, j);
287
287
  }
288
288
  out.values[i] = sum;
@@ -353,10 +353,10 @@ function polygonContains(array, index, p) {
353
353
  const [a, b] = range(array, index);
354
354
  if (array.kind !== "list")
355
355
  throw new Error("Invalid polygon");
356
- if (a === b || !(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, a))
356
+ if (a === b || !(0, import_arrow.isGeoArrowValueValid)(array.child.validity, a))
357
357
  return -1;
358
358
  for (let i = a; i < b; i++) {
359
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(array.child.validity, i))
359
+ if (!(0, import_arrow.isGeoArrowValueValid)(array.child.validity, i))
360
360
  continue;
361
361
  const [x, y] = range(array.child, i);
362
362
  if (array.child.kind !== "list")
@@ -387,7 +387,7 @@ function booleanPointInPolygon(pointColumn, polygonColumn, options = {}) {
387
387
  if (y.array.kind !== "list")
388
388
  throw new Error("Invalid multipolygon");
389
389
  for (let j = start; j < end; j++) {
390
- if (!(0, import_geoarrow_utils.isGeoArrowValueValid)(y.array.child.validity, j))
390
+ if (!(0, import_arrow.isGeoArrowValueValid)(y.array.child.validity, j))
391
391
  continue;
392
392
  const c = polygonContains(y.array.child, j, p);
393
393
  if (c > 0 || c === 0 && !options.ignoreBoundary) {
@@ -403,7 +403,7 @@ function booleanPointInPolygon(pointColumn, polygonColumn, options = {}) {
403
403
  }
404
404
  function clone(column) {
405
405
  rows(column, native);
406
- return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => coordinate);
406
+ return (0, import_arrow2.mapGeoArrowCoordinates)(column, (coordinate) => coordinate);
407
407
  }
408
408
  function truncate(column, options = {}) {
409
409
  rows(column, native);
@@ -412,14 +412,14 @@ function truncate(column, options = {}) {
412
412
  throw new RangeError("precision must be an integer between 0 and 15");
413
413
  }
414
414
  const factor = 10 ** precision;
415
- return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => coordinate.map((value) => Math.round(value * factor) / factor));
415
+ return (0, import_arrow2.mapGeoArrowCoordinates)(column, (coordinate) => coordinate.map((value) => Math.round(value * factor) / factor));
416
416
  }
417
417
  function toMercator(column) {
418
418
  rows(column, native);
419
419
  const radius = 6378137;
420
420
  const maximum = 20037508342789244e-9;
421
421
  return {
422
- ...(0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => {
422
+ ...(0, import_arrow2.mapGeoArrowCoordinates)(column, (coordinate) => {
423
423
  const longitude = Math.abs(coordinate[0]) <= 180 ? coordinate[0] : coordinate[0] - Math.sign(coordinate[0]) * 360;
424
424
  const x = radius * longitude * RAD;
425
425
  const y = radius * Math.log(Math.tan(Math.PI / 4 + coordinate[1] * RAD / 2));
@@ -435,7 +435,7 @@ function toMercator(column) {
435
435
  function toWgs84(column) {
436
436
  rows(column, native);
437
437
  return {
438
- ...(0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (coordinate) => [
438
+ ...(0, import_arrow2.mapGeoArrowCoordinates)(column, (coordinate) => [
439
439
  coordinate[0] / 6378137 / RAD,
440
440
  (2 * Math.atan(Math.exp(coordinate[1] / 6378137)) - Math.PI / 2) / RAD,
441
441
  ...coordinate.slice(2)
@@ -473,7 +473,7 @@ function pointOutput(source, count, calculate) {
473
473
  }
474
474
  function center(column) {
475
475
  rows(column, native);
476
- const bounds = (0, import_geoarrow_utils2.getGeoArrowRowBounds)(column);
476
+ const bounds = (0, import_arrow2.getGeoArrowRowBounds)(column);
477
477
  return pointOutput(column, bounds.length, (i) => bounds[i] ? [(bounds[i][0] + bounds[i][2]) / 2, (bounds[i][1] + bounds[i][3]) / 2] : null);
478
478
  }
479
479
  function destinationPoint(p, radians, bearingDegrees) {
@@ -556,7 +556,7 @@ function transformTranslate(column, distanceValue, direction, options = {}) {
556
556
  if (!Number.isFinite(distanceValue) || !Number.isFinite(direction))
557
557
  throw new RangeError("Distance and direction must be finite");
558
558
  const radians = distanceValue / units(1, options.units);
559
- return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (p) => [
559
+ return (0, import_arrow2.mapGeoArrowCoordinates)(column, (p) => [
560
560
  ...rhumbDestinationPoint([p[0], p[1]], radians, direction),
561
561
  ...p.slice(2)
562
562
  ]);
@@ -566,7 +566,7 @@ function transformRotate(column, angle2, options) {
566
566
  if (!Number.isFinite(angle2) || !options.pivot.every(Number.isFinite))
567
567
  throw new RangeError("Angle and pivot must be finite");
568
568
  const pivot = [options.pivot[0], options.pivot[1]];
569
- return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (p) => {
569
+ return (0, import_arrow2.mapGeoArrowCoordinates)(column, (p) => {
570
570
  const phi = (p[1] - pivot[1]) * RAD;
571
571
  const psi = Math.log(Math.tan(p[1] * RAD / 2 + Math.PI / 4) / Math.tan(pivot[1] * RAD / 2 + Math.PI / 4));
572
572
  const q = Math.abs(psi) > 1e-11 ? phi / psi : Math.cos(pivot[1] * RAD);
@@ -637,7 +637,7 @@ function circle(column, radius, options = {}) {
637
637
  }
638
638
  function bboxPolygon(column) {
639
639
  rows(column, native);
640
- const bounds = (0, import_geoarrow_utils2.getGeoArrowRowBounds)(column);
640
+ const bounds = (0, import_arrow2.getGeoArrowRowBounds)(column);
641
641
  return generatedPaths(column, bounds.length, 5, true, (i, j) => {
642
642
  const b = bounds[i];
643
643
  if (!b)
@@ -741,14 +741,14 @@ function booleanClockwise(column) {
741
741
  }
742
742
  function rewind(column, options = {}) {
743
743
  rows(column, polygons);
744
- return (0, import_geoarrow_utils2.rewindGeoArrow)(column, { outer: options.reverse ? "clockwise" : "counter-clockwise" });
744
+ return (0, import_arrow2.rewindGeoArrow)(column, { outer: options.reverse ? "clockwise" : "counter-clockwise" });
745
745
  }
746
746
  function transformScale(column, factor, options) {
747
747
  rows(column, native);
748
748
  if (!Number.isFinite(factor) || factor <= 0 || !options.origin.every(Number.isFinite))
749
749
  throw new RangeError("factor must be positive and origin must be finite");
750
750
  const origin = [options.origin[0], options.origin[1]];
751
- return (0, import_geoarrow_utils2.mapGeoArrowCoordinates)(column, (p) => {
751
+ return (0, import_arrow2.mapGeoArrowCoordinates)(column, (p) => {
752
752
  const delta = (p[1] - origin[1]) * RAD;
753
753
  const psi = Math.log(Math.tan(p[1] * RAD / 2 + Math.PI / 4) / Math.tan(origin[1] * RAD / 2 + Math.PI / 4));
754
754
  const q = Math.abs(psi) > 1e-11 ? delta / psi : Math.cos(origin[1] * RAD);
@@ -872,7 +872,7 @@ function booleanConcave(column) {
872
872
  valid(out.validity, i);
873
873
  const [firstRing, lastRing] = range(row.array, row.index);
874
874
  const rings = row.array.child;
875
- if (firstRing === lastRing || rings.kind !== "list" || !(0, import_geoarrow_utils.isGeoArrowValueValid)(rings.validity, firstRing))
875
+ if (firstRing === lastRing || rings.kind !== "list" || !(0, import_arrow.isGeoArrowValueValid)(rings.validity, firstRing))
876
876
  return;
877
877
  const [a, b] = range(rings, firstRing), n = b - a - 1;
878
878
  if (n < 3)