@math.gl/geospatial 5.0.0-beta.3 → 5.0.0-beta.5

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 (475) hide show
  1. package/README.md +192 -2
  2. package/THIRD-PARTY-NOTICES.md +192 -20
  3. package/dist/expressions.d.ts +1 -1
  4. package/dist/expressions.d.ts.map +1 -1
  5. package/dist/index.cjs +456 -4614
  6. package/dist/index.cjs.map +3 -3
  7. package/dist/index.d.ts +9 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +5 -4
  10. package/dist/index.js.map +1 -1
  11. package/dist/projection/experimental/common/adjust_lat.js +1 -1
  12. package/dist/projection/experimental/common/adjust_lat.js.map +1 -1
  13. package/dist/projection/experimental/common/adjust_lon.js +1 -1
  14. package/dist/projection/experimental/common/adjust_lon.js.map +1 -1
  15. package/dist/projection/experimental/common/asinhy.js +1 -1
  16. package/dist/projection/experimental/common/asinhy.js.map +1 -1
  17. package/dist/projection/experimental/common/asinz.js +1 -1
  18. package/dist/projection/experimental/common/asinz.js.map +1 -1
  19. package/dist/projection/experimental/common/authlat.js +1 -1
  20. package/dist/projection/experimental/common/authlat.js.map +1 -1
  21. package/dist/projection/experimental/common/authset.js +1 -1
  22. package/dist/projection/experimental/common/authset.js.map +1 -1
  23. package/dist/projection/experimental/common/clens.js +1 -1
  24. package/dist/projection/experimental/common/clens.js.map +1 -1
  25. package/dist/projection/experimental/common/clens_cmplx.js +1 -1
  26. package/dist/projection/experimental/common/clens_cmplx.js.map +1 -1
  27. package/dist/projection/experimental/common/constants.js +1 -1
  28. package/dist/projection/experimental/common/constants.js.map +1 -1
  29. package/dist/projection/experimental/common/cosh.js +1 -1
  30. package/dist/projection/experimental/common/cosh.js.map +1 -1
  31. package/dist/projection/experimental/common/e0fn.js +1 -1
  32. package/dist/projection/experimental/common/e0fn.js.map +1 -1
  33. package/dist/projection/experimental/common/e1fn.js +1 -1
  34. package/dist/projection/experimental/common/e1fn.js.map +1 -1
  35. package/dist/projection/experimental/common/e2fn.js +1 -1
  36. package/dist/projection/experimental/common/e2fn.js.map +1 -1
  37. package/dist/projection/experimental/common/e3fn.js +1 -1
  38. package/dist/projection/experimental/common/e3fn.js.map +1 -1
  39. package/dist/projection/experimental/common/fL.js +1 -1
  40. package/dist/projection/experimental/common/fL.js.map +1 -1
  41. package/dist/projection/experimental/common/gN.js +1 -1
  42. package/dist/projection/experimental/common/gN.js.map +1 -1
  43. package/dist/projection/experimental/common/gatg.js +1 -1
  44. package/dist/projection/experimental/common/gatg.js.map +1 -1
  45. package/dist/projection/experimental/common/hypot.js +1 -1
  46. package/dist/projection/experimental/common/hypot.js.map +1 -1
  47. package/dist/projection/experimental/common/imlfn.js +1 -1
  48. package/dist/projection/experimental/common/imlfn.js.map +1 -1
  49. package/dist/projection/experimental/common/invlatiso.js +1 -1
  50. package/dist/projection/experimental/common/invlatiso.js.map +1 -1
  51. package/dist/projection/experimental/common/iqsfnz.js +1 -1
  52. package/dist/projection/experimental/common/iqsfnz.js.map +1 -1
  53. package/dist/projection/experimental/common/latiso.js +1 -1
  54. package/dist/projection/experimental/common/latiso.js.map +1 -1
  55. package/dist/projection/experimental/common/log1py.js +1 -1
  56. package/dist/projection/experimental/common/log1py.js.map +1 -1
  57. package/dist/projection/experimental/common/mlfn.js +1 -1
  58. package/dist/projection/experimental/common/mlfn.js.map +1 -1
  59. package/dist/projection/experimental/common/msfnz.js +1 -1
  60. package/dist/projection/experimental/common/msfnz.js.map +1 -1
  61. package/dist/projection/experimental/common/phi2z.js +1 -1
  62. package/dist/projection/experimental/common/phi2z.js.map +1 -1
  63. package/dist/projection/experimental/common/pj_enfn.js +1 -1
  64. package/dist/projection/experimental/common/pj_enfn.js.map +1 -1
  65. package/dist/projection/experimental/common/pj_inv_mlfn.js +1 -1
  66. package/dist/projection/experimental/common/pj_inv_mlfn.js.map +1 -1
  67. package/dist/projection/experimental/common/pj_mlfn.js +1 -1
  68. package/dist/projection/experimental/common/pj_mlfn.js.map +1 -1
  69. package/dist/projection/experimental/common/qsfnz.js +1 -1
  70. package/dist/projection/experimental/common/qsfnz.js.map +1 -1
  71. package/dist/projection/experimental/common/sign.js +1 -1
  72. package/dist/projection/experimental/common/sign.js.map +1 -1
  73. package/dist/projection/experimental/common/sinh.js +1 -1
  74. package/dist/projection/experimental/common/sinh.js.map +1 -1
  75. package/dist/projection/experimental/common/srat.js +1 -1
  76. package/dist/projection/experimental/common/srat.js.map +1 -1
  77. package/dist/projection/experimental/common/tsfnz.js +1 -1
  78. package/dist/projection/experimental/common/tsfnz.js.map +1 -1
  79. package/dist/projection/experimental/common/vincenty.js +1 -1
  80. package/dist/projection/experimental/common/vincenty.js.map +1 -1
  81. package/dist/projection/experimental/core.cjs +100 -2
  82. package/dist/projection/experimental/core.cjs.map +2 -2
  83. package/dist/projection/experimental/core.d.ts +1 -0
  84. package/dist/projection/experimental/core.d.ts.map +1 -1
  85. package/dist/projection/experimental/crs/datum-table.js +1 -1
  86. package/dist/projection/experimental/crs/datum-table.js.map +1 -1
  87. package/dist/projection/experimental/crs/ellipsoid-table.js +1 -1
  88. package/dist/projection/experimental/crs/ellipsoid-table.js.map +1 -1
  89. package/dist/projection/experimental/crs/primemeridian-table.js +1 -1
  90. package/dist/projection/experimental/crs/primemeridian-table.js.map +1 -1
  91. package/dist/projection/experimental/crs/structured.js +1 -1
  92. package/dist/projection/experimental/crs/structured.js.map +1 -1
  93. package/dist/projection/experimental/crs/wkt.js +1 -1
  94. package/dist/projection/experimental/crs/wkt.js.map +1 -1
  95. package/dist/projection/experimental/datum.js +1 -1
  96. package/dist/projection/experimental/datum.js.map +1 -1
  97. package/dist/projection/experimental/ellipsoidal-gnomonic.js +1 -1
  98. package/dist/projection/experimental/ellipsoidal-gnomonic.js.map +1 -1
  99. package/dist/projection/experimental/entries/projections/eqc.cjs +1 -0
  100. package/dist/projection/experimental/entries/projections/eqc.cjs.map +1 -1
  101. package/dist/projection/experimental/entries/projections/merc.cjs +1 -0
  102. package/dist/projection/experimental/entries/projections/merc.cjs.map +1 -1
  103. package/dist/projection/experimental/grids/geotiff.js +1 -1
  104. package/dist/projection/experimental/grids/geotiff.js.map +1 -1
  105. package/dist/projection/experimental/grids/ntv2.js +1 -1
  106. package/dist/projection/experimental/grids/ntv2.js.map +1 -1
  107. package/dist/projection/experimental/index.cjs +102 -2
  108. package/dist/projection/experimental/index.cjs.map +3 -3
  109. package/dist/projection/experimental/kernels/aea.js +1 -1
  110. package/dist/projection/experimental/kernels/aea.js.map +1 -1
  111. package/dist/projection/experimental/kernels/aeqd.js +1 -1
  112. package/dist/projection/experimental/kernels/aeqd.js.map +1 -1
  113. package/dist/projection/experimental/kernels/bonne.js +1 -1
  114. package/dist/projection/experimental/kernels/bonne.js.map +1 -1
  115. package/dist/projection/experimental/kernels/cass.js +1 -1
  116. package/dist/projection/experimental/kernels/cass.js.map +1 -1
  117. package/dist/projection/experimental/kernels/cea.js +1 -1
  118. package/dist/projection/experimental/kernels/cea.js.map +1 -1
  119. package/dist/projection/experimental/kernels/eck6.js +1 -1
  120. package/dist/projection/experimental/kernels/eck6.js.map +1 -1
  121. package/dist/projection/experimental/kernels/eqdc.js +1 -1
  122. package/dist/projection/experimental/kernels/eqdc.js.map +1 -1
  123. package/dist/projection/experimental/kernels/eqearth.js +1 -1
  124. package/dist/projection/experimental/kernels/eqearth.js.map +1 -1
  125. package/dist/projection/experimental/kernels/equi.js +1 -1
  126. package/dist/projection/experimental/kernels/equi.js.map +1 -1
  127. package/dist/projection/experimental/kernels/etmerc.js +1 -1
  128. package/dist/projection/experimental/kernels/etmerc.js.map +1 -1
  129. package/dist/projection/experimental/kernels/gauss.js +1 -1
  130. package/dist/projection/experimental/kernels/gauss.js.map +1 -1
  131. package/dist/projection/experimental/kernels/geos.js +1 -1
  132. package/dist/projection/experimental/kernels/geos.js.map +1 -1
  133. package/dist/projection/experimental/kernels/gnom.js +1 -1
  134. package/dist/projection/experimental/kernels/gnom.js.map +1 -1
  135. package/dist/projection/experimental/kernels/gstmerc.js +1 -1
  136. package/dist/projection/experimental/kernels/gstmerc.js.map +1 -1
  137. package/dist/projection/experimental/kernels/krovak.js +1 -1
  138. package/dist/projection/experimental/kernels/krovak.js.map +1 -1
  139. package/dist/projection/experimental/kernels/laea.js +1 -1
  140. package/dist/projection/experimental/kernels/laea.js.map +1 -1
  141. package/dist/projection/experimental/kernels/lcc.js +1 -1
  142. package/dist/projection/experimental/kernels/lcc.js.map +1 -1
  143. package/dist/projection/experimental/kernels/mill.js +1 -1
  144. package/dist/projection/experimental/kernels/mill.js.map +1 -1
  145. package/dist/projection/experimental/kernels/moll.js +1 -1
  146. package/dist/projection/experimental/kernels/moll.js.map +1 -1
  147. package/dist/projection/experimental/kernels/nzmg.js +1 -1
  148. package/dist/projection/experimental/kernels/nzmg.js.map +1 -1
  149. package/dist/projection/experimental/kernels/omerc.js +1 -1
  150. package/dist/projection/experimental/kernels/omerc.js.map +1 -1
  151. package/dist/projection/experimental/kernels/poly.js +1 -1
  152. package/dist/projection/experimental/kernels/poly.js.map +1 -1
  153. package/dist/projection/experimental/kernels/qsc.js +1 -1
  154. package/dist/projection/experimental/kernels/qsc.js.map +1 -1
  155. package/dist/projection/experimental/kernels/robin.js +1 -1
  156. package/dist/projection/experimental/kernels/robin.js.map +1 -1
  157. package/dist/projection/experimental/kernels/sinu.js +1 -1
  158. package/dist/projection/experimental/kernels/sinu.js.map +1 -1
  159. package/dist/projection/experimental/kernels/somerc.js +1 -1
  160. package/dist/projection/experimental/kernels/somerc.js.map +1 -1
  161. package/dist/projection/experimental/kernels/stere.js +1 -1
  162. package/dist/projection/experimental/kernels/stere.js.map +1 -1
  163. package/dist/projection/experimental/kernels/sterea.js +1 -1
  164. package/dist/projection/experimental/kernels/sterea.js.map +1 -1
  165. package/dist/projection/experimental/kernels/tmerc.js +1 -1
  166. package/dist/projection/experimental/kernels/tmerc.js.map +1 -1
  167. package/dist/projection/experimental/kernels/tpers.js +1 -1
  168. package/dist/projection/experimental/kernels/tpers.js.map +1 -1
  169. package/dist/projection/experimental/kernels/vandg.js +1 -1
  170. package/dist/projection/experimental/kernels/vandg.js.map +1 -1
  171. package/dist/projection/experimental/kinematic-helmert.js +1 -1
  172. package/dist/projection/experimental/kinematic-helmert.js.map +1 -1
  173. package/dist/projection/experimental/lazy-projections/index.cjs +100 -2
  174. package/dist/projection/experimental/lazy-projections/index.cjs.map +2 -2
  175. package/dist/projection/experimental/projections/equidistant-cylindrical.d.ts.map +1 -1
  176. package/dist/projection/experimental/projections/equidistant-cylindrical.js +1 -0
  177. package/dist/projection/experimental/projections/equidistant-cylindrical.js.map +1 -1
  178. package/dist/projection/experimental/projections/mercator.d.ts.map +1 -1
  179. package/dist/projection/experimental/projections/mercator.js +1 -0
  180. package/dist/projection/experimental/projections/mercator.js.map +1 -1
  181. package/dist/projection/experimental/transform-description.d.ts +8 -0
  182. package/dist/projection/experimental/transform-description.d.ts.map +1 -0
  183. package/dist/projection/experimental/transform-description.js +57 -0
  184. package/dist/projection/experimental/transform-description.js.map +1 -0
  185. package/dist/projection/experimental/types.d.ts +5 -0
  186. package/dist/projection/experimental/types.d.ts.map +1 -1
  187. package/dist/projection/experimental/typescript-projection.d.ts +4 -0
  188. package/dist/projection/experimental/typescript-projection.d.ts.map +1 -1
  189. package/dist/projection/experimental/typescript-projection.js +54 -5
  190. package/dist/projection/experimental/typescript-projection.js.map +1 -1
  191. package/dist/projection/index.cjs +102 -2
  192. package/dist/projection/index.cjs.map +3 -3
  193. package/dist/projection/transform-analysis.cjs +100 -2
  194. package/dist/projection/transform-analysis.cjs.map +2 -2
  195. package/dist/projection/transform-description.d.ts +44 -0
  196. package/dist/projection/transform-description.d.ts.map +1 -0
  197. package/dist/projection/transform-description.js +5 -0
  198. package/dist/projection/transform-description.js.map +1 -0
  199. package/dist/projection/types.d.ts +4 -0
  200. package/dist/projection/types.d.ts.map +1 -1
  201. package/dist/tasks/definitions.d.ts +3 -3
  202. package/dist/tasks/index.cjs +107 -2
  203. package/dist/tasks/index.cjs.map +3 -3
  204. package/dist/tasks/index.d.ts +1 -1
  205. package/dist/tasks/index.d.ts.map +1 -1
  206. package/dist/tasks/map-worker.js +1 -1
  207. package/dist/tasks/map-worker.js.map +1 -1
  208. package/dist/tasks/operations.d.ts +1 -1
  209. package/dist/tasks/operations.d.ts.map +1 -1
  210. package/dist/tasks/projection-worker.js +1 -1
  211. package/dist/tasks/projection-worker.js.map +1 -1
  212. package/dist/terrain/contour-boundary-diagnostics.d.ts +23 -0
  213. package/dist/terrain/contour-boundary-diagnostics.d.ts.map +1 -0
  214. package/dist/terrain/contour-boundary-diagnostics.js +62 -0
  215. package/dist/terrain/contour-boundary-diagnostics.js.map +1 -0
  216. package/dist/terrain/contour-mixed-weld.d.ts +25 -0
  217. package/dist/terrain/contour-mixed-weld.d.ts.map +1 -0
  218. package/dist/terrain/contour-mixed-weld.js +194 -0
  219. package/dist/terrain/contour-mixed-weld.js.map +1 -0
  220. package/dist/terrain/contour-tile-paths.d.ts +7 -0
  221. package/dist/terrain/contour-tile-paths.d.ts.map +1 -0
  222. package/dist/terrain/contour-tile-paths.js +12 -0
  223. package/dist/terrain/contour-tile-paths.js.map +1 -0
  224. package/dist/terrain/contour-tile-weld.d.ts +24 -0
  225. package/dist/terrain/contour-tile-weld.d.ts.map +1 -0
  226. package/dist/terrain/contour-tile-weld.js +147 -0
  227. package/dist/terrain/contour-tile-weld.js.map +1 -0
  228. package/dist/terrain/gradient-pyramid.d.ts +29 -0
  229. package/dist/terrain/gradient-pyramid.d.ts.map +1 -0
  230. package/dist/terrain/gradient-pyramid.js +94 -0
  231. package/dist/terrain/gradient-pyramid.js.map +1 -0
  232. package/dist/terrain/height-field.d.ts.map +1 -1
  233. package/dist/terrain/height-field.js +48 -5
  234. package/dist/terrain/height-field.js.map +1 -1
  235. package/dist/terrain/index.cjs +448 -4
  236. package/dist/terrain/index.cjs.map +3 -3
  237. package/dist/terrain/index.d.ts +9 -0
  238. package/dist/terrain/index.d.ts.map +1 -1
  239. package/dist/terrain/index.js +5 -0
  240. package/dist/terrain/index.js.map +1 -1
  241. package/dist/terrain/tiled.d.ts +10 -2
  242. package/dist/terrain/tiled.d.ts.map +1 -1
  243. package/dist/terrain/tiled.js +5 -1
  244. package/dist/terrain/tiled.js.map +1 -1
  245. package/dist/terrain/types.d.ts +6 -0
  246. package/dist/terrain/types.d.ts.map +1 -1
  247. package/dist/turf.cjs +25 -671
  248. package/dist/turf.cjs.map +3 -3
  249. package/dist/turf.d.ts +1 -1
  250. package/dist/turf.d.ts.map +1 -1
  251. package/dist/turf.js +2 -2
  252. package/dist/turf.js.map +1 -1
  253. package/package.json +15 -19
  254. package/src/expressions.ts +1 -1
  255. package/src/index.ts +15 -123
  256. package/src/projection/experimental/common/adjust_lat.ts +1 -1
  257. package/src/projection/experimental/common/adjust_lon.ts +1 -1
  258. package/src/projection/experimental/common/asinhy.ts +1 -1
  259. package/src/projection/experimental/common/asinz.ts +1 -1
  260. package/src/projection/experimental/common/authlat.ts +1 -1
  261. package/src/projection/experimental/common/authset.ts +1 -1
  262. package/src/projection/experimental/common/clens.ts +1 -1
  263. package/src/projection/experimental/common/clens_cmplx.ts +1 -1
  264. package/src/projection/experimental/common/constants.ts +1 -1
  265. package/src/projection/experimental/common/cosh.ts +1 -1
  266. package/src/projection/experimental/common/e0fn.ts +1 -1
  267. package/src/projection/experimental/common/e1fn.ts +1 -1
  268. package/src/projection/experimental/common/e2fn.ts +1 -1
  269. package/src/projection/experimental/common/e3fn.ts +1 -1
  270. package/src/projection/experimental/common/fL.ts +1 -1
  271. package/src/projection/experimental/common/gN.ts +1 -1
  272. package/src/projection/experimental/common/gatg.ts +1 -1
  273. package/src/projection/experimental/common/hypot.ts +1 -1
  274. package/src/projection/experimental/common/imlfn.ts +1 -1
  275. package/src/projection/experimental/common/invlatiso.ts +1 -1
  276. package/src/projection/experimental/common/iqsfnz.ts +1 -1
  277. package/src/projection/experimental/common/latiso.ts +1 -1
  278. package/src/projection/experimental/common/log1py.ts +1 -1
  279. package/src/projection/experimental/common/mlfn.ts +1 -1
  280. package/src/projection/experimental/common/msfnz.ts +1 -1
  281. package/src/projection/experimental/common/phi2z.ts +1 -1
  282. package/src/projection/experimental/common/pj_enfn.ts +1 -1
  283. package/src/projection/experimental/common/pj_inv_mlfn.ts +1 -1
  284. package/src/projection/experimental/common/pj_mlfn.ts +1 -1
  285. package/src/projection/experimental/common/qsfnz.ts +1 -1
  286. package/src/projection/experimental/common/sign.ts +1 -1
  287. package/src/projection/experimental/common/sinh.ts +1 -1
  288. package/src/projection/experimental/common/srat.ts +1 -1
  289. package/src/projection/experimental/common/tsfnz.ts +1 -1
  290. package/src/projection/experimental/common/vincenty.ts +1 -1
  291. package/src/projection/experimental/core.ts +8 -0
  292. package/src/projection/experimental/crs/datum-table.ts +1 -1
  293. package/src/projection/experimental/crs/ellipsoid-table.ts +1 -1
  294. package/src/projection/experimental/crs/primemeridian-table.ts +1 -1
  295. package/src/projection/experimental/crs/structured.ts +1 -1
  296. package/src/projection/experimental/crs/wkt.ts +1 -1
  297. package/src/projection/experimental/datum.ts +1 -1
  298. package/src/projection/experimental/ellipsoidal-gnomonic.ts +1 -1
  299. package/src/projection/experimental/exact-helmert.ts +1 -1
  300. package/src/projection/experimental/grids/geotiff.ts +1 -1
  301. package/src/projection/experimental/grids/grid.ts +1 -1
  302. package/src/projection/experimental/grids/ntv2.ts +1 -1
  303. package/src/projection/experimental/helmert-flat.ts +1 -1
  304. package/src/projection/experimental/kernels/aea.ts +1 -1
  305. package/src/projection/experimental/kernels/aeqd.ts +1 -1
  306. package/src/projection/experimental/kernels/bonne.ts +1 -1
  307. package/src/projection/experimental/kernels/cass.ts +1 -1
  308. package/src/projection/experimental/kernels/cea.ts +1 -1
  309. package/src/projection/experimental/kernels/eck6.ts +1 -1
  310. package/src/projection/experimental/kernels/eqdc.ts +1 -1
  311. package/src/projection/experimental/kernels/eqearth.ts +1 -1
  312. package/src/projection/experimental/kernels/equi.ts +1 -1
  313. package/src/projection/experimental/kernels/etmerc.ts +1 -1
  314. package/src/projection/experimental/kernels/gauss.ts +1 -1
  315. package/src/projection/experimental/kernels/geos.ts +1 -1
  316. package/src/projection/experimental/kernels/gnom.ts +1 -1
  317. package/src/projection/experimental/kernels/gstmerc.ts +1 -1
  318. package/src/projection/experimental/kernels/krovak.ts +1 -1
  319. package/src/projection/experimental/kernels/laea.ts +1 -1
  320. package/src/projection/experimental/kernels/lcc.ts +1 -1
  321. package/src/projection/experimental/kernels/mill.ts +1 -1
  322. package/src/projection/experimental/kernels/moll.ts +1 -1
  323. package/src/projection/experimental/kernels/nzmg.ts +1 -1
  324. package/src/projection/experimental/kernels/omerc.ts +1 -1
  325. package/src/projection/experimental/kernels/ortho.ts +1 -1
  326. package/src/projection/experimental/kernels/poly.ts +1 -1
  327. package/src/projection/experimental/kernels/qsc.ts +1 -1
  328. package/src/projection/experimental/kernels/robin.ts +1 -1
  329. package/src/projection/experimental/kernels/sinu.ts +1 -1
  330. package/src/projection/experimental/kernels/somerc.ts +1 -1
  331. package/src/projection/experimental/kernels/stere.ts +1 -1
  332. package/src/projection/experimental/kernels/sterea.ts +1 -1
  333. package/src/projection/experimental/kernels/tmerc.ts +1 -1
  334. package/src/projection/experimental/kernels/tpers.ts +1 -1
  335. package/src/projection/experimental/kernels/vandg.ts +1 -1
  336. package/src/projection/experimental/kinematic-helmert-flat.ts +1 -1
  337. package/src/projection/experimental/kinematic-helmert.ts +1 -1
  338. package/src/projection/experimental/projection-pipeline.ts +1 -1
  339. package/src/projection/experimental/projections/equidistant-cylindrical.ts +1 -0
  340. package/src/projection/experimental/projections/mercator.ts +1 -0
  341. package/src/projection/experimental/projections/ob-tran.ts +1 -1
  342. package/src/projection/experimental/transform-description.ts +82 -0
  343. package/src/projection/experimental/types.ts +5 -0
  344. package/src/projection/experimental/typescript-projection.ts +54 -6
  345. package/src/projection/transform-description.ts +69 -0
  346. package/src/projection/types.ts +11 -0
  347. package/src/tasks/definitions.ts +1 -1
  348. package/src/tasks/index.ts +1 -1
  349. package/src/tasks/map-worker.ts +1 -1
  350. package/src/tasks/operations.ts +1 -1
  351. package/src/tasks/projection-worker.ts +1 -1
  352. package/src/terrain/contour-boundary-diagnostics.ts +90 -0
  353. package/src/terrain/contour-mixed-weld.ts +254 -0
  354. package/src/terrain/contour-tile-paths.ts +20 -0
  355. package/src/terrain/contour-tile-weld.ts +182 -0
  356. package/src/terrain/gradient-pyramid.ts +129 -0
  357. package/src/terrain/height-field.ts +45 -5
  358. package/src/terrain/index.ts +12 -0
  359. package/src/terrain/tiled.ts +16 -3
  360. package/src/terrain/types.ts +9 -1
  361. package/src/turf.ts +7 -3
  362. package/crs/README.md +0 -84
  363. package/crs/schemas/README.md +0 -9
  364. package/dist/geoarrow/builder-entry.d.ts +0 -4
  365. package/dist/geoarrow/builder-entry.d.ts.map +0 -1
  366. package/dist/geoarrow/builder-entry.js +0 -5
  367. package/dist/geoarrow/builder-entry.js.map +0 -1
  368. package/dist/geoarrow/builder.d.ts +0 -106
  369. package/dist/geoarrow/builder.d.ts.map +0 -1
  370. package/dist/geoarrow/builder.js +0 -668
  371. package/dist/geoarrow/builder.js.map +0 -1
  372. package/dist/geoarrow/codecs.d.ts +0 -24
  373. package/dist/geoarrow/codecs.d.ts.map +0 -1
  374. package/dist/geoarrow/codecs.js +0 -916
  375. package/dist/geoarrow/codecs.js.map +0 -1
  376. package/dist/geoarrow/index.cjs +0 -4352
  377. package/dist/geoarrow/index.cjs.map +0 -6
  378. package/dist/geoarrow/index.d.ts +0 -21
  379. package/dist/geoarrow/index.d.ts.map +0 -1
  380. package/dist/geoarrow/index.js +0 -15
  381. package/dist/geoarrow/index.js.map +0 -1
  382. package/dist/geoarrow/kernels.d.ts +0 -56
  383. package/dist/geoarrow/kernels.d.ts.map +0 -1
  384. package/dist/geoarrow/kernels.js +0 -982
  385. package/dist/geoarrow/kernels.js.map +0 -1
  386. package/dist/geoarrow/layout.d.ts +0 -66
  387. package/dist/geoarrow/layout.d.ts.map +0 -1
  388. package/dist/geoarrow/layout.js +0 -723
  389. package/dist/geoarrow/layout.js.map +0 -1
  390. package/dist/geoarrow/stream-tessellate.d.ts +0 -34
  391. package/dist/geoarrow/stream-tessellate.d.ts.map +0 -1
  392. package/dist/geoarrow/stream-tessellate.js +0 -171
  393. package/dist/geoarrow/stream-tessellate.js.map +0 -1
  394. package/dist/geoarrow/stream.d.ts +0 -29
  395. package/dist/geoarrow/stream.d.ts.map +0 -1
  396. package/dist/geoarrow/stream.js +0 -100
  397. package/dist/geoarrow/stream.js.map +0 -1
  398. package/dist/geoarrow/tessellate.d.ts +0 -31
  399. package/dist/geoarrow/tessellate.d.ts.map +0 -1
  400. package/dist/geoarrow/tessellate.js +0 -102
  401. package/dist/geoarrow/tessellate.js.map +0 -1
  402. package/dist/geoarrow/tessellation-entry.d.ts +0 -4
  403. package/dist/geoarrow/tessellation-entry.d.ts.map +0 -1
  404. package/dist/geoarrow/tessellation-entry.js +0 -5
  405. package/dist/geoarrow/tessellation-entry.js.map +0 -1
  406. package/dist/geoarrow/types.d.ts +0 -155
  407. package/dist/geoarrow/types.d.ts.map +0 -1
  408. package/dist/geoarrow/types.js +0 -71
  409. package/dist/geoarrow/types.js.map +0 -1
  410. package/dist/geoarrow/views.d.ts +0 -45
  411. package/dist/geoarrow/views.d.ts.map +0 -1
  412. package/dist/geoarrow/views.js +0 -114
  413. package/dist/geoarrow/views.js.map +0 -1
  414. package/dist/geoarrow/wkb-entry.d.ts +0 -4
  415. package/dist/geoarrow/wkb-entry.d.ts.map +0 -1
  416. package/dist/geoarrow/wkb-entry.js +0 -6
  417. package/dist/geoarrow/wkb-entry.js.map +0 -1
  418. package/dist/geoarrow/worker.d.ts +0 -11
  419. package/dist/geoarrow/worker.d.ts.map +0 -1
  420. package/dist/geoarrow/worker.js +0 -10
  421. package/dist/geoarrow/worker.js.map +0 -1
  422. package/dist/wkb/index.d.ts +0 -11
  423. package/dist/wkb/index.d.ts.map +0 -1
  424. package/dist/wkb/index.js +0 -9
  425. package/dist/wkb/index.js.map +0 -1
  426. package/dist/wkb/types.d.ts +0 -30
  427. package/dist/wkb/types.d.ts.map +0 -1
  428. package/dist/wkb/types.js +0 -34
  429. package/dist/wkb/types.js.map +0 -1
  430. package/dist/wkb/wkb-builder.d.ts +0 -91
  431. package/dist/wkb/wkb-builder.d.ts.map +0 -1
  432. package/dist/wkb/wkb-builder.js +0 -283
  433. package/dist/wkb/wkb-builder.js.map +0 -1
  434. package/dist/wkb/wkb-reader.d.ts +0 -74
  435. package/dist/wkb/wkb-reader.d.ts.map +0 -1
  436. package/dist/wkb/wkb-reader.js +0 -251
  437. package/dist/wkb/wkb-reader.js.map +0 -1
  438. package/dist/wkb/wkb.d.ts +0 -21
  439. package/dist/wkb/wkb.d.ts.map +0 -1
  440. package/dist/wkb/wkb.js +0 -204
  441. package/dist/wkb/wkb.js.map +0 -1
  442. package/dist/wkb/wkt.d.ts +0 -19
  443. package/dist/wkb/wkt.d.ts.map +0 -1
  444. package/dist/wkb/wkt.js +0 -321
  445. package/dist/wkb/wkt.js.map +0 -1
  446. package/projection/THIRD-PARTY-NOTICES.md +0 -210
  447. package/src/discontinuous/elastic/README.md +0 -20
  448. package/src/discontinuous/spherical-clip/README.md +0 -16
  449. package/src/discontinuous/world-kernels/README.md +0 -24
  450. package/src/geoarrow/builder-entry.ts +0 -18
  451. package/src/geoarrow/builder.ts +0 -860
  452. package/src/geoarrow/codecs.ts +0 -1268
  453. package/src/geoarrow/index.ts +0 -111
  454. package/src/geoarrow/kernels.ts +0 -1290
  455. package/src/geoarrow/layout.ts +0 -900
  456. package/src/geoarrow/stream-tessellate.ts +0 -205
  457. package/src/geoarrow/stream.ts +0 -130
  458. package/src/geoarrow/tessellate.ts +0 -133
  459. package/src/geoarrow/tessellation-entry.ts +0 -7
  460. package/src/geoarrow/types.ts +0 -259
  461. package/src/geoarrow/views.ts +0 -150
  462. package/src/geoarrow/wkb-entry.ts +0 -13
  463. package/src/geoarrow/worker.ts +0 -20
  464. package/src/terrain/vendor/README.md +0 -20
  465. package/src/vendor/geographiclib-geodesic/README.md +0 -26
  466. package/src/wkb/index.ts +0 -38
  467. package/src/wkb/types.ts +0 -54
  468. package/src/wkb/wkb-builder.ts +0 -395
  469. package/src/wkb/wkb-reader.ts +0 -401
  470. package/src/wkb/wkb.ts +0 -255
  471. package/src/wkb/wkt.ts +0 -375
  472. /package/{projection/APACHE-2.0-LICENSE.txt → APACHE-2.0-LICENSE.txt} +0 -0
  473. /package/{projection/PROJ-LICENSE.txt → PROJ-LICENSE.txt} +0 -0
  474. /package/{projection/PROJ4-LICENSE.md → PROJ4-LICENSE.md} +0 -0
  475. /package/{crs/schemas → src/crs}/projjson.schema.json +0 -0
@@ -1,4 +1,4 @@
1
- import type { TaskWorker } from '@math.gl/core/tasks';
1
+ import type { TaskWorker } from '@math.gl/tasks';
2
2
  import { ProjectCoordinatesTask as projectionTask, PrepareMapTask as mapTask } from "./definitions.js";
3
3
  export type { ProjectCoordinatesTypes, PrepareMapTypes } from "./definitions.js";
4
4
  /** Reproject coordinates with an automatic or explicitly retained worker. */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAC,sBAAsB,IAAI,cAAc,EAAE,cAAc,IAAI,OAAO,EAAC,yBAAsB;AAClG,YAAY,EAAC,uBAAuB,EAAE,eAAe,EAAC,yBAAsB;AAU5E,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,OAAO,cAAc,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAW/E,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,OAAO,OAAO,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAQhE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tasks/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAC,sBAAsB,IAAI,cAAc,EAAE,cAAc,IAAI,OAAO,EAAC,yBAAsB;AAClG,YAAY,EAAC,uBAAuB,EAAE,eAAe,EAAC,yBAAsB;AAU5E,6EAA6E;AAC7E,eAAO,MAAM,sBAAsB,EAAE,OAAO,cAAc,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAW/E,CAAC;AAEF,mDAAmD;AACnD,eAAO,MAAM,cAAc,EAAE,OAAO,OAAO,GAAG;IAAC,MAAM,EAAE,UAAU,CAAA;CAQhE,CAAC"}
@@ -1,7 +1,7 @@
1
1
  // math.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
- import { initializeTaskWorker } from '@math.gl/core/tasks';
4
+ import { initializeTaskWorker } from '@math.gl/tasks';
5
5
  import { PrepareMapTask } from "./definitions.js";
6
6
  void initializeTaskWorker(PrepareMapTask);
7
7
  //# sourceMappingURL=map-worker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"map-worker.js","sourceRoot":"","sources":["../../src/tasks/map-worker.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,cAAc,EAAC,yBAAsB;AAC7C,KAAK,oBAAoB,CAAC,cAAc,CAAC,CAAC"}
1
+ {"version":3,"file":"map-worker.js","sourceRoot":"","sources":["../../src/tasks/map-worker.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,cAAc,EAAC,yBAAsB;AAC7C,KAAK,oBAAoB,CAAC,cAAc,CAAC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { MapEngine, type MapDescription, type MapEngineOptions } from "../discontinuous/map-engine.js";
2
2
  import type { CreateProjectionOptions, ProjectionArray, Projection } from "../projection/types.js";
3
- import type { TaskContext } from '@math.gl/core/tasks';
3
+ import type { TaskContext } from '@math.gl/tasks';
4
4
  type OperationContext = Partial<Omit<TaskContext<unknown>, 'state'>>;
5
5
  export type BulkProjectionTask = {
6
6
  projection: CreateProjectionOptions;
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/tasks/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAC,uCAAoC;AAClG,OAAO,KAAK,EAAC,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAC,+BAA4B;AAC9F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AACrD,KAAK,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,QAAQ,CACtB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,gBAAgB,GACzB,SAAS,CAMX;AAED,oFAAoF;AACpF,wBAAsB,WAAW,CAC/B,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,CAAC,EAAE,UAAU,GAC9B,OAAO,CAAC,eAAe,CAAC,CAkC1B"}
1
+ {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/tasks/operations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAC,uCAAoC;AAClG,OAAO,KAAK,EAAC,uBAAuB,EAAE,eAAe,EAAE,UAAU,EAAC,+BAA4B;AAC9F,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAChD,KAAK,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAErE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,UAAU,EAAE,uBAAuB,CAAC;IACpC,WAAW,EAAE,eAAe,CAAC;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,4EAA4E;AAC5E,wBAAgB,QAAQ,CACtB,WAAW,EAAE,cAAc,EAC3B,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,gBAAgB,GACzB,SAAS,CAMX;AAED,oFAAoF;AACpF,wBAAsB,WAAW,CAC/B,KAAK,EAAE,kBAAkB,EACzB,OAAO,EAAE,gBAAgB,EACzB,kBAAkB,CAAC,EAAE,UAAU,GAC9B,OAAO,CAAC,eAAe,CAAC,CAkC1B"}
@@ -1,7 +1,7 @@
1
1
  // math.gl
2
2
  // SPDX-License-Identifier: MIT
3
3
  // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
- import { initializeTaskWorker } from '@math.gl/core/tasks';
4
+ import { initializeTaskWorker } from '@math.gl/tasks';
5
5
  import { ProjectCoordinatesTask } from "./definitions.js";
6
6
  void initializeTaskWorker(ProjectCoordinatesTask);
7
7
  //# sourceMappingURL=projection-worker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"projection-worker.js","sourceRoot":"","sources":["../../src/tasks/projection-worker.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAC,sBAAsB,EAAC,yBAAsB;AACrD,KAAK,oBAAoB,CAAC,sBAAsB,CAAC,CAAC"}
1
+ {"version":3,"file":"projection-worker.js","sourceRoot":"","sources":["../../src/tasks/projection-worker.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAC5D,OAAO,EAAC,oBAAoB,EAAC,MAAM,gBAAgB,CAAC;AACpD,OAAO,EAAC,sBAAsB,EAAC,yBAAsB;AACrD,KAAK,oBAAoB,CAAC,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { TerrainContours } from "./contours.js";
2
+ import { type TerrainContourPathLimits } from "./contour-path-data.js";
3
+ export declare const TerrainContourBoundaryAxis: {
4
+ readonly COLUMN: 1;
5
+ readonly ROW: 2;
6
+ };
7
+ export type TerrainContourBoundaryDiagnostics = {
8
+ /** Boundary vertices with degree one (open) or greater than two (junction). */
9
+ vertexIndices: Uint32Array;
10
+ degrees: Uint32Array;
11
+ levelIndices: Uint32Array;
12
+ /** Bitmask of TerrainContourBoundaryAxis values; corners have both bits. */
13
+ boundaryAxes: Uint8Array;
14
+ };
15
+ /** Inspect a welded contour graph at same-level tile lattice lines. An open
16
+ * endpoint can indicate a dataset edge, missing tile, nodata or another break;
17
+ * this function does not infer the cause or alter the graph.
18
+ */
19
+ export declare function diagnoseTerrainContourBoundaries(contours: TerrainContours, options: TerrainContourPathLimits & {
20
+ width: number;
21
+ height: number;
22
+ }): TerrainContourBoundaryDiagnostics;
23
+ //# sourceMappingURL=contour-boundary-diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-boundary-diagnostics.d.ts","sourceRoot":"","sources":["../../src/terrain/contour-boundary-diagnostics.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,sBAAmB;AAChD,OAAO,EAIL,KAAK,wBAAwB,EAC9B,+BAA4B;AAE7B,eAAO,MAAM,0BAA0B;;;CAA+B,CAAC;AACvE,MAAM,MAAM,iCAAiC,GAAG;IAC9C,+EAA+E;IAC/E,aAAa,EAAE,WAAW,CAAC;IAC3B,OAAO,EAAE,WAAW,CAAC;IACrB,YAAY,EAAE,WAAW,CAAC;IAC1B,4EAA4E;IAC5E,YAAY,EAAE,UAAU,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gCAAgC,CAC9C,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,wBAAwB,GAAG;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAC,GAClE,iCAAiC,CA4DnC"}
@@ -0,0 +1,62 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { contourPathLimits, validateContourData, validateContourVertex } from "./contour-path-data.js";
5
+ export const TerrainContourBoundaryAxis = { COLUMN: 1, ROW: 2 };
6
+ /** Inspect a welded contour graph at same-level tile lattice lines. An open
7
+ * endpoint can indicate a dataset edge, missing tile, nodata or another break;
8
+ * this function does not infer the cause or alter the graph.
9
+ */
10
+ export function diagnoseTerrainContourBoundaries(contours, options) {
11
+ const { width, height } = options;
12
+ if (!Number.isSafeInteger(width) || width < 2 || !Number.isSafeInteger(height) || height < 2)
13
+ throw new Error('Invalid terrain contour boundary tile dimensions');
14
+ const limits = contourPathLimits(options);
15
+ const count = validateContourData(contours, limits);
16
+ if (!(contours.segments instanceof Uint32Array) ||
17
+ contours.segments.length % 2 ||
18
+ !(contours.levelIndices instanceof Uint32Array) ||
19
+ contours.levelIndices.length !== contours.segments.length / 2 ||
20
+ contours.levelIndices.length > limits.maxSegments)
21
+ throw new Error('Invalid terrain contour boundary segments or capacity');
22
+ const degrees = new Uint32Array(count), assignments = new Uint32Array(count).fill(0xffffffff);
23
+ const seen = new Set();
24
+ for (let i = 0; i < contours.levelIndices.length; i++) {
25
+ const a = contours.segments[2 * i], b = contours.segments[2 * i + 1], level = contours.levelIndices[i];
26
+ validateContourVertex(contours, a, level, assignments);
27
+ validateContourVertex(contours, b, level, assignments);
28
+ if (a === b ||
29
+ (contours.positions[3 * a] === contours.positions[3 * b] &&
30
+ contours.positions[3 * a + 1] === contours.positions[3 * b + 1]))
31
+ throw new Error('Degenerate terrain contour segment');
32
+ const key = a < b ? `${a}/${b}` : `${b}/${a}`;
33
+ if (seen.has(key))
34
+ throw new Error('Duplicate terrain contour segment');
35
+ seen.add(key);
36
+ degrees[a]++;
37
+ degrees[b]++;
38
+ }
39
+ const vertices = [], resultDegrees = [], levels = [], axes = [];
40
+ for (let i = 0; i < count; i++) {
41
+ if (degrees[i] !== 1 && degrees[i] <= 2)
42
+ continue;
43
+ const x = contours.gridCoordinates[2 * i], y = contours.gridCoordinates[2 * i + 1];
44
+ if (Math.abs(x) > Number.MAX_SAFE_INTEGER || Math.abs(y) > Number.MAX_SAFE_INTEGER)
45
+ throw new Error('Terrain contour boundary lattice exceeds safe integer range');
46
+ const axis = (Number.isSafeInteger(x) && x % (width - 1) === 0 ? TerrainContourBoundaryAxis.COLUMN : 0) |
47
+ (Number.isSafeInteger(y) && y % (height - 1) === 0 ? TerrainContourBoundaryAxis.ROW : 0);
48
+ if (!axis)
49
+ continue;
50
+ vertices.push(i);
51
+ resultDegrees.push(degrees[i]);
52
+ levels.push(assignments[i]);
53
+ axes.push(axis);
54
+ }
55
+ return {
56
+ vertexIndices: Uint32Array.from(vertices),
57
+ degrees: Uint32Array.from(resultDegrees),
58
+ levelIndices: Uint32Array.from(levels),
59
+ boundaryAxes: Uint8Array.from(axes)
60
+ };
61
+ }
62
+ //# sourceMappingURL=contour-boundary-diagnostics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-boundary-diagnostics.js","sourceRoot":"","sources":["../../src/terrain/contour-boundary-diagnostics.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AC,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAClB,CAAC;IACD,OAAO;QACL,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC;QACzC,OAAO,EAAE,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC;QACxC,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,YAAY,EAAE,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;KACpC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ import type { TerrainContours } from "./contours.js";
2
+ import { type TerrainContourPathLimits } from "./contour-path-data.js";
3
+ export type TerrainMixedContourTile = {
4
+ contours: TerrainContours;
5
+ /** Tile minimum in the common finest lattice; integer coordinates. */
6
+ column: number;
7
+ row: number;
8
+ width: number;
9
+ height: number;
10
+ /** Positive power-of-two spacing in the common lattice. */
11
+ spacing: number;
12
+ };
13
+ export type TerrainMixedContourWeldOptions = TerrainContourPathLimits & {
14
+ maxTiles?: number;
15
+ maxBoundaryTests?: number;
16
+ maxPositionDifference?: number;
17
+ };
18
+ /** Weld contour graphs from nonoverlapping vertex tiles in a shared affine lattice.
19
+ * Subdivides coincident axis-aligned boundary segments at finer boundary vertices.
20
+ * Only exact lattice intersections at the same level are joined. Differing source
21
+ * surfaces remain open; callers must reconcile elevations before contouring.
22
+ * Coordinates must retain their fractional precision in the common lattice.
23
+ */
24
+ export declare function weldTerrainMixedContourTiles(tiles: readonly TerrainMixedContourTile[], options?: TerrainMixedContourWeldOptions): TerrainContours;
25
+ //# sourceMappingURL=contour-mixed-weld.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-mixed-weld.d.ts","sourceRoot":"","sources":["../../src/terrain/contour-mixed-weld.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,sBAAmB;AAChD,OAAO,EAIL,KAAK,wBAAwB,EAC9B,+BAA4B;AAE7B,MAAM,MAAM,uBAAuB,GAAG;IACpC,QAAQ,EAAE,eAAe,CAAC;IAC1B,sEAAsE;IACtE,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AACF,MAAM,MAAM,8BAA8B,GAAG,wBAAwB,GAAG;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,KAAK,EAAE,SAAS,uBAAuB,EAAE,EACzC,OAAO,GAAE,8BAAmC,GAC3C,eAAe,CAwNjB"}
@@ -0,0 +1,194 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { contourPathLimits, validateContourData, validateContourVertex } from "./contour-path-data.js";
5
+ /** Weld contour graphs from nonoverlapping vertex tiles in a shared affine lattice.
6
+ * Subdivides coincident axis-aligned boundary segments at finer boundary vertices.
7
+ * Only exact lattice intersections at the same level are joined. Differing source
8
+ * surfaces remain open; callers must reconcile elevations before contouring.
9
+ * Coordinates must retain their fractional precision in the common lattice.
10
+ */
11
+ export function weldTerrainMixedContourTiles(tiles, options = {}) {
12
+ const limits = contourPathLimits(options);
13
+ const maxTiles = options.maxTiles ?? 4096;
14
+ const budget = options.maxBoundaryTests ?? 10000000;
15
+ const tolerance = options.maxPositionDifference ?? 0;
16
+ if (!Number.isSafeInteger(maxTiles) ||
17
+ maxTiles < 1 ||
18
+ !tiles.length ||
19
+ tiles.length > maxTiles ||
20
+ !Number.isSafeInteger(budget) ||
21
+ budget < 0 ||
22
+ !Number.isFinite(tolerance) ||
23
+ tolerance < 0)
24
+ throw new Error('Invalid mixed contour capacity or tolerance');
25
+ let tests = 0;
26
+ const charge = () => {
27
+ if (++tests > budget)
28
+ throw new Error('Mixed contour boundary-test budget exceeded');
29
+ };
30
+ const sorted = [...tiles].sort((a, b) => a.column - b.column || a.row - b.row || a.spacing - b.spacing);
31
+ const bounds = sorted.map(t => {
32
+ if (![t.column, t.row, t.width, t.height, t.spacing].every(Number.isSafeInteger) ||
33
+ t.width < 2 ||
34
+ t.height < 2 ||
35
+ t.spacing < 1 ||
36
+ 2 ** Math.round(Math.log2(t.spacing)) !== t.spacing)
37
+ throw new Error('Invalid mixed contour tile lattice');
38
+ const x1 = t.column + (t.width - 1) * t.spacing, y1 = t.row + (t.height - 1) * t.spacing;
39
+ if (![(t.width - 1) * t.spacing, (t.height - 1) * t.spacing, x1, y1].every(Number.isSafeInteger))
40
+ throw new Error('Mixed contour lattice overflow');
41
+ return [t.column, t.row, x1, y1];
42
+ });
43
+ for (let i = 0; i < bounds.length; i++)
44
+ for (let j = 0; j < i; j++) {
45
+ charge();
46
+ const a = bounds[i], b = bounds[j];
47
+ if (Math.max(a[0], b[0]) < Math.min(a[2], b[2]) &&
48
+ Math.max(a[1], b[1]) < Math.min(a[3], b[3]))
49
+ throw new Error('Mixed contour tile interiors overlap');
50
+ }
51
+ const first = sorted[0].contours, origin = [...first.origin];
52
+ const positions = [], grid = [], vertexLevels = [];
53
+ const roundedBoundary = new Map();
54
+ const boundary = new Set(), shared = new Map();
55
+ const edges = [];
56
+ let inputVertices = 0, inputSegments = 0;
57
+ for (let ti = 0; ti < sorted.length; ti++) {
58
+ const tile = sorted[ti], data = tile.contours;
59
+ const count = validateContourData(data, limits);
60
+ inputVertices += count;
61
+ if (inputVertices > limits.maxVertices)
62
+ throw new Error('Mixed contour input vertex capacity exceeded');
63
+ if (data.heightReference !== first.heightReference ||
64
+ data.levels.length !== first.levels.length ||
65
+ !data.levels.every((v, i) => v === first.levels[i]))
66
+ throw new Error('Mixed contour levels or height reference differ');
67
+ if (!(data.segments instanceof Uint32Array) ||
68
+ data.segments.length % 2 ||
69
+ !(data.levelIndices instanceof Uint32Array) ||
70
+ data.levelIndices.length !== data.segments.length / 2)
71
+ throw new Error('Invalid mixed contour segments');
72
+ inputSegments += data.levelIndices.length;
73
+ if (inputSegments > limits.maxSegments)
74
+ throw new Error('Mixed contour input segment capacity exceeded');
75
+ const assigned = new Uint32Array(count).fill(0xffffffff), remap = new Map();
76
+ const local = new Set();
77
+ const vertex = (v, level) => {
78
+ validateContourVertex(data, v, level, assigned);
79
+ const existing = remap.get(v);
80
+ if (existing !== undefined)
81
+ return existing;
82
+ const x = data.gridCoordinates[2 * v], y = data.gridCoordinates[2 * v + 1];
83
+ if (x < 0 || x > tile.width - 1 || y < 0 || y > tile.height - 1)
84
+ throw new Error('Mixed contour vertex outside tile');
85
+ const sx = x * tile.spacing, sy = y * tile.spacing;
86
+ const gx = tile.column + sx, gy = tile.row + sy;
87
+ // Reject coordinates whose local fraction cannot survive common-frame rebasing.
88
+ if (Math.abs(gx - tile.column - sx) > 8 * Number.EPSILON * Math.max(1, Math.abs(sx)) ||
89
+ Math.abs(gy - tile.row - sy) > 8 * Number.EPSILON * Math.max(1, Math.abs(sy)))
90
+ throw new Error('Mixed contour lattice loses precision');
91
+ const px = data.positions[3 * v] + (data.origin[0] - origin[0]), py = data.positions[3 * v + 1] + (data.origin[1] - origin[1]);
92
+ const pz = data.levels[level] - origin[2];
93
+ if (![gx, gy, px, py, pz].every(Number.isFinite))
94
+ throw new Error('Mixed contour frame overflow');
95
+ const onEdge = x === 0 || y === 0 || x === tile.width - 1 || y === tile.height - 1;
96
+ const xi = Math.floor(sx), yi = Math.floor(sy);
97
+ const key = `${level}/${tile.column + xi}/${sx - xi}/${tile.row + yi}/${sy - yi}`;
98
+ if (onEdge) {
99
+ const rounded = `${level}/${gx}/${gy}`;
100
+ const identity = roundedBoundary.get(rounded);
101
+ if (identity !== undefined && identity !== key)
102
+ throw new Error('Mixed contour lattice loses precision');
103
+ roundedBoundary.set(rounded, key);
104
+ }
105
+ if (onEdge && local.has(key))
106
+ throw new Error('Duplicate mixed contour boundary vertex');
107
+ if (onEdge)
108
+ local.add(key);
109
+ let id = onEdge ? shared.get(key) : undefined;
110
+ if (id !== undefined) {
111
+ if (Math.hypot(px - positions[3 * id], py - positions[3 * id + 1]) > tolerance)
112
+ throw new Error('Mixed contour boundary positions disagree');
113
+ }
114
+ else {
115
+ id = positions.length / 3;
116
+ if (id >= limits.maxVertices)
117
+ throw new Error('Mixed contour vertex capacity exceeded');
118
+ positions.push(px, py, pz);
119
+ grid.push(gx, gy);
120
+ vertexLevels.push(level);
121
+ if (onEdge) {
122
+ shared.set(key, id);
123
+ boundary.add(id);
124
+ }
125
+ }
126
+ remap.set(v, id);
127
+ return id;
128
+ };
129
+ const localEdges = new Set();
130
+ for (let i = 0; i < data.levelIndices.length; i++) {
131
+ const level = data.levelIndices[i], a = vertex(data.segments[2 * i], level), b = vertex(data.segments[2 * i + 1], level);
132
+ if (a === b ||
133
+ (positions[3 * a] === positions[3 * b] && positions[3 * a + 1] === positions[3 * b + 1]))
134
+ throw new Error('Degenerate mixed contour segment');
135
+ const key = a < b ? `${a}/${b}` : `${b}/${a}`;
136
+ if (localEdges.has(key))
137
+ throw new Error('Duplicate mixed contour segment');
138
+ localEdges.add(key);
139
+ const box = bounds[ti];
140
+ const seam = (grid[2 * a] === grid[2 * b] && (grid[2 * a] === box[0] || grid[2 * a] === box[2])) ||
141
+ (grid[2 * a + 1] === grid[2 * b + 1] &&
142
+ (grid[2 * a + 1] === box[1] || grid[2 * a + 1] === box[3]));
143
+ edges.push({ a, b, level, tile: ti, seam });
144
+ }
145
+ }
146
+ const segments = [], levels = [], emitted = new Map();
147
+ for (const edge of edges) {
148
+ const { a, b, level } = edge;
149
+ const axis = grid[2 * a] === grid[2 * b] ? 1 : 0;
150
+ const start = grid[2 * a + axis], end = grid[2 * b + axis];
151
+ const cuts = [a, b];
152
+ if (edge.seam)
153
+ for (const v of boundary) {
154
+ charge();
155
+ const value = grid[2 * v + axis];
156
+ if (vertexLevels[v] !== level ||
157
+ grid[2 * v + 1 - axis] !== grid[2 * a + 1 - axis] ||
158
+ value <= Math.min(start, end) ||
159
+ value >= Math.max(start, end))
160
+ continue;
161
+ const f = (value - start) / (end - start);
162
+ const px = positions[3 * a] + f * (positions[3 * b] - positions[3 * a]);
163
+ const py = positions[3 * a + 1] + f * (positions[3 * b + 1] - positions[3 * a + 1]);
164
+ if (Math.hypot(px - positions[3 * v], py - positions[3 * v + 1]) > tolerance)
165
+ throw new Error('Mixed contour boundary positions disagree');
166
+ cuts.push(v);
167
+ }
168
+ cuts.sort((u, v) => grid[2 * u + axis] - grid[2 * v + axis]);
169
+ for (let i = 1; i < cuts.length; i++) {
170
+ const u = cuts[i - 1], v = cuts[i], key = u < v ? `${u}/${v}` : `${v}/${u}`;
171
+ const prior = emitted.get(key);
172
+ if (prior !== undefined) {
173
+ if (prior === edge.tile)
174
+ throw new Error('Overlapping mixed contour segments within tile');
175
+ continue;
176
+ }
177
+ if (levels.length >= limits.maxSegments)
178
+ throw new Error('Mixed contour output segment capacity exceeded');
179
+ emitted.set(key, edge.tile);
180
+ segments.push(u, v);
181
+ levels.push(level);
182
+ }
183
+ }
184
+ return {
185
+ positions: Float64Array.from(positions),
186
+ gridCoordinates: Float64Array.from(grid),
187
+ segments: Uint32Array.from(segments),
188
+ levelIndices: Uint32Array.from(levels),
189
+ levels: first.levels.slice(),
190
+ origin,
191
+ heightReference: first.heightReference
192
+ };
193
+ }
194
+ //# sourceMappingURL=contour-mixed-weld.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-mixed-weld.js","sourceRoot":"","sources":["../../src/terrain/contour-mixed-weld.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAG5D,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,qBAAqB,EAEtB,+BAA4B;AAkB7B;;;;;GAKG;AACH,MAAM,UAAU,4B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,QAAQ,CAAC;QACpC,YAAY,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC;QACtC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE;QAC5B,MAAM;QACN,eAAe,EAAE,KAAK,CAAC,eAAe;KACvC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { type TerrainContourTile, type TerrainContourTileWeldOptions } from "./contour-tile-weld.js";
2
+ import { type TerrainContourPaths } from "./contour-paths.js";
3
+ /** Weld a same-level tile snapshot and trace its maximal contour paths.
4
+ * Missing tiles and source gaps remain open. This does not simplify paths.
5
+ */
6
+ export declare function stitchTerrainContourTiles(tiles: readonly TerrainContourTile[], options: TerrainContourTileWeldOptions): TerrainContourPaths;
7
+ //# sourceMappingURL=contour-tile-paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-tile-paths.d.ts","sourceRoot":"","sources":["../../src/terrain/contour-tile-paths.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,6BAA6B,EACnC,+BAA4B;AAC7B,OAAO,EAAwB,KAAK,mBAAmB,EAAC,2BAAwB;AAEhF;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,OAAO,EAAE,6BAA6B,GACrC,mBAAmB,CAErB"}
@@ -0,0 +1,12 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { weldTerrainContourTiles } from "./contour-tile-weld.js";
5
+ import { stitchTerrainContours } from "./contour-paths.js";
6
+ /** Weld a same-level tile snapshot and trace its maximal contour paths.
7
+ * Missing tiles and source gaps remain open. This does not simplify paths.
8
+ */
9
+ export function stitchTerrainContourTiles(tiles, options) {
10
+ return stitchTerrainContours(weldTerrainContourTiles(tiles, options), options);
11
+ }
12
+ //# sourceMappingURL=contour-tile-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-tile-paths.js","sourceRoot":"","sources":["../../src/terrain/contour-tile-paths.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAE5D,OAAO,EACL,uBAAuB,EAGxB,+BAA4B;AAC7B,OAAO,EAAC,qBAAqB,EAA2B,2BAAwB;AAEhF;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAoC,EACpC,OAAsC;IAEtC,OAAO,qBAAqB,CAAC,uBAAuB,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;AACjF,CAAC"}
@@ -0,0 +1,24 @@
1
+ import type { TerrainContours } from "./contours.js";
2
+ import { type TerrainContourPathLimits } from "./contour-path-data.js";
3
+ export type TerrainContourTile = {
4
+ column: number;
5
+ row: number;
6
+ contours: TerrainContours;
7
+ };
8
+ export type TerrainContourTileWeldOptions = TerrainContourPathLimits & {
9
+ /** Number of vertices in each vertex-registered tile. */
10
+ width: number;
11
+ height: number;
12
+ /** Maximum world-frame XY disagreement for a matching lattice point. Default zero. */
13
+ maxPositionDifference?: number;
14
+ maxTiles?: number;
15
+ };
16
+ /** Weld coincident contour vertices on same-level vertex-tile boundaries.
17
+ * Tiles share an integer lattice and identical contour levels and height reference.
18
+ * Boundary identity uses exact global grid coordinates, not a spatial tolerance.
19
+ * Missing tiles or missing source triangles remain open; no segments are invented.
20
+ * The output grid coordinates are global lattice coordinates, and its origin is
21
+ * taken from the lexicographically first tile. Equivalent inputs are order independent.
22
+ */
23
+ export declare function weldTerrainContourTiles(tiles: readonly TerrainContourTile[], options: TerrainContourTileWeldOptions): TerrainContours;
24
+ //# sourceMappingURL=contour-tile-weld.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contour-tile-weld.d.ts","sourceRoot":"","sources":["../../src/terrain/contour-tile-weld.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,eAAe,EAAC,sBAAmB;AAChD,OAAO,EAIL,KAAK,wBAAwB,EAC9B,+BAA4B;AAE7B,MAAM,MAAM,kBAAkB,GAAG;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,eAAe,CAAA;CAAC,CAAC;AAC1F,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,GAAG;IACrE,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,sFAAsF;IACtF,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,SAAS,kBAAkB,EAAE,EACpC,OAAO,EAAE,6BAA6B,GACrC,eAAe,CAqJjB"}
@@ -0,0 +1,147 @@
1
+ // math.gl
2
+ // SPDX-License-Identifier: MIT
3
+ // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
+ import { contourPathLimits, validateContourData, validateContourVertex } from "./contour-path-data.js";
5
+ /** Weld coincident contour vertices on same-level vertex-tile boundaries.
6
+ * Tiles share an integer lattice and identical contour levels and height reference.
7
+ * Boundary identity uses exact global grid coordinates, not a spatial tolerance.
8
+ * Missing tiles or missing source triangles remain open; no segments are invented.
9
+ * The output grid coordinates are global lattice coordinates, and its origin is
10
+ * taken from the lexicographically first tile. Equivalent inputs are order independent.
11
+ */
12
+ export function weldTerrainContourTiles(tiles, options) {
13
+ const { width, height } = options;
14
+ const limits = contourPathLimits(options);
15
+ const tolerance = options.maxPositionDifference ?? 0;
16
+ const maxTiles = options.maxTiles ?? 4096;
17
+ if (!Number.isSafeInteger(width) ||
18
+ width < 2 ||
19
+ !Number.isSafeInteger(height) ||
20
+ height < 2 ||
21
+ !Number.isFinite(tolerance) ||
22
+ tolerance < 0 ||
23
+ !Number.isSafeInteger(maxTiles) ||
24
+ maxTiles < 1 ||
25
+ tiles.length > maxTiles ||
26
+ !tiles.length)
27
+ throw new Error('Invalid terrain contour tile dimensions or tolerance');
28
+ const sorted = [...tiles].sort((a, b) => a.column - b.column || a.row - b.row);
29
+ const first = sorted[0].contours;
30
+ const origin = [...first.origin];
31
+ const levels = first.levels.slice();
32
+ const positions = [], grid = [], segments = [], levelIndices = [];
33
+ const vertices = new Map();
34
+ const edges = new Map();
35
+ const addresses = new Set();
36
+ let inputVertices = 0;
37
+ let inputSegments = 0;
38
+ for (let tileIndex = 0; tileIndex < sorted.length; tileIndex++) {
39
+ const tile = sorted[tileIndex], data = tile.contours;
40
+ const id = `${tile.column},${tile.row}`;
41
+ if (!Number.isSafeInteger(tile.column) || !Number.isSafeInteger(tile.row) || addresses.has(id))
42
+ throw new Error('Invalid or duplicate terrain contour tile address');
43
+ addresses.add(id);
44
+ const x0 = tile.column * (width - 1), y0 = tile.row * (height - 1);
45
+ if (![x0, y0, x0 + width - 1, y0 + height - 1].every(Number.isSafeInteger))
46
+ throw new Error('Terrain contour tile lattice overflow');
47
+ const count = validateContourData(data, limits);
48
+ inputVertices += count;
49
+ if (inputVertices > limits.maxVertices)
50
+ throw new Error('Terrain contour input vertex capacity exceeded');
51
+ if (data.heightReference !== first.heightReference ||
52
+ data.levels.length !== levels.length ||
53
+ !data.levels.every((level, i) => level === levels[i]))
54
+ throw new Error('Terrain contour tile levels or height reference differ');
55
+ if (!(data.segments instanceof Uint32Array) ||
56
+ data.segments.length % 2 ||
57
+ !(data.levelIndices instanceof Uint32Array) ||
58
+ data.levelIndices.length !== data.segments.length / 2 ||
59
+ data.levelIndices.length > limits.maxSegments)
60
+ throw new Error('Invalid terrain contour tile segments');
61
+ inputSegments += data.levelIndices.length;
62
+ if (inputSegments > limits.maxSegments)
63
+ throw new Error('Terrain contour input segment capacity exceeded');
64
+ const assigned = new Uint32Array(count).fill(0xffffffff);
65
+ const remap = new Uint32Array(count).fill(0xffffffff);
66
+ const localBoundary = new Set();
67
+ const mapVertex = (source, level) => {
68
+ validateContourVertex(data, source, level, assigned);
69
+ if (remap[source] !== 0xffffffff)
70
+ return remap[source];
71
+ const x = data.gridCoordinates[2 * source], y = data.gridCoordinates[2 * source + 1];
72
+ if (x < 0 || x > width - 1 || y < 0 || y > height - 1)
73
+ throw new Error('Terrain contour vertex outside tile lattice');
74
+ const gx = x0 + x, gy = y0 + y;
75
+ if (!Number.isFinite(gx) ||
76
+ !Number.isFinite(gy) ||
77
+ (x % 1 !== 0 && Number.isInteger(gx)) ||
78
+ (y % 1 !== 0 && Number.isInteger(gy)))
79
+ throw new Error('Terrain contour tile lattice loses precision');
80
+ const px = data.positions[3 * source] + (data.origin[0] - origin[0]);
81
+ const py = data.positions[3 * source + 1] + (data.origin[1] - origin[1]);
82
+ if (!Number.isFinite(px) || !Number.isFinite(py))
83
+ throw new Error('Terrain contour frame overflow');
84
+ const boundary = x === 0 || y === 0 || x === width - 1 || y === height - 1;
85
+ // Keep the integer lattice coordinate and local fractional remainder separate.
86
+ // Adding a small fraction to a large tile offset can round distinct points
87
+ // to the same binary64 global coordinate and must not weld them together.
88
+ const xi = Math.floor(x), yi = Math.floor(y);
89
+ const vertexKey = `${level}/${x0 + xi}/${x - xi}/${y0 + yi}/${y - yi}`;
90
+ if (boundary) {
91
+ if (localBoundary.has(vertexKey))
92
+ throw new Error('Duplicate terrain contour boundary vertex');
93
+ localBoundary.add(vertexKey);
94
+ }
95
+ const found = boundary ? vertices.get(vertexKey) : undefined;
96
+ if (found) {
97
+ if (found.tile === tileIndex)
98
+ throw new Error('Duplicate terrain contour boundary vertex');
99
+ const delta = Math.hypot(px - positions[3 * found.id], py - positions[3 * found.id + 1]);
100
+ if (!Number.isFinite(delta) || delta > tolerance)
101
+ throw new Error('Terrain contour boundary positions disagree');
102
+ remap[source] = found.id;
103
+ return found.id;
104
+ }
105
+ if (positions.length / 3 >= limits.maxVertices)
106
+ throw new Error('Terrain contour vertex capacity exceeded');
107
+ const output = positions.length / 3;
108
+ const pz = levels[level] - origin[2];
109
+ if (!Number.isFinite(pz))
110
+ throw new Error('Terrain contour frame overflow');
111
+ positions.push(px, py, pz);
112
+ grid.push(gx, gy);
113
+ if (boundary)
114
+ vertices.set(vertexKey, { id: output, tile: tileIndex });
115
+ remap[source] = output;
116
+ return output;
117
+ };
118
+ for (let i = 0; i < data.levelIndices.length; i++) {
119
+ const level = data.levelIndices[i], a = mapVertex(data.segments[2 * i], level), b = mapVertex(data.segments[2 * i + 1], level);
120
+ if (a === b ||
121
+ (positions[3 * a] === positions[3 * b] && positions[3 * a + 1] === positions[3 * b + 1]))
122
+ throw new Error('Degenerate terrain contour segment after rebasing');
123
+ const edge = a < b ? `${a}/${b}` : `${b}/${a}`;
124
+ const previous = edges.get(edge);
125
+ if (previous !== undefined) {
126
+ if (previous === tileIndex)
127
+ throw new Error('Duplicate terrain contour segment');
128
+ continue;
129
+ }
130
+ if (levelIndices.length >= limits.maxSegments)
131
+ throw new Error('Terrain contour segment capacity exceeded');
132
+ edges.set(edge, tileIndex);
133
+ segments.push(a, b);
134
+ levelIndices.push(level);
135
+ }
136
+ }
137
+ return {
138
+ positions: Float64Array.from(positions),
139
+ gridCoordinates: Float64Array.from(grid),
140
+ segments: Uint32Array.from(segments),
141
+ levelIndices: Uint32Array.from(levelIndices),
142
+ levels,
143
+ origin,
144
+ heightReference: first.heightReference
145
+ };
146
+ }
147
+ //# sourceMappingURL=contour-tile-weld.js.map