@math.gl/geospatial 5.0.0-beta.4 → 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 (455) 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 +212 -4614
  6. package/dist/index.cjs.map +3 -3
  7. package/dist/index.d.ts +2 -8
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +1 -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-mixed-weld.d.ts +25 -0
  213. package/dist/terrain/contour-mixed-weld.d.ts.map +1 -0
  214. package/dist/terrain/contour-mixed-weld.js +194 -0
  215. package/dist/terrain/contour-mixed-weld.js.map +1 -0
  216. package/dist/terrain/height-field.d.ts.map +1 -1
  217. package/dist/terrain/height-field.js +48 -5
  218. package/dist/terrain/height-field.js.map +1 -1
  219. package/dist/terrain/index.cjs +204 -4
  220. package/dist/terrain/index.cjs.map +3 -3
  221. package/dist/terrain/index.d.ts +2 -0
  222. package/dist/terrain/index.d.ts.map +1 -1
  223. package/dist/terrain/index.js +1 -0
  224. package/dist/terrain/index.js.map +1 -1
  225. package/dist/terrain/tiled.d.ts +10 -2
  226. package/dist/terrain/tiled.d.ts.map +1 -1
  227. package/dist/terrain/tiled.js +5 -1
  228. package/dist/terrain/tiled.js.map +1 -1
  229. package/dist/terrain/types.d.ts +6 -0
  230. package/dist/terrain/types.d.ts.map +1 -1
  231. package/dist/turf.cjs +25 -671
  232. package/dist/turf.cjs.map +3 -3
  233. package/dist/turf.d.ts +1 -1
  234. package/dist/turf.d.ts.map +1 -1
  235. package/dist/turf.js +2 -2
  236. package/dist/turf.js.map +1 -1
  237. package/package.json +15 -19
  238. package/src/expressions.ts +1 -1
  239. package/src/index.ts +5 -123
  240. package/src/projection/experimental/common/adjust_lat.ts +1 -1
  241. package/src/projection/experimental/common/adjust_lon.ts +1 -1
  242. package/src/projection/experimental/common/asinhy.ts +1 -1
  243. package/src/projection/experimental/common/asinz.ts +1 -1
  244. package/src/projection/experimental/common/authlat.ts +1 -1
  245. package/src/projection/experimental/common/authset.ts +1 -1
  246. package/src/projection/experimental/common/clens.ts +1 -1
  247. package/src/projection/experimental/common/clens_cmplx.ts +1 -1
  248. package/src/projection/experimental/common/constants.ts +1 -1
  249. package/src/projection/experimental/common/cosh.ts +1 -1
  250. package/src/projection/experimental/common/e0fn.ts +1 -1
  251. package/src/projection/experimental/common/e1fn.ts +1 -1
  252. package/src/projection/experimental/common/e2fn.ts +1 -1
  253. package/src/projection/experimental/common/e3fn.ts +1 -1
  254. package/src/projection/experimental/common/fL.ts +1 -1
  255. package/src/projection/experimental/common/gN.ts +1 -1
  256. package/src/projection/experimental/common/gatg.ts +1 -1
  257. package/src/projection/experimental/common/hypot.ts +1 -1
  258. package/src/projection/experimental/common/imlfn.ts +1 -1
  259. package/src/projection/experimental/common/invlatiso.ts +1 -1
  260. package/src/projection/experimental/common/iqsfnz.ts +1 -1
  261. package/src/projection/experimental/common/latiso.ts +1 -1
  262. package/src/projection/experimental/common/log1py.ts +1 -1
  263. package/src/projection/experimental/common/mlfn.ts +1 -1
  264. package/src/projection/experimental/common/msfnz.ts +1 -1
  265. package/src/projection/experimental/common/phi2z.ts +1 -1
  266. package/src/projection/experimental/common/pj_enfn.ts +1 -1
  267. package/src/projection/experimental/common/pj_inv_mlfn.ts +1 -1
  268. package/src/projection/experimental/common/pj_mlfn.ts +1 -1
  269. package/src/projection/experimental/common/qsfnz.ts +1 -1
  270. package/src/projection/experimental/common/sign.ts +1 -1
  271. package/src/projection/experimental/common/sinh.ts +1 -1
  272. package/src/projection/experimental/common/srat.ts +1 -1
  273. package/src/projection/experimental/common/tsfnz.ts +1 -1
  274. package/src/projection/experimental/common/vincenty.ts +1 -1
  275. package/src/projection/experimental/core.ts +8 -0
  276. package/src/projection/experimental/crs/datum-table.ts +1 -1
  277. package/src/projection/experimental/crs/ellipsoid-table.ts +1 -1
  278. package/src/projection/experimental/crs/primemeridian-table.ts +1 -1
  279. package/src/projection/experimental/crs/structured.ts +1 -1
  280. package/src/projection/experimental/crs/wkt.ts +1 -1
  281. package/src/projection/experimental/datum.ts +1 -1
  282. package/src/projection/experimental/ellipsoidal-gnomonic.ts +1 -1
  283. package/src/projection/experimental/exact-helmert.ts +1 -1
  284. package/src/projection/experimental/grids/geotiff.ts +1 -1
  285. package/src/projection/experimental/grids/grid.ts +1 -1
  286. package/src/projection/experimental/grids/ntv2.ts +1 -1
  287. package/src/projection/experimental/helmert-flat.ts +1 -1
  288. package/src/projection/experimental/kernels/aea.ts +1 -1
  289. package/src/projection/experimental/kernels/aeqd.ts +1 -1
  290. package/src/projection/experimental/kernels/bonne.ts +1 -1
  291. package/src/projection/experimental/kernels/cass.ts +1 -1
  292. package/src/projection/experimental/kernels/cea.ts +1 -1
  293. package/src/projection/experimental/kernels/eck6.ts +1 -1
  294. package/src/projection/experimental/kernels/eqdc.ts +1 -1
  295. package/src/projection/experimental/kernels/eqearth.ts +1 -1
  296. package/src/projection/experimental/kernels/equi.ts +1 -1
  297. package/src/projection/experimental/kernels/etmerc.ts +1 -1
  298. package/src/projection/experimental/kernels/gauss.ts +1 -1
  299. package/src/projection/experimental/kernels/geos.ts +1 -1
  300. package/src/projection/experimental/kernels/gnom.ts +1 -1
  301. package/src/projection/experimental/kernels/gstmerc.ts +1 -1
  302. package/src/projection/experimental/kernels/krovak.ts +1 -1
  303. package/src/projection/experimental/kernels/laea.ts +1 -1
  304. package/src/projection/experimental/kernels/lcc.ts +1 -1
  305. package/src/projection/experimental/kernels/mill.ts +1 -1
  306. package/src/projection/experimental/kernels/moll.ts +1 -1
  307. package/src/projection/experimental/kernels/nzmg.ts +1 -1
  308. package/src/projection/experimental/kernels/omerc.ts +1 -1
  309. package/src/projection/experimental/kernels/ortho.ts +1 -1
  310. package/src/projection/experimental/kernels/poly.ts +1 -1
  311. package/src/projection/experimental/kernels/qsc.ts +1 -1
  312. package/src/projection/experimental/kernels/robin.ts +1 -1
  313. package/src/projection/experimental/kernels/sinu.ts +1 -1
  314. package/src/projection/experimental/kernels/somerc.ts +1 -1
  315. package/src/projection/experimental/kernels/stere.ts +1 -1
  316. package/src/projection/experimental/kernels/sterea.ts +1 -1
  317. package/src/projection/experimental/kernels/tmerc.ts +1 -1
  318. package/src/projection/experimental/kernels/tpers.ts +1 -1
  319. package/src/projection/experimental/kernels/vandg.ts +1 -1
  320. package/src/projection/experimental/kinematic-helmert-flat.ts +1 -1
  321. package/src/projection/experimental/kinematic-helmert.ts +1 -1
  322. package/src/projection/experimental/projection-pipeline.ts +1 -1
  323. package/src/projection/experimental/projections/equidistant-cylindrical.ts +1 -0
  324. package/src/projection/experimental/projections/mercator.ts +1 -0
  325. package/src/projection/experimental/projections/ob-tran.ts +1 -1
  326. package/src/projection/experimental/transform-description.ts +82 -0
  327. package/src/projection/experimental/types.ts +5 -0
  328. package/src/projection/experimental/typescript-projection.ts +54 -6
  329. package/src/projection/transform-description.ts +69 -0
  330. package/src/projection/types.ts +11 -0
  331. package/src/tasks/definitions.ts +1 -1
  332. package/src/tasks/index.ts +1 -1
  333. package/src/tasks/map-worker.ts +1 -1
  334. package/src/tasks/operations.ts +1 -1
  335. package/src/tasks/projection-worker.ts +1 -1
  336. package/src/terrain/contour-mixed-weld.ts +254 -0
  337. package/src/terrain/height-field.ts +45 -5
  338. package/src/terrain/index.ts +2 -0
  339. package/src/terrain/tiled.ts +16 -3
  340. package/src/terrain/types.ts +9 -1
  341. package/src/turf.ts +7 -3
  342. package/crs/README.md +0 -84
  343. package/crs/schemas/README.md +0 -9
  344. package/dist/geoarrow/builder-entry.d.ts +0 -4
  345. package/dist/geoarrow/builder-entry.d.ts.map +0 -1
  346. package/dist/geoarrow/builder-entry.js +0 -5
  347. package/dist/geoarrow/builder-entry.js.map +0 -1
  348. package/dist/geoarrow/builder.d.ts +0 -106
  349. package/dist/geoarrow/builder.d.ts.map +0 -1
  350. package/dist/geoarrow/builder.js +0 -668
  351. package/dist/geoarrow/builder.js.map +0 -1
  352. package/dist/geoarrow/codecs.d.ts +0 -24
  353. package/dist/geoarrow/codecs.d.ts.map +0 -1
  354. package/dist/geoarrow/codecs.js +0 -916
  355. package/dist/geoarrow/codecs.js.map +0 -1
  356. package/dist/geoarrow/index.cjs +0 -4352
  357. package/dist/geoarrow/index.cjs.map +0 -6
  358. package/dist/geoarrow/index.d.ts +0 -21
  359. package/dist/geoarrow/index.d.ts.map +0 -1
  360. package/dist/geoarrow/index.js +0 -15
  361. package/dist/geoarrow/index.js.map +0 -1
  362. package/dist/geoarrow/kernels.d.ts +0 -56
  363. package/dist/geoarrow/kernels.d.ts.map +0 -1
  364. package/dist/geoarrow/kernels.js +0 -982
  365. package/dist/geoarrow/kernels.js.map +0 -1
  366. package/dist/geoarrow/layout.d.ts +0 -66
  367. package/dist/geoarrow/layout.d.ts.map +0 -1
  368. package/dist/geoarrow/layout.js +0 -723
  369. package/dist/geoarrow/layout.js.map +0 -1
  370. package/dist/geoarrow/stream-tessellate.d.ts +0 -34
  371. package/dist/geoarrow/stream-tessellate.d.ts.map +0 -1
  372. package/dist/geoarrow/stream-tessellate.js +0 -171
  373. package/dist/geoarrow/stream-tessellate.js.map +0 -1
  374. package/dist/geoarrow/stream.d.ts +0 -29
  375. package/dist/geoarrow/stream.d.ts.map +0 -1
  376. package/dist/geoarrow/stream.js +0 -100
  377. package/dist/geoarrow/stream.js.map +0 -1
  378. package/dist/geoarrow/tessellate.d.ts +0 -31
  379. package/dist/geoarrow/tessellate.d.ts.map +0 -1
  380. package/dist/geoarrow/tessellate.js +0 -102
  381. package/dist/geoarrow/tessellate.js.map +0 -1
  382. package/dist/geoarrow/tessellation-entry.d.ts +0 -4
  383. package/dist/geoarrow/tessellation-entry.d.ts.map +0 -1
  384. package/dist/geoarrow/tessellation-entry.js +0 -5
  385. package/dist/geoarrow/tessellation-entry.js.map +0 -1
  386. package/dist/geoarrow/types.d.ts +0 -155
  387. package/dist/geoarrow/types.d.ts.map +0 -1
  388. package/dist/geoarrow/types.js +0 -71
  389. package/dist/geoarrow/types.js.map +0 -1
  390. package/dist/geoarrow/views.d.ts +0 -45
  391. package/dist/geoarrow/views.d.ts.map +0 -1
  392. package/dist/geoarrow/views.js +0 -114
  393. package/dist/geoarrow/views.js.map +0 -1
  394. package/dist/geoarrow/wkb-entry.d.ts +0 -4
  395. package/dist/geoarrow/wkb-entry.d.ts.map +0 -1
  396. package/dist/geoarrow/wkb-entry.js +0 -6
  397. package/dist/geoarrow/wkb-entry.js.map +0 -1
  398. package/dist/geoarrow/worker.d.ts +0 -11
  399. package/dist/geoarrow/worker.d.ts.map +0 -1
  400. package/dist/geoarrow/worker.js +0 -10
  401. package/dist/geoarrow/worker.js.map +0 -1
  402. package/dist/wkb/index.d.ts +0 -11
  403. package/dist/wkb/index.d.ts.map +0 -1
  404. package/dist/wkb/index.js +0 -9
  405. package/dist/wkb/index.js.map +0 -1
  406. package/dist/wkb/types.d.ts +0 -30
  407. package/dist/wkb/types.d.ts.map +0 -1
  408. package/dist/wkb/types.js +0 -34
  409. package/dist/wkb/types.js.map +0 -1
  410. package/dist/wkb/wkb-builder.d.ts +0 -91
  411. package/dist/wkb/wkb-builder.d.ts.map +0 -1
  412. package/dist/wkb/wkb-builder.js +0 -283
  413. package/dist/wkb/wkb-builder.js.map +0 -1
  414. package/dist/wkb/wkb-reader.d.ts +0 -74
  415. package/dist/wkb/wkb-reader.d.ts.map +0 -1
  416. package/dist/wkb/wkb-reader.js +0 -251
  417. package/dist/wkb/wkb-reader.js.map +0 -1
  418. package/dist/wkb/wkb.d.ts +0 -21
  419. package/dist/wkb/wkb.d.ts.map +0 -1
  420. package/dist/wkb/wkb.js +0 -204
  421. package/dist/wkb/wkb.js.map +0 -1
  422. package/dist/wkb/wkt.d.ts +0 -19
  423. package/dist/wkb/wkt.d.ts.map +0 -1
  424. package/dist/wkb/wkt.js +0 -321
  425. package/dist/wkb/wkt.js.map +0 -1
  426. package/projection/THIRD-PARTY-NOTICES.md +0 -210
  427. package/src/discontinuous/elastic/README.md +0 -20
  428. package/src/discontinuous/spherical-clip/README.md +0 -16
  429. package/src/discontinuous/world-kernels/README.md +0 -24
  430. package/src/geoarrow/builder-entry.ts +0 -18
  431. package/src/geoarrow/builder.ts +0 -860
  432. package/src/geoarrow/codecs.ts +0 -1268
  433. package/src/geoarrow/index.ts +0 -111
  434. package/src/geoarrow/kernels.ts +0 -1290
  435. package/src/geoarrow/layout.ts +0 -900
  436. package/src/geoarrow/stream-tessellate.ts +0 -205
  437. package/src/geoarrow/stream.ts +0 -130
  438. package/src/geoarrow/tessellate.ts +0 -133
  439. package/src/geoarrow/tessellation-entry.ts +0 -7
  440. package/src/geoarrow/types.ts +0 -259
  441. package/src/geoarrow/views.ts +0 -150
  442. package/src/geoarrow/wkb-entry.ts +0 -13
  443. package/src/geoarrow/worker.ts +0 -20
  444. package/src/terrain/vendor/README.md +0 -20
  445. package/src/vendor/geographiclib-geodesic/README.md +0 -26
  446. package/src/wkb/index.ts +0 -38
  447. package/src/wkb/types.ts +0 -54
  448. package/src/wkb/wkb-builder.ts +0 -395
  449. package/src/wkb/wkb-reader.ts +0 -401
  450. package/src/wkb/wkb.ts +0 -255
  451. package/src/wkb/wkt.ts +0 -375
  452. /package/{projection/APACHE-2.0-LICENSE.txt → APACHE-2.0-LICENSE.txt} +0 -0
  453. /package/{projection/PROJ-LICENSE.txt → PROJ-LICENSE.txt} +0 -0
  454. /package/{projection/PROJ4-LICENSE.md → PROJ4-LICENSE.md} +0 -0
  455. /package/{crs/schemas → src/crs}/projjson.schema.json +0 -0
@@ -1,91 +0,0 @@
1
- import type { WellKnownDimension } from "./types.js";
2
- import type { WKBGeometryType } from "./wkb-reader.js";
3
- /** Function that writes one WKB geometry into a builder. */
4
- export type WKBGeometryWriter = (builder: WKBBuilder) => void;
5
- /** Transforms one complete coordinate before it is written. */
6
- export type WKBCoordinateTransform = (coordinate: readonly number[], dimension: WellKnownDimension) => readonly number[];
7
- /** Options shared by WKB measuring and writing modes. */
8
- export type WKBBuilderBaseOptions = Readonly<{
9
- /** Coordinate dimension written by every geometry header. Defaults to `xy`. */
10
- dimension?: WellKnownDimension;
11
- /** Optional per-row dimension resolver used by geometry-array helpers. */
12
- dimensionResolver?: (geometryIndex: number) => WellKnownDimension;
13
- /** Byte order written by every geometry header. Defaults to little endian. */
14
- byteOrder?: 'little-endian' | 'big-endian';
15
- /** Optional EWKB spatial reference identifier. */
16
- srid?: number;
17
- /** Optional coordinate transform applied during writing and measurement. */
18
- transform?: WKBCoordinateTransform;
19
- }>;
20
- /** Options for a builder that only measures byte length. */
21
- export type WKBBuilderMeasureOptions = WKBBuilderBaseOptions & Readonly<{
22
- mode: 'measure';
23
- }>;
24
- /** Options for a builder that writes into caller-owned storage. */
25
- export type WKBBuilderWriteOptions = WKBBuilderBaseOptions & Readonly<{
26
- mode: 'write';
27
- target: ArrayBufferLike | ArrayBufferView;
28
- /** Starting byte offset within `target`. Defaults to zero. */
29
- byteOffset?: number;
30
- }>;
31
- /** Constructor options for {@link WKBBuilder}. */
32
- export type WKBBuilderOptions = WKBBuilderMeasureOptions | WKBBuilderWriteOptions;
33
- /** Plain offset, value, and validity buffers suitable for Arrow Binary adapters. */
34
- export type WKBGeometryArray = Readonly<{
35
- valueOffsets: Int32Array;
36
- values: Uint8Array;
37
- nullBitmap?: Uint8Array;
38
- nullCount: number;
39
- }>;
40
- /**
41
- * Incremental WKB writer with matching measure and caller-buffer write modes.
42
- *
43
- * Callers run the same event sequence once in `measure` mode and once in `write`
44
- * mode. No Arrow or GeoJSON objects are created by the builder.
45
- */
46
- export declare class WKBBuilder {
47
- readonly mode: 'measure' | 'write';
48
- dimension: WellKnownDimension;
49
- readonly littleEndian: boolean;
50
- readonly srid?: number;
51
- readonly transform?: WKBCoordinateTransform;
52
- private readonly dataView;
53
- private readonly startByteOffset;
54
- private readonly endByteOffset;
55
- private byteOffset;
56
- constructor(options: WKBBuilderOptions);
57
- /** Begins a geometry and writes its count field when required. */
58
- beginGeometry(type: WKBGeometryType, count?: number): void;
59
- /** Begins one point geometry. */
60
- beginPoint(): void;
61
- /** Begins one linestring geometry. */
62
- beginLineString(pointCount: number): void;
63
- /** Begins one polygon geometry. */
64
- beginPolygon(ringCount: number): void;
65
- /** Begins one linear ring inside a polygon. */
66
- beginLinearRing(pointCount: number): void;
67
- /** Begins one multipoint geometry. */
68
- beginMultiPoint(pointCount: number): void;
69
- /** Begins one multilinestring geometry. */
70
- beginMultiLineString(lineCount: number): void;
71
- /** Begins one multipolygon geometry. */
72
- beginMultiPolygon(polygonCount: number): void;
73
- /** Writes one coordinate using the builder's semantic dimension. */
74
- writeCoordinate(x: number, y: number, z?: number, m?: number): void;
75
- /** Temporarily changes the semantic dimension for a nested geometry. */
76
- withDimension<T>(dimension: WellKnownDimension, callback: () => T): T;
77
- /** Returns the number of bytes measured or written. */
78
- finishGeometry(): number;
79
- /** Measures geometry callbacks and returns contiguous Binary offsets. */
80
- static measureGeometryArray(geometryWriters: readonly (WKBGeometryWriter | null | undefined)[], options?: WKBBuilderBaseOptions): Int32Array;
81
- /** Writes geometry callbacks into an existing contiguous values buffer. */
82
- static writeGeometryArray(geometryWriters: readonly (WKBGeometryWriter | null | undefined)[], valueOffsets: Int32Array, values: Uint8Array, options?: WKBBuilderBaseOptions): Uint8Array;
83
- /** Builds plain offsets, values, and validity buffers in two passes. */
84
- static buildGeometryArray(geometryWriters: readonly (WKBGeometryWriter | null | undefined)[], options?: WKBBuilderBaseOptions): WKBGeometryArray;
85
- private writeHeader;
86
- private writeUint8;
87
- private writeUint32;
88
- private writeFloat64;
89
- private ensureSize;
90
- }
91
- //# sourceMappingURL=wkb-builder.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wkb-builder.d.ts","sourceRoot":"","sources":["../../src/wkb/wkb-builder.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAC,mBAAgB;AAChD,OAAO,KAAK,EAAC,eAAe,EAAC,wBAAqB;AAElD,4DAA4D;AAC5D,MAAM,M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UrE,uDAAuD;IACvD,cAAc,IAAI,MAAM;IAIxB,yEAAyE;IACzE,MAAM,CAAC,oBAAoB,CACzB,eAAe,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,EAClE,OAAO,GAAE,qBAA0B,GAClC,UAAU;IAiBb,2EAA2E;IAC3E,MAAM,CAAC,kBAAkB,CACvB,eAAe,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,EAClE,YAAY,EAAE,UAAU,EACxB,MAAM,EAAE,UAAU,EAClB,OAAO,GAAE,qBAA0B,GAClC,UAAU;IAmCb,wEAAwE;IACxE,MAAM,CAAC,kBAAkB,CACvB,eAAe,EAAE,SAAS,CAAC,iBAAiB,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,EAClE,OAAO,GAAE,qBAA0B,GAClC,gBAAgB;IAanB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,YAAY;IAMpB,OAAO,CAAC,UAAU;CAKnB"}
@@ -1,283 +0,0 @@
1
- // math.gl
2
- // SPDX-License-Identifier: MIT
3
- // SPDX-FileCopyrightText: Copyright (c) vis.gl contributors
4
- const GEOMETRY_TYPE_CODES = {
5
- Point: 1,
6
- LineString: 2,
7
- Polygon: 3,
8
- MultiPoint: 4,
9
- MultiLineString: 5,
10
- MultiPolygon: 6,
11
- GeometryCollection: 7
12
- };
13
- /**
14
- * Incremental WKB writer with matching measure and caller-buffer write modes.
15
- *
16
- * Callers run the same event sequence once in `measure` mode and once in `write`
17
- * mode. No Arrow or GeoJSON objects are created by the builder.
18
- */
19
- export class WKBBuilder {
20
- constructor(options) {
21
- this.mode = options.mode;
22
- this.dimension = options.dimension ?? 'xy';
23
- this.littleEndian = options.byteOrder !== 'big-endian';
24
- this.srid = options.srid;
25
- this.transform = options.transform;
26
- validateSrid(this.srid);
27
- if (options.mode === 'write') {
28
- const dataView = getTargetDataView(options.target);
29
- const byteOffset = options.byteOffset ?? 0;
30
- if (!Number.isSafeInteger(byteOffset) || byteOffset < 0 || byteOffset > dataView.byteLength) {
31
- throw new Error('WKBBuilder byteOffset is outside the target');
32
- }
33
- this.dataView = dataView;
34
- this.startByteOffset = byteOffset;
35
- this.endByteOffset = dataView.byteLength;
36
- this.byteOffset = byteOffset;
37
- }
38
- else {
39
- this.dataView = null;
40
- this.startByteOffset = 0;
41
- this.endByteOffset = Number.POSITIVE_INFINITY;
42
- this.byteOffset = 0;
43
- }
44
- }
45
- /** Begins a geometry and writes its count field when required. */
46
- beginGeometry(type, count) {
47
- switch (type) {
48
- case 'Point':
49
- this.beginPoint();
50
- break;
51
- case 'LineString':
52
- this.beginLineString(count ?? 0);
53
- break;
54
- case 'Polygon':
55
- this.beginPolygon(count ?? 0);
56
- break;
57
- case 'MultiPoint':
58
- this.beginMultiPoint(count ?? 0);
59
- break;
60
- case 'MultiLineString':
61
- this.beginMultiLineString(count ?? 0);
62
- break;
63
- case 'MultiPolygon':
64
- this.beginMultiPolygon(count ?? 0);
65
- break;
66
- case 'GeometryCollection':
67
- this.writeHeader('GeometryCollection');
68
- this.writeUint32(count ?? 0);
69
- break;
70
- }
71
- }
72
- /** Begins one point geometry. */
73
- beginPoint() {
74
- this.writeHeader('Point');
75
- }
76
- /** Begins one linestring geometry. */
77
- beginLineString(pointCount) {
78
- this.writeHeader('LineString');
79
- this.writeUint32(pointCount);
80
- }
81
- /** Begins one polygon geometry. */
82
- beginPolygon(ringCount) {
83
- this.writeHeader('Polygon');
84
- this.writeUint32(ringCount);
85
- }
86
- /** Begins one linear ring inside a polygon. */
87
- beginLinearRing(pointCount) {
88
- this.writeUint32(pointCount);
89
- }
90
- /** Begins one multipoint geometry. */
91
- beginMultiPoint(pointCount) {
92
- this.writeHeader('MultiPoint');
93
- this.writeUint32(pointCount);
94
- }
95
- /** Begins one multilinestring geometry. */
96
- beginMultiLineString(lineCount) {
97
- this.writeHeader('MultiLineString');
98
- this.writeUint32(lineCount);
99
- }
100
- /** Begins one multipolygon geometry. */
101
- beginMultiPolygon(polygonCount) {
102
- this.writeHeader('MultiPolygon');
103
- this.writeUint32(polygonCount);
104
- }
105
- /** Writes one coordinate using the builder's semantic dimension. */
106
- writeCoordinate(x, y, z, m) {
107
- let coordinate = makeCoordinate(this.dimension, x, y, z, m);
108
- if (this.transform)
109
- coordinate = this.transform(coordinate, this.dimension);
110
- const coordinateSize = getDimensionSize(this.dimension);
111
- for (let index = 0; index < coordinateSize; index++) {
112
- this.writeFloat64(coordinate[index] ?? Number.NaN);
113
- }
114
- }
115
- /** Temporarily changes the semantic dimension for a nested geometry. */
116
- withDimension(dimension, callback) {
117
- const previous = this.dimension;
118
- this.dimension = dimension;
119
- try {
120
- return callback();
121
- }
122
- finally {
123
- this.dimension = previous;
124
- }
125
- }
126
- /** Returns the number of bytes measured or written. */
127
- finishGeometry() {
128
- return this.byteOffset - this.startByteOffset;
129
- }
130
- /** Measures geometry callbacks and returns contiguous Binary offsets. */
131
- static measureGeometryArray(geometryWriters, options = {}) {
132
- const valueOffsets = new Int32Array(geometryWriters.length + 1);
133
- for (let geometryIndex = 0; geometryIndex < geometryWriters.length; geometryIndex++) {
134
- const geometryWriter = geometryWriters[geometryIndex];
135
- const byteLength = geometryWriter
136
- ? measureGeometry(geometryWriter, {
137
- ...options,
138
- dimension: options.dimensionResolver?.(geometryIndex) ?? options.dimension
139
- })
140
- : 0;
141
- const nextOffset = valueOffsets[geometryIndex] + byteLength;
142
- if (nextOffset > 0x7fffffff)
143
- throw new Error('WKB geometry array exceeds Int32 offsets');
144
- valueOffsets[geometryIndex + 1] = nextOffset;
145
- }
146
- return valueOffsets;
147
- }
148
- /** Writes geometry callbacks into an existing contiguous values buffer. */
149
- static writeGeometryArray(geometryWriters, valueOffsets, values, options = {}) {
150
- if (valueOffsets.length !== geometryWriters.length + 1) {
151
- throw new Error('WKB valueOffsets length must equal geometry count plus one');
152
- }
153
- for (let i = 0; i < valueOffsets.length; i++) {
154
- if (!Number.isInteger(valueOffsets[i]) ||
155
- valueOffsets[i] < 0 ||
156
- (i > 0 && valueOffsets[i] < valueOffsets[i - 1])) {
157
- throw new Error('WKB valueOffsets must be nonnegative and nondecreasing');
158
- }
159
- }
160
- if (valueOffsets[valueOffsets.length - 1] > values.byteLength) {
161
- throw new Error('WKB values buffer is smaller than its final offset');
162
- }
163
- for (let geometryIndex = 0; geometryIndex < geometryWriters.length; geometryIndex++) {
164
- const geometryWriter = geometryWriters[geometryIndex];
165
- if (!geometryWriter)
166
- continue;
167
- const builder = new WKBBuilder({
168
- ...options,
169
- mode: 'write',
170
- target: values,
171
- byteOffset: valueOffsets[geometryIndex],
172
- dimension: options.dimensionResolver?.(geometryIndex) ?? options.dimension
173
- });
174
- geometryWriter(builder);
175
- const byteLength = builder.finishGeometry();
176
- if (valueOffsets[geometryIndex] + byteLength !== valueOffsets[geometryIndex + 1]) {
177
- throw new Error('WKB measure and write passes produced different byte lengths');
178
- }
179
- }
180
- return values;
181
- }
182
- /** Builds plain offsets, values, and validity buffers in two passes. */
183
- static buildGeometryArray(geometryWriters, options = {}) {
184
- const valueOffsets = WKBBuilder.measureGeometryArray(geometryWriters, options);
185
- const values = new Uint8Array(valueOffsets[valueOffsets.length - 1]);
186
- WKBBuilder.writeGeometryArray(geometryWriters, valueOffsets, values, options);
187
- const { nullBitmap, nullCount } = makeNullBitmap(geometryWriters);
188
- return {
189
- valueOffsets,
190
- values,
191
- ...(nullCount > 0 ? { nullBitmap } : {}),
192
- nullCount
193
- };
194
- }
195
- writeHeader(geometryType) {
196
- this.writeUint8(this.littleEndian ? 1 : 0);
197
- this.writeUint32(getWKBTypeCode(geometryType, this.dimension, this.srid !== undefined));
198
- if (this.srid !== undefined)
199
- this.writeUint32(this.srid);
200
- }
201
- writeUint8(value) {
202
- this.ensureSize(1);
203
- this.dataView?.setUint8(this.byteOffset, value);
204
- this.byteOffset++;
205
- }
206
- writeUint32(value) {
207
- if (!Number.isSafeInteger(value) || value < 0 || value > 0xffffffff) {
208
- throw new Error('WKB count must be an unsigned 32-bit integer');
209
- }
210
- this.ensureSize(4);
211
- this.dataView?.setUint32(this.byteOffset, value, this.littleEndian);
212
- this.byteOffset += 4;
213
- }
214
- writeFloat64(value) {
215
- this.ensureSize(8);
216
- this.dataView?.setFloat64(this.byteOffset, value, this.littleEndian);
217
- this.byteOffset += 8;
218
- }
219
- ensureSize(byteLength) {
220
- if (this.byteOffset + byteLength > this.endByteOffset) {
221
- throw new Error('WKBBuilder target buffer overflow');
222
- }
223
- }
224
- }
225
- function measureGeometry(geometryWriter, options) {
226
- const builder = new WKBBuilder({ ...options, mode: 'measure' });
227
- geometryWriter(builder);
228
- return builder.finishGeometry();
229
- }
230
- function getTargetDataView(target) {
231
- return ArrayBuffer.isView(target)
232
- ? new DataView(target.buffer, target.byteOffset, target.byteLength)
233
- : new DataView(target);
234
- }
235
- function getWKBTypeCode(geometryType, dimension, hasSrid) {
236
- const geometryCode = GEOMETRY_TYPE_CODES[geometryType];
237
- if (hasSrid) {
238
- const dimensionFlags = dimension === 'xyz'
239
- ? 0x80000000
240
- : dimension === 'xym'
241
- ? 0x40000000
242
- : dimension === 'xyzm'
243
- ? 0xc0000000
244
- : 0;
245
- return (geometryCode | dimensionFlags | 0x20000000) >>> 0;
246
- }
247
- const dimensionOffset = dimension === 'xyz' ? 1000 : dimension === 'xym' ? 2000 : dimension === 'xyzm' ? 3000 : 0;
248
- return geometryCode + dimensionOffset;
249
- }
250
- function makeCoordinate(dimension, x, y, z, m) {
251
- switch (dimension) {
252
- case 'xy':
253
- return [x, y];
254
- case 'xyz':
255
- return [x, y, z ?? Number.NaN];
256
- case 'xym':
257
- return [x, y, m ?? Number.NaN];
258
- case 'xyzm':
259
- return [x, y, z ?? Number.NaN, m ?? Number.NaN];
260
- }
261
- }
262
- function getDimensionSize(dimension) {
263
- return dimension === 'xy' ? 2 : dimension === 'xyzm' ? 4 : 3;
264
- }
265
- function validateSrid(srid) {
266
- if (srid !== undefined && (!Number.isSafeInteger(srid) || srid < 0 || srid > 0xffffffff)) {
267
- throw new Error('WKBBuilder srid must be an unsigned 32-bit integer');
268
- }
269
- }
270
- function makeNullBitmap(geometryWriters) {
271
- const nullBitmap = new Uint8Array(Math.ceil(geometryWriters.length / 8));
272
- let nullCount = 0;
273
- for (let geometryIndex = 0; geometryIndex < geometryWriters.length; geometryIndex++) {
274
- if (geometryWriters[geometryIndex]) {
275
- nullBitmap[geometryIndex >> 3] |= 1 << (geometryIndex & 7);
276
- }
277
- else {
278
- nullCount++;
279
- }
280
- }
281
- return { nullBitmap, nullCount };
282
- }
283
- //# sourceMappingURL=wkb-builder.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wkb-builder.js","sourceRoot":"","sources":["../../src/wkb/wkb-builder.ts"],"names":[],"mappings":"AAAA,UAAU;AACV,+BAA+B;AAC/B,4DAA4D;AAmD5D,MAAM,mBAAmB,GAA8C;IACrE,KAAK,EAAE,CAAC;IACR,UAAU,EAAE,CAAC;IACb,OAAO,EAAE,CAAC;IACV,UAAU,EAAE,CAAC;IACb,eAAe,EAAE,CAAC;IAClB,YAAY,EAAE,CAAC;IACf,kBAAkB,EAAE,CAAC;CACtB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,OAAO,UAAU;IAYrB,YAAY,OAA0B;QACpC,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;QAC3C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,SAAS,KAAK,YAAY,CAAC;QACvD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC;QACnC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAExB,IAAI,OAAO,CAAC,IAAI,KAAK,OAAO,EAAE,CAA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AI,IAAI,GAAG,CAAC,IAAI,IAAI,GAAG,UAAU,CAAC,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;AACH,CAAC;AAED,SAAS,cAAc,CAAC,eAAkE;IAIxF,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IACzE,IAAI,SAAS,GAAG,CAAC,CAAC;IAClB,KAAK,IAAI,aAAa,GAAG,CAAC,EAAE,aAAa,GAAG,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,CAAC;QACpF,IAAI,eAAe,CAAC,aAAa,CAAC,EAAE,CAAC;YACnC,UAAU,CAAC,aAAa,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC,CAAC;QAC7D,CAAC;aAAM,CAAC;YACN,SAAS,EAAE,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,CAAC;AACjC,CAAC"}
@@ -1,74 +0,0 @@
1
- import type { WellKnownDimension, WellKnownGeometry } from "./types.js";
2
- /** Geometry family encoded by a WKB header. */
3
- export type WKBGeometryType = WellKnownGeometry['type'];
4
- /** WKB dialect identified from one geometry header. */
5
- export type WKBDialect = 'wkb' | 'iso-wkb' | 'ewkb';
6
- /** Immutable facts decoded from one WKB geometry header. */
7
- export type WKBHeader = Readonly<{
8
- geometryType: WKBGeometryType;
9
- dimension: WellKnownDimension;
10
- dialect: WKBDialect;
11
- littleEndian: boolean;
12
- /** Offset of the endian byte, relative to the supplied input view. */
13
- byteOffset: number;
14
- /** Offset of the geometry body, relative to the supplied input view. */
15
- bodyByteOffset: number;
16
- /** Number of bytes occupied by the header. */
17
- byteLength: number;
18
- /** EWKB spatial reference identifier, when present. */
19
- srid?: number;
20
- }>;
21
- /** Defensive limits shared by WKB traversal and scanning. */
22
- export type WKBTraversalOptions = Readonly<{
23
- /** Maximum recursive geometry nesting. Defaults to 64. */
24
- maximumDepth?: number;
25
- /** Maximum total declared list elements. Defaults to 100 million. */
26
- maximumElements?: number;
27
- }>;
28
- /** Direct callbacks invoked while traversing WKB bytes without materializing geometry rows. */
29
- export type WKBVisitor = Readonly<{
30
- /** Called at the start of each geometry. `count` is points, rings, or child geometries. */
31
- geometry?: (header: WKBHeader, count: number | undefined, depth: number) => void;
32
- /** Called at the start of each polygon ring. */
33
- ring?: (pointCount: number, ringIndex: number, depth: number) => void;
34
- /**
35
- * Called for each coordinate without allocating a coordinate array.
36
- * Missing Z or M ordinates are passed as `undefined`.
37
- */
38
- coordinate?: (x: number, y: number, z: number | undefined, m: number | undefined, dimension: WellKnownDimension, byteOffset: number, depth: number) => void;
39
- }>;
40
- /** Finite coordinate bounds collected by {@link scanWKB}. */
41
- export type WKBBounds = Readonly<{
42
- xmin: number;
43
- ymin: number;
44
- xmax: number;
45
- ymax: number;
46
- zmin?: number;
47
- zmax?: number;
48
- mmin?: number;
49
- mmax?: number;
50
- }>;
51
- /** Per-family geometry counts collected by {@link scanWKB}. */
52
- export type WKBGeometryCounts = Readonly<Record<WKBGeometryType, number>>;
53
- /** Structural statistics collected without materializing geometry rows. */
54
- export type WKBScanResult = Readonly<{
55
- header: WKBHeader;
56
- byteLength: number;
57
- coordinateCount: number;
58
- ringCount: number;
59
- geometryCount: number;
60
- maximumDepth: number;
61
- geometryTypes: readonly WKBGeometryType[];
62
- geometryCounts: WKBGeometryCounts;
63
- bounds?: WKBBounds;
64
- }>;
65
- /** Inspects one WKB/ISO WKB/EWKB header without reading its coordinate payload. */
66
- export declare function inspectWKBHeader(input: ArrayBufferLike | ArrayBufferView, byteOffset?: number): WKBHeader;
67
- /**
68
- * Traverses exactly one WKB geometry without constructing coordinate or geometry objects.
69
- * Returns the number of bytes consumed.
70
- */
71
- export declare function visitWKB(input: ArrayBufferLike | ArrayBufferView, visitor: WKBVisitor, options?: WKBTraversalOptions): number;
72
- /** Collects geometry counts and XYZM bounds without materializing geometry rows. */
73
- export declare function scanWKB(input: ArrayBufferLike | ArrayBufferView, options?: WKBTraversalOptions): WKBScanResult;
74
- //# sourceMappingURL=wkb-reader.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wkb-reader.d.ts","sourceRoot":"","sources":["../../src/wkb/wkb-reader.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,kBAAkB,EAAE,iBAAiB,EAAC,mBAAgB;AAGnE,+CAA+C;AAC/C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAC;AAExD,uDAAuD;AACvD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;AAEpD,4DAA4D;AAC5D,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC;IAC/B,YAAY,EAAE,eAAe,CAAC;IAC9B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,OAAO,EAAE,UAAU,CAAC;IACpB,YAAY,EAAE,OAAO,CAAC;IACtB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,cAAc,EAAE,MAAM,CAAC;IACvB,8CAA8C;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC,CAAC;AAEH,6DAA6D;AAC7D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC;IACzC,0DAA0D;IAC1D,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qEAAqE;IACrE,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC,CAAC;AAEH,+FAA+F;AAC/F,MAAM,MAAM,UAAU,GAAG,QAAQ,CAAC;IAChC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,MAA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