node-red-contrib-tak-registration 0.13.1 → 0.14.0

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 (920) hide show
  1. package/node_modules/@turf/along/README.md +3 -5
  2. package/node_modules/@turf/along/dist/cjs/index.cjs.map +1 -1
  3. package/node_modules/@turf/along/dist/cjs/index.d.cts +3 -3
  4. package/node_modules/@turf/along/dist/esm/index.d.ts +3 -3
  5. package/node_modules/@turf/along/dist/esm/index.js.map +1 -1
  6. package/node_modules/@turf/along/package.json +13 -13
  7. package/node_modules/@turf/angle/dist/cjs/index.cjs +10 -7
  8. package/node_modules/@turf/angle/dist/cjs/index.cjs.map +1 -1
  9. package/node_modules/@turf/angle/dist/cjs/index.d.cts +1 -1
  10. package/node_modules/@turf/angle/dist/esm/index.d.ts +1 -1
  11. package/node_modules/@turf/angle/dist/esm/index.js +10 -7
  12. package/node_modules/@turf/angle/dist/esm/index.js.map +1 -1
  13. package/node_modules/@turf/angle/package.json +15 -15
  14. package/node_modules/@turf/area/dist/cjs/index.cjs +1 -2
  15. package/node_modules/@turf/area/dist/cjs/index.cjs.map +1 -1
  16. package/node_modules/@turf/area/dist/cjs/index.d.cts +1 -1
  17. package/node_modules/@turf/area/dist/esm/index.d.ts +1 -1
  18. package/node_modules/@turf/area/dist/esm/index.js +1 -2
  19. package/node_modules/@turf/area/dist/esm/index.js.map +1 -1
  20. package/node_modules/@turf/area/package.json +10 -10
  21. package/node_modules/@turf/bbox/dist/cjs/index.cjs.map +1 -1
  22. package/node_modules/@turf/bbox/dist/cjs/index.d.cts +1 -1
  23. package/node_modules/@turf/bbox/dist/esm/index.d.ts +1 -1
  24. package/node_modules/@turf/bbox/dist/esm/index.js.map +1 -1
  25. package/node_modules/@turf/bbox/package.json +10 -10
  26. package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs +9 -18
  27. package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs.map +1 -1
  28. package/node_modules/@turf/bbox-clip/dist/cjs/index.d.cts +1 -1
  29. package/node_modules/@turf/bbox-clip/dist/esm/index.d.ts +1 -1
  30. package/node_modules/@turf/bbox-clip/dist/esm/index.js +9 -18
  31. package/node_modules/@turf/bbox-clip/dist/esm/index.js.map +1 -1
  32. package/node_modules/@turf/bbox-clip/package.json +11 -11
  33. package/node_modules/@turf/bbox-polygon/README.md +6 -6
  34. package/node_modules/@turf/bbox-polygon/dist/cjs/index.cjs.map +1 -1
  35. package/node_modules/@turf/bbox-polygon/dist/cjs/index.d.cts +2 -2
  36. package/node_modules/@turf/bbox-polygon/dist/esm/index.d.ts +2 -2
  37. package/node_modules/@turf/bbox-polygon/dist/esm/index.js.map +1 -1
  38. package/node_modules/@turf/bbox-polygon/package.json +9 -9
  39. package/node_modules/@turf/bearing/dist/cjs/index.cjs.map +1 -1
  40. package/node_modules/@turf/bearing/dist/cjs/index.d.cts +1 -1
  41. package/node_modules/@turf/bearing/dist/esm/index.d.ts +1 -1
  42. package/node_modules/@turf/bearing/dist/esm/index.js.map +1 -1
  43. package/node_modules/@turf/bearing/package.json +11 -11
  44. package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs.map +1 -1
  45. package/node_modules/@turf/bezier-spline/dist/cjs/index.d.cts +1 -1
  46. package/node_modules/@turf/bezier-spline/dist/esm/index.d.ts +1 -1
  47. package/node_modules/@turf/bezier-spline/dist/esm/index.js.map +1 -1
  48. package/node_modules/@turf/bezier-spline/package.json +10 -10
  49. package/node_modules/@turf/boolean-clockwise/dist/cjs/index.cjs.map +1 -1
  50. package/node_modules/@turf/boolean-clockwise/dist/cjs/index.d.cts +1 -1
  51. package/node_modules/@turf/boolean-clockwise/dist/esm/index.d.ts +1 -1
  52. package/node_modules/@turf/boolean-clockwise/dist/esm/index.js.map +1 -1
  53. package/node_modules/@turf/boolean-clockwise/package.json +10 -10
  54. package/node_modules/@turf/boolean-concave/dist/cjs/index.cjs.map +1 -1
  55. package/node_modules/@turf/boolean-concave/dist/cjs/index.d.cts +1 -1
  56. package/node_modules/@turf/boolean-concave/dist/esm/index.d.ts +1 -1
  57. package/node_modules/@turf/boolean-concave/dist/esm/index.js.map +1 -1
  58. package/node_modules/@turf/boolean-concave/package.json +10 -10
  59. package/node_modules/@turf/boolean-contains/dist/cjs/index.cjs.map +1 -1
  60. package/node_modules/@turf/boolean-contains/dist/cjs/index.d.cts +1 -1
  61. package/node_modules/@turf/boolean-contains/dist/esm/index.d.ts +1 -1
  62. package/node_modules/@turf/boolean-contains/dist/esm/index.js.map +1 -1
  63. package/node_modules/@turf/boolean-contains/package.json +13 -13
  64. package/node_modules/@turf/boolean-crosses/dist/cjs/index.cjs.map +1 -1
  65. package/node_modules/@turf/boolean-crosses/dist/cjs/index.d.cts +1 -1
  66. package/node_modules/@turf/boolean-crosses/dist/esm/index.d.ts +1 -1
  67. package/node_modules/@turf/boolean-crosses/dist/esm/index.js.map +1 -1
  68. package/node_modules/@turf/boolean-crosses/package.json +13 -13
  69. package/node_modules/@turf/boolean-disjoint/README.md +1 -1
  70. package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs +3 -3
  71. package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs.map +1 -1
  72. package/node_modules/@turf/boolean-disjoint/dist/cjs/index.d.cts +3 -3
  73. package/node_modules/@turf/boolean-disjoint/dist/esm/index.d.ts +3 -3
  74. package/node_modules/@turf/boolean-disjoint/dist/esm/index.js +3 -3
  75. package/node_modules/@turf/boolean-disjoint/dist/esm/index.js.map +1 -1
  76. package/node_modules/@turf/boolean-disjoint/package.json +13 -13
  77. package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs +1 -2
  78. package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs.map +1 -1
  79. package/node_modules/@turf/boolean-equal/dist/cjs/index.d.cts +1 -1
  80. package/node_modules/@turf/boolean-equal/dist/esm/index.d.ts +1 -1
  81. package/node_modules/@turf/boolean-equal/dist/esm/index.js +1 -2
  82. package/node_modules/@turf/boolean-equal/dist/esm/index.js.map +1 -1
  83. package/node_modules/@turf/boolean-equal/package.json +11 -11
  84. package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs +3 -3
  85. package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs.map +1 -1
  86. package/node_modules/@turf/boolean-intersects/dist/cjs/index.d.cts +3 -3
  87. package/node_modules/@turf/boolean-intersects/dist/esm/index.d.ts +3 -3
  88. package/node_modules/@turf/boolean-intersects/dist/esm/index.js +3 -3
  89. package/node_modules/@turf/boolean-intersects/dist/esm/index.js.map +1 -1
  90. package/node_modules/@turf/boolean-intersects/package.json +11 -11
  91. package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs +3 -6
  92. package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs.map +1 -1
  93. package/node_modules/@turf/boolean-overlap/dist/cjs/index.d.cts +1 -1
  94. package/node_modules/@turf/boolean-overlap/dist/esm/index.d.ts +1 -1
  95. package/node_modules/@turf/boolean-overlap/dist/esm/index.js +3 -6
  96. package/node_modules/@turf/boolean-overlap/dist/esm/index.js.map +1 -1
  97. package/node_modules/@turf/boolean-overlap/package.json +13 -13
  98. package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs +7 -14
  99. package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs.map +1 -1
  100. package/node_modules/@turf/boolean-parallel/dist/cjs/index.d.cts +1 -1
  101. package/node_modules/@turf/boolean-parallel/dist/esm/index.d.ts +1 -1
  102. package/node_modules/@turf/boolean-parallel/dist/esm/index.js +7 -14
  103. package/node_modules/@turf/boolean-parallel/dist/esm/index.js.map +1 -1
  104. package/node_modules/@turf/boolean-parallel/package.json +12 -12
  105. package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs +2 -4
  106. package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs.map +1 -1
  107. package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.d.cts +1 -1
  108. package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.d.ts +1 -1
  109. package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +2 -4
  110. package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
  111. package/node_modules/@turf/boolean-point-in-polygon/package.json +10 -10
  112. package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs +10 -0
  113. package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs.map +1 -1
  114. package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.d.cts +1 -1
  115. package/node_modules/@turf/boolean-point-on-line/dist/esm/index.d.ts +1 -1
  116. package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js +10 -0
  117. package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js.map +1 -1
  118. package/node_modules/@turf/boolean-point-on-line/package.json +10 -10
  119. package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs +2 -4
  120. package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs.map +1 -1
  121. package/node_modules/@turf/boolean-touches/dist/cjs/index.d.cts +2 -1
  122. package/node_modules/@turf/boolean-touches/dist/esm/index.d.ts +2 -1
  123. package/node_modules/@turf/boolean-touches/dist/esm/index.js +2 -4
  124. package/node_modules/@turf/boolean-touches/dist/esm/index.js.map +1 -1
  125. package/node_modules/@turf/boolean-touches/package.json +12 -12
  126. package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs +14 -28
  127. package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs.map +1 -1
  128. package/node_modules/@turf/boolean-valid/dist/cjs/index.d.cts +1 -1
  129. package/node_modules/@turf/boolean-valid/dist/esm/index.d.ts +1 -1
  130. package/node_modules/@turf/boolean-valid/dist/esm/index.js +14 -28
  131. package/node_modules/@turf/boolean-valid/dist/esm/index.js.map +1 -1
  132. package/node_modules/@turf/boolean-valid/package.json +17 -17
  133. package/node_modules/@turf/boolean-within/dist/cjs/index.cjs +4 -8
  134. package/node_modules/@turf/boolean-within/dist/cjs/index.cjs.map +1 -1
  135. package/node_modules/@turf/boolean-within/dist/cjs/index.d.cts +1 -1
  136. package/node_modules/@turf/boolean-within/dist/esm/index.d.ts +1 -1
  137. package/node_modules/@turf/boolean-within/dist/esm/index.js +4 -8
  138. package/node_modules/@turf/boolean-within/dist/esm/index.js.map +1 -1
  139. package/node_modules/@turf/boolean-within/package.json +13 -13
  140. package/node_modules/@turf/buffer/dist/cjs/index.cjs +12 -24
  141. package/node_modules/@turf/buffer/dist/cjs/index.cjs.map +1 -1
  142. package/node_modules/@turf/buffer/dist/esm/index.js +12 -24
  143. package/node_modules/@turf/buffer/dist/esm/index.js.map +1 -1
  144. package/node_modules/@turf/buffer/package.json +12 -12
  145. package/node_modules/@turf/center/dist/cjs/index.cjs.map +1 -1
  146. package/node_modules/@turf/center/dist/cjs/index.d.cts +1 -1
  147. package/node_modules/@turf/center/dist/esm/index.d.ts +1 -1
  148. package/node_modules/@turf/center/dist/esm/index.js.map +1 -1
  149. package/node_modules/@turf/center/package.json +12 -12
  150. package/node_modules/@turf/center-mean/dist/cjs/index.cjs.map +1 -1
  151. package/node_modules/@turf/center-mean/dist/cjs/index.d.cts +1 -1
  152. package/node_modules/@turf/center-mean/dist/esm/index.d.ts +1 -1
  153. package/node_modules/@turf/center-mean/dist/esm/index.js.map +1 -1
  154. package/node_modules/@turf/center-mean/package.json +13 -13
  155. package/node_modules/@turf/center-median/dist/cjs/index.cjs +5 -10
  156. package/node_modules/@turf/center-median/dist/cjs/index.cjs.map +1 -1
  157. package/node_modules/@turf/center-median/dist/cjs/index.d.cts +1 -1
  158. package/node_modules/@turf/center-median/dist/esm/index.d.ts +1 -1
  159. package/node_modules/@turf/center-median/dist/esm/index.js +5 -10
  160. package/node_modules/@turf/center-median/dist/esm/index.js.map +1 -1
  161. package/node_modules/@turf/center-median/package.json +17 -17
  162. package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs +2 -4
  163. package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs.map +1 -1
  164. package/node_modules/@turf/center-of-mass/dist/cjs/index.d.cts +1 -1
  165. package/node_modules/@turf/center-of-mass/dist/esm/index.d.ts +1 -1
  166. package/node_modules/@turf/center-of-mass/dist/esm/index.js +2 -4
  167. package/node_modules/@turf/center-of-mass/dist/esm/index.js.map +1 -1
  168. package/node_modules/@turf/center-of-mass/package.json +13 -13
  169. package/node_modules/@turf/centroid/dist/cjs/index.cjs.map +1 -1
  170. package/node_modules/@turf/centroid/dist/cjs/index.d.cts +1 -1
  171. package/node_modules/@turf/centroid/dist/esm/index.d.ts +1 -1
  172. package/node_modules/@turf/centroid/dist/esm/index.js.map +1 -1
  173. package/node_modules/@turf/centroid/package.json +10 -10
  174. package/node_modules/@turf/circle/dist/cjs/index.cjs.map +1 -1
  175. package/node_modules/@turf/circle/dist/cjs/index.d.cts +1 -1
  176. package/node_modules/@turf/circle/dist/esm/index.d.ts +1 -1
  177. package/node_modules/@turf/circle/dist/esm/index.js.map +1 -1
  178. package/node_modules/@turf/circle/package.json +11 -11
  179. package/node_modules/@turf/clean-coords/dist/cjs/index.cjs +4 -8
  180. package/node_modules/@turf/clean-coords/dist/cjs/index.cjs.map +1 -1
  181. package/node_modules/@turf/clean-coords/dist/cjs/index.d.cts +1 -1
  182. package/node_modules/@turf/clean-coords/dist/esm/index.d.ts +1 -1
  183. package/node_modules/@turf/clean-coords/dist/esm/index.js +4 -8
  184. package/node_modules/@turf/clean-coords/dist/esm/index.js.map +1 -1
  185. package/node_modules/@turf/clean-coords/package.json +11 -11
  186. package/node_modules/@turf/clone/dist/cjs/index.cjs.map +1 -1
  187. package/node_modules/@turf/clone/dist/cjs/index.d.cts +1 -1
  188. package/node_modules/@turf/clone/dist/esm/index.d.ts +1 -1
  189. package/node_modules/@turf/clone/dist/esm/index.js.map +1 -1
  190. package/node_modules/@turf/clone/package.json +10 -10
  191. package/node_modules/@turf/clusters/README.md +8 -2
  192. package/node_modules/@turf/clusters/dist/cjs/index.cjs +9 -18
  193. package/node_modules/@turf/clusters/dist/cjs/index.cjs.map +1 -1
  194. package/node_modules/@turf/clusters/dist/cjs/index.d.cts +9 -8
  195. package/node_modules/@turf/clusters/dist/esm/index.d.ts +9 -8
  196. package/node_modules/@turf/clusters/dist/esm/index.js +9 -18
  197. package/node_modules/@turf/clusters/dist/esm/index.js.map +1 -1
  198. package/node_modules/@turf/clusters/package.json +10 -10
  199. package/node_modules/@turf/clusters-dbscan/README.md +38 -15
  200. package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs +2 -4
  201. package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs.map +1 -1
  202. package/node_modules/@turf/clusters-dbscan/dist/cjs/index.d.cts +16 -3
  203. package/node_modules/@turf/clusters-dbscan/dist/esm/index.d.ts +16 -3
  204. package/node_modules/@turf/clusters-dbscan/dist/esm/index.js +2 -4
  205. package/node_modules/@turf/clusters-dbscan/dist/esm/index.js.map +1 -1
  206. package/node_modules/@turf/clusters-dbscan/package.json +14 -14
  207. package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs +2 -4
  208. package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs.map +1 -1
  209. package/node_modules/@turf/clusters-kmeans/dist/cjs/index.d.cts +1 -1
  210. package/node_modules/@turf/clusters-kmeans/dist/esm/index.d.ts +1 -1
  211. package/node_modules/@turf/clusters-kmeans/dist/esm/index.js +2 -4
  212. package/node_modules/@turf/clusters-kmeans/dist/esm/index.js.map +1 -1
  213. package/node_modules/@turf/clusters-kmeans/package.json +15 -15
  214. package/node_modules/@turf/collect/dist/cjs/index.cjs.map +1 -1
  215. package/node_modules/@turf/collect/dist/cjs/index.d.cts +1 -1
  216. package/node_modules/@turf/collect/dist/esm/index.d.ts +1 -1
  217. package/node_modules/@turf/collect/dist/esm/index.js.map +1 -1
  218. package/node_modules/@turf/collect/package.json +11 -11
  219. package/node_modules/@turf/combine/dist/cjs/index.cjs.map +1 -1
  220. package/node_modules/@turf/combine/dist/cjs/index.d.cts +1 -1
  221. package/node_modules/@turf/combine/dist/esm/index.d.ts +1 -1
  222. package/node_modules/@turf/combine/dist/esm/index.js.map +1 -1
  223. package/node_modules/@turf/combine/package.json +10 -10
  224. package/node_modules/@turf/concave/dist/cjs/index.cjs.map +1 -1
  225. package/node_modules/@turf/concave/dist/cjs/index.d.cts +1 -1
  226. package/node_modules/@turf/concave/dist/esm/index.d.ts +1 -1
  227. package/node_modules/@turf/concave/dist/esm/index.js.map +1 -1
  228. package/node_modules/@turf/concave/package.json +14 -14
  229. package/node_modules/@turf/convex/dist/cjs/index.cjs.map +1 -1
  230. package/node_modules/@turf/convex/dist/cjs/index.d.cts +1 -1
  231. package/node_modules/@turf/convex/dist/esm/index.d.ts +1 -1
  232. package/node_modules/@turf/convex/dist/esm/index.js.map +1 -1
  233. package/node_modules/@turf/convex/package.json +10 -10
  234. package/node_modules/@turf/destination/dist/cjs/index.cjs.map +1 -1
  235. package/node_modules/@turf/destination/dist/cjs/index.d.cts +1 -1
  236. package/node_modules/@turf/destination/dist/esm/index.d.ts +1 -1
  237. package/node_modules/@turf/destination/dist/esm/index.js.map +1 -1
  238. package/node_modules/@turf/destination/package.json +11 -11
  239. package/node_modules/@turf/difference/dist/cjs/index.cjs +8 -10
  240. package/node_modules/@turf/difference/dist/cjs/index.cjs.map +1 -1
  241. package/node_modules/@turf/difference/dist/cjs/index.d.cts +1 -1
  242. package/node_modules/@turf/difference/dist/esm/index.d.ts +1 -1
  243. package/node_modules/@turf/difference/dist/esm/index.js +7 -9
  244. package/node_modules/@turf/difference/dist/esm/index.js.map +1 -1
  245. package/node_modules/@turf/difference/package.json +11 -11
  246. package/node_modules/@turf/dissolve/README.md +11 -12
  247. package/node_modules/@turf/dissolve/dist/cjs/index.cjs +5 -6
  248. package/node_modules/@turf/dissolve/dist/cjs/index.cjs.map +1 -1
  249. package/node_modules/@turf/dissolve/dist/cjs/index.d.cts +3 -3
  250. package/node_modules/@turf/dissolve/dist/esm/index.d.ts +3 -3
  251. package/node_modules/@turf/dissolve/dist/esm/index.js +4 -5
  252. package/node_modules/@turf/dissolve/dist/esm/index.js.map +1 -1
  253. package/node_modules/@turf/dissolve/package.json +13 -13
  254. package/node_modules/@turf/distance/dist/cjs/index.cjs.map +1 -1
  255. package/node_modules/@turf/distance/dist/cjs/index.d.cts +1 -1
  256. package/node_modules/@turf/distance/dist/esm/index.d.ts +1 -1
  257. package/node_modules/@turf/distance/dist/esm/index.js.map +1 -1
  258. package/node_modules/@turf/distance/package.json +10 -10
  259. package/node_modules/@turf/distance-weight/dist/cjs/index.cjs.map +1 -1
  260. package/node_modules/@turf/distance-weight/dist/cjs/index.d.cts +3 -1
  261. package/node_modules/@turf/distance-weight/dist/esm/index.d.ts +3 -1
  262. package/node_modules/@turf/distance-weight/dist/esm/index.js.map +1 -1
  263. package/node_modules/@turf/distance-weight/package.json +12 -12
  264. package/node_modules/@turf/ellipse/dist/cjs/index.cjs +8 -16
  265. package/node_modules/@turf/ellipse/dist/cjs/index.cjs.map +1 -1
  266. package/node_modules/@turf/ellipse/dist/esm/index.js +8 -16
  267. package/node_modules/@turf/ellipse/dist/esm/index.js.map +1 -1
  268. package/node_modules/@turf/ellipse/package.json +16 -16
  269. package/node_modules/@turf/envelope/dist/cjs/index.cjs.map +1 -1
  270. package/node_modules/@turf/envelope/dist/cjs/index.d.cts +1 -1
  271. package/node_modules/@turf/envelope/dist/esm/index.d.ts +1 -1
  272. package/node_modules/@turf/envelope/dist/esm/index.js.map +1 -1
  273. package/node_modules/@turf/envelope/package.json +11 -11
  274. package/node_modules/@turf/explode/dist/cjs/index.cjs.map +1 -1
  275. package/node_modules/@turf/explode/dist/cjs/index.d.cts +1 -1
  276. package/node_modules/@turf/explode/dist/esm/index.d.ts +1 -1
  277. package/node_modules/@turf/explode/dist/esm/index.js.map +1 -1
  278. package/node_modules/@turf/explode/package.json +10 -10
  279. package/node_modules/@turf/flatten/dist/cjs/index.cjs +1 -2
  280. package/node_modules/@turf/flatten/dist/cjs/index.cjs.map +1 -1
  281. package/node_modules/@turf/flatten/dist/cjs/index.d.cts +1 -1
  282. package/node_modules/@turf/flatten/dist/esm/index.d.ts +1 -1
  283. package/node_modules/@turf/flatten/dist/esm/index.js +1 -2
  284. package/node_modules/@turf/flatten/dist/esm/index.js.map +1 -1
  285. package/node_modules/@turf/flatten/package.json +10 -10
  286. package/node_modules/@turf/flip/dist/cjs/index.cjs +3 -6
  287. package/node_modules/@turf/flip/dist/cjs/index.cjs.map +1 -1
  288. package/node_modules/@turf/flip/dist/cjs/index.d.cts +1 -1
  289. package/node_modules/@turf/flip/dist/esm/index.d.ts +1 -1
  290. package/node_modules/@turf/flip/dist/esm/index.js +3 -6
  291. package/node_modules/@turf/flip/dist/esm/index.js.map +1 -1
  292. package/node_modules/@turf/flip/package.json +11 -11
  293. package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs +9 -18
  294. package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs.map +1 -1
  295. package/node_modules/@turf/geojson-rbush/dist/esm/index.js +9 -18
  296. package/node_modules/@turf/geojson-rbush/dist/esm/index.js.map +1 -1
  297. package/node_modules/@turf/geojson-rbush/package.json +11 -11
  298. package/node_modules/@turf/great-circle/README.md +2 -1
  299. package/node_modules/@turf/great-circle/dist/cjs/index.cjs +7 -2
  300. package/node_modules/@turf/great-circle/dist/cjs/index.cjs.map +1 -1
  301. package/node_modules/@turf/great-circle/dist/esm/index.js +7 -2
  302. package/node_modules/@turf/great-circle/dist/esm/index.js.map +1 -1
  303. package/node_modules/@turf/great-circle/package.json +9 -9
  304. package/node_modules/@turf/helpers/README.md +199 -154
  305. package/node_modules/@turf/helpers/dist/cjs/index.cjs +10 -7
  306. package/node_modules/@turf/helpers/dist/cjs/index.cjs.map +1 -1
  307. package/node_modules/@turf/helpers/dist/cjs/index.d.cts +149 -110
  308. package/node_modules/@turf/helpers/dist/esm/index.d.ts +149 -110
  309. package/node_modules/@turf/helpers/dist/esm/index.js +10 -7
  310. package/node_modules/@turf/helpers/dist/esm/index.js.map +1 -1
  311. package/node_modules/@turf/helpers/package.json +8 -8
  312. package/node_modules/@turf/hex-grid/dist/cjs/index.cjs +2 -4
  313. package/node_modules/@turf/hex-grid/dist/cjs/index.cjs.map +1 -1
  314. package/node_modules/@turf/hex-grid/dist/cjs/index.d.cts +1 -1
  315. package/node_modules/@turf/hex-grid/dist/esm/index.d.ts +1 -1
  316. package/node_modules/@turf/hex-grid/dist/esm/index.js +2 -4
  317. package/node_modules/@turf/hex-grid/dist/esm/index.js.map +1 -1
  318. package/node_modules/@turf/hex-grid/package.json +14 -14
  319. package/node_modules/@turf/interpolate/README.md +5 -2
  320. package/node_modules/@turf/interpolate/dist/cjs/index.cjs +10 -15
  321. package/node_modules/@turf/interpolate/dist/cjs/index.cjs.map +1 -1
  322. package/node_modules/@turf/interpolate/dist/cjs/index.d.cts +3 -1
  323. package/node_modules/@turf/interpolate/dist/esm/index.d.ts +3 -1
  324. package/node_modules/@turf/interpolate/dist/esm/index.js +11 -16
  325. package/node_modules/@turf/interpolate/dist/esm/index.js.map +1 -1
  326. package/node_modules/@turf/interpolate/package.json +18 -18
  327. package/node_modules/@turf/intersect/dist/cjs/index.cjs +7 -11
  328. package/node_modules/@turf/intersect/dist/cjs/index.cjs.map +1 -1
  329. package/node_modules/@turf/intersect/dist/cjs/index.d.cts +1 -1
  330. package/node_modules/@turf/intersect/dist/esm/index.d.ts +1 -1
  331. package/node_modules/@turf/intersect/dist/esm/index.js +6 -10
  332. package/node_modules/@turf/intersect/dist/esm/index.js.map +1 -1
  333. package/node_modules/@turf/intersect/package.json +11 -11
  334. package/node_modules/@turf/invariant/README.md +4 -0
  335. package/node_modules/@turf/invariant/dist/cjs/index.cjs.map +1 -1
  336. package/node_modules/@turf/invariant/dist/cjs/index.d.cts +6 -6
  337. package/node_modules/@turf/invariant/dist/esm/index.d.ts +6 -6
  338. package/node_modules/@turf/invariant/dist/esm/index.js.map +1 -1
  339. package/node_modules/@turf/invariant/package.json +9 -9
  340. package/node_modules/@turf/isobands/dist/cjs/index.cjs +10 -20
  341. package/node_modules/@turf/isobands/dist/cjs/index.cjs.map +1 -1
  342. package/node_modules/@turf/isobands/dist/cjs/index.d.cts +1 -1
  343. package/node_modules/@turf/isobands/dist/esm/index.d.ts +1 -1
  344. package/node_modules/@turf/isobands/dist/esm/index.js +10 -20
  345. package/node_modules/@turf/isobands/dist/esm/index.js.map +1 -1
  346. package/node_modules/@turf/isobands/package.json +20 -20
  347. package/node_modules/@turf/isolines/dist/cjs/index.cjs +10 -20
  348. package/node_modules/@turf/isolines/dist/cjs/index.cjs.map +1 -1
  349. package/node_modules/@turf/isolines/dist/cjs/index.d.cts +1 -1
  350. package/node_modules/@turf/isolines/dist/esm/index.d.ts +1 -1
  351. package/node_modules/@turf/isolines/dist/esm/index.js +10 -20
  352. package/node_modules/@turf/isolines/dist/esm/index.js.map +1 -1
  353. package/node_modules/@turf/isolines/package.json +17 -17
  354. package/node_modules/@turf/kinks/dist/cjs/index.cjs.map +1 -1
  355. package/node_modules/@turf/kinks/dist/cjs/index.d.cts +1 -1
  356. package/node_modules/@turf/kinks/dist/esm/index.d.ts +1 -1
  357. package/node_modules/@turf/kinks/dist/esm/index.js.map +1 -1
  358. package/node_modules/@turf/kinks/package.json +10 -10
  359. package/node_modules/@turf/length/dist/cjs/index.cjs.map +1 -1
  360. package/node_modules/@turf/length/dist/cjs/index.d.cts +1 -1
  361. package/node_modules/@turf/length/dist/esm/index.d.ts +1 -1
  362. package/node_modules/@turf/length/dist/esm/index.js.map +1 -1
  363. package/node_modules/@turf/length/package.json +11 -11
  364. package/node_modules/@turf/line-arc/dist/cjs/index.cjs.map +1 -1
  365. package/node_modules/@turf/line-arc/dist/cjs/index.d.cts +1 -1
  366. package/node_modules/@turf/line-arc/dist/esm/index.d.ts +1 -1
  367. package/node_modules/@turf/line-arc/dist/esm/index.js.map +1 -1
  368. package/node_modules/@turf/line-arc/package.json +12 -12
  369. package/node_modules/@turf/line-chunk/dist/cjs/index.cjs +3 -6
  370. package/node_modules/@turf/line-chunk/dist/cjs/index.cjs.map +1 -1
  371. package/node_modules/@turf/line-chunk/dist/esm/index.js +3 -6
  372. package/node_modules/@turf/line-chunk/dist/esm/index.js.map +1 -1
  373. package/node_modules/@turf/line-chunk/package.json +11 -11
  374. package/node_modules/@turf/line-intersect/README.md +1 -1
  375. package/node_modules/@turf/line-intersect/dist/cjs/index.cjs +3 -5
  376. package/node_modules/@turf/line-intersect/dist/cjs/index.cjs.map +1 -1
  377. package/node_modules/@turf/line-intersect/dist/cjs/index.d.cts +2 -2
  378. package/node_modules/@turf/line-intersect/dist/esm/index.d.ts +2 -2
  379. package/node_modules/@turf/line-intersect/dist/esm/index.js +3 -5
  380. package/node_modules/@turf/line-intersect/dist/esm/index.js.map +1 -1
  381. package/node_modules/@turf/line-intersect/package.json +10 -10
  382. package/node_modules/@turf/line-offset/dist/cjs/index.cjs +3 -6
  383. package/node_modules/@turf/line-offset/dist/cjs/index.cjs.map +1 -1
  384. package/node_modules/@turf/line-offset/dist/esm/index.js +3 -6
  385. package/node_modules/@turf/line-offset/dist/esm/index.js.map +1 -1
  386. package/node_modules/@turf/line-offset/package.json +10 -10
  387. package/node_modules/@turf/line-overlap/dist/cjs/index.cjs +10 -20
  388. package/node_modules/@turf/line-overlap/dist/cjs/index.cjs.map +1 -1
  389. package/node_modules/@turf/line-overlap/dist/cjs/index.d.cts +1 -1
  390. package/node_modules/@turf/line-overlap/dist/esm/index.d.ts +1 -1
  391. package/node_modules/@turf/line-overlap/dist/esm/index.js +10 -20
  392. package/node_modules/@turf/line-overlap/dist/esm/index.js.map +1 -1
  393. package/node_modules/@turf/line-overlap/package.json +15 -15
  394. package/node_modules/@turf/line-segment/dist/cjs/index.cjs.map +1 -1
  395. package/node_modules/@turf/line-segment/dist/cjs/index.d.cts +1 -1
  396. package/node_modules/@turf/line-segment/dist/esm/index.d.ts +1 -1
  397. package/node_modules/@turf/line-segment/dist/esm/index.js.map +1 -1
  398. package/node_modules/@turf/line-segment/package.json +11 -11
  399. package/node_modules/@turf/line-slice/dist/cjs/index.cjs.map +1 -1
  400. package/node_modules/@turf/line-slice/dist/esm/index.js.map +1 -1
  401. package/node_modules/@turf/line-slice/package.json +10 -10
  402. package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs +5 -10
  403. package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs.map +1 -1
  404. package/node_modules/@turf/line-slice-along/dist/esm/index.js +5 -10
  405. package/node_modules/@turf/line-slice-along/dist/esm/index.js.map +1 -1
  406. package/node_modules/@turf/line-slice-along/package.json +12 -12
  407. package/node_modules/@turf/line-split/dist/cjs/index.cjs +7 -14
  408. package/node_modules/@turf/line-split/dist/cjs/index.cjs.map +1 -1
  409. package/node_modules/@turf/line-split/dist/esm/index.js +7 -14
  410. package/node_modules/@turf/line-split/dist/esm/index.js.map +1 -1
  411. package/node_modules/@turf/line-split/package.json +16 -16
  412. package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs +4 -8
  413. package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs.map +1 -1
  414. package/node_modules/@turf/line-to-polygon/dist/cjs/index.d.cts +1 -1
  415. package/node_modules/@turf/line-to-polygon/dist/esm/index.d.ts +1 -1
  416. package/node_modules/@turf/line-to-polygon/dist/esm/index.js +4 -8
  417. package/node_modules/@turf/line-to-polygon/dist/esm/index.js.map +1 -1
  418. package/node_modules/@turf/line-to-polygon/package.json +12 -12
  419. package/node_modules/@turf/mask/dist/cjs/index.cjs +7 -7
  420. package/node_modules/@turf/mask/dist/cjs/index.cjs.map +1 -1
  421. package/node_modules/@turf/mask/dist/cjs/index.d.cts +1 -1
  422. package/node_modules/@turf/mask/dist/esm/index.d.ts +1 -1
  423. package/node_modules/@turf/mask/dist/esm/index.js +6 -6
  424. package/node_modules/@turf/mask/dist/esm/index.js.map +1 -1
  425. package/node_modules/@turf/mask/package.json +11 -11
  426. package/node_modules/@turf/meta/README.md +145 -93
  427. package/node_modules/@turf/meta/dist/cjs/index.cjs +22 -44
  428. package/node_modules/@turf/meta/dist/cjs/index.cjs.map +1 -1
  429. package/node_modules/@turf/meta/dist/esm/index.js +22 -44
  430. package/node_modules/@turf/meta/dist/esm/index.js.map +1 -1
  431. package/node_modules/@turf/meta/package.json +7 -7
  432. package/node_modules/@turf/midpoint/dist/cjs/index.cjs.map +1 -1
  433. package/node_modules/@turf/midpoint/dist/cjs/index.d.cts +1 -1
  434. package/node_modules/@turf/midpoint/dist/esm/index.d.ts +1 -1
  435. package/node_modules/@turf/midpoint/dist/esm/index.js.map +1 -1
  436. package/node_modules/@turf/midpoint/package.json +12 -12
  437. package/node_modules/@turf/moran-index/README.md +25 -47
  438. package/node_modules/@turf/moran-index/dist/cjs/index.cjs.map +1 -1
  439. package/node_modules/@turf/moran-index/dist/cjs/index.d.cts +16 -8
  440. package/node_modules/@turf/moran-index/dist/esm/index.d.ts +16 -8
  441. package/node_modules/@turf/moran-index/dist/esm/index.js.map +1 -1
  442. package/node_modules/@turf/moran-index/package.json +11 -11
  443. package/node_modules/@turf/nearest-neighbor-analysis/README.md +50 -21
  444. package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.cjs.map +1 -1
  445. package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.d.cts +25 -6
  446. package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.d.ts +25 -6
  447. package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js.map +1 -1
  448. package/node_modules/@turf/nearest-neighbor-analysis/package.json +17 -17
  449. package/node_modules/@turf/nearest-point/dist/cjs/index.cjs +2 -4
  450. package/node_modules/@turf/nearest-point/dist/cjs/index.cjs.map +1 -1
  451. package/node_modules/@turf/nearest-point/dist/cjs/index.d.cts +1 -1
  452. package/node_modules/@turf/nearest-point/dist/esm/index.d.ts +1 -1
  453. package/node_modules/@turf/nearest-point/dist/esm/index.js +2 -4
  454. package/node_modules/@turf/nearest-point/dist/esm/index.js.map +1 -1
  455. package/node_modules/@turf/nearest-point/package.json +12 -12
  456. package/node_modules/@turf/nearest-point-on-line/README.md +9 -9
  457. package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs +97 -53
  458. package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs.map +1 -1
  459. package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.d.cts +2 -2
  460. package/node_modules/@turf/nearest-point-on-line/dist/esm/index.d.ts +2 -2
  461. package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js +99 -55
  462. package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js.map +1 -1
  463. package/node_modules/@turf/nearest-point-on-line/package.json +15 -18
  464. package/node_modules/@turf/nearest-point-to-line/README.md +1 -9
  465. package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.cjs.map +1 -1
  466. package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.d.cts +1 -1
  467. package/node_modules/@turf/nearest-point-to-line/dist/esm/index.d.ts +1 -1
  468. package/node_modules/@turf/nearest-point-to-line/dist/esm/index.js.map +1 -1
  469. package/node_modules/@turf/nearest-point-to-line/package.json +14 -14
  470. package/node_modules/@turf/planepoint/dist/cjs/index.cjs.map +1 -1
  471. package/node_modules/@turf/planepoint/dist/cjs/index.d.cts +1 -1
  472. package/node_modules/@turf/planepoint/dist/esm/index.d.ts +1 -1
  473. package/node_modules/@turf/planepoint/dist/esm/index.js.map +1 -1
  474. package/node_modules/@turf/planepoint/package.json +10 -10
  475. package/node_modules/@turf/point-grid/dist/cjs/index.cjs +2 -4
  476. package/node_modules/@turf/point-grid/dist/cjs/index.cjs.map +1 -1
  477. package/node_modules/@turf/point-grid/dist/cjs/index.d.cts +1 -1
  478. package/node_modules/@turf/point-grid/dist/esm/index.d.ts +1 -1
  479. package/node_modules/@turf/point-grid/dist/esm/index.js +2 -4
  480. package/node_modules/@turf/point-grid/dist/esm/index.js.map +1 -1
  481. package/node_modules/@turf/point-grid/package.json +14 -14
  482. package/node_modules/@turf/point-on-feature/dist/cjs/index.cjs.map +1 -1
  483. package/node_modules/@turf/point-on-feature/dist/cjs/index.d.cts +1 -1
  484. package/node_modules/@turf/point-on-feature/dist/esm/index.d.ts +1 -1
  485. package/node_modules/@turf/point-on-feature/dist/esm/index.js.map +1 -1
  486. package/node_modules/@turf/point-on-feature/package.json +15 -15
  487. package/node_modules/@turf/point-to-line-distance/README.md +10 -10
  488. package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs +21 -19
  489. package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs.map +1 -1
  490. package/node_modules/@turf/point-to-line-distance/dist/cjs/index.d.cts +3 -3
  491. package/node_modules/@turf/point-to-line-distance/dist/esm/index.d.ts +3 -3
  492. package/node_modules/@turf/point-to-line-distance/dist/esm/index.js +22 -20
  493. package/node_modules/@turf/point-to-line-distance/dist/esm/index.js.map +1 -1
  494. package/node_modules/@turf/point-to-line-distance/package.json +18 -17
  495. package/node_modules/@turf/point-to-polygon-distance/LICENSE +20 -0
  496. package/node_modules/@turf/point-to-polygon-distance/README.md +61 -0
  497. package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs +49 -0
  498. package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs.map +1 -0
  499. package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.d.cts +23 -0
  500. package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.d.ts +23 -0
  501. package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js +49 -0
  502. package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js.map +1 -0
  503. package/node_modules/@turf/point-to-polygon-distance/package.json +80 -0
  504. package/node_modules/@turf/points-within-polygon/dist/cjs/index.cjs.map +1 -1
  505. package/node_modules/@turf/points-within-polygon/dist/cjs/index.d.cts +1 -1
  506. package/node_modules/@turf/points-within-polygon/dist/esm/index.d.ts +1 -1
  507. package/node_modules/@turf/points-within-polygon/dist/esm/index.js.map +1 -1
  508. package/node_modules/@turf/points-within-polygon/package.json +11 -11
  509. package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs +1 -2
  510. package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs.map +1 -1
  511. package/node_modules/@turf/polygon-smooth/dist/cjs/index.d.cts +1 -1
  512. package/node_modules/@turf/polygon-smooth/dist/esm/index.d.ts +1 -1
  513. package/node_modules/@turf/polygon-smooth/dist/esm/index.js +1 -2
  514. package/node_modules/@turf/polygon-smooth/dist/esm/index.js.map +1 -1
  515. package/node_modules/@turf/polygon-smooth/package.json +10 -10
  516. package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs +1 -2
  517. package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs.map +1 -1
  518. package/node_modules/@turf/polygon-tangents/dist/cjs/index.d.cts +1 -1
  519. package/node_modules/@turf/polygon-tangents/dist/esm/index.d.ts +1 -1
  520. package/node_modules/@turf/polygon-tangents/dist/esm/index.js +1 -2
  521. package/node_modules/@turf/polygon-tangents/dist/esm/index.js.map +1 -1
  522. package/node_modules/@turf/polygon-tangents/package.json +14 -14
  523. package/node_modules/@turf/polygon-to-line/dist/cjs/index.cjs.map +1 -1
  524. package/node_modules/@turf/polygon-to-line/dist/cjs/index.d.cts +1 -1
  525. package/node_modules/@turf/polygon-to-line/dist/esm/index.d.ts +1 -1
  526. package/node_modules/@turf/polygon-to-line/dist/esm/index.js.map +1 -1
  527. package/node_modules/@turf/polygon-to-line/package.json +10 -10
  528. package/node_modules/@turf/polygonize/dist/cjs/index.cjs +20 -40
  529. package/node_modules/@turf/polygonize/dist/cjs/index.cjs.map +1 -1
  530. package/node_modules/@turf/polygonize/dist/cjs/index.d.cts +1 -1
  531. package/node_modules/@turf/polygonize/dist/esm/index.d.ts +1 -1
  532. package/node_modules/@turf/polygonize/dist/esm/index.js +20 -40
  533. package/node_modules/@turf/polygonize/dist/esm/index.js.map +1 -1
  534. package/node_modules/@turf/polygonize/package.json +13 -13
  535. package/node_modules/@turf/projection/README.md +2 -2
  536. package/node_modules/@turf/projection/dist/cjs/index.cjs +6 -12
  537. package/node_modules/@turf/projection/dist/cjs/index.cjs.map +1 -1
  538. package/node_modules/@turf/projection/dist/cjs/index.d.cts +2 -2
  539. package/node_modules/@turf/projection/dist/esm/index.d.ts +2 -2
  540. package/node_modules/@turf/projection/dist/esm/index.js +6 -12
  541. package/node_modules/@turf/projection/dist/esm/index.js.map +1 -1
  542. package/node_modules/@turf/projection/package.json +12 -12
  543. package/node_modules/@turf/quadrat-analysis/README.md +10 -10
  544. package/node_modules/@turf/quadrat-analysis/dist/cjs/index.cjs.map +1 -1
  545. package/node_modules/@turf/quadrat-analysis/dist/cjs/index.d.cts +4 -4
  546. package/node_modules/@turf/quadrat-analysis/dist/esm/index.d.ts +4 -4
  547. package/node_modules/@turf/quadrat-analysis/dist/esm/index.js.map +1 -1
  548. package/node_modules/@turf/quadrat-analysis/package.json +18 -18
  549. package/node_modules/@turf/random/README.md +27 -29
  550. package/node_modules/@turf/random/dist/cjs/index.cjs +1 -3
  551. package/node_modules/@turf/random/dist/cjs/index.cjs.map +1 -1
  552. package/node_modules/@turf/random/dist/cjs/index.d.cts +11 -11
  553. package/node_modules/@turf/random/dist/esm/index.d.ts +11 -11
  554. package/node_modules/@turf/random/dist/esm/index.js +1 -3
  555. package/node_modules/@turf/random/dist/esm/index.js.map +1 -1
  556. package/node_modules/@turf/random/package.json +9 -9
  557. package/node_modules/@turf/rectangle-grid/dist/cjs/index.cjs.map +1 -1
  558. package/node_modules/@turf/rectangle-grid/dist/cjs/index.d.cts +1 -1
  559. package/node_modules/@turf/rectangle-grid/dist/esm/index.d.ts +1 -1
  560. package/node_modules/@turf/rectangle-grid/dist/esm/index.js.map +1 -1
  561. package/node_modules/@turf/rectangle-grid/package.json +13 -13
  562. package/node_modules/@turf/rewind/dist/cjs/index.cjs +3 -6
  563. package/node_modules/@turf/rewind/dist/cjs/index.cjs.map +1 -1
  564. package/node_modules/@turf/rewind/dist/cjs/index.d.cts +1 -1
  565. package/node_modules/@turf/rewind/dist/esm/index.d.ts +1 -1
  566. package/node_modules/@turf/rewind/dist/esm/index.js +3 -6
  567. package/node_modules/@turf/rewind/dist/esm/index.js.map +1 -1
  568. package/node_modules/@turf/rewind/package.json +13 -13
  569. package/node_modules/@turf/rhumb-bearing/README.md +1 -1
  570. package/node_modules/@turf/rhumb-bearing/dist/cjs/index.cjs.map +1 -1
  571. package/node_modules/@turf/rhumb-bearing/dist/cjs/index.d.cts +1 -1
  572. package/node_modules/@turf/rhumb-bearing/dist/esm/index.d.ts +1 -1
  573. package/node_modules/@turf/rhumb-bearing/dist/esm/index.js.map +1 -1
  574. package/node_modules/@turf/rhumb-bearing/package.json +11 -11
  575. package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs +1 -2
  576. package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs.map +1 -1
  577. package/node_modules/@turf/rhumb-destination/dist/cjs/index.d.cts +1 -1
  578. package/node_modules/@turf/rhumb-destination/dist/esm/index.d.ts +1 -1
  579. package/node_modules/@turf/rhumb-destination/dist/esm/index.js +1 -2
  580. package/node_modules/@turf/rhumb-destination/dist/esm/index.js.map +1 -1
  581. package/node_modules/@turf/rhumb-destination/package.json +11 -11
  582. package/node_modules/@turf/rhumb-distance/README.md +1 -1
  583. package/node_modules/@turf/rhumb-distance/dist/cjs/index.cjs.map +1 -1
  584. package/node_modules/@turf/rhumb-distance/dist/cjs/index.d.cts +1 -1
  585. package/node_modules/@turf/rhumb-distance/dist/esm/index.d.ts +1 -1
  586. package/node_modules/@turf/rhumb-distance/dist/esm/index.js.map +1 -1
  587. package/node_modules/@turf/rhumb-distance/package.json +11 -11
  588. package/node_modules/@turf/sample/README.md +2 -1
  589. package/node_modules/@turf/sample/dist/cjs/index.cjs +3 -6
  590. package/node_modules/@turf/sample/dist/cjs/index.cjs.map +1 -1
  591. package/node_modules/@turf/sample/dist/cjs/index.d.cts +1 -1
  592. package/node_modules/@turf/sample/dist/esm/index.d.ts +1 -1
  593. package/node_modules/@turf/sample/dist/esm/index.js +3 -6
  594. package/node_modules/@turf/sample/dist/esm/index.js.map +1 -1
  595. package/node_modules/@turf/sample/package.json +9 -9
  596. package/node_modules/@turf/sector/dist/cjs/index.cjs +4 -8
  597. package/node_modules/@turf/sector/dist/cjs/index.cjs.map +1 -1
  598. package/node_modules/@turf/sector/dist/cjs/index.d.cts +1 -1
  599. package/node_modules/@turf/sector/dist/esm/index.d.ts +1 -1
  600. package/node_modules/@turf/sector/dist/esm/index.js +4 -8
  601. package/node_modules/@turf/sector/dist/esm/index.js.map +1 -1
  602. package/node_modules/@turf/sector/package.json +14 -14
  603. package/node_modules/@turf/shortest-path/README.md +13 -19
  604. package/node_modules/@turf/shortest-path/dist/cjs/index.cjs +3 -6
  605. package/node_modules/@turf/shortest-path/dist/cjs/index.cjs.map +1 -1
  606. package/node_modules/@turf/shortest-path/dist/cjs/index.d.cts +5 -5
  607. package/node_modules/@turf/shortest-path/dist/esm/index.d.ts +5 -5
  608. package/node_modules/@turf/shortest-path/dist/esm/index.js +3 -6
  609. package/node_modules/@turf/shortest-path/dist/esm/index.js.map +1 -1
  610. package/node_modules/@turf/shortest-path/package.json +18 -18
  611. package/node_modules/@turf/simplify/dist/cjs/index.cjs +8 -16
  612. package/node_modules/@turf/simplify/dist/cjs/index.cjs.map +1 -1
  613. package/node_modules/@turf/simplify/dist/cjs/index.d.cts +1 -1
  614. package/node_modules/@turf/simplify/dist/esm/index.d.ts +1 -1
  615. package/node_modules/@turf/simplify/dist/esm/index.js +8 -16
  616. package/node_modules/@turf/simplify/dist/esm/index.js.map +1 -1
  617. package/node_modules/@turf/simplify/package.json +13 -13
  618. package/node_modules/@turf/square/dist/cjs/index.cjs.map +1 -1
  619. package/node_modules/@turf/square/dist/cjs/index.d.cts +1 -1
  620. package/node_modules/@turf/square/dist/esm/index.d.ts +1 -1
  621. package/node_modules/@turf/square/dist/esm/index.js.map +1 -1
  622. package/node_modules/@turf/square/package.json +10 -10
  623. package/node_modules/@turf/square-grid/dist/cjs/index.cjs.map +1 -1
  624. package/node_modules/@turf/square-grid/dist/cjs/index.d.cts +1 -1
  625. package/node_modules/@turf/square-grid/dist/esm/index.d.ts +1 -1
  626. package/node_modules/@turf/square-grid/dist/esm/index.js.map +1 -1
  627. package/node_modules/@turf/square-grid/package.json +12 -12
  628. package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.cjs +3 -6
  629. package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.cjs.map +1 -1
  630. package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.d.cts +1 -1
  631. package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.d.ts +1 -1
  632. package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.js +3 -6
  633. package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.js.map +1 -1
  634. package/node_modules/@turf/standard-deviational-ellipse/package.json +16 -16
  635. package/node_modules/@turf/tag/dist/cjs/index.cjs +1 -2
  636. package/node_modules/@turf/tag/dist/cjs/index.cjs.map +1 -1
  637. package/node_modules/@turf/tag/dist/cjs/index.d.cts +1 -1
  638. package/node_modules/@turf/tag/dist/esm/index.d.ts +1 -1
  639. package/node_modules/@turf/tag/dist/esm/index.js +1 -2
  640. package/node_modules/@turf/tag/dist/esm/index.js.map +1 -1
  641. package/node_modules/@turf/tag/package.json +12 -12
  642. package/node_modules/@turf/tesselate/dist/cjs/index.cjs +1 -2
  643. package/node_modules/@turf/tesselate/dist/cjs/index.cjs.map +1 -1
  644. package/node_modules/@turf/tesselate/dist/cjs/index.d.cts +1 -1
  645. package/node_modules/@turf/tesselate/dist/esm/index.d.ts +1 -1
  646. package/node_modules/@turf/tesselate/dist/esm/index.js +1 -2
  647. package/node_modules/@turf/tesselate/dist/esm/index.js.map +1 -1
  648. package/node_modules/@turf/tesselate/package.json +9 -9
  649. package/node_modules/@turf/tin/dist/cjs/index.cjs +13 -14
  650. package/node_modules/@turf/tin/dist/cjs/index.cjs.map +1 -1
  651. package/node_modules/@turf/tin/dist/cjs/index.d.cts +1 -1
  652. package/node_modules/@turf/tin/dist/esm/index.d.ts +1 -1
  653. package/node_modules/@turf/tin/dist/esm/index.js +13 -14
  654. package/node_modules/@turf/tin/dist/esm/index.js.map +1 -1
  655. package/node_modules/@turf/tin/package.json +9 -9
  656. package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs +4 -8
  657. package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs.map +1 -1
  658. package/node_modules/@turf/transform-rotate/dist/cjs/index.d.cts +1 -1
  659. package/node_modules/@turf/transform-rotate/dist/esm/index.d.ts +1 -1
  660. package/node_modules/@turf/transform-rotate/dist/esm/index.js +4 -8
  661. package/node_modules/@turf/transform-rotate/dist/esm/index.js.map +1 -1
  662. package/node_modules/@turf/transform-rotate/package.json +17 -17
  663. package/node_modules/@turf/transform-scale/dist/cjs/index.cjs +18 -12
  664. package/node_modules/@turf/transform-scale/dist/cjs/index.cjs.map +1 -1
  665. package/node_modules/@turf/transform-scale/dist/cjs/index.d.cts +1 -1
  666. package/node_modules/@turf/transform-scale/dist/esm/index.d.ts +1 -1
  667. package/node_modules/@turf/transform-scale/dist/esm/index.js +18 -12
  668. package/node_modules/@turf/transform-scale/dist/esm/index.js.map +1 -1
  669. package/node_modules/@turf/transform-scale/package.json +21 -21
  670. package/node_modules/@turf/transform-translate/dist/cjs/index.cjs +4 -8
  671. package/node_modules/@turf/transform-translate/dist/cjs/index.cjs.map +1 -1
  672. package/node_modules/@turf/transform-translate/dist/cjs/index.d.cts +1 -1
  673. package/node_modules/@turf/transform-translate/dist/esm/index.d.ts +1 -1
  674. package/node_modules/@turf/transform-translate/dist/esm/index.js +4 -8
  675. package/node_modules/@turf/transform-translate/dist/esm/index.js.map +1 -1
  676. package/node_modules/@turf/transform-translate/package.json +14 -14
  677. package/node_modules/@turf/triangle-grid/dist/cjs/index.cjs.map +1 -1
  678. package/node_modules/@turf/triangle-grid/dist/cjs/index.d.cts +1 -1
  679. package/node_modules/@turf/triangle-grid/dist/esm/index.d.ts +1 -1
  680. package/node_modules/@turf/triangle-grid/dist/esm/index.js.map +1 -1
  681. package/node_modules/@turf/triangle-grid/package.json +13 -13
  682. package/node_modules/@turf/truncate/dist/cjs/index.cjs +3 -6
  683. package/node_modules/@turf/truncate/dist/cjs/index.cjs.map +1 -1
  684. package/node_modules/@turf/truncate/dist/cjs/index.d.cts +1 -1
  685. package/node_modules/@turf/truncate/dist/esm/index.d.ts +1 -1
  686. package/node_modules/@turf/truncate/dist/esm/index.js +3 -6
  687. package/node_modules/@turf/truncate/dist/esm/index.js.map +1 -1
  688. package/node_modules/@turf/truncate/package.json +10 -10
  689. package/node_modules/@turf/turf/dist/cjs/index.cjs +3 -1
  690. package/node_modules/@turf/turf/dist/cjs/index.cjs.map +1 -1
  691. package/node_modules/@turf/turf/dist/cjs/index.d.cts +1 -0
  692. package/node_modules/@turf/turf/dist/esm/index.d.ts +1 -0
  693. package/node_modules/@turf/turf/dist/esm/index.js +2 -0
  694. package/node_modules/@turf/turf/dist/esm/index.js.map +1 -1
  695. package/node_modules/@turf/turf/package.json +126 -125
  696. package/node_modules/@turf/turf/turf.min.js +3 -26
  697. package/node_modules/@turf/union/README.md +44 -24
  698. package/node_modules/@turf/union/dist/cjs/index.cjs +9 -12
  699. package/node_modules/@turf/union/dist/cjs/index.cjs.map +1 -1
  700. package/node_modules/@turf/union/dist/cjs/index.d.cts +40 -21
  701. package/node_modules/@turf/union/dist/esm/index.d.ts +40 -21
  702. package/node_modules/@turf/union/dist/esm/index.js +8 -11
  703. package/node_modules/@turf/union/dist/esm/index.js.map +1 -1
  704. package/node_modules/@turf/union/package.json +11 -11
  705. package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs +14 -28
  706. package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs.map +1 -1
  707. package/node_modules/@turf/unkink-polygon/dist/cjs/index.d.cts +1 -1
  708. package/node_modules/@turf/unkink-polygon/dist/esm/index.d.ts +1 -1
  709. package/node_modules/@turf/unkink-polygon/dist/esm/index.js +14 -28
  710. package/node_modules/@turf/unkink-polygon/dist/esm/index.js.map +1 -1
  711. package/node_modules/@turf/unkink-polygon/package.json +13 -13
  712. package/node_modules/@turf/voronoi/dist/cjs/index.cjs +3 -6
  713. package/node_modules/@turf/voronoi/dist/cjs/index.cjs.map +1 -1
  714. package/node_modules/@turf/voronoi/dist/cjs/index.d.cts +1 -1
  715. package/node_modules/@turf/voronoi/dist/esm/index.d.ts +1 -1
  716. package/node_modules/@turf/voronoi/dist/esm/index.js +3 -6
  717. package/node_modules/@turf/voronoi/dist/esm/index.js.map +1 -1
  718. package/node_modules/@turf/voronoi/package.json +11 -11
  719. package/node_modules/@types/node/README.md +1 -1
  720. package/node_modules/@types/node/events.d.ts +1 -1
  721. package/node_modules/@types/node/globals.d.ts +8 -6
  722. package/node_modules/@types/node/module.d.ts +10 -3
  723. package/node_modules/@types/node/net.d.ts +3 -0
  724. package/node_modules/@types/node/package.json +2 -2
  725. package/node_modules/@types/node/process.d.ts +35 -2
  726. package/node_modules/@types/node/sqlite.d.ts +30 -9
  727. package/node_modules/bignumber.js/CHANGELOG.md +295 -0
  728. package/node_modules/bignumber.js/LICENCE.md +26 -0
  729. package/node_modules/bignumber.js/README.md +286 -0
  730. package/node_modules/bignumber.js/bignumber.d.ts +1831 -0
  731. package/node_modules/bignumber.js/bignumber.js +2922 -0
  732. package/node_modules/bignumber.js/bignumber.mjs +2907 -0
  733. package/node_modules/bignumber.js/doc/API.html +2249 -0
  734. package/node_modules/bignumber.js/package.json +50 -0
  735. package/node_modules/long/index.d.ts +1 -456
  736. package/node_modules/long/package.json +1 -1
  737. package/node_modules/long/umd/index.d.ts +456 -1
  738. package/node_modules/polyclip-ts/LICENSE +21 -0
  739. package/node_modules/{polygon-clipping → polyclip-ts}/README.md +35 -36
  740. package/node_modules/polyclip-ts/dist/cjs/index.cjs +1179 -0
  741. package/node_modules/polyclip-ts/dist/cjs/index.cjs.map +1 -0
  742. package/node_modules/polyclip-ts/dist/cjs/index.d.cts +12 -0
  743. package/node_modules/polyclip-ts/dist/esm/index.d.ts +12 -0
  744. package/node_modules/polyclip-ts/dist/esm/index.js +1138 -0
  745. package/node_modules/polyclip-ts/dist/esm/index.js.map +1 -0
  746. package/node_modules/polyclip-ts/dist/polyclip-ts.umd.js +4811 -0
  747. package/node_modules/polyclip-ts/dist/polyclip-ts.umd.min.js +2 -0
  748. package/node_modules/polyclip-ts/package.json +72 -0
  749. package/node_modules/splaytree-ts/LICENSE +29 -0
  750. package/node_modules/splaytree-ts/README.md +296 -0
  751. package/node_modules/splaytree-ts/dist/cjs/index.cjs +714 -0
  752. package/node_modules/splaytree-ts/dist/cjs/index.cjs.map +1 -0
  753. package/node_modules/splaytree-ts/dist/cjs/index.d.cts +105 -0
  754. package/node_modules/splaytree-ts/dist/esm/index.d.ts +105 -0
  755. package/node_modules/splaytree-ts/dist/esm/index.js +688 -0
  756. package/node_modules/splaytree-ts/dist/esm/index.js.map +1 -0
  757. package/node_modules/splaytree-ts/dist/splaytree-ts.umd.js +736 -0
  758. package/node_modules/splaytree-ts/dist/splaytree-ts.umd.min.js +2 -0
  759. package/node_modules/splaytree-ts/package.json +59 -0
  760. package/node_modules/uuid/README.md +29 -16
  761. package/node_modules/uuid/dist/cjs/md5.d.ts +2 -0
  762. package/node_modules/uuid/dist/cjs/native.d.ts +1 -0
  763. package/node_modules/uuid/dist/cjs/rng.js +1 -1
  764. package/node_modules/uuid/dist/cjs/sha1.d.ts +2 -0
  765. package/node_modules/uuid/dist/cjs/stringify.js +2 -1
  766. package/node_modules/uuid/dist/cjs/v1.js +10 -1
  767. package/node_modules/uuid/dist/cjs/v1ToV6.js +1 -1
  768. package/node_modules/uuid/dist/cjs/v35.js +3 -3
  769. package/node_modules/uuid/dist/cjs/v4.js +7 -1
  770. package/node_modules/uuid/dist/cjs/v6ToV1.js +1 -1
  771. package/node_modules/uuid/dist/cjs/v7.js +10 -1
  772. package/node_modules/uuid/dist/cjs-browser/rng.js +1 -1
  773. package/node_modules/uuid/dist/cjs-browser/stringify.js +2 -1
  774. package/node_modules/uuid/dist/cjs-browser/v1.js +10 -1
  775. package/node_modules/uuid/dist/cjs-browser/v1ToV6.js +1 -1
  776. package/node_modules/uuid/dist/cjs-browser/v35.js +3 -3
  777. package/node_modules/uuid/dist/cjs-browser/v4.js +7 -1
  778. package/node_modules/uuid/dist/cjs-browser/v6ToV1.js +1 -1
  779. package/node_modules/uuid/dist/cjs-browser/v7.js +10 -1
  780. package/node_modules/uuid/dist/esm/md5.d.ts +2 -0
  781. package/node_modules/uuid/dist/esm/native.d.ts +1 -0
  782. package/node_modules/uuid/dist/esm/sha1.d.ts +2 -0
  783. package/node_modules/uuid/dist/esm/v1.js +8 -0
  784. package/node_modules/uuid/dist/esm/v4.js +7 -1
  785. package/node_modules/uuid/dist/esm/v7.js +8 -0
  786. package/node_modules/uuid/dist/esm-browser/v1.js +8 -0
  787. package/node_modules/uuid/dist/esm-browser/v4.js +7 -1
  788. package/node_modules/uuid/dist/esm-browser/v7.js +8 -0
  789. package/node_modules/uuid/package.json +26 -28
  790. package/package.json +4 -4
  791. package/node_modules/polygon-clipping/LICENSE.md +0 -11
  792. package/node_modules/polygon-clipping/dist/polygon-clipping.cjs.js +0 -1803
  793. package/node_modules/polygon-clipping/dist/polygon-clipping.d.ts +0 -14
  794. package/node_modules/polygon-clipping/dist/polygon-clipping.esm.js +0 -1532
  795. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.js +0 -2496
  796. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js +0 -24
  797. package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js.map +0 -1
  798. package/node_modules/polygon-clipping/node_modules/robust-predicates/LICENSE +0 -24
  799. package/node_modules/polygon-clipping/node_modules/robust-predicates/README.md +0 -82
  800. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/incircle.js +0 -765
  801. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/insphere.js +0 -766
  802. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient2d.js +0 -184
  803. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/orient3d.js +0 -462
  804. package/node_modules/polygon-clipping/node_modules/robust-predicates/esm/util.js +0 -138
  805. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.d.ts +0 -49
  806. package/node_modules/polygon-clipping/node_modules/robust-predicates/index.js +0 -5
  807. package/node_modules/polygon-clipping/node_modules/robust-predicates/package.json +0 -75
  808. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.js +0 -908
  809. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/incircle.min.js +0 -1
  810. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.js +0 -914
  811. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/insphere.min.js +0 -1
  812. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.js +0 -280
  813. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient2d.min.js +0 -1
  814. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.js +0 -601
  815. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/orient3d.min.js +0 -1
  816. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.js +0 -2328
  817. package/node_modules/polygon-clipping/node_modules/robust-predicates/umd/predicates.min.js +0 -1
  818. package/node_modules/polygon-clipping/package.json +0 -79
  819. package/node_modules/splaytree/Readme.md +0 -222
  820. package/node_modules/splaytree/dist/splay.esm.js +0 -686
  821. package/node_modules/splaytree/dist/splay.esm.js.map +0 -1
  822. package/node_modules/splaytree/dist/splay.js +0 -694
  823. package/node_modules/splaytree/dist/splay.js.map +0 -1
  824. package/node_modules/splaytree/package.json +0 -91
  825. package/node_modules/splaytree/src/index.ts +0 -679
  826. package/node_modules/splaytree/src/node.ts +0 -15
  827. package/node_modules/splaytree/src/types.ts +0 -2
  828. package/node_modules/splaytree/typings/index.d.ts +0 -82
  829. package/node_modules/splaytree/typings/node.d.ts +0 -8
  830. package/node_modules/splaytree/typings/types.d.ts +0 -2
  831. package/node_modules/uuid/CHANGELOG.md +0 -335
  832. package/node_modules/uuid/CONTRIBUTING.md +0 -18
  833. package/node_modules/uuid/dist/cjs/test/parse.test.d.ts +0 -1
  834. package/node_modules/uuid/dist/cjs/test/parse.test.js +0 -50
  835. package/node_modules/uuid/dist/cjs/test/rng.test.d.ts +0 -1
  836. package/node_modules/uuid/dist/cjs/test/rng.test.js +0 -14
  837. package/node_modules/uuid/dist/cjs/test/stringify.test.d.ts +0 -1
  838. package/node_modules/uuid/dist/cjs/test/stringify.test.js +0 -23
  839. package/node_modules/uuid/dist/cjs/test/test_constants.d.ts +0 -33
  840. package/node_modules/uuid/dist/cjs/test/test_constants.js +0 -91
  841. package/node_modules/uuid/dist/cjs/test/v1.test.d.ts +0 -1
  842. package/node_modules/uuid/dist/cjs/test/v1.test.js +0 -127
  843. package/node_modules/uuid/dist/cjs/test/v35.test.d.ts +0 -1
  844. package/node_modules/uuid/dist/cjs/test/v35.test.js +0 -143
  845. package/node_modules/uuid/dist/cjs/test/v4.test.d.ts +0 -1
  846. package/node_modules/uuid/dist/cjs/test/v4.test.js +0 -60
  847. package/node_modules/uuid/dist/cjs/test/v6.test.d.ts +0 -1
  848. package/node_modules/uuid/dist/cjs/test/v6.test.js +0 -56
  849. package/node_modules/uuid/dist/cjs/test/v7.test.d.ts +0 -1
  850. package/node_modules/uuid/dist/cjs/test/v7.test.js +0 -194
  851. package/node_modules/uuid/dist/cjs/test/validate.test.d.ts +0 -1
  852. package/node_modules/uuid/dist/cjs/test/validate.test.js +0 -13
  853. package/node_modules/uuid/dist/cjs/test/version.test.d.ts +0 -1
  854. package/node_modules/uuid/dist/cjs/test/version.test.js +0 -20
  855. package/node_modules/uuid/dist/cjs-browser/test/parse.test.d.ts +0 -1
  856. package/node_modules/uuid/dist/cjs-browser/test/parse.test.js +0 -50
  857. package/node_modules/uuid/dist/cjs-browser/test/rng.test.d.ts +0 -1
  858. package/node_modules/uuid/dist/cjs-browser/test/rng.test.js +0 -14
  859. package/node_modules/uuid/dist/cjs-browser/test/stringify.test.d.ts +0 -1
  860. package/node_modules/uuid/dist/cjs-browser/test/stringify.test.js +0 -23
  861. package/node_modules/uuid/dist/cjs-browser/test/test_constants.d.ts +0 -33
  862. package/node_modules/uuid/dist/cjs-browser/test/test_constants.js +0 -91
  863. package/node_modules/uuid/dist/cjs-browser/test/v1.test.d.ts +0 -1
  864. package/node_modules/uuid/dist/cjs-browser/test/v1.test.js +0 -127
  865. package/node_modules/uuid/dist/cjs-browser/test/v35.test.d.ts +0 -1
  866. package/node_modules/uuid/dist/cjs-browser/test/v35.test.js +0 -143
  867. package/node_modules/uuid/dist/cjs-browser/test/v4.test.d.ts +0 -1
  868. package/node_modules/uuid/dist/cjs-browser/test/v4.test.js +0 -60
  869. package/node_modules/uuid/dist/cjs-browser/test/v6.test.d.ts +0 -1
  870. package/node_modules/uuid/dist/cjs-browser/test/v6.test.js +0 -56
  871. package/node_modules/uuid/dist/cjs-browser/test/v7.test.d.ts +0 -1
  872. package/node_modules/uuid/dist/cjs-browser/test/v7.test.js +0 -194
  873. package/node_modules/uuid/dist/cjs-browser/test/validate.test.d.ts +0 -1
  874. package/node_modules/uuid/dist/cjs-browser/test/validate.test.js +0 -13
  875. package/node_modules/uuid/dist/cjs-browser/test/version.test.d.ts +0 -1
  876. package/node_modules/uuid/dist/cjs-browser/test/version.test.js +0 -20
  877. package/node_modules/uuid/dist/esm/test/parse.test.d.ts +0 -1
  878. package/node_modules/uuid/dist/esm/test/parse.test.js +0 -48
  879. package/node_modules/uuid/dist/esm/test/rng.test.d.ts +0 -1
  880. package/node_modules/uuid/dist/esm/test/rng.test.js +0 -12
  881. package/node_modules/uuid/dist/esm/test/stringify.test.d.ts +0 -1
  882. package/node_modules/uuid/dist/esm/test/stringify.test.js +0 -21
  883. package/node_modules/uuid/dist/esm/test/test_constants.d.ts +0 -33
  884. package/node_modules/uuid/dist/esm/test/test_constants.js +0 -88
  885. package/node_modules/uuid/dist/esm/test/v1.test.d.ts +0 -1
  886. package/node_modules/uuid/dist/esm/test/v1.test.js +0 -125
  887. package/node_modules/uuid/dist/esm/test/v35.test.d.ts +0 -1
  888. package/node_modules/uuid/dist/esm/test/v35.test.js +0 -141
  889. package/node_modules/uuid/dist/esm/test/v4.test.d.ts +0 -1
  890. package/node_modules/uuid/dist/esm/test/v4.test.js +0 -58
  891. package/node_modules/uuid/dist/esm/test/v6.test.d.ts +0 -1
  892. package/node_modules/uuid/dist/esm/test/v6.test.js +0 -54
  893. package/node_modules/uuid/dist/esm/test/v7.test.d.ts +0 -1
  894. package/node_modules/uuid/dist/esm/test/v7.test.js +0 -192
  895. package/node_modules/uuid/dist/esm/test/validate.test.d.ts +0 -1
  896. package/node_modules/uuid/dist/esm/test/validate.test.js +0 -11
  897. package/node_modules/uuid/dist/esm/test/version.test.d.ts +0 -1
  898. package/node_modules/uuid/dist/esm/test/version.test.js +0 -18
  899. package/node_modules/uuid/dist/esm-browser/test/parse.test.d.ts +0 -1
  900. package/node_modules/uuid/dist/esm-browser/test/parse.test.js +0 -48
  901. package/node_modules/uuid/dist/esm-browser/test/rng.test.d.ts +0 -1
  902. package/node_modules/uuid/dist/esm-browser/test/rng.test.js +0 -12
  903. package/node_modules/uuid/dist/esm-browser/test/stringify.test.d.ts +0 -1
  904. package/node_modules/uuid/dist/esm-browser/test/stringify.test.js +0 -21
  905. package/node_modules/uuid/dist/esm-browser/test/test_constants.d.ts +0 -33
  906. package/node_modules/uuid/dist/esm-browser/test/test_constants.js +0 -88
  907. package/node_modules/uuid/dist/esm-browser/test/v1.test.d.ts +0 -1
  908. package/node_modules/uuid/dist/esm-browser/test/v1.test.js +0 -125
  909. package/node_modules/uuid/dist/esm-browser/test/v35.test.d.ts +0 -1
  910. package/node_modules/uuid/dist/esm-browser/test/v35.test.js +0 -141
  911. package/node_modules/uuid/dist/esm-browser/test/v4.test.d.ts +0 -1
  912. package/node_modules/uuid/dist/esm-browser/test/v4.test.js +0 -58
  913. package/node_modules/uuid/dist/esm-browser/test/v6.test.d.ts +0 -1
  914. package/node_modules/uuid/dist/esm-browser/test/v6.test.js +0 -54
  915. package/node_modules/uuid/dist/esm-browser/test/v7.test.d.ts +0 -1
  916. package/node_modules/uuid/dist/esm-browser/test/v7.test.js +0 -192
  917. package/node_modules/uuid/dist/esm-browser/test/validate.test.d.ts +0 -1
  918. package/node_modules/uuid/dist/esm-browser/test/validate.test.js +0 -11
  919. package/node_modules/uuid/dist/esm-browser/test/version.test.d.ts +0 -1
  920. package/node_modules/uuid/dist/esm-browser/test/version.test.js +0 -18
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/rbush-export.ts"],"sourcesContent":["import { GeoJsonProperties, FeatureCollection, Point } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { distance } from \"@turf/distance\";\nimport { degreesToRadians, lengthToDegrees, Units } from \"@turf/helpers\";\nimport { rbush as RBush } from \"./lib/rbush-export.js\";\n\ntype Dbscan = \"core\" | \"edge\" | \"noise\";\ntype DbscanProps = GeoJsonProperties & {\n dbscan?: Dbscan;\n cluster?: number;\n};\n\n// Structure of a point in the spatial index\ntype IndexedPoint = {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n index: number;\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters according to {@link DBSCAN's|https://en.wikipedia.org/wiki/DBSCAN} data clustering algorithm.\n *\n * @name clustersDbscan\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers\n * @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated\n * @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,\n * points which do not meet this requirement will be classified as an 'edge' or 'noise'.\n * @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var maxDistance = 100;\n * var clustered = turf.clustersDbscan(points, maxDistance);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersDbscan(\n points: FeatureCollection<Point>,\n maxDistance: number,\n options: {\n units?: Units;\n minPoints?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, DbscanProps> {\n // Input validation being handled by Typescript\n // collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');\n // if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');\n // if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');\n // if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');\n\n // Clone points to prevent any mutations\n if (options.mutate !== true) points = clone(points);\n\n // Defaults\n const minPoints = options.minPoints || 3;\n\n // Calculate the distance in degrees for region queries\n const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units);\n\n // Create a spatial index\n var tree = new RBush(points.features.length);\n\n // Keeps track of whether a point has been visited or not.\n var visited = points.features.map((_) => false);\n\n // Keeps track of whether a point is assigned to a cluster or not.\n var assigned = points.features.map((_) => false);\n\n // Keeps track of whether a point is noise|edge or not.\n var isnoise = points.features.map((_) => false);\n\n // Keeps track of the clusterId for each point\n var clusterIds: number[] = points.features.map((_) => -1);\n\n // Index each point for spatial queries\n tree.load(\n points.features.map((point, index) => {\n var [x, y] = point.geometry.coordinates;\n return {\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n index: index,\n } as IndexedPoint;\n })\n );\n\n // Function to find neighbors of a point within a given distance\n const regionQuery = (index: number): IndexedPoint[] => {\n const point = points.features[index];\n const [x, y] = point.geometry.coordinates;\n\n const minY = Math.max(y - latDistanceInDegrees, -90.0);\n const maxY = Math.min(y + latDistanceInDegrees, 90.0);\n\n const lonDistanceInDegrees = (function () {\n // Handle the case where the bounding box crosses the poles\n if (minY < 0 && maxY > 0) {\n return latDistanceInDegrees;\n }\n if (Math.abs(minY) < Math.abs(maxY)) {\n return latDistanceInDegrees / Math.cos(degreesToRadians(maxY));\n } else {\n return latDistanceInDegrees / Math.cos(degreesToRadians(minY));\n }\n })();\n\n const minX = Math.max(x - lonDistanceInDegrees, -360.0);\n const maxX = Math.min(x + lonDistanceInDegrees, 360.0);\n\n // Calculate the bounding box for the region query\n const bbox = { minX, minY, maxX, maxY };\n return (tree.search(bbox) as ReadonlyArray<IndexedPoint>).filter(\n (neighbor) => {\n const neighborIndex = neighbor.index;\n const neighborPoint = points.features[neighborIndex];\n const distanceInKm = distance(point, neighborPoint, {\n units: \"kilometers\",\n });\n return distanceInKm <= maxDistance;\n }\n );\n };\n\n // Function to expand a cluster\n const expandCluster = (clusteredId: number, neighbors: IndexedPoint[]) => {\n for (var i = 0; i < neighbors.length; i++) {\n var neighbor = neighbors[i];\n const neighborIndex = neighbor.index;\n if (!visited[neighborIndex]) {\n visited[neighborIndex] = true;\n const nextNeighbors = regionQuery(neighborIndex);\n if (nextNeighbors.length >= minPoints) {\n neighbors.push(...nextNeighbors);\n }\n }\n if (!assigned[neighborIndex]) {\n assigned[neighborIndex] = true;\n clusterIds[neighborIndex] = clusteredId;\n }\n }\n };\n\n // Main DBSCAN clustering algorithm\n var nextClusteredId = 0;\n points.features.forEach((_, index) => {\n if (visited[index]) return;\n const neighbors = regionQuery(index);\n if (neighbors.length >= minPoints) {\n const clusteredId = nextClusteredId;\n nextClusteredId++;\n visited[index] = true;\n expandCluster(clusteredId, neighbors);\n } else {\n isnoise[index] = true;\n }\n });\n\n // Assign DBSCAN properties to each point\n points.features.forEach((_, index) => {\n var clusterPoint = points.features[index];\n if (!clusterPoint.properties) {\n clusterPoint.properties = {};\n }\n\n if (clusterIds[index] >= 0) {\n clusterPoint.properties.dbscan = isnoise[index] ? \"edge\" : \"core\";\n clusterPoint.properties.cluster = clusterIds[index];\n } else {\n clusterPoint.properties.dbscan = \"noise\";\n }\n });\n\n return points as FeatureCollection<Point, DbscanProps>;\n}\n\nexport { Dbscan, DbscanProps, clustersDbscan };\nexport default clustersDbscan;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"],"mappings":";AACA,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAA8B;;;ACCzD,OAAO,SAAS;AAET,IAAM,QAAQ;;;ADsCrB,SAAS,eACP,QACA,aACA,UAII,CAAC,GACkC;AAQvC,MAAI,QAAQ,WAAW;AAAM,aAAS,MAAM,MAAM;AAGlD,QAAM,YAAY,QAAQ,aAAa;AAGvC,QAAM,uBAAuB,gBAAgB,aAAa,QAAQ,KAAK;AAGvE,MAAI,OAAO,IAAI,MAAM,OAAO,SAAS,MAAM;AAG3C,MAAI,UAAU,OAAO,SAAS,IAAI,CAAC,MAAM,KAAK;AAG9C,MAAI,WAAW,OAAO,SAAS,IAAI,CAAC,MAAM,KAAK;AAG/C,MAAI,UAAU,OAAO,SAAS,IAAI,CAAC,MAAM,KAAK;AAG9C,MAAI,aAAuB,OAAO,SAAS,IAAI,CAAC,MAAM,EAAE;AAGxD,OAAK;AAAA,IACH,OAAO,SAAS,IAAI,CAAC,OAAO,UAAU;AACpC,UAAI,CAAC,GAAG,CAAC,IAAI,MAAM,SAAS;AAC5B,aAAO;AAAA,QACL,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN,MAAM;AAAA,QACN;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAGA,QAAM,cAAc,CAAC,UAAkC;AACrD,UAAM,QAAQ,OAAO,SAAS,KAAK;AACnC,UAAM,CAAC,GAAG,CAAC,IAAI,MAAM,SAAS;AAE9B,UAAM,OAAO,KAAK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ACF;AAGA,MAAI,kBAAkB;AACtB,SAAO,SAAS,QAAQ,CAAC,GAAG,UAAU;AACpC,QAAI,QAAQ,KAAK;AAAG;AACpB,UAAM,YAAY,YAAY,KAAK;AACnC,QAAI,UAAU,UAAU,WAAW;AACjC,YAAM,cAAc;AACpB;AACA,cAAQ,KAAK,IAAI;AACjB,oBAAc,aAAa,SAAS;AAAA,IACtC,OAAO;AACL,cAAQ,KAAK,IAAI;AAAA,IACnB;AAAA,EACF,CAAC;AAGD,SAAO,SAAS,QAAQ,CAAC,GAAG,UAAU;AACpC,QAAI,eAAe,OAAO,SAAS,KAAK;AACxC,QAAI,CAAC,aAAa,YAAY;AAC5B,mBAAa,aAAa,CAAC;AAAA,IAC7B;AAEA,QAAI,WAAW,KAAK,KAAK,GAAG;AAC1B,mBAAa,WAAW,SAAS,QAAQ,KAAK,IAAI,SAAS;AAC3D,mBAAa,WAAW,UAAU,WAAW,KAAK;AAAA,IACpD,OAAO;AACL,mBAAa,WAAW,SAAS;AAAA,IACnC;AAAA,EACF,CAAC;AAED,SAAO;AACT;AAGA,IAAO,+BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts","../../lib/rbush-export.ts"],"sourcesContent":["import { GeoJsonProperties, FeatureCollection, Point } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { distance } from \"@turf/distance\";\nimport { degreesToRadians, lengthToDegrees, Units } from \"@turf/helpers\";\nimport { rbush as RBush } from \"./lib/rbush-export.js\";\n\n/**\n * Point classification within the cluster.\n *\n * @typedef {\"core\" | \"edge\" | \"noise\"} Dbscan\n */\ntype Dbscan = \"core\" | \"edge\" | \"noise\";\n\n/**\n * Properties assigned to each clustered point.\n *\n * @extends GeoJsonProperties\n * @typedef {object} DbscanProps\n * @property {Dbscan} [dbscan] type of point it has been classified as\n * @property {number} [cluster] associated clusterId\n */\ntype DbscanProps = GeoJsonProperties & {\n dbscan?: Dbscan;\n cluster?: number;\n};\n\n// Structure of a point in the spatial index\ntype IndexedPoint = {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n index: number;\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters according to {@link https://en.wikipedia.org/wiki/DBSCAN|DBSCAN's} data clustering algorithm.\n *\n * @function\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers\n * @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated\n * @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,\n * points which do not meet this requirement will be classified as an 'edge' or 'noise'.\n * @returns {FeatureCollection<Point, DbscanProps>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var maxDistance = 100;\n * var clustered = turf.clustersDbscan(points, maxDistance);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersDbscan(\n points: FeatureCollection<Point>,\n maxDistance: number,\n options: {\n units?: Units;\n minPoints?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, DbscanProps> {\n // Input validation being handled by Typescript\n // collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');\n // if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');\n // if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');\n // if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');\n\n // Clone points to prevent any mutations\n if (options.mutate !== true) points = clone(points);\n\n // Defaults\n const minPoints = options.minPoints || 3;\n\n // Calculate the distance in degrees for region queries\n const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units);\n\n // Create a spatial index\n var tree = new RBush(points.features.length);\n\n // Keeps track of whether a point has been visited or not.\n var visited = points.features.map((_) => false);\n\n // Keeps track of whether a point is assigned to a cluster or not.\n var assigned = points.features.map((_) => false);\n\n // Keeps track of whether a point is noise|edge or not.\n var isnoise = points.features.map((_) => false);\n\n // Keeps track of the clusterId for each point\n var clusterIds: number[] = points.features.map((_) => -1);\n\n // Index each point for spatial queries\n tree.load(\n points.features.map((point, index) => {\n var [x, y] = point.geometry.coordinates;\n return {\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n index: index,\n } as IndexedPoint;\n })\n );\n\n // Function to find neighbors of a point within a given distance\n const regionQuery = (index: number): IndexedPoint[] => {\n const point = points.features[index];\n const [x, y] = point.geometry.coordinates;\n\n const minY = Math.max(y - latDistanceInDegrees, -90.0);\n const maxY = Math.min(y + latDistanceInDegrees, 90.0);\n\n const lonDistanceInDegrees = (function () {\n // Handle the case where the bounding box crosses the poles\n if (minY < 0 && maxY > 0) {\n return latDistanceInDegrees;\n }\n if (Math.abs(minY) < Math.abs(maxY)) {\n return latDistanceInDegrees / Math.cos(degreesToRadians(maxY));\n } else {\n return latDistanceInDegrees / Math.cos(degreesToRadians(minY));\n }\n })();\n\n const minX = Math.max(x - lonDistanceInDegrees, -360.0);\n const maxX = Math.min(x + lonDistanceInDegrees, 360.0);\n\n // Calculate the bounding box for the region query\n const bbox = { minX, minY, maxX, maxY };\n return (tree.search(bbox) as ReadonlyArray<IndexedPoint>).filter(\n (neighbor) => {\n const neighborIndex = neighbor.index;\n const neighborPoint = points.features[neighborIndex];\n const distanceInKm = distance(point, neighborPoint, {\n units: \"kilometers\",\n });\n return distanceInKm <= maxDistance;\n }\n );\n };\n\n // Function to expand a cluster\n const expandCluster = (clusteredId: number, neighbors: IndexedPoint[]) => {\n for (var i = 0; i < neighbors.length; i++) {\n var neighbor = neighbors[i];\n const neighborIndex = neighbor.index;\n if (!visited[neighborIndex]) {\n visited[neighborIndex] = true;\n const nextNeighbors = regionQuery(neighborIndex);\n if (nextNeighbors.length >= minPoints) {\n neighbors.push(...nextNeighbors);\n }\n }\n if (!assigned[neighborIndex]) {\n assigned[neighborIndex] = true;\n clusterIds[neighborIndex] = clusteredId;\n }\n }\n };\n\n // Main DBSCAN clustering algorithm\n var nextClusteredId = 0;\n points.features.forEach((_, index) => {\n if (visited[index]) return;\n const neighbors = regionQuery(index);\n if (neighbors.length >= minPoints) {\n const clusteredId = nextClusteredId;\n nextClusteredId++;\n visited[index] = true;\n expandCluster(clusteredId, neighbors);\n } else {\n isnoise[index] = true;\n }\n });\n\n // Assign DBSCAN properties to each point\n points.features.forEach((_, index) => {\n var clusterPoint = points.features[index];\n if (!clusterPoint.properties) {\n clusterPoint.properties = {};\n }\n\n if (clusterIds[index] >= 0) {\n clusterPoint.properties.dbscan = isnoise[index] ? \"edge\" : \"core\";\n clusterPoint.properties.cluster = clusterIds[index];\n } else {\n clusterPoint.properties.dbscan = \"noise\";\n }\n });\n\n return points as FeatureCollection<Point, DbscanProps>;\n}\n\nexport { Dbscan, DbscanProps, clustersDbscan };\nexport default clustersDbscan;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"],"mappings":";AACA,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAA8B;;;ACCzD,OAAO,SAAS;AAET,IAAM,QAAQ;;;ADoDrB,SAAS,eACP,QACA,aACA,UAII,CAAC,GACkC;AAQvC,MAAI,QAAQ,WAAW,KAAM,UAAS,MAAM,MAAM;AAGlD,QAAM,YAAY,QAAQ,aAAa;AAGvC,QAAM,uBAAuB,gBAAgB,aAAa,QAAQ,KAAK;AAGvE,MAAI,OAAO,IAAI,MAAM,OAAO,SAAS,MAAM;AAG3C,MAAI,UAAU,OAAO,SAAS,IAAI,CAAC,MAAM,KAAK;AAG9C,MAAI,WAAW,OAAO,SAAS,IAAI,C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2
  "name": "@turf/clusters-dbscan",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "turf clusters-dbscan module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -60,30 +60,30 @@
60
60
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
61
61
  },
62
62
  "devDependencies": {
63
- "@turf/centroid": "^7.1.0",
64
- "@turf/clusters": "^7.1.0",
63
+ "@turf/centroid": "^7.2.0",
64
+ "@turf/clusters": "^7.2.0",
65
65
  "@types/benchmark": "^2.1.5",
66
66
  "@types/rbush": "^3.0.2",
67
- "@types/tape": "^4.2.32",
67
+ "@types/tape": "^4.13.4",
68
68
  "benchmark": "^2.1.4",
69
69
  "chromatism": "^3.0.0",
70
70
  "concaveman": "^1.2.1",
71
71
  "load-json-file": "^7.0.1",
72
72
  "npm-run-all": "^4.1.5",
73
- "tape": "^5.7.2",
74
- "tsup": "^8.0.1",
75
- "tsx": "^4.6.2",
76
- "typescript": "^5.2.2",
73
+ "tape": "^5.9.0",
74
+ "tsup": "^8.3.5",
75
+ "tsx": "^4.19.2",
76
+ "typescript": "^5.5.4",
77
77
  "write-json-file": "^5.0.0"
78
78
  },
79
79
  "dependencies": {
80
- "@turf/clone": "^7.1.0",
81
- "@turf/distance": "^7.1.0",
82
- "@turf/helpers": "^7.1.0",
83
- "@turf/meta": "^7.1.0",
80
+ "@turf/clone": "^7.2.0",
81
+ "@turf/distance": "^7.2.0",
82
+ "@turf/helpers": "^7.2.0",
83
+ "@turf/meta": "^7.2.0",
84
84
  "@types/geojson": "^7946.0.10",
85
85
  "rbush": "^3.0.1",
86
- "tslib": "^2.6.2"
86
+ "tslib": "^2.8.1"
87
87
  },
88
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
88
+ "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
89
89
  }
@@ -5,10 +5,8 @@ var _skmeans = require('skmeans'); var _skmeans2 = _interopRequireDefault(_skmea
5
5
  function clustersKmeans(points, options = {}) {
6
6
  var count = points.features.length;
7
7
  options.numberOfClusters = options.numberOfClusters || Math.round(Math.sqrt(count / 2));
8
- if (options.numberOfClusters > count)
9
- options.numberOfClusters = count;
10
- if (options.mutate !== true)
11
- points = _clone.clone.call(void 0, points);
8
+ if (options.numberOfClusters > count) options.numberOfClusters = count;
9
+ if (options.mutate !== true) points = _clone.clone.call(void 0, points);
12
10
  var data = _meta.coordAll.call(void 0, points);
13
11
  var initialCentroids = data.slice(0, options.numberOfClusters);
14
12
  var skmeansResult = _skmeans2.default.call(void 0, data, options.numberOfClusters, initialCentroids);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";AACA,SAAS,aAAa;AACtB,SAAS,UAAU,mBAAmB;AACtC,OAAO,aAAa;AA4BpB,SAAS,eACP,QACA,UAGI,CAAC,GACkC;AAEvC,MAAI,QAAQ,OAAO,SAAS;AAC5B,UAAQ,mBACN,QAAQ,oBAAoB,KAAK,MAAM,KAAK,KAAK,QAAQ,CAAC,CAAC;AAI7D,MAAI,QAAQ,mBAAmB;AAAO,YAAQ,mBAAmB;AAGjE,MAAI,QAAQ,WAAW;AAAM,aAAS,MAAM,MAAM;AAGlD,MAAI,OAAO,SAAS,MAAM;AAG1B,MAAI,mBAAmB,KAAK,MAAM,GAAG,QAAQ,gBAAgB;AAG7D,MAAI,gBAAgB,QAAQ,MAAM,QAAQ,kBAAkB,gBAAgB;AAG5E,MAAI,YAAsC,CAAC;AAC3C,EAAC,cAAc,UAAyB,QAAQ,SAC9C,OACA,KACA;AACA,cAAU,GAAG,IAAI;AAAA,EACnB,CAAC;AAGD,cAAY,QAAQ,SAAU,OAAO,OAAO;AAC1C,QAAI,YAAY,cAAc,KAAK,KAAK;AACxC,UAAM,WAAY,UAAU;AAC5B,UAAM,WAAY,WAAW,UAAU,SAAS;AAAA,EAClD,CAAC;AAED,SAAO;AACT;AAGA,IAAO,+BAAQ","sourcesContent":["import { FeatureCollection, Point, GeoJsonProperties } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { coordAll, featureEach } from \"@turf/meta\";\nimport skmeans from \"skmeans\";\n\ntype KmeansProps = GeoJsonProperties & {\n cluster?: number;\n centroid?: [number, number];\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .\n * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)\n *\n * @name clustersKmeans\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {[number, number]} centroid - Centroid of the cluster [Longitude, Latitude]\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var options = {numberOfClusters: 7};\n * var clustered = turf.clustersKmeans(points, options);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersKmeans(\n points: FeatureCollection<Point>,\n options: {\n numberOfClusters?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, KmeansProps> {\n // Default Params\n var count = points.features.length;\n options.numberOfClusters =\n options.numberOfClusters || Math.round(Math.sqrt(count / 2));\n\n // numberOfClusters can't be greater than the number of points\n // fallbacks to count\n if (options.numberOfClusters > count) options.numberOfClusters = count;\n\n // Clone points to prevent any mutations (enabled by default)\n if (options.mutate !== true) points = clone(points);\n\n // collect points coordinates\n var data = coordAll(points);\n\n // create seed to avoid skmeans to drift\n var initialCentroids = data.slice(0, options.numberOfClusters);\n\n // create skmeans clusters\n var skmeansResult = skmeans(data, options.numberOfClusters, initialCentroids);\n\n // store centroids {clusterId: [number, number]}\n var centroids: Record<string, number[]> = {};\n (skmeansResult.centroids as number[][]).forEach(function (\n coord: number[],\n idx: number\n ) {\n centroids[idx] = coord;\n });\n\n // add associated cluster number\n featureEach(points, function (point, index) {\n var clusterId = skmeansResult.idxs[index];\n point.properties!.cluster = clusterId;\n point.properties!.centroid = centroids[clusterId];\n });\n\n return points as FeatureCollection<Point, KmeansProps>;\n}\n\nexport { clustersKmeans, KmeansProps };\nexport default clustersKmeans;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-clusters-kmeans/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,oCAAsB;AACtB,kCAAsC;AACtC,oFAAoB;AA4BpB,SAAS,cAAA,CACP,MAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACkC;AAEvC,EAAA,IAAI,MAAA,EAAQ,MAAA,CAAO,QAAA,CAAS,MAAA;AAC5B,EAAA,OAAA,CAAQ,iBAAA,EACN,OAAA,CAAQ,iBAAA,GAAoB,IAAA,CAAK,KAAA,CAAM,IAAA,CAAK,IAAA,CAAK,MAAA,EAAQ,CAAC,CAAC,CAAA;AAI7D,EAAA,GAAA,CAAI,OAAA,CAAQ,iBAAA,EAAmB,KAAA,EAAO,OAAA,CAAQ,iBAAA,EAAmB,KAAA;AAGjE,EAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,IAAW,IAAA,EAAM,OAAA,EAAS,0BAAA,MAAY,CAAA;AAGlD,EAAA,IAAI,KAAA,EAAO,4BAAA,MAAe,CAAA;AAG1B,EAAA,IAAI,iBAAA,EAAmB,IAAA,CAAK,KAAA,CAAM,CAAA,EAAG,OAAA,CAAQ,gBAAgB,CAAA;AAG7D,EAAA,IAAI,cAAA,EAAgB,+BAAA,IAAQ,EAAM,OAAA,CAAQ,gBAAA,EAAkB,gBAAgB,CAAA;AAG5E,EAAA,IAAI,UAAA,EAAsC,CAAC,CAAA;AAC3C,EAAC,aAAA,CAAc,SAAA,CAAyB,OAAA,CAAQ,QAAA,CAC9C,KAAA,EACA,GAAA,EACA;AACA,IAAA,SAAA,CAAU,GAAG,EAAA,EAAI,KAAA;AAAA,EACnB,CAAC,CAAA;AAGD,EAAA,+BAAA,MAAY,EAAQ,QAAA,CAAU,KAAA,EAAO,KAAA,EAAO;AAC1C,IAAA,IAAI,UAAA,EAAY,aAAA,CAAc,IAAA,CAAK,KAAK,CAAA;AACxC,IAAA,KAAA,CAAM,UAAA,CAAY,QAAA,EAAU,SAAA;AAC5B,IAAA,KAAA,CAAM,UAAA,CAAY,SAAA,EAAW,SAAA,CAAU,SAAS,CAAA;AAAA,EAClD,CAAC,CAAA;AAED,EAAA,OAAO,MAAA;AACT;AAGA,IAAO,6BAAA,EAAQ,cAAA;ADvDf;AACE;AACA;AACF,wFAAC","file":"/home/runner/work/turf/turf/packages/turf-clusters-kmeans/dist/cjs/index.cjs","sourcesContent":[null,"import { FeatureCollection, Point, GeoJsonProperties } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { coordAll, featureEach } from \"@turf/meta\";\nimport skmeans from \"skmeans\";\n\ntype KmeansProps = GeoJsonProperties & {\n cluster?: number;\n centroid?: [number, number];\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .\n * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)\n *\n * @function\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {[number, number]} centroid - Centroid of the cluster [Longitude, Latitude]\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var options = {numberOfClusters: 7};\n * var clustered = turf.clustersKmeans(points, options);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersKmeans(\n points: FeatureCollection<Point>,\n options: {\n numberOfClusters?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, KmeansProps> {\n // Default Params\n var count = points.features.length;\n options.numberOfClusters =\n options.numberOfClusters || Math.round(Math.sqrt(count / 2));\n\n // numberOfClusters can't be greater than the number of points\n // fallbacks to count\n if (options.numberOfClusters > count) options.numberOfClusters = count;\n\n // Clone points to prevent any mutations (enabled by default)\n if (options.mutate !== true) points = clone(points);\n\n // collect points coordinates\n var data = coordAll(points);\n\n // create seed to avoid skmeans to drift\n var initialCentroids = data.slice(0, options.numberOfClusters);\n\n // create skmeans clusters\n var skmeansResult = skmeans(data, options.numberOfClusters, initialCentroids);\n\n // store centroids {clusterId: [number, number]}\n var centroids: Record<string, number[]> = {};\n (skmeansResult.centroids as number[][]).forEach(function (\n coord: number[],\n idx: number\n ) {\n centroids[idx] = coord;\n });\n\n // add associated cluster number\n featureEach(points, function (point, index) {\n var clusterId = skmeansResult.idxs[index];\n point.properties!.cluster = clusterId;\n point.properties!.centroid = centroids[clusterId];\n });\n\n return points as FeatureCollection<Point, KmeansProps>;\n}\n\nexport { clustersKmeans, KmeansProps };\nexport default clustersKmeans;\n"]}
@@ -8,7 +8,7 @@ type KmeansProps = GeoJsonProperties & {
8
8
  * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .
9
9
  * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)
10
10
  *
11
- * @name clustersKmeans
11
+ * @function
12
12
  * @param {FeatureCollection<Point>} points to be clustered
13
13
  * @param {Object} [options={}] Optional parameters
14
14
  * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated
@@ -8,7 +8,7 @@ type KmeansProps = GeoJsonProperties & {
8
8
  * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .
9
9
  * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)
10
10
  *
11
- * @name clustersKmeans
11
+ * @function
12
12
  * @param {FeatureCollection<Point>} points to be clustered
13
13
  * @param {Object} [options={}] Optional parameters
14
14
  * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated
@@ -5,10 +5,8 @@ import skmeans from "skmeans";
5
5
  function clustersKmeans(points, options = {}) {
6
6
  var count = points.features.length;
7
7
  options.numberOfClusters = options.numberOfClusters || Math.round(Math.sqrt(count / 2));
8
- if (options.numberOfClusters > count)
9
- options.numberOfClusters = count;
10
- if (options.mutate !== true)
11
- points = clone(points);
8
+ if (options.numberOfClusters > count) options.numberOfClusters = count;
9
+ if (options.mutate !== true) points = clone(points);
12
10
  var data = coordAll(points);
13
11
  var initialCentroids = data.slice(0, options.numberOfClusters);
14
12
  var skmeansResult = skmeans(data, options.numberOfClusters, initialCentroids);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { FeatureCollection, Point, GeoJsonProperties } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { coordAll, featureEach } from \"@turf/meta\";\nimport skmeans from \"skmeans\";\n\ntype KmeansProps = GeoJsonProperties & {\n cluster?: number;\n centroid?: [number, number];\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .\n * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)\n *\n * @name clustersKmeans\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {[number, number]} centroid - Centroid of the cluster [Longitude, Latitude]\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var options = {numberOfClusters: 7};\n * var clustered = turf.clustersKmeans(points, options);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersKmeans(\n points: FeatureCollection<Point>,\n options: {\n numberOfClusters?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, KmeansProps> {\n // Default Params\n var count = points.features.length;\n options.numberOfClusters =\n options.numberOfClusters || Math.round(Math.sqrt(count / 2));\n\n // numberOfClusters can't be greater than the number of points\n // fallbacks to count\n if (options.numberOfClusters > count) options.numberOfClusters = count;\n\n // Clone points to prevent any mutations (enabled by default)\n if (options.mutate !== true) points = clone(points);\n\n // collect points coordinates\n var data = coordAll(points);\n\n // create seed to avoid skmeans to drift\n var initialCentroids = data.slice(0, options.numberOfClusters);\n\n // create skmeans clusters\n var skmeansResult = skmeans(data, options.numberOfClusters, initialCentroids);\n\n // store centroids {clusterId: [number, number]}\n var centroids: Record<string, number[]> = {};\n (skmeansResult.centroids as number[][]).forEach(function (\n coord: number[],\n idx: number\n ) {\n centroids[idx] = coord;\n });\n\n // add associated cluster number\n featureEach(points, function (point, index) {\n var clusterId = skmeansResult.idxs[index];\n point.properties!.cluster = clusterId;\n point.properties!.centroid = centroids[clusterId];\n });\n\n return points as FeatureCollection<Point, KmeansProps>;\n}\n\nexport { clustersKmeans, KmeansProps };\nexport default clustersKmeans;\n"],"mappings":";AACA,SAAS,aAAa;AACtB,SAAS,UAAU,mBAAmB;AACtC,OAAO,aAAa;AA4BpB,SAAS,eACP,QACA,UAGI,CAAC,GACkC;AAEvC,MAAI,QAAQ,OAAO,SAAS;AAC5B,UAAQ,mBACN,QAAQ,oBAAoB,KAAK,MAAM,KAAK,KAAK,QAAQ,CAAC,CAAC;AAI7D,MAAI,QAAQ,mBAAmB;AAAO,YAAQ,mBAAmB;AAGjE,MAAI,QAAQ,WAAW;AAAM,aAAS,MAAM,MAAM;AAGlD,MAAI,OAAO,SAAS,MAAM;AAG1B,MAAI,mBAAmB,KAAK,MAAM,GAAG,QAAQ,gBAAgB;AAG7D,MAAI,gBAAgB,QAAQ,MAAM,QAAQ,kBAAkB,gBAAgB;AAG5E,MAAI,YAAsC,CAAC;AAC3C,EAAC,cAAc,UAAyB,QAAQ,SAC9C,OACA,KACA;AACA,cAAU,GAAG,IAAI;AAAA,EACnB,CAAC;AAGD,cAAY,QAAQ,SAAU,OAAO,OAAO;AAC1C,QAAI,YAAY,cAAc,KAAK,KAAK;AACxC,UAAM,WAAY,UAAU;AAC5B,UAAM,WAAY,WAAW,UAAU,SAAS;AAAA,EAClD,CAAC;AAED,SAAO;AACT;AAGA,IAAO,+BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { FeatureCollection, Point, GeoJsonProperties } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { coordAll, featureEach } from \"@turf/meta\";\nimport skmeans from \"skmeans\";\n\ntype KmeansProps = GeoJsonProperties & {\n cluster?: number;\n centroid?: [number, number];\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters using the k-mean .\n * It uses the [k-means algorithm](https://en.wikipedia.org/wiki/K-means_clustering)\n *\n * @function\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.numberOfClusters=Math.sqrt(numberOfPoints/2)] numberOfClusters that will be generated\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {[number, number]} centroid - Centroid of the cluster [Longitude, Latitude]\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var options = {numberOfClusters: 7};\n * var clustered = turf.clustersKmeans(points, options);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersKmeans(\n points: FeatureCollection<Point>,\n options: {\n numberOfClusters?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, KmeansProps> {\n // Default Params\n var count = points.features.length;\n options.numberOfClusters =\n options.numberOfClusters || Math.round(Math.sqrt(count / 2));\n\n // numberOfClusters can't be greater than the number of points\n // fallbacks to count\n if (options.numberOfClusters > count) options.numberOfClusters = count;\n\n // Clone points to prevent any mutations (enabled by default)\n if (options.mutate !== true) points = clone(points);\n\n // collect points coordinates\n var data = coordAll(points);\n\n // create seed to avoid skmeans to drift\n var initialCentroids = data.slice(0, options.numberOfClusters);\n\n // create skmeans clusters\n var skmeansResult = skmeans(data, options.numberOfClusters, initialCentroids);\n\n // store centroids {clusterId: [number, number]}\n var centroids: Record<string, number[]> = {};\n (skmeansResult.centroids as number[][]).forEach(function (\n coord: number[],\n idx: number\n ) {\n centroids[idx] = coord;\n });\n\n // add associated cluster number\n featureEach(points, function (point, index) {\n var clusterId = skmeansResult.idxs[index];\n point.properties!.cluster = clusterId;\n point.properties!.centroid = centroids[clusterId];\n });\n\n return points as FeatureCollection<Point, KmeansProps>;\n}\n\nexport { clustersKmeans, KmeansProps };\nexport default clustersKmeans;\n"],"mappings":";AACA,SAAS,aAAa;AACtB,SAAS,UAAU,mBAAmB;AACtC,OAAO,aAAa;AA4BpB,SAAS,eACP,QACA,UAGI,CAAC,GACkC;AAEvC,MAAI,QAAQ,OAAO,SAAS;AAC5B,UAAQ,mBACN,QAAQ,oBAAoB,KAAK,MAAM,KAAK,KAAK,QAAQ,CAAC,CAAC;AAI7D,MAAI,QAAQ,mBAAmB,MAAO,SAAQ,mBAAmB;AAGjE,MAAI,QAAQ,WAAW,KAAM,UAAS,MAAM,MAAM;AAGlD,MAAI,OAAO,SAAS,MAAM;AAG1B,MAAI,mBAAmB,KAAK,MAAM,GAAG,QAAQ,gBAAgB;AAG7D,MAAI,gBAAgB,QAAQ,MAAM,QAAQ,kBAAkB,gBAAgB;AAG5E,MAAI,YAAsC,CAAC;AAC3C,EAAC,cAAc,UAAyB,QAAQ,SAC9C,OACA,KACA;AACA,cAAU,GAAG,IAAI;AAAA,EACnB,CAAC;AAGD,cAAY,QAAQ,SAAU,OAAO,OAAO;AAC1C,QAAI,YAAY,cAAc,KAAK,KAAK;AACxC,UAAM,WAAY,UAAU;AAC5B,UAAM,WAAY,WAAW,UAAU,SAAS;AAAA,EAClD,CAAC;AAED,SAAO;AACT;AAGA,IAAO,+BAAQ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/clusters-kmeans",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "turf clusters-kmeans module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -59,31 +59,31 @@
59
59
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
60
60
  },
61
61
  "devDependencies": {
62
- "@turf/centroid": "^7.1.0",
63
- "@turf/clusters": "^7.1.0",
64
- "@turf/random": "^7.1.0",
62
+ "@turf/centroid": "^7.2.0",
63
+ "@turf/clusters": "^7.2.0",
64
+ "@turf/random": "^7.2.0",
65
65
  "@types/benchmark": "^2.1.5",
66
66
  "@types/skmeans": "^0.11.7",
67
- "@types/tape": "^4.2.32",
67
+ "@types/tape": "^4.13.4",
68
68
  "benchmark": "^2.1.4",
69
69
  "chromatism": "^3.0.0",
70
70
  "concaveman": "^1.2.1",
71
71
  "load-json-file": "^7.0.1",
72
72
  "npm-run-all": "^4.1.5",
73
- "tape": "^5.7.2",
74
- "tsup": "^8.0.1",
75
- "tsx": "^4.6.2",
76
- "typescript": "^5.2.2",
73
+ "tape": "^5.9.0",
74
+ "tsup": "^8.3.5",
75
+ "tsx": "^4.19.2",
76
+ "typescript": "^5.5.4",
77
77
  "write-json-file": "^5.0.0"
78
78
  },
79
79
  "dependencies": {
80
- "@turf/clone": "^7.1.0",
81
- "@turf/helpers": "^7.1.0",
82
- "@turf/invariant": "^7.1.0",
83
- "@turf/meta": "^7.1.0",
80
+ "@turf/clone": "^7.2.0",
81
+ "@turf/helpers": "^7.2.0",
82
+ "@turf/invariant": "^7.2.0",
83
+ "@turf/meta": "^7.2.0",
84
84
  "@types/geojson": "^7946.0.10",
85
85
  "skmeans": "0.9.7",
86
- "tslib": "^2.6.2"
86
+ "tslib": "^2.8.1"
87
87
  },
88
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
88
+ "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
89
89
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/rbush-export.ts"],"names":[],"mappings":";AACA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,6BAA6B;;;ACEtC,OAAO,SAAS;AAET,IAAM,QAAQ;;;ADqCrB,SAAS,QACP,UACA,QACA,YACA,aAC4B;AAC5B,MAAI,QAAQ,IAAI,MAAa,CAAC;AAE9B,MAAI,YAAY,OAAO,SAAS,IAAI,SAAU,MAAM;AAnDtD;AAoDI,WAAO;AAAA,MACL,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,WAAU,UAAK,eAAL,mBAAkB;AAAA,IAC9B;AAAA,EACF,CAAC;AAED,QAAM,KAAK,SAAS;AACpB,WAAS,SAAS,QAAQ,SAAU,MAAM;AACxC,QAAI,CAAC,KAAK,YAAY;AACpB,WAAK,aAAa,CAAC;AAAA,IACrB;AACA,QAAI,OAAO,SAAS,IAAI;AACxB,QAAI,kBAAkB,MAAM,OAAO;AAAA,MACjC,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,IACd,CAAC;AACD,QAAI,SAAgB,CAAC;AACrB,oBAAgB,QAAQ,SAAU,IAAI;AACpC,UAAI,sBAAsB,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG;AACnD,eAAO,KAAK,GAAG,QAAQ;AAAA,MACzB;AAAA,IACF,CAAC;AAED,SAAK,WAAW,WAAW,IAAI;AAAA,EACjC,CAAC;AAED,SAAO;AACT;AAGA,IAAO,uBAAQ","sourcesContent":["import { FeatureCollection, Polygon, Point } from \"geojson\";\nimport { bbox as turfbbox } from \"@turf/bbox\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { rbush } from \"./lib/rbush-export.js\";\n\ninterface Entry {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n property: any;\n}\n\n/**\n * Merges a specified property from a FeatureCollection of points into a\n * FeatureCollection of polygons. Given an `inProperty` on points and an `outProperty`\n * for polygons, this finds every point that lies within each polygon, collects the\n * `inProperty` values from those points, and adds them as an array to `outProperty`\n * on the polygon.\n *\n * @name collect\n * @param {FeatureCollection<Polygon>} polygons polygons with values on which to aggregate\n * @param {FeatureCollection<Point>} points points to be aggregated\n * @param {string} inProperty property to be nested from\n * @param {string} outProperty property to be nested into\n * @returns {FeatureCollection<Polygon>} polygons with properties listed based on `outField`\n * @example\n * var poly1 = turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]);\n * var poly2 = turf.polygon([[[10,0],[20,10],[20,20],[20,0],[10,0]]]);\n * var polyFC = turf.featureCollection([poly1, poly2]);\n * var pt1 = turf.point([5,5], {population: 200});\n * var pt2 = turf.point([1,3], {population: 600});\n * var pt3 = turf.point([14,2], {population: 100});\n * var pt4 = turf.point([13,1], {population: 200});\n * var pt5 = turf.point([19,7], {population: 300});\n * var pointFC = turf.featureCollection([pt1, pt2, pt3, pt4, pt5]);\n * var collected = turf.collect(polyFC, pointFC, 'population', 'values');\n * var values = collected.features[0].properties.values\n * //=values => [200, 600]\n *\n * //addToMap\n * var addToMap = [pointFC, collected]\n */\nfunction collect(\n polygons: FeatureCollection<Polygon>,\n points: FeatureCollection<Point>,\n inProperty: string,\n outProperty: string\n): FeatureCollection<Polygon> {\n var rtree = new rbush<Entry>(6);\n\n var treeItems = points.features.map(function (item) {\n return {\n minX: item.geometry.coordinates[0],\n minY: item.geometry.coordinates[1],\n maxX: item.geometry.coordinates[0],\n maxY: item.geometry.coordinates[1],\n property: item.properties?.[inProperty],\n };\n });\n\n rtree.load(treeItems);\n polygons.features.forEach(function (poly) {\n if (!poly.properties) {\n poly.properties = {};\n }\n var bbox = turfbbox(poly);\n var potentialPoints = rtree.search({\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n });\n var values: any[] = [];\n potentialPoints.forEach(function (pt) {\n if (booleanPointInPolygon([pt.minX, pt.minY], poly)) {\n values.push(pt.property);\n }\n });\n\n poly.properties[outProperty] = values;\n });\n\n return polygons;\n}\n\nexport { collect };\nexport default collect;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-collect/dist/cjs/index.cjs","../../index.ts","../../lib/rbush-export.ts"],"names":[],"mappings":"AAAA;ACCA,kCAAiC;AACjC,uEAAsC;ADCtC;AACA;AEAA,4EAAgB;AAET,IAAM,MAAA,EAAQ,eAAA;AFCrB;AACA;ACmCA,SAAS,OAAA,CACP,QAAA,EACA,MAAA,EACA,UAAA,EACA,WAAA,EAC4B;AAC5B,EAAA,IAAI,MAAA,EAAQ,IAAI,KAAA,CAAa,CAAC,CAAA;AAE9B,EAAA,IAAI,UAAA,EAAY,MAAA,CAAO,QAAA,CAAS,GAAA,CAAI,QAAA,CAAU,IAAA,EAAM;AAnDtD,IAAA,IAAA,EAAA;AAoDI,IAAA,OAAO;AAAA,MACL,IAAA,EAAM,IAAA,CAAK,QAAA,CAAS,WAAA,CAAY,CAAC,CAAA;AAAA,MACjC,IAAA,EAAM,IAAA,CAAK,QAAA,CAAS,WAAA,CAAY,CAAC,CAAA;AAAA,MACjC,IAAA,EAAM,IAAA,CAAK,QAAA,CAAS,WAAA,CAAY,CAAC,CAAA;AAAA,MACjC,IAAA,EAAM,IAAA,CAAK,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","file":"/home/runner/work/turf/turf/packages/turf-collect/dist/cjs/index.cjs","sourcesContent":[null,"import { FeatureCollection, Polygon, Point } from \"geojson\";\nimport { bbox as turfbbox } from \"@turf/bbox\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { rbush } from \"./lib/rbush-export.js\";\n\ninterface Entry {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n property: any;\n}\n\n/**\n * Merges a specified property from a FeatureCollection of points into a\n * FeatureCollection of polygons. Given an `inProperty` on points and an `outProperty`\n * for polygons, this finds every point that lies within each polygon, collects the\n * `inProperty` values from those points, and adds them as an array to `outProperty`\n * on the polygon.\n *\n * @function\n * @param {FeatureCollection<Polygon>} polygons polygons with values on which to aggregate\n * @param {FeatureCollection<Point>} points points to be aggregated\n * @param {string} inProperty property to be nested from\n * @param {string} outProperty property to be nested into\n * @returns {FeatureCollection<Polygon>} polygons with properties listed based on `outField`\n * @example\n * var poly1 = turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]);\n * var poly2 = turf.polygon([[[10,0],[20,10],[20,20],[20,0],[10,0]]]);\n * var polyFC = turf.featureCollection([poly1, poly2]);\n * var pt1 = turf.point([5,5], {population: 200});\n * var pt2 = turf.point([1,3], {population: 600});\n * var pt3 = turf.point([14,2], {population: 100});\n * var pt4 = turf.point([13,1], {population: 200});\n * var pt5 = turf.point([19,7], {population: 300});\n * var pointFC = turf.featureCollection([pt1, pt2, pt3, pt4, pt5]);\n * var collected = turf.collect(polyFC, pointFC, 'population', 'values');\n * var values = collected.features[0].properties.values\n * //=values => [200, 600]\n *\n * //addToMap\n * var addToMap = [pointFC, collected]\n */\nfunction collect(\n polygons: FeatureCollection<Polygon>,\n points: FeatureCollection<Point>,\n inProperty: string,\n outProperty: string\n): FeatureCollection<Polygon> {\n var rtree = new rbush<Entry>(6);\n\n var treeItems = points.features.map(function (item) {\n return {\n minX: item.geometry.coordinates[0],\n minY: item.geometry.coordinates[1],\n maxX: item.geometry.coordinates[0],\n maxY: item.geometry.coordinates[1],\n property: item.properties?.[inProperty],\n };\n });\n\n rtree.load(treeItems);\n polygons.features.forEach(function (poly) {\n if (!poly.properties) {\n poly.properties = {};\n }\n var bbox = turfbbox(poly);\n var potentialPoints = rtree.search({\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n });\n var values: any[] = [];\n potentialPoints.forEach(function (pt) {\n if (booleanPointInPolygon([pt.minX, pt.minY], poly)) {\n values.push(pt.property);\n }\n });\n\n poly.properties[outProperty] = values;\n });\n\n return polygons;\n}\n\nexport { collect };\nexport default collect;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"]}
@@ -7,7 +7,7 @@ import { FeatureCollection, Polygon, Point } from 'geojson';
7
7
  * `inProperty` values from those points, and adds them as an array to `outProperty`
8
8
  * on the polygon.
9
9
  *
10
- * @name collect
10
+ * @function
11
11
  * @param {FeatureCollection<Polygon>} polygons polygons with values on which to aggregate
12
12
  * @param {FeatureCollection<Point>} points points to be aggregated
13
13
  * @param {string} inProperty property to be nested from
@@ -7,7 +7,7 @@ import { FeatureCollection, Polygon, Point } from 'geojson';
7
7
  * `inProperty` values from those points, and adds them as an array to `outProperty`
8
8
  * on the polygon.
9
9
  *
10
- * @name collect
10
+ * @function
11
11
  * @param {FeatureCollection<Polygon>} polygons polygons with values on which to aggregate
12
12
  * @param {FeatureCollection<Point>} points points to be aggregated
13
13
  * @param {string} inProperty property to be nested from
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/rbush-export.ts"],"sourcesContent":["import { FeatureCollection, Polygon, Point } from \"geojson\";\nimport { bbox as turfbbox } from \"@turf/bbox\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { rbush } from \"./lib/rbush-export.js\";\n\ninterface Entry {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n property: any;\n}\n\n/**\n * Merges a specified property from a FeatureCollection of points into a\n * FeatureCollection of polygons. Given an `inProperty` on points and an `outProperty`\n * for polygons, this finds every point that lies within each polygon, collects the\n * `inProperty` values from those points, and adds them as an array to `outProperty`\n * on the polygon.\n *\n * @name collect\n * @param {FeatureCollection<Polygon>} polygons polygons with values on which to aggregate\n * @param {FeatureCollection<Point>} points points to be aggregated\n * @param {string} inProperty property to be nested from\n * @param {string} outProperty property to be nested into\n * @returns {FeatureCollection<Polygon>} polygons with properties listed based on `outField`\n * @example\n * var poly1 = turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]);\n * var poly2 = turf.polygon([[[10,0],[20,10],[20,20],[20,0],[10,0]]]);\n * var polyFC = turf.featureCollection([poly1, poly2]);\n * var pt1 = turf.point([5,5], {population: 200});\n * var pt2 = turf.point([1,3], {population: 600});\n * var pt3 = turf.point([14,2], {population: 100});\n * var pt4 = turf.point([13,1], {population: 200});\n * var pt5 = turf.point([19,7], {population: 300});\n * var pointFC = turf.featureCollection([pt1, pt2, pt3, pt4, pt5]);\n * var collected = turf.collect(polyFC, pointFC, 'population', 'values');\n * var values = collected.features[0].properties.values\n * //=values => [200, 600]\n *\n * //addToMap\n * var addToMap = [pointFC, collected]\n */\nfunction collect(\n polygons: FeatureCollection<Polygon>,\n points: FeatureCollection<Point>,\n inProperty: string,\n outProperty: string\n): FeatureCollection<Polygon> {\n var rtree = new rbush<Entry>(6);\n\n var treeItems = points.features.map(function (item) {\n return {\n minX: item.geometry.coordinates[0],\n minY: item.geometry.coordinates[1],\n maxX: item.geometry.coordinates[0],\n maxY: item.geometry.coordinates[1],\n property: item.properties?.[inProperty],\n };\n });\n\n rtree.load(treeItems);\n polygons.features.forEach(function (poly) {\n if (!poly.properties) {\n poly.properties = {};\n }\n var bbox = turfbbox(poly);\n var potentialPoints = rtree.search({\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n });\n var values: any[] = [];\n potentialPoints.forEach(function (pt) {\n if (booleanPointInPolygon([pt.minX, pt.minY], poly)) {\n values.push(pt.property);\n }\n });\n\n poly.properties[outProperty] = values;\n });\n\n return polygons;\n}\n\nexport { collect };\nexport default collect;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"],"mappings":";AACA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,6BAA6B;;;ACEtC,OAAO,SAAS;AAET,IAAM,QAAQ;;;ADqCrB,SAAS,QACP,UACA,QACA,YACA,aAC4B;AAC5B,MAAI,QAAQ,IAAI,MAAa,CAAC;AAE9B,MAAI,YAAY,OAAO,SAAS,IAAI,SAAU,MAAM;AAnDtD;AAoDI,WAAO;AAAA,MACL,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,WAAU,UAAK,eAAL,mBAAkB;AAAA,IAC9B;AAAA,EACF,CAAC;AAED,QAAM,KAAK,SAAS;AACpB,WAAS,SAAS,QAAQ,SAAU,MAAM;AACxC,QAAI,CAAC,KAAK,YAAY;AACpB,WAAK,aAAa,CAAC;AAAA,IACrB;AACA,QAAI,OAAO,SAAS,IAAI;AACxB,QAAI,kBAAkB,MAAM,OAAO;AAAA,MACjC,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,IACd,CAAC;AACD,QAAI,SAAgB,CAAC;AACrB,oBAAgB,QAAQ,SAAU,IAAI;AACpC,UAAI,sBAAsB,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG;AACnD,eAAO,KAAK,GAAG,QAAQ;AAAA,MACzB;AAAA,IACF,CAAC;AAED,SAAK,WAAW,WAAW,IAAI;AAAA,EACjC,CAAC;AAED,SAAO;AACT;AAGA,IAAO,uBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts","../../lib/rbush-export.ts"],"sourcesContent":["import { FeatureCollection, Polygon, Point } from \"geojson\";\nimport { bbox as turfbbox } from \"@turf/bbox\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { rbush } from \"./lib/rbush-export.js\";\n\ninterface Entry {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n property: any;\n}\n\n/**\n * Merges a specified property from a FeatureCollection of points into a\n * FeatureCollection of polygons. Given an `inProperty` on points and an `outProperty`\n * for polygons, this finds every point that lies within each polygon, collects the\n * `inProperty` values from those points, and adds them as an array to `outProperty`\n * on the polygon.\n *\n * @function\n * @param {FeatureCollection<Polygon>} polygons polygons with values on which to aggregate\n * @param {FeatureCollection<Point>} points points to be aggregated\n * @param {string} inProperty property to be nested from\n * @param {string} outProperty property to be nested into\n * @returns {FeatureCollection<Polygon>} polygons with properties listed based on `outField`\n * @example\n * var poly1 = turf.polygon([[[0,0],[10,0],[10,10],[0,10],[0,0]]]);\n * var poly2 = turf.polygon([[[10,0],[20,10],[20,20],[20,0],[10,0]]]);\n * var polyFC = turf.featureCollection([poly1, poly2]);\n * var pt1 = turf.point([5,5], {population: 200});\n * var pt2 = turf.point([1,3], {population: 600});\n * var pt3 = turf.point([14,2], {population: 100});\n * var pt4 = turf.point([13,1], {population: 200});\n * var pt5 = turf.point([19,7], {population: 300});\n * var pointFC = turf.featureCollection([pt1, pt2, pt3, pt4, pt5]);\n * var collected = turf.collect(polyFC, pointFC, 'population', 'values');\n * var values = collected.features[0].properties.values\n * //=values => [200, 600]\n *\n * //addToMap\n * var addToMap = [pointFC, collected]\n */\nfunction collect(\n polygons: FeatureCollection<Polygon>,\n points: FeatureCollection<Point>,\n inProperty: string,\n outProperty: string\n): FeatureCollection<Polygon> {\n var rtree = new rbush<Entry>(6);\n\n var treeItems = points.features.map(function (item) {\n return {\n minX: item.geometry.coordinates[0],\n minY: item.geometry.coordinates[1],\n maxX: item.geometry.coordinates[0],\n maxY: item.geometry.coordinates[1],\n property: item.properties?.[inProperty],\n };\n });\n\n rtree.load(treeItems);\n polygons.features.forEach(function (poly) {\n if (!poly.properties) {\n poly.properties = {};\n }\n var bbox = turfbbox(poly);\n var potentialPoints = rtree.search({\n minX: bbox[0],\n minY: bbox[1],\n maxX: bbox[2],\n maxY: bbox[3],\n });\n var values: any[] = [];\n potentialPoints.forEach(function (pt) {\n if (booleanPointInPolygon([pt.minX, pt.minY], poly)) {\n values.push(pt.property);\n }\n });\n\n poly.properties[outProperty] = values;\n });\n\n return polygons;\n}\n\nexport { collect };\nexport default collect;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"],"mappings":";AACA,SAAS,QAAQ,gBAAgB;AACjC,SAAS,6BAA6B;;;ACEtC,OAAO,SAAS;AAET,IAAM,QAAQ;;;ADqCrB,SAAS,QACP,UACA,QACA,YACA,aAC4B;AAC5B,MAAI,QAAQ,IAAI,MAAa,CAAC;AAE9B,MAAI,YAAY,OAAO,SAAS,IAAI,SAAU,MAAM;AAnDtD;AAoDI,WAAO;AAAA,MACL,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,MAAM,KAAK,SAAS,YAAY,CAAC;AAAA,MACjC,WAAU,UAAK,eAAL,mBAAkB;AAAA,IAC9B;AAAA,EACF,CAAC;AAED,QAAM,KAAK,SAAS;AACpB,WAAS,SAAS,QAAQ,SAAU,MAAM;AACxC,QAAI,CAAC,KAAK,YAAY;AACpB,WAAK,aAAa,CAAC;AAAA,IACrB;AACA,QAAI,OAAO,SAAS,IAAI;AACxB,QAAI,kBAAkB,MAAM,OAAO;AAAA,MACjC,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,KAAK,CAAC;AAAA,IACd,CAAC;AACD,QAAI,SAAgB,CAAC;AACrB,oBAAgB,QAAQ,SAAU,IAAI;AACpC,UAAI,sBAAsB,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG;AACnD,eAAO,KAAK,GAAG,QAAQ;AAAA,MACzB;AAAA,IACF,CAAC;AAED,SAAK,WAAW,WAAW,IAAI;AAAA,EACjC,CAAC;AAED,SAAO;AACT;AAGA,IAAO,uBAAQ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/collect",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "turf collect module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -58,21 +58,21 @@
58
58
  "devDependencies": {
59
59
  "@types/benchmark": "^2.1.5",
60
60
  "@types/rbush": "^3.0.2",
61
- "@types/tape": "^4.2.32",
61
+ "@types/tape": "^4.13.4",
62
62
  "benchmark": "^2.1.4",
63
63
  "npm-run-all": "^4.1.5",
64
- "tape": "^5.7.2",
65
- "tsup": "^8.0.1",
66
- "tsx": "^4.6.2",
67
- "typescript": "^5.2.2"
64
+ "tape": "^5.9.0",
65
+ "tsup": "^8.3.5",
66
+ "tsx": "^4.19.2",
67
+ "typescript": "^5.5.4"
68
68
  },
69
69
  "dependencies": {
70
- "@turf/bbox": "^7.1.0",
71
- "@turf/boolean-point-in-polygon": "^7.1.0",
72
- "@turf/helpers": "^7.1.0",
70
+ "@turf/bbox": "^7.2.0",
71
+ "@turf/boolean-point-in-polygon": "^7.2.0",
72
+ "@turf/helpers": "^7.2.0",
73
73
  "@types/geojson": "^7946.0.10",
74
74
  "rbush": "^3.0.1",
75
- "tslib": "^2.6.2"
75
+ "tslib": "^2.8.1"
76
76
  },
77
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
77
+ "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
78
78
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"names":["feature"],"mappings":";AAUA,SAAS,SAAS,yBAAyB;AAC3C,SAAS,mBAAmB;AAoB5B,SAAS,QACP,IAGA;AACA,MAAI,SAAS;AAAA,IACX,YAAY;AAAA,MACV,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,IACA,cAAc;AAAA,MACZ,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,EACF;AAEA,cAAY,IAAI,CAACA,aAAY;AAnD/B;AAoDI,aAAQ,KAAAA,SAAQ,aAAR,mBAAkB,MAAM;AAAA,MAC9B,KAAK;AACH,eAAO,WAAW,YAAY,KAAKA,SAAQ,SAAS,WAAW;AAC/D,eAAO,WAAW,WAAW,KAAKA,SAAQ,UAAU;AACpD;AAAA,MACF,KAAK;AACH,eAAO,WAAW,YAAY,KAAK,GAAGA,SAAQ,SAAS,WAAW;AAClE,eAAO,WAAW,WAAW,KAAKA,SAAQ,UAAU;AACpD;AAAA,MACF,KAAK;AACH,eAAO,gBAAgB,YAAY,KAAKA,SAAQ,SAAS,WAAW;AACpE,eAAO,gBAAgB,WAAW,KAAKA,SAAQ,UAAU;AACzD;AAAA,MACF,KAAK;AACH,eAAO,gBAAgB,YAAY;AAAA,UACjC,GAAGA,SAAQ,SAAS;AAAA,QACtB;AACA,eAAO,gBAAgB,WAAW,KAAKA,SAAQ,UAAU;AACzD;AAAA,MACF,KAAK;AACH,eAAO,aAAa,YAAY,KAAKA,SAAQ,SAAS,WAAW;AACjE,eAAO,aAAa,WAAW,KAAKA,SAAQ,UAAU;AACtD;AAAA,MACF,KAAK;AACH,eAAO,aAAa,YAAY,KAAK,GAAGA,SAAQ,SAAS,WAAW;AACpE,eAAO,aAAa,WAAW,KAAKA,SAAQ,UAAU;AACtD;AAAA,MACF;AACE;AAAA,IACJ;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACJ,OAAO,KAAK,MAAM,EAChB,OAAO,SAAU,KAAK;AACrB,aAAO,OAAO,GAAG,EAAE,YAAY;AAAA,IACjC,CAAC,EACA,KAAK,EACL,IAAI,SAAU,KAAK;AAClB,UAAI,WAAW,EAAE,MAAM,KAAK,aAAa,OAAO,GAAG,EAAE,YAAY;AAIjE,UAAI,aAAa,EAAE,qBAAqB,OAAO,GAAG,EAAE,WAAW;AAC/D,aAAO,QAAQ,UAAU,UAAU;AAAA,IACrC,CAAC;AAAA,EACL;AACF;AAGA,IAAO,uBAAQ","sourcesContent":["import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @name combine\n * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type\n * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input\n * @example\n * var fc = turf.featureCollection([\n * turf.point([19.026432, 47.49134]),\n * turf.point([19.074497, 47.509548])\n * ]);\n *\n * var combined = turf.combine(fc);\n *\n * //addToMap\n * var addToMap = [combined]\n */\nfunction combine(\n fc: FeatureCollection<\n Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon\n >\n) {\n var groups = {\n MultiPoint: {\n coordinates: [] as number[][],\n properties: [] as GeoJsonProperties[],\n },\n MultiLineString: {\n coordinates: [] as number[][][],\n properties: [] as GeoJsonProperties[],\n },\n MultiPolygon: {\n coordinates: [] as number[][][][],\n properties: [] as GeoJsonProperties[],\n },\n };\n\n featureEach(fc, (feature) => {\n switch (feature.geometry?.type) {\n case \"Point\":\n groups.MultiPoint.coordinates.push(feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"MultiPoint\":\n groups.MultiPoint.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"LineString\":\n groups.MultiLineString.coordinates.push(feature.geometry.coordinates);\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"MultiLineString\":\n groups.MultiLineString.coordinates.push(\n ...feature.geometry.coordinates\n );\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"Polygon\":\n groups.MultiPolygon.coordinates.push(feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n case \"MultiPolygon\":\n groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n default:\n break;\n }\n });\n\n return featureCollection(\n (Object.keys(groups) as (keyof typeof groups)[])\n .filter(function (key) {\n return groups[key].coordinates.length;\n })\n .sort()\n .map(function (key) {\n var geometry = { type: key, coordinates: groups[key].coordinates } as\n | MultiPoint\n | MultiLineString\n | MultiPolygon;\n var properties = { collectedProperties: groups[key].properties };\n return feature(geometry, properties);\n })\n );\n}\n\nexport { combine };\nexport default combine;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-combine/dist/cjs/index.cjs","../../index.ts"],"names":["feature"],"mappings":"AAAA;ACUA,wCAA2C;AAC3C,kCAA4B;AAoB5B,SAAS,OAAA,CACP,EAAA,EAGA;AACA,EAAA,IAAI,OAAA,EAAS;AAAA,IACX,UAAA,EAAY;AAAA,MACV,WAAA,EAAa,CAAC,CAAA;AAAA,MACd,UAAA,EAA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AAA,IACrC,CAAC;AAAA,EACL,CAAA;AACF;AAGA,IAAO,qBAAA,EAAQ,OAAA;ADxCf;AACE;AACA;AACF,kEAAC","file":"/home/runner/work/turf/turf/packages/turf-combine/dist/cjs/index.cjs","sourcesContent":[null,"import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @function\n * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type\n * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input\n * @example\n * var fc = turf.featureCollection([\n * turf.point([19.026432, 47.49134]),\n * turf.point([19.074497, 47.509548])\n * ]);\n *\n * var combined = turf.combine(fc);\n *\n * //addToMap\n * var addToMap = [combined]\n */\nfunction combine(\n fc: FeatureCollection<\n Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon\n >\n) {\n var groups = {\n MultiPoint: {\n coordinates: [] as number[][],\n properties: [] as GeoJsonProperties[],\n },\n MultiLineString: {\n coordinates: [] as number[][][],\n properties: [] as GeoJsonProperties[],\n },\n MultiPolygon: {\n coordinates: [] as number[][][][],\n properties: [] as GeoJsonProperties[],\n },\n };\n\n featureEach(fc, (feature) => {\n switch (feature.geometry?.type) {\n case \"Point\":\n groups.MultiPoint.coordinates.push(feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"MultiPoint\":\n groups.MultiPoint.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"LineString\":\n groups.MultiLineString.coordinates.push(feature.geometry.coordinates);\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"MultiLineString\":\n groups.MultiLineString.coordinates.push(\n ...feature.geometry.coordinates\n );\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"Polygon\":\n groups.MultiPolygon.coordinates.push(feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n case \"MultiPolygon\":\n groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n default:\n break;\n }\n });\n\n return featureCollection(\n (Object.keys(groups) as (keyof typeof groups)[])\n .filter(function (key) {\n return groups[key].coordinates.length;\n })\n .sort()\n .map(function (key) {\n var geometry = { type: key, coordinates: groups[key].coordinates } as\n | MultiPoint\n | MultiLineString\n | MultiPolygon;\n var properties = { collectedProperties: groups[key].properties };\n return feature(geometry, properties);\n })\n );\n}\n\nexport { combine };\nexport default combine;\n"]}
@@ -4,7 +4,7 @@ import { FeatureCollection, Point, MultiPoint, LineString, MultiLineString, Poly
4
4
  * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
5
5
  * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
6
6
  *
7
- * @name combine
7
+ * @function
8
8
  * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
9
9
  * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
10
10
  * @example
@@ -4,7 +4,7 @@ import { FeatureCollection, Point, MultiPoint, LineString, MultiLineString, Poly
4
4
  * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features
5
5
  * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.
6
6
  *
7
- * @name combine
7
+ * @function
8
8
  * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type
9
9
  * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input
10
10
  * @example
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @name combine\n * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type\n * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input\n * @example\n * var fc = turf.featureCollection([\n * turf.point([19.026432, 47.49134]),\n * turf.point([19.074497, 47.509548])\n * ]);\n *\n * var combined = turf.combine(fc);\n *\n * //addToMap\n * var addToMap = [combined]\n */\nfunction combine(\n fc: FeatureCollection<\n Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon\n >\n) {\n var groups = {\n MultiPoint: {\n coordinates: [] as number[][],\n properties: [] as GeoJsonProperties[],\n },\n MultiLineString: {\n coordinates: [] as number[][][],\n properties: [] as GeoJsonProperties[],\n },\n MultiPolygon: {\n coordinates: [] as number[][][][],\n properties: [] as GeoJsonProperties[],\n },\n };\n\n featureEach(fc, (feature) => {\n switch (feature.geometry?.type) {\n case \"Point\":\n groups.MultiPoint.coordinates.push(feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"MultiPoint\":\n groups.MultiPoint.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"LineString\":\n groups.MultiLineString.coordinates.push(feature.geometry.coordinates);\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"MultiLineString\":\n groups.MultiLineString.coordinates.push(\n ...feature.geometry.coordinates\n );\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"Polygon\":\n groups.MultiPolygon.coordinates.push(feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n case \"MultiPolygon\":\n groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n default:\n break;\n }\n });\n\n return featureCollection(\n (Object.keys(groups) as (keyof typeof groups)[])\n .filter(function (key) {\n return groups[key].coordinates.length;\n })\n .sort()\n .map(function (key) {\n var geometry = { type: key, coordinates: groups[key].coordinates } as\n | MultiPoint\n | MultiLineString\n | MultiPolygon;\n var properties = { collectedProperties: groups[key].properties };\n return feature(geometry, properties);\n })\n );\n}\n\nexport { combine };\nexport default combine;\n"],"mappings":";AAUA,SAAS,SAAS,yBAAyB;AAC3C,SAAS,mBAAmB;AAoB5B,SAAS,QACP,IAGA;AACA,MAAI,SAAS;AAAA,IACX,YAAY;AAAA,MACV,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,IACA,iBAAiB;AAAA,MACf,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,IACA,cAAc;AAAA,MACZ,aAAa,CAAC;AAAA,MACd,YAAY,CAAC;AAAA,IACf;AAAA,EACF;AAEA,cAAY,IAAI,CAACA,aAAY;AAnD/B;AAoDI,aAAQ,KAAAA,SAAQ,aAAR,mBAAkB,MAAM;AAAA,MAC9B,KAAK;AACH,eAAO,WAAW,YAAY,KAAKA,SAAQ,SAAS,WAAW;AAC/D,eAAO,WAAW,WAAW,KAAKA,SAAQ,UAAU;AACpD;AAAA,MACF,KAAK;AACH,eAAO,WAAW,YAAY,KAAK,GAAGA,SAAQ,SAAS,WAAW;AAClE,eAAO,WAAW,WAAW,KAAKA,SAAQ,UAAU;AACpD;AAAA,MACF,KAAK;AACH,eAAO,gBAAgB,YAAY,KAAKA,SAAQ,SAAS,WAAW;AACpE,eAAO,gBAAgB,WAAW,KAAKA,SAAQ,UAAU;AACzD;AAAA,MACF,KAAK;AACH,eAAO,gBAAgB,YAAY;AAAA,UACjC,GAAGA,SAAQ,SAAS;AAAA,QACtB;AACA,eAAO,gBAAgB,WAAW,KAAKA,SAAQ,UAAU;AACzD;AAAA,MACF,KAAK;AACH,eAAO,aAAa,YAAY,KAAKA,SAAQ,SAAS,WAAW;AACjE,eAAO,aAAa,WAAW,KAAKA,SAAQ,UAAU;AACtD;AAAA,MACF,KAAK;AACH,eAAO,aAAa,YAAY,KAAK,GAAGA,SAAQ,SAAS,WAAW;AACpE,eAAO,aAAa,WAAW,KAAKA,SAAQ,UAAU;AACtD;AAAA,MACF;AACE;AAAA,IACJ;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACJ,OAAO,KAAK,MAAM,EAChB,OAAO,SAAU,KAAK;AACrB,aAAO,OAAO,GAAG,EAAE,YAAY;AAAA,IACjC,CAAC,EACA,KAAK,EACL,IAAI,SAAU,KAAK;AAClB,UAAI,WAAW,EAAE,MAAM,KAAK,aAAa,OAAO,GAAG,EAAE,YAAY;AAIjE,UAAI,aAAa,EAAE,qBAAqB,OAAO,GAAG,EAAE,WAAW;AAC/D,aAAO,QAAQ,UAAU,UAAU;AAAA,IACrC,CAAC;AAAA,EACL;AACF;AAGA,IAAO,uBAAQ;","names":["feature"]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n GeoJsonProperties,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPoint,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\n\n/**\n * Combines a {@link FeatureCollection} of {@link Point}, {@link LineString}, or {@link Polygon} features\n * into {@link MultiPoint}, {@link MultiLineString}, or {@link MultiPolygon} features.\n *\n * @function\n * @param {FeatureCollection<Point|LineString|Polygon>} fc a FeatureCollection of any type\n * @returns {FeatureCollection<MultiPoint|MultiLineString|MultiPolygon>} a FeatureCollection of corresponding type to input\n * @example\n * var fc = turf.featureCollection([\n * turf.point([19.026432, 47.49134]),\n * turf.point([19.074497, 47.509548])\n * ]);\n *\n * var combined = turf.combine(fc);\n *\n * //addToMap\n * var addToMap = [combined]\n */\nfunction combine(\n fc: FeatureCollection<\n Point | MultiPoint | LineString | MultiLineString | Polygon | MultiPolygon\n >\n) {\n var groups = {\n MultiPoint: {\n coordinates: [] as number[][],\n properties: [] as GeoJsonProperties[],\n },\n MultiLineString: {\n coordinates: [] as number[][][],\n properties: [] as GeoJsonProperties[],\n },\n MultiPolygon: {\n coordinates: [] as number[][][][],\n properties: [] as GeoJsonProperties[],\n },\n };\n\n featureEach(fc, (feature) => {\n switch (feature.geometry?.type) {\n case \"Point\":\n groups.MultiPoint.coordinates.push(feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"MultiPoint\":\n groups.MultiPoint.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPoint.properties.push(feature.properties);\n break;\n case \"LineString\":\n groups.MultiLineString.coordinates.push(feature.geometry.coordinates);\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"MultiLineString\":\n groups.MultiLineString.coordinates.push(\n ...feature.geometry.coordinates\n );\n groups.MultiLineString.properties.push(feature.properties);\n break;\n case \"Polygon\":\n groups.MultiPolygon.coordinates.push(feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n case \"MultiPolygon\":\n groups.MultiPolygon.coordinates.push(...feature.geometry.coordinates);\n groups.MultiPolygon.properties.push(feature.properties);\n break;\n default:\n break;\n }\n });\n\n return featureCollection(\n (Object.keys(groups) as (keyof typeof groups)[])\n .filter(function (key) {\n return groups[key].coordinates.length;\n })\n .sort()\n .map(function (key) {\n var geometry = { type: key, coordinates: groups[key].coordinates } as\n | MultiPoint\n | MultiLineString\n | MultiPolygon;\n var properties = { collectedProperties: groups[key].properties };\n return feature(geometry, properties);\n })\n );\n}\n\nexport { combine };\nexport default combine;\n"],"mappings":";AAUA,SAAS,SAAS,yBAAyB;AAC3C,SAAS,mBAAmB;AAoB5B,SAAS,QACP,IAGA;AACA,MAA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AAC,EACA,KAAK,EACL,IAAI,SAAU,KAAK;AAClB,UAAI,WAAW,EAAE,MAAM,KAAK,aAAa,OAAO,GAAG,EAAE,YAAY;AAIjE,UAAI,aAAa,EAAE,qBAAqB,OAAO,GAAG,EAAE,WAAW;AAC/D,aAAO,QAAQ,UAAU,UAAU;AAAA,IACrC,CAAC;AAAA,EACL;AACF;AAGA,IAAO,uBAAQ;","names":["feature"]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/combine",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "turf combine module",
5
5
  "author": "Turf Authors",
6
6
  "license": "MIT",
@@ -53,19 +53,19 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@types/benchmark": "^2.1.5",
56
- "@types/tape": "^4.2.32",
56
+ "@types/tape": "^4.13.4",
57
57
  "benchmark": "^2.1.4",
58
58
  "npm-run-all": "^4.1.5",
59
- "tape": "^5.7.2",
60
- "tsup": "^8.0.1",
61
- "tsx": "^4.6.2",
62
- "typescript": "^5.2.2"
59
+ "tape": "^5.9.0",
60
+ "tsup": "^8.3.5",
61
+ "tsx": "^4.19.2",
62
+ "typescript": "^5.5.4"
63
63
  },
64
64
  "dependencies": {
65
- "@turf/helpers": "^7.1.0",
66
- "@turf/meta": "^7.1.0",
65
+ "@turf/helpers": "^7.2.0",
66
+ "@turf/meta": "^7.2.0",
67
67
  "@types/geojson": "^7946.0.10",
68
- "tslib": "^2.6.2"
68
+ "tslib": "^2.8.1"
69
69
  },
70
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
70
+ "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
71
71
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/turf-dissolve.ts","../../lib/turf-line-dissolve.ts","../../lib/turf-polygon-dissolve.ts"],"names":["clone","isObject","getType","flattenEach","feature"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,SAAS,yBAAyB;AAS3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SAAS,QACP,QACA,UAA+C,CAAC,GACR;AACxC,QAAM,UAAU,QAAQ,WAAW;AAEnC,QAAM,UAAU,iBAAiB,MAAM;AAEvC,QAAM,WAAW,IAAI,OAAO;AAG5B,WAAS,WAAW,SAAS,SAAS,OAAO,CAAC,aAAa;AACzD,UAAM,MAAM,SAAS,SAAS,YAAY,CAAC,EAAE,CAAC;AAC9C,UAAM,MAAM,SAAS,SAAS,YAAY,CAAC,EAAE,CAAC;AAC9C,UAAM,MAAM,SAAS,SAAS,YAAY,CAAC,EAAE,CAAC;AAC9C,UAAM,QAAQ,SAAS,KAAK,KAAK,OAAO;AACxC,UAAM,QAAQ,SAAS,KAAK,KAAK,OAAO;AACxC,UAAM,QAAQ,SAAS,KAAK,KAAK,OAAO;AACxC,WAAO,SAAS,WAAW,SAAS,WAAW,SAAS;AAAA,EAC1D,CAAC;AAED,MAAI,SAAS,SAAS,SAAS,GAAG;AAChC,WAAO;AAAA,EACT;AAGA,QAAM,YAAiB,SAAS,QAAQ;AAGxC,MAAI,UAAU,YAAY,WAAW,GAAG;AACtC,cAAU,cAAc,UAAU,YAAY,CAAC;AAC/C,cAAU,OAAO;AAAA,EACnB;AACA,SAAO,QAAQ,SAAS;AAC1B;AASA,SAAS,iBACP,QAC0B;AAC1B,QAAM,UAAiC,CAAC;AACxC,QAAM,WAAuC,CAAC;AAE9C,cAAY,QAAQ,CAAC,OAAO;AAC1B,QAAI,CAAC,GAAG,UAAU;AAChB;AAAA,IACF;AACA,UAAM,MAAM,GAAG,SAAS,YAAY,KAAK,GAAG;AAC5C,QAAI,CAAC,OAAO,UAAU,eAAe,KAAK,UAAU,GAAG,GAAG;AACxD,cAAQ,KAAK,EAAE;AACf,eAAS,GAAG,IAAI;AAAA,IAClB;AAAA,EACF,CAAC;AACD,SAAO,kBAAkB,OAAO;AAClC;AAGA,IAAO,uBAAQ","sourcesContent":["import { distance } from \"@turf/distance\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { Units } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\nimport { tin } from \"@turf/tin\";\nimport { dissolve } from \"./lib/turf-dissolve.js\";\n\n/**\n * Takes a set of {@link Point|points} and returns a concave hull Polygon or MultiPolygon.\n * Internally, this uses [turf-tin](https://github.com/Turfjs/turf-tin) to generate geometries.\n *\n * @name concave\n * @param {FeatureCollection<Point>} points input points\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.maxEdge=Infinity] the length (in 'units') of an edge necessary for part of the\n * hull to become concave.\n * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers\n * @returns {Feature<(Polygon|MultiPolygon)>|null} a concave hull (null value is returned if unable to compute hull)\n * @example\n * var points = turf.featureCollection([\n * turf.point([-63.601226, 44.642643]),\n * turf.point([-63.591442, 44.651436]),\n * turf.point([-63.580799, 44.648749]),\n * turf.point([-63.573589, 44.641788]),\n * turf.point([-63.587665, 44.64533]),\n * turf.point([-63.595218, 44.64765])\n * ]);\n * var options = {units: 'miles', maxEdge: 1};\n *\n * var hull = turf.concave(points, options);\n *\n * //addToMap\n * var addToMap = [points, hull]\n */\nfunction concave(\n points: FeatureCollection<Point>,\n options: { maxEdge?: number; units?: Units } = {}\n): Feature<Polygon | MultiPolygon> | null {\n const maxEdge = options.maxEdge || Infinity;\n\n const cleaned = removeDuplicates(points);\n\n const tinPolys = tin(cleaned);\n // calculate length of all edges and area of all triangles\n // and remove triangles that fail the max length test\n tinPolys.features = tinPolys.features.filter((triangle) => {\n const pt1 = triangle.geometry.coordinates[0][0];\n const pt2 = triangle.geometry.coordinates[0][1];\n const pt3 = triangle.geometry.coordinates[0][2];\n const dist1 = distance(pt1, pt2, options);\n const dist2 = distance(pt2, pt3, options);\n const dist3 = distance(pt1, pt3, options);\n return dist1 <= maxEdge && dist2 <= maxEdge && dist3 <= maxEdge;\n });\n\n if (tinPolys.features.length < 1) {\n return null;\n }\n\n // merge the adjacent triangles\n const dissolved: any = dissolve(tinPolys);\n\n // geojson-dissolve always returns a MultiPolygon\n if (dissolved.coordinates.length === 1) {\n dissolved.coordinates = dissolved.coordinates[0];\n dissolved.type = \"Polygon\";\n }\n return feature(dissolved);\n}\n\n/**\n * Removes duplicated points in a collection returning a new collection\n *\n * @private\n * @param {FeatureCollection<Point>} points to be cleaned\n * @returns {FeatureCollection<Point>} cleaned set of points\n */\nfunction removeDuplicates(\n points: FeatureCollection<Point>\n): FeatureCollection<Point> {\n const cleaned: Array<Feature<Point>> = [];\n const existing: { [key: string]: boolean } = {};\n\n featureEach(points, (pt) => {\n if (!pt.geometry) {\n return;\n }\n const key = pt.geometry.coordinates.join(\"-\");\n if (!Object.prototype.hasOwnProperty.call(existing, key)) {\n cleaned.push(pt);\n existing[key] = true;\n }\n });\n return featureCollection(cleaned);\n}\n\nexport { concave };\nexport default concave;\n","import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Polygon,\n} from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { isObject } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { flattenEach } from \"@turf/meta\";\nimport { lineDissolve } from \"./turf-line-dissolve.js\";\nimport { polygonDissolve } from \"./turf-polygon-dissolve.js\";\n\n/**\n * Transform function: attempts to dissolve geojson objects where possible\n * [GeoJSON] -> GeoJSON geometry\n *\n * @private\n * @param {FeatureCollection<LineString|MultiLineString|Polygon|MultiPolygon>} geojson Features to dissolved\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] Prevent input mutation\n * @returns {Feature<MultiLineString|MultiPolygon>} Dissolved Features\n */\nfunction dissolve(\n geojson: FeatureCollection<\n LineString | MultiLineString | Polygon | MultiPolygon\n >,\n options: {\n mutate?: boolean;\n } = {}\n): Feature<LineString | MultiLineString | Polygon | MultiPolygon> | null {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n const mutate = options.mutate;\n\n // Validation\n if (getType(geojson) !== \"FeatureCollection\") {\n throw new Error(\"geojson must be a FeatureCollection\");\n }\n if (!geojson.features.length) {\n throw new Error(\"geojson is empty\");\n }\n\n // Clone geojson to avoid side effects\n // Topojson modifies in place, so we need to deep clone first\n if (mutate === false || mutate === undefined) {\n geojson = clone(geojson);\n }\n\n // Assert homogenity\n const type = getHomogenousType(geojson);\n if (!type) {\n throw new Error(\"geojson must be homogenous\");\n }\n\n // Data => Typescript hack\n const data: any = geojson;\n\n switch (type) {\n case \"LineString\":\n return lineDissolve(data, options);\n case \"Polygon\":\n return polygonDissolve(data, options);\n default:\n throw new Error(type + \" is not supported\");\n }\n}\n\n/**\n * Checks if GeoJSON is Homogenous\n *\n * @private\n * @param {GeoJSON} geojson GeoJSON\n * @returns {string|null} Homogenous type or null if multiple types\n */\nfunction getHomogenousType(geojson: any) {\n const types: { [key: string]: boolean } = {};\n flattenEach(geojson, (feature) => {\n types[feature.geometry.type] = true;\n });\n const keys = Object.keys(types);\n if (keys.length === 1) {\n return keys[0];\n }\n return null;\n}\n\nexport { dissolve };\nexport default dissolve;\n","import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n} from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { isObject, lineString, multiLineString } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { lineReduce } from \"@turf/meta\";\n\n/**\n * Merges all connected (non-forking, non-junctioning) line strings into single lineStrings.\n * [LineString] -> LineString|MultiLineString\n *\n * @param {FeatureCollection<LineString|MultiLineString>} geojson Lines to dissolve\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] Prevent input mutation\n * @returns {Feature<LineString|MultiLineString>} Dissolved lines\n */\nfunction lineDissolve(\n geojson: FeatureCollection<LineString | MultiLineString>,\n options: { mutate?: boolean } = {}\n): Feature<LineString | MultiLineString> | null {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n const mutate = options.mutate;\n\n // Validation\n if (getType(geojson) !== \"FeatureCollection\") {\n throw new Error(\"geojson must be a FeatureCollection\");\n }\n if (!geojson.features.length) {\n throw new Error(\"geojson is empty\");\n }\n\n // Clone geojson to avoid side effects\n if (mutate === false || mutate === undefined) {\n geojson = clone(geojson);\n }\n\n const result: any[] = [];\n const lastLine = lineReduce(\n geojson,\n (previousLine: any, currentLine: any) => {\n // Attempt to merge this LineString with the other LineStrings, updating\n // the reference as it is merged with others and grows.\n const merged = mergeLineStrings(previousLine, currentLine);\n\n // Accumulate the merged LineString\n if (merged) {\n return merged;\n // Put the unmerged LineString back into the list\n } else {\n result.push(previousLine);\n return currentLine;\n }\n }\n );\n // Append the last line\n if (lastLine) {\n result.push(lastLine);\n }\n\n // Return null if no lines were dissolved\n if (!result.length) {\n return null;\n // Return LineString if only 1 line was dissolved\n } else if (result.length === 1) {\n return result[0];\n // Return MultiLineString if multiple lines were dissolved with gaps\n } else {\n return multiLineString(\n result.map((line) => {\n return line.coordinates;\n })\n );\n }\n}\n\n// [Number, Number] -> String\nfunction coordId(coord: number[]) {\n return coord[0].toString() + \",\" + coord[1].toString();\n}\n\n/**\n * LineString, LineString -> LineString\n *\n * @private\n * @param {Feature<LineString>} a line1\n * @param {Feature<LineString>} b line2\n * @returns {Feature<LineString>|null} Merged LineString\n */\nfunction mergeLineStrings(a: Feature<LineString>, b: Feature<LineString>) {\n const coords1 = a.geometry.coordinates;\n const coords2 = b.geometry.coordinates;\n\n const s1 = coordId(coords1[0]);\n const e1 = coordId(coords1[coords1.length - 1]);\n const s2 = coordId(coords2[0]);\n const e2 = coordId(coords2[coords2.length - 1]);\n\n // TODO: handle case where more than one of these is true!\n let coords;\n if (s1 === e2) {\n coords = coords2.concat(coords1.slice(1));\n } else if (s2 === e1) {\n coords = coords1.concat(coords2.slice(1));\n } else if (s1 === s2) {\n coords = coords1.slice(1).reverse().concat(coords2);\n } else if (e1 === e2) {\n coords = coords1.concat(coords2.reverse().slice(1));\n } else {\n return null;\n }\n\n return lineString(coords);\n}\n\nexport { lineDissolve };\nexport default lineDissolve;\n","import { Feature, FeatureCollection, MultiPolygon, Polygon } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { geometryCollection } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { flattenEach } from \"@turf/meta\";\nimport { merge } from \"topojson-client\";\nimport { topology } from \"topojson-server\";\n\n/**\n * Dissolves all overlapping (Multi)Polygon\n *\n * @param {FeatureCollection<Polygon|MultiPolygon>} geojson Polygons to dissolve\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] Prevent input mutation\n * @returns {Feature<Polygon|MultiPolygon>} Dissolved Polygons\n */\nfunction polygonDissolve(\n geojson: FeatureCollection<Polygon | MultiPolygon>,\n options: { mutate?: boolean } = {}\n): Feature<Polygon | MultiPolygon> | null {\n // Validation\n if (getType(geojson) !== \"FeatureCollection\") {\n throw new Error(\"geojson must be a FeatureCollection\");\n }\n if (!geojson.features.length) {\n throw new Error(\"geojson is empty\");\n }\n\n // Clone geojson to avoid side effects\n // Topojson modifies in place, so we need to deep clone first\n if (options.mutate === false || options.mutate === undefined) {\n geojson = clone(geojson);\n }\n\n const geoms: any[] = [];\n flattenEach(geojson, (feature) => {\n geoms.push(feature.geometry);\n });\n const topo: any = topology({ geoms: geometryCollection(geoms).geometry });\n const merged: any = merge(topo, topo.objects.geoms.geometries);\n return merged;\n}\n\nexport { polygonDissolve };\nexport default polygonDissolve;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-concave/dist/cjs/index.cjs","../../index.ts","../../lib/turf-dissolve.ts","../../lib/turf-line-dissolve.ts","../../lib/turf-polygon-dissolve.ts"],"names":["getType","clone","feature","isObject","flattenEach"],"mappings":"AAAA;ACAA,0CAAyB;AACzB,wCAA2C;AAS3C,kCAA4B;AAC5B,gCAAoB;ADNpB;AACA;AEEA,oCAAsB;AACtB;AACA,4CAAwB;AACxB;A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AAA,CAAK,GAAG,CAAA;AAC5C,IAAA,GAAA,CAAI,CAAC,MAAA,CAAO,SAAA,CAAU,cAAA,CAAe,IAAA,CAAK,QAAA,EAAU,GAAG,CAAA,EAAG;AACxD,MAAA,OAAA,CAAQ,IAAA,CAAK,EAAE,CAAA;AACf,MAAA,QAAA,CAAS,GAAG,EAAA,EAAI,IAAA;AAAA,IAClB;AAAA,EACF,CAAC,CAAA;AACD,EAAA,OAAO,wCAAA,OAAyB,CAAA;AAClC;AAGA,IAAO,qBAAA,EAAQ,OAAA;ADyFf;AACE;AACA;AACF,kEAAC","file":"/home/runner/work/turf/turf/packages/turf-concave/dist/cjs/index.cjs","sourcesContent":[null,"import { distance } from \"@turf/distance\";\nimport { feature, featureCollection } from \"@turf/helpers\";\nimport {\n Feature,\n FeatureCollection,\n MultiPolygon,\n Point,\n Polygon,\n} from \"geojson\";\nimport { Units } from \"@turf/helpers\";\nimport { featureEach } from \"@turf/meta\";\nimport { tin } from \"@turf/tin\";\nimport { dissolve } from \"./lib/turf-dissolve.js\";\n\n/**\n * Takes a set of {@link Point|points} and returns a concave hull Polygon or MultiPolygon.\n * Internally, this uses [turf-tin](https://github.com/Turfjs/turf-tin) to generate geometries.\n *\n * @function\n * @param {FeatureCollection<Point>} points input points\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.maxEdge=Infinity] the length (in 'units') of an edge necessary for part of the\n * hull to become concave.\n * @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers\n * @returns {Feature<(Polygon|MultiPolygon)>|null} a concave hull (null value is returned if unable to compute hull)\n * @example\n * var points = turf.featureCollection([\n * turf.point([-63.601226, 44.642643]),\n * turf.point([-63.591442, 44.651436]),\n * turf.point([-63.580799, 44.648749]),\n * turf.point([-63.573589, 44.641788]),\n * turf.point([-63.587665, 44.64533]),\n * turf.point([-63.595218, 44.64765])\n * ]);\n * var options = {units: 'miles', maxEdge: 1};\n *\n * var hull = turf.concave(points, options);\n *\n * //addToMap\n * var addToMap = [points, hull]\n */\nfunction concave(\n points: FeatureCollection<Point>,\n options: { maxEdge?: number; units?: Units } = {}\n): Feature<Polygon | MultiPolygon> | null {\n const maxEdge = options.maxEdge || Infinity;\n\n const cleaned = removeDuplicates(points);\n\n const tinPolys = tin(cleaned);\n // calculate length of all edges and area of all triangles\n // and remove triangles that fail the max length test\n tinPolys.features = tinPolys.features.filter((triangle) => {\n const pt1 = triangle.geometry.coordinates[0][0];\n const pt2 = triangle.geometry.coordinates[0][1];\n const pt3 = triangle.geometry.coordinates[0][2];\n const dist1 = distance(pt1, pt2, options);\n const dist2 = distance(pt2, pt3, options);\n const dist3 = distance(pt1, pt3, options);\n return dist1 <= maxEdge && dist2 <= maxEdge && dist3 <= maxEdge;\n });\n\n if (tinPolys.features.length < 1) {\n return null;\n }\n\n // merge the adjacent triangles\n const dissolved: any = dissolve(tinPolys);\n\n // geojson-dissolve always returns a MultiPolygon\n if (dissolved.coordinates.length === 1) {\n dissolved.coordinates = dissolved.coordinates[0];\n dissolved.type = \"Polygon\";\n }\n return feature(dissolved);\n}\n\n/**\n * Removes duplicated points in a collection returning a new collection\n *\n * @private\n * @param {FeatureCollection<Point>} points to be cleaned\n * @returns {FeatureCollection<Point>} cleaned set of points\n */\nfunction removeDuplicates(\n points: FeatureCollection<Point>\n): FeatureCollection<Point> {\n const cleaned: Array<Feature<Point>> = [];\n const existing: { [key: string]: boolean } = {};\n\n featureEach(points, (pt) => {\n if (!pt.geometry) {\n return;\n }\n const key = pt.geometry.coordinates.join(\"-\");\n if (!Object.prototype.hasOwnProperty.call(existing, key)) {\n cleaned.push(pt);\n existing[key] = true;\n }\n });\n return featureCollection(cleaned);\n}\n\nexport { concave };\nexport default concave;\n","import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n MultiPolygon,\n Polygon,\n} from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { isObject } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { flattenEach } from \"@turf/meta\";\nimport { lineDissolve } from \"./turf-line-dissolve.js\";\nimport { polygonDissolve } from \"./turf-polygon-dissolve.js\";\n\n/**\n * Transform function: attempts to dissolve geojson objects where possible\n * [GeoJSON] -> GeoJSON geometry\n *\n * @private\n * @param {FeatureCollection<LineString|MultiLineString|Polygon|MultiPolygon>} geojson Features to dissolved\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] Prevent input mutation\n * @returns {Feature<MultiLineString|MultiPolygon>} Dissolved Features\n */\nfunction dissolve(\n geojson: FeatureCollection<\n LineString | MultiLineString | Polygon | MultiPolygon\n >,\n options: {\n mutate?: boolean;\n } = {}\n): Feature<LineString | MultiLineString | Polygon | MultiPolygon> | null {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n const mutate = options.mutate;\n\n // Validation\n if (getType(geojson) !== \"FeatureCollection\") {\n throw new Error(\"geojson must be a FeatureCollection\");\n }\n if (!geojson.features.length) {\n throw new Error(\"geojson is empty\");\n }\n\n // Clone geojson to avoid side effects\n // Topojson modifies in place, so we need to deep clone first\n if (mutate === false || mutate === undefined) {\n geojson = clone(geojson);\n }\n\n // Assert homogenity\n const type = getHomogenousType(geojson);\n if (!type) {\n throw new Error(\"geojson must be homogenous\");\n }\n\n // Data => Typescript hack\n const data: any = geojson;\n\n switch (type) {\n case \"LineString\":\n return lineDissolve(data, options);\n case \"Polygon\":\n return polygonDissolve(data, options);\n default:\n throw new Error(type + \" is not supported\");\n }\n}\n\n/**\n * Checks if GeoJSON is Homogenous\n *\n * @private\n * @param {GeoJSON} geojson GeoJSON\n * @returns {string|null} Homogenous type or null if multiple types\n */\nfunction getHomogenousType(geojson: any) {\n const types: { [key: string]: boolean } = {};\n flattenEach(geojson, (feature) => {\n types[feature.geometry.type] = true;\n });\n const keys = Object.keys(types);\n if (keys.length === 1) {\n return keys[0];\n }\n return null;\n}\n\nexport { dissolve };\nexport default dissolve;\n","import {\n Feature,\n FeatureCollection,\n LineString,\n MultiLineString,\n} from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { isObject, lineString, multiLineString } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { lineReduce } from \"@turf/meta\";\n\n/**\n * Merges all connected (non-forking, non-junctioning) line strings into single lineStrings.\n * [LineString] -> LineString|MultiLineString\n *\n * @param {FeatureCollection<LineString|MultiLineString>} geojson Lines to dissolve\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] Prevent input mutation\n * @returns {Feature<LineString|MultiLineString>} Dissolved lines\n */\nfunction lineDissolve(\n geojson: FeatureCollection<LineString | MultiLineString>,\n options: { mutate?: boolean } = {}\n): Feature<LineString | MultiLineString> | null {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) {\n throw new Error(\"options is invalid\");\n }\n const mutate = options.mutate;\n\n // Validation\n if (getType(geojson) !== \"FeatureCollection\") {\n throw new Error(\"geojson must be a FeatureCollection\");\n }\n if (!geojson.features.length) {\n throw new Error(\"geojson is empty\");\n }\n\n // Clone geojson to avoid side effects\n if (mutate === false || mutate === undefined) {\n geojson = clone(geojson);\n }\n\n const result: any[] = [];\n const lastLine = lineReduce(\n geojson,\n (previousLine: any, currentLine: any) => {\n // Attempt to merge this LineString with the other LineStrings, updating\n // the reference as it is merged with others and grows.\n const merged = mergeLineStrings(previousLine, currentLine);\n\n // Accumulate the merged LineString\n if (merged) {\n return merged;\n // Put the unmerged LineString back into the list\n } else {\n result.push(previousLine);\n return currentLine;\n }\n }\n );\n // Append the last line\n if (lastLine) {\n result.push(lastLine);\n }\n\n // Return null if no lines were dissolved\n if (!result.length) {\n return null;\n // Return LineString if only 1 line was dissolved\n } else if (result.length === 1) {\n return result[0];\n // Return MultiLineString if multiple lines were dissolved with gaps\n } else {\n return multiLineString(\n result.map((line) => {\n return line.coordinates;\n })\n );\n }\n}\n\n// [Number, Number] -> String\nfunction coordId(coord: number[]) {\n return coord[0].toString() + \",\" + coord[1].toString();\n}\n\n/**\n * LineString, LineString -> LineString\n *\n * @private\n * @param {Feature<LineString>} a line1\n * @param {Feature<LineString>} b line2\n * @returns {Feature<LineString>|null} Merged LineString\n */\nfunction mergeLineStrings(a: Feature<LineString>, b: Feature<LineString>) {\n const coords1 = a.geometry.coordinates;\n const coords2 = b.geometry.coordinates;\n\n const s1 = coordId(coords1[0]);\n const e1 = coordId(coords1[coords1.length - 1]);\n const s2 = coordId(coords2[0]);\n const e2 = coordId(coords2[coords2.length - 1]);\n\n // TODO: handle case where more than one of these is true!\n let coords;\n if (s1 === e2) {\n coords = coords2.concat(coords1.slice(1));\n } else if (s2 === e1) {\n coords = coords1.concat(coords2.slice(1));\n } else if (s1 === s2) {\n coords = coords1.slice(1).reverse().concat(coords2);\n } else if (e1 === e2) {\n coords = coords1.concat(coords2.reverse().slice(1));\n } else {\n return null;\n }\n\n return lineString(coords);\n}\n\nexport { lineDissolve };\nexport default lineDissolve;\n","import { Feature, FeatureCollection, MultiPolygon, Polygon } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { geometryCollection } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { flattenEach } from \"@turf/meta\";\nimport { merge } from \"topojson-client\";\nimport { topology } from \"topojson-server\";\n\n/**\n * Dissolves all overlapping (Multi)Polygon\n *\n * @param {FeatureCollection<Polygon|MultiPolygon>} geojson Polygons to dissolve\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] Prevent input mutation\n * @returns {Feature<Polygon|MultiPolygon>} Dissolved Polygons\n */\nfunction polygonDissolve(\n geojson: FeatureCollection<Polygon | MultiPolygon>,\n options: { mutate?: boolean } = {}\n): Feature<Polygon | MultiPolygon> | null {\n // Validation\n if (getType(geojson) !== \"FeatureCollection\") {\n throw new Error(\"geojson must be a FeatureCollection\");\n }\n if (!geojson.features.length) {\n throw new Error(\"geojson is empty\");\n }\n\n // Clone geojson to avoid side effects\n // Topojson modifies in place, so we need to deep clone first\n if (options.mutate === false || options.mutate === undefined) {\n geojson = clone(geojson);\n }\n\n const geoms: any[] = [];\n flattenEach(geojson, (feature) => {\n geoms.push(feature.geometry);\n });\n const topo: any = topology({ geoms: geometryCollection(geoms).geometry });\n const merged: any = merge(topo, topo.objects.geoms.geometries);\n return merged;\n}\n\nexport { polygonDissolve };\nexport default polygonDissolve;\n"]}
@@ -5,7 +5,7 @@ import { Units } from '@turf/helpers';
5
5
  * Takes a set of {@link Point|points} and returns a concave hull Polygon or MultiPolygon.
6
6
  * Internally, this uses [turf-tin](https://github.com/Turfjs/turf-tin) to generate geometries.
7
7
  *
8
- * @name concave
8
+ * @function
9
9
  * @param {FeatureCollection<Point>} points input points
10
10
  * @param {Object} [options={}] Optional parameters
11
11
  * @param {number} [options.maxEdge=Infinity] the length (in 'units') of an edge necessary for part of the