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
@@ -283,14 +283,11 @@ BinaryHeap.prototype = {
283
283
  // index.ts
284
284
  function shortestPath(start, end, options = {}) {
285
285
  options = options || {};
286
- if (!isObject(options))
287
- throw new Error("options is invalid");
286
+ if (!isObject(options)) throw new Error("options is invalid");
288
287
  let obstacles = options.obstacles || featureCollection([]);
289
288
  let resolution = options.resolution || 100;
290
- if (!start)
291
- throw new Error("start is required");
292
- if (!end)
293
- throw new Error("end is required");
289
+ if (!start) throw new Error("start is required");
290
+ if (!end) throw new Error("end is required");
294
291
  if (resolution && (!isNumber(resolution) || resolution <= 0))
295
292
  throw new Error("options.resolution must be a number, greater than 0");
296
293
  const startCoord = getCoord(start);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/javascript-astar.js"],"sourcesContent":["import {\n Polygon,\n Feature,\n FeatureCollection,\n LineString,\n Geometry,\n Point,\n} from \"geojson\";\nimport { bbox } from \"@turf/bbox\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { distance } from \"@turf/distance\";\nimport { transformScale as scale } from \"@turf/transform-scale\";\nimport { cleanCoords } from \"@turf/clean-coords\";\nimport { bboxPolygon } from \"@turf/bbox-polygon\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nimport {\n Coord,\n Units,\n point,\n isNumber,\n lineString,\n isObject,\n featureCollection,\n feature,\n} from \"@turf/helpers\";\nimport { Graph, GridNode, astar } from \"./lib/javascript-astar.js\";\n\n/**\n * Returns the shortest {@link LineString|path} from {@link Point|start} to {@link Point|end} without colliding with\n * any {@link Feature} in {@link FeatureCollection<Polygon>| obstacles}\n *\n * @name shortestPath\n * @param {Coord} start point\n * @param {Coord} end point\n * @param {Object} [options={}] optional parameters\n * @param {Geometry|Feature|FeatureCollection<Polygon>} [options.obstacles] areas which path cannot travel\n * @param {string} [options.units='kilometers'] unit in which resolution & minimum distance will be expressed in; it can be degrees, radians, miles, kilometers, ...\n * @param {number} [options.resolution=100] distance between matrix points on which the path will be calculated\n * @returns {Feature<LineString>} shortest path between start and end\n * @example\n * var start = [-5, -6];\n * var end = [9, -6];\n * var options = {\n * obstacles: turf.polygon([[[0, -7], [5, -7], [5, -3], [0, -3], [0, -7]]])\n * };\n *\n * var path = turf.shortestPath(start, end, options);\n *\n * //addToMap\n * var addToMap = [start, end, options.obstacles, path];\n */\nfunction shortestPath(\n start: Coord,\n end: Coord,\n options: {\n obstacles?: Polygon | Feature<Polygon> | FeatureCollection<Polygon>;\n units?: Units;\n resolution?: number;\n } = {}\n): Feature<LineString> {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n let obstacles = options.obstacles || featureCollection([]);\n let resolution = options.resolution || 100;\n\n // validation\n if (!start) throw new Error(\"start is required\");\n if (!end) throw new Error(\"end is required\");\n if (resolution && (!isNumber(resolution) || resolution <= 0))\n throw new Error(\"options.resolution must be a number, greater than 0\");\n\n // Normalize Inputs\n const startCoord = getCoord(start);\n const endCoord = getCoord(end);\n start = point(startCoord);\n end = point(endCoord);\n\n // Handle obstacles\n if (obstacles.type === \"FeatureCollection\") {\n if (obstacles.features.length === 0) {\n return lineString([startCoord, endCoord]);\n }\n } else if (obstacles.type === \"Polygon\") {\n obstacles = featureCollection([feature(getGeom(obstacles))]);\n } else {\n throw new Error(\"invalid obstacles\");\n }\n\n // define path grid area\n const collection: FeatureCollection<Geometry> = obstacles;\n collection.features.push(start);\n collection.features.push(end);\n const box = bbox(scale(bboxPolygon(bbox(collection)), 1.15)); // extend 15%\n const [west, south, east, north] = box;\n\n const width = distance([west, south], [east, south], options);\n const division = width / resolution;\n\n collection.features.pop();\n collection.features.pop();\n\n const xFraction = division / distance([west, south], [east, south], options);\n const cellWidth = xFraction * (east - west);\n const yFraction = division / distance([west, south], [west, north], options);\n const cellHeight = yFraction * (north - south);\n\n const bboxHorizontalSide = east - west;\n const bboxVerticalSide = north - south;\n const columns = Math.floor(bboxHorizontalSide / cellWidth);\n const rows = Math.floor(bboxVerticalSide / cellHeight);\n // adjust origin of the grid\n const deltaX = (bboxHorizontalSide - columns * cellWidth) / 2;\n const deltaY = (bboxVerticalSide - rows * cellHeight) / 2;\n\n // loop through points only once to speed up process\n // define matrix grid for A-star algorithm\n const pointMatrix: string[][] = [];\n const matrix: number[][] = [];\n\n let closestToStart: GridNode;\n let closestToEnd: GridNode;\n let minDistStart = Infinity;\n let minDistEnd = Infinity;\n let currentY = north - deltaY;\n let r = 0;\n while (currentY >= south) {\n // var currentY = south + deltaY;\n const matrixRow = [];\n const pointMatrixRow = [];\n let currentX = west + deltaX;\n let c = 0;\n while (currentX <= east) {\n const pt = point([currentX, currentY]);\n const isInsideObstacle = isInside(pt, obstacles);\n // feed obstacles matrix\n matrixRow.push(isInsideObstacle ? 0 : 1); // with javascript-astar\n // matrixRow.push(isInsideObstacle ? 1 : 0); // with astar-andrea\n // map point's coords\n pointMatrixRow.push(currentX + \"|\" + currentY);\n // set closest points\n const distStart = distance(pt, start);\n // if (distStart < minDistStart) {\n if (!isInsideObstacle && distStart < minDistStart) {\n minDistStart = distStart;\n closestToStart = { x: c, y: r };\n }\n const distEnd = distance(pt, end);\n // if (distEnd < minDistEnd) {\n if (!isInsideObstacle && distEnd < minDistEnd) {\n minDistEnd = distEnd;\n closestToEnd = { x: c, y: r };\n }\n currentX += cellWidth;\n c++;\n }\n matrix.push(matrixRow);\n pointMatrix.push(pointMatrixRow);\n currentY -= cellHeight;\n r++;\n }\n\n // find path on matrix grid\n\n // javascript-astar ----------------------\n const graph = new Graph(matrix, { diagonal: true });\n const startOnMatrix = graph.grid[closestToStart!.y][closestToStart!.x];\n const endOnMatrix = graph.grid[closestToEnd!.y][closestToEnd!.x];\n const result: GridNode[] = astar.search(graph, startOnMatrix, endOnMatrix);\n\n const path = [startCoord];\n result.forEach(function (coord) {\n const coords = pointMatrix[coord.x][coord.y].split(\"|\");\n path.push([+coords[0], +coords[1]]); // make sure coords are numbers\n });\n path.push(endCoord);\n // ---------------------------------------\n\n // astar-andrea ------------------------\n // var result = aStar(matrix, [closestToStart.x, closestToStart.y], [closestToEnd.x, closestToEnd.y], 'DiagonalFree');\n // var path = [start.geometry.coordinates];\n // result.forEach(function (coord) {\n // var coords = pointMatrix[coord[1]][coord[0]].split('|');\n // path.push([+coords[0], +coords[1]]); // make sure coords are numbers\n // });\n // path.push(end.geometry.coordinates);\n // ---------------------------------------\n\n return cleanCoords(lineString(path));\n}\n\n/**\n * Checks if Point is inside any of the Polygons\n *\n * @private\n * @param {Feature<Point>} pt to check\n * @param {FeatureCollection<Polygon>} polygons features\n * @returns {boolean} if inside or not\n */\nfunction isInside(pt: Feature<Point>, polygons: FeatureCollection<Polygon>) {\n for (let i = 0; i < polygons.features.length; i++) {\n if (booleanPointInPolygon(pt, polygons.features[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { shortestPath };\nexport default shortestPath;\n","// javascript-astar 0.4.1\n// http://github.com/bgrins/javascript-astar\n// Freely distributable under the MIT License.\n// Implements the astar search algorithm in javascript using a Binary Heap.\n// Includes Binary Heap (with modifications) from Marijn Haverbeke.\n// http://eloquentjavascript.net/appendix2.html\n\nfunction pathTo(node) {\n var curr = node,\n path = [];\n while (curr.parent) {\n path.unshift(curr);\n curr = curr.parent;\n }\n return path;\n}\n\nfunction getHeap() {\n return new BinaryHeap(function (node) {\n return node.f;\n });\n}\n\n/**\n * Astar\n * @private\n */\nexport var astar = {\n /**\n * Perform an A* Search on a graph given a start and end node.\n *\n * @private\n * @memberof astar\n * @param {Graph} graph Graph\n * @param {GridNode} start Start\n * @param {GridNode} end End\n * @param {Object} [options] Options\n * @param {bool} [options.closest] Specifies whether to return the path to the closest node if the target is unreachable.\n * @param {Function} [options.heuristic] Heuristic function (see astar.heuristics).\n * @returns {Object} Search\n */\n search: function (graph, start, end, options) {\n graph.cleanDirty();\n options = options || {};\n var heuristic = options.heuristic || astar.heuristics.manhattan,\n closest = options.closest ?? false;\n\n var openHeap = getHeap(),\n closestNode = start; // set the start node to be the closest if required\n\n start.h = heuristic(start, end);\n\n openHeap.push(start);\n\n while (openHeap.size() > 0) {\n // Grab the lowest f(x) to process next. Heap keeps this sorted for us.\n var currentNode = openHeap.pop();\n\n // End case -- result has been found, return the traced path.\n if (currentNode === end) {\n return pathTo(currentNode);\n }\n\n // Normal case -- move currentNode from open to closed, process each of its neighbors.\n currentNode.closed = true;\n\n // Find all neighbors for the current node.\n var neighbors = graph.neighbors(currentNode);\n\n for (var i = 0, il = neighbors.length; i < il; ++i) {\n var neighbor = neighbors[i];\n\n if (neighbor.closed || neighbor.isWall()) {\n // Not a valid node to process, skip to next neighbor.\n continue;\n }\n\n // The g score is the shortest distance from start to current node.\n // We need to check if the path we have arrived at this neighbor is the shortest one we have seen yet.\n var gScore = currentNode.g + neighbor.getCost(currentNode),\n beenVisited = neighbor.visited;\n\n if (!beenVisited || gScore < neighbor.g) {\n // Found an optimal (so far) path to this node. Take score for node to see how good it is.\n neighbor.visited = true;\n neighbor.parent = currentNode;\n neighbor.h = neighbor.h || heuristic(neighbor, end);\n neighbor.g = gScore;\n neighbor.f = neighbor.g + neighbor.h;\n graph.markDirty(neighbor);\n if (closest) {\n // If the neighbour is closer than the current closestNode or if it's equally close but has\n // a cheaper path than the current closest node then it becomes the closest node\n if (\n neighbor.h < closestNode.h ||\n (neighbor.h === closestNode.h && neighbor.g < closestNode.g)\n ) {\n closestNode = neighbor;\n }\n }\n\n if (!beenVisited) {\n // Pushing to heap will put it in proper place based on the 'f' value.\n openHeap.push(neighbor);\n } else {\n // Already seen the node, but since it has been rescored we need to reorder it in the heap\n openHeap.rescoreElement(neighbor);\n }\n }\n }\n }\n\n if (closest) {\n return pathTo(closestNode);\n }\n\n // No result was found - empty array signifies failure to find path.\n return [];\n },\n // See list of heuristics: http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html\n heuristics: {\n manhattan: function (pos0, pos1) {\n var d1 = Math.abs(pos1.x - pos0.x);\n var d2 = Math.abs(pos1.y - pos0.y);\n return d1 + d2;\n },\n diagonal: function (pos0, pos1) {\n var D = 1;\n var D2 = Math.sqrt(2);\n var d1 = Math.abs(pos1.x - pos0.x);\n var d2 = Math.abs(pos1.y - pos0.y);\n return D * (d1 + d2) + (D2 - 2 * D) * Math.min(d1, d2);\n },\n },\n cleanNode: function (node) {\n node.f = 0;\n node.g = 0;\n node.h = 0;\n node.visited = false;\n node.closed = false;\n node.parent = null;\n },\n};\n\n/**\n * A graph memory structure\n *\n * @private\n * @param {Array} gridIn 2D array of input weights\n * @param {Object} [options] Options\n * @param {boolean} [options.diagonal] Specifies whether diagonal moves are allowed\n * @returns {void} Graph\n */\nexport function Graph(gridIn, options) {\n options = options || {};\n this.nodes = [];\n this.diagonal = !!options.diagonal;\n this.grid = [];\n for (var x = 0; x < gridIn.length; x++) {\n this.grid[x] = [];\n\n for (var y = 0, row = gridIn[x]; y < row.length; y++) {\n var node = new GridNode(x, y, row[y]);\n this.grid[x][y] = node;\n this.nodes.push(node);\n }\n }\n this.init();\n}\n\nGraph.prototype.init = function () {\n this.dirtyNodes = [];\n for (var i = 0; i < this.nodes.length; i++) {\n astar.cleanNode(this.nodes[i]);\n }\n};\n\nGraph.prototype.cleanDirty = function () {\n for (var i = 0; i < this.dirtyNodes.length; i++) {\n astar.cleanNode(this.dirtyNodes[i]);\n }\n this.dirtyNodes = [];\n};\n\nGraph.prototype.markDirty = function (node) {\n this.dirtyNodes.push(node);\n};\n\nGraph.prototype.neighbors = function (node) {\n var ret = [],\n x = node.x,\n y = node.y,\n grid = this.grid;\n\n // West\n if (grid[x - 1] && grid[x - 1][y]) {\n ret.push(grid[x - 1][y]);\n }\n\n // East\n if (grid[x + 1] && grid[x + 1][y]) {\n ret.push(grid[x + 1][y]);\n }\n\n // South\n if (grid[x] && grid[x][y - 1]) {\n ret.push(grid[x][y - 1]);\n }\n\n // North\n if (grid[x] && grid[x][y + 1]) {\n ret.push(grid[x][y + 1]);\n }\n\n if (this.diagonal) {\n // Southwest\n if (grid[x - 1] && grid[x - 1][y - 1]) {\n ret.push(grid[x - 1][y - 1]);\n }\n\n // Southeast\n if (grid[x + 1] && grid[x + 1][y - 1]) {\n ret.push(grid[x + 1][y - 1]);\n }\n\n // Northwest\n if (grid[x - 1] && grid[x - 1][y + 1]) {\n ret.push(grid[x - 1][y + 1]);\n }\n\n // Northeast\n if (grid[x + 1] && grid[x + 1][y + 1]) {\n ret.push(grid[x + 1][y + 1]);\n }\n }\n\n return ret;\n};\n\nGraph.prototype.toString = function () {\n var graphString = [],\n nodes = this.grid, // when using grid\n rowDebug,\n row,\n y,\n l;\n for (var x = 0, len = nodes.length; x < len; x++) {\n rowDebug = [];\n row = nodes[x];\n for (y = 0, l = row.length; y < l; y++) {\n rowDebug.push(row[y].weight);\n }\n graphString.push(rowDebug.join(\" \"));\n }\n return graphString.join(\"\\n\");\n};\n\nfunction GridNode(x, y, weight) {\n this.x = x;\n this.y = y;\n this.weight = weight;\n}\n\nGridNode.prototype.toString = function () {\n return \"[\" + this.x + \" \" + this.y + \"]\";\n};\n\nGridNode.prototype.getCost = function (fromNeighbor) {\n // Take diagonal weight into consideration.\n if (fromNeighbor && fromNeighbor.x !== this.x && fromNeighbor.y !== this.y) {\n return this.weight * 1.41421;\n }\n return this.weight;\n};\n\nGridNode.prototype.isWall = function () {\n return this.weight === 0;\n};\n\nfunction BinaryHeap(scoreFunction) {\n this.content = [];\n this.scoreFunction = scoreFunction;\n}\n\nBinaryHeap.prototype = {\n push: function (element) {\n // Add the new element to the end of the array.\n this.content.push(element);\n\n // Allow it to sink down.\n this.sinkDown(this.content.length - 1);\n },\n pop: function () {\n // Store the first element so we can return it later.\n var result = this.content[0];\n // Get the element at the end of the array.\n var end = this.content.pop();\n // If there are any elements left, put the end element at the\n // start, and let it bubble up.\n if (this.content.length > 0) {\n this.content[0] = end;\n this.bubbleUp(0);\n }\n return result;\n },\n remove: function (node) {\n var i = this.content.indexOf(node);\n\n // When it is found, the process seen in 'pop' is repeated\n // to fill up the hole.\n var end = this.content.pop();\n\n if (i !== this.content.length - 1) {\n this.content[i] = end;\n\n if (this.scoreFunction(end) < this.scoreFunction(node)) {\n this.sinkDown(i);\n } else {\n this.bubbleUp(i);\n }\n }\n },\n size: function () {\n return this.content.length;\n },\n rescoreElement: function (node) {\n this.sinkDown(this.content.indexOf(node));\n },\n sinkDown: function (n) {\n // Fetch the element that has to be sunk.\n var element = this.content[n];\n\n // When at 0, an element can not sink any further.\n while (n > 0) {\n // Compute the parent element's index, and fetch it.\n var parentN = ((n + 1) >> 1) - 1,\n parent = this.content[parentN];\n // Swap the elements if the parent is greater.\n if (this.scoreFunction(element) < this.scoreFunction(parent)) {\n this.content[parentN] = element;\n this.content[n] = parent;\n // Update 'n' to continue at the new position.\n n = parentN;\n // Found a parent that is less, no need to sink any further.\n } else {\n break;\n }\n }\n },\n bubbleUp: function (n) {\n // Look up the target element and its score.\n var length = this.content.length,\n element = this.content[n],\n elemScore = this.scoreFunction(element);\n\n while (true) {\n // Compute the indices of the child elements.\n var child2N = (n + 1) << 1,\n child1N = child2N - 1;\n // This is used to store the new position of the element, if any.\n var swap = null,\n child1Score;\n // If the first child exists (is inside the array)...\n if (child1N < length) {\n // Look it up and compute its score.\n var child1 = this.content[child1N];\n child1Score = this.scoreFunction(child1);\n\n // If the score is less than our element's, we need to swap.\n if (child1Score < elemScore) {\n swap = child1N;\n }\n }\n\n // Do the same checks for the other child.\n if (child2N < length) {\n var child2 = this.content[child2N],\n child2Score = this.scoreFunction(child2);\n if (child2Score < (swap === null ? elemScore : child1Score)) {\n swap = child2N;\n }\n }\n\n // If the element needs to be moved, swap it, and continue.\n if (swap !== null) {\n this.content[n] = this.content[swap];\n this.content[swap] = element;\n n = swap;\n // Otherwise, we are done.\n } else {\n break;\n }\n }\n },\n};\n"],"mappings":";AAQA,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,aAAa;AACxC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,UAAU,eAAe;AAClC;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACjBP,SAAS,OAAO,MAAM;AACpB,MAAI,OAAO,MACT,OAAO,CAAC;AACV,SAAO,KAAK,QAAQ;AAClB,SAAK,QAAQ,IAAI;AACjB,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;AAEA,SAAS,UAAU;AACjB,SAAO,IAAI,WAAW,SAAU,MAAM;AACpC,WAAO,KAAK;AAAA,EACd,CAAC;AACH;AAMO,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcjB,QAAQ,SAAU,OAAO,OAAO,KAAK,SAAS;AAzChD;AA0CI,UAAM,WAAW;AACjB,cAAU,WAAW,CAAC;AACtB,QAAI,YAAY,QAAQ,aAAa,MAAM,WAAW,WACpD,WAAU,aAAQ,YAAR,YAAmB;AAE/B,QAAI,WAAW,QAAQ,GACrB,cAAc;AAEhB,UAAM,IAAI,UAAU,OAAO,GAAG;AAE9B,aAAS,KAAK,KAAK;AAEnB,WAAO,SAAS,KAAK,IAAI,GAAG;AAE1B,UAAI,cAAc,SAAS,IAAI;AAG/B,UAAI,gBAAgB,KAAK;AACvB,eAAO,OAAO,WAAW;AAAA,MAC3B;AAGA,kBAAY,SAAS;AAGrB,UAA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,UAAI,CAAC,oBAAoB,YAAY,cAAc;AACjD,uBAAe;AACf,yBAAiB,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,MAChC;AACA,YAAM,UAAU,SAAS,IAAI,GAAG;AAEhC,UAAI,CAAC,oBAAoB,UAAU,YAAY;AAC7C,qBAAa;AACb,uBAAe,EAAE,GAAG,GAAG,GAAG,EAAE;AAAA,MAC9B;AACA,kBAAY;AACZ;AAAA,IACF;AACA,WAAO,KAAK,SAAS;AACrB,gBAAY,KAAK,cAAc;AAC/B,gBAAY;AACZ;AAAA,EACF;AAKA,QAAM,QAAQ,IAAI,MAAM,QAAQ,EAAE,UAAU,KAAK,CAAC;AAClD,QAAM,gBAAgB,MAAM,KAAK,eAAgB,CAAC,EAAE,eAAgB,CAAC;AACrE,QAAM,cAAc,MAAM,KAAK,aAAc,CAAC,EAAE,aAAc,CAAC;AAC/D,QAAM,SAAqB,MAAM,OAAO,OAAO,eAAe,WAAW;AAEzE,QAAM,OAAO,CAAC,UAAU;AACxB,SAAO,QAAQ,SAAU,OAAO;AAC9B,UAAM,SAAS,YAAY,MAAM,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG;AACtD,SAAK,KAAK,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC;AAAA,EACpC,CAAC;AACD,OAAK,KAAK,QAAQ;AAalB,SAAO,YAAY,WAAW,IAAI,CAAC;AACrC;AAUA,SAAS,SAAS,IAAoB,UAAsC;AAC1E,WAAS,IAAI,GAAG,IAAI,SAAS,SAAS,QAAQ,KAAK;AACjD,QAAI,sBAAsB,IAAI,SAAS,SAAS,CAAC,CAAC,GAAG;AACnD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAGA,IAAO,6BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts","../../lib/javascript-astar.js"],"sourcesContent":["import {\n Polygon,\n Feature,\n FeatureCollection,\n LineString,\n Geometry,\n Point,\n} from \"geojson\";\nimport { bbox } from \"@turf/bbox\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { distance } from \"@turf/distance\";\nimport { transformScale as scale } from \"@turf/transform-scale\";\nimport { cleanCoords } from \"@turf/clean-coords\";\nimport { bboxPolygon } from \"@turf/bbox-polygon\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nimport {\n Coord,\n Units,\n point,\n isNumber,\n lineString,\n isObject,\n featureCollection,\n feature,\n} from \"@turf/helpers\";\nimport { Graph, GridNode, astar } from \"./lib/javascript-astar.js\";\n\n/**\n * Returns the shortest {@link LineString|path} from {@link Point|start} to {@link Point|end} without colliding with\n * any {@link Feature} in obstacles {@link FeatureCollection}<{@link Polygon}>\n *\n * @function\n * @param {Coord} start point\n * @param {Coord} end point\n * @param {Object} [options={}] optional parameters\n * @param {Polygon|Feature<Polygon>|FeatureCollection<Polygon>} [options.obstacles] areas which path cannot travel\n * @param {Units} [options.units='kilometers'] unit in which resolution & minimum distance will be expressed in; it can be degrees, radians, miles, kilometers, ...\n * @param {number} [options.resolution=100] distance between matrix points on which the path will be calculated\n * @returns {Feature<LineString>} shortest path between start and end\n * @example\n * var start = [-5, -6];\n * var end = [9, -6];\n * var options = {\n * obstacles: turf.polygon([[[0, -7], [5, -7], [5, -3], [0, -3], [0, -7]]]).geometry\n * };\n *\n * var path = turf.shortestPath(start, end, options);\n *\n * //addToMap\n * var addToMap = [start, end, options.obstacles, path];\n */\nfunction shortestPath(\n start: Coord,\n end: Coord,\n options: {\n obstacles?: Polygon | Feature<Polygon> | FeatureCollection<Polygon>;\n units?: Units;\n resolution?: number;\n } = {}\n): Feature<LineString> {\n // Optional parameters\n options = options || {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n let obstacles = options.obstacles || featureCollection([]);\n let resolution = options.resolution || 100;\n\n // validation\n if (!start) throw new Error(\"start is required\");\n if (!end) throw new Error(\"end is required\");\n if (resolution && (!isNumber(resolution) || resolution <= 0))\n throw new Error(\"options.resolution must be a number, greater than 0\");\n\n // Normalize Inputs\n const startCoord = getCoord(start);\n const endCoord = getCoord(end);\n start = point(startCoord);\n end = point(endCoord);\n\n // Handle obstacles\n if (obstacles.type === \"FeatureCollection\") {\n if (obstacles.features.length === 0) {\n return lineString([startCoord, endCoord]);\n }\n } else if (obstacles.type === \"Polygon\") {\n obstacles = featureCollection([feature(getGeom(obstacles))]);\n } else {\n throw new Error(\"invalid obstacles\");\n }\n\n // define path grid area\n const collection: FeatureCollection<Geometry> = obstacles;\n collection.features.push(start);\n collection.features.push(end);\n const box = bbox(scale(bboxPolygon(bbox(collection)), 1.15)); // extend 15%\n const [west, south, east, north] = box;\n\n const width = distance([west, south], [east, south], options);\n const division = width / resolution;\n\n collection.features.pop();\n collection.features.pop();\n\n const xFraction = division / distance([west, south], [east, south], options);\n const cellWidth = xFraction * (east - west);\n const yFraction = division / distance([west, south], [west, north], options);\n const cellHeight = yFraction * (north - south);\n\n const bboxHorizontalSide = east - west;\n const bboxVerticalSide = north - south;\n const columns = Math.floor(bboxHorizontalSide / cellWidth);\n const rows = Math.floor(bboxVerticalSide / cellHeight);\n // adjust origin of the grid\n const deltaX = (bboxHorizontalSide - columns * cellWidth) / 2;\n const deltaY = (bboxVerticalSide - rows * cellHeight) / 2;\n\n // loop through points only once to speed up process\n // define matrix grid for A-star algorithm\n const pointMatrix: string[][] = [];\n const matrix: number[][] = [];\n\n let closestToStart: GridNode;\n let closestToEnd: GridNode;\n let minDistStart = Infinity;\n let minDistEnd = Infinity;\n let currentY = north - deltaY;\n let r = 0;\n while (currentY >= south) {\n // var currentY = south + deltaY;\n const matrixRow = [];\n const pointMatrixRow = [];\n let currentX = west + deltaX;\n let c = 0;\n while (currentX <= east) {\n const pt = point([currentX, currentY]);\n const isInsideObstacle = isInside(pt, obstacles);\n // feed obstacles matrix\n matrixRow.push(isInsideObstacle ? 0 : 1); // with javascript-astar\n // matrixRow.push(isInsideObstacle ? 1 : 0); // with astar-andrea\n // map point's coords\n pointMatrixRow.push(currentX + \"|\" + currentY);\n // set closest points\n const distStart = distance(pt, start);\n // if (distStart < minDistStart) {\n if (!isInsideObstacle && distStart < minDistStart) {\n minDistStart = distStart;\n closestToStart = { x: c, y: r };\n }\n const distEnd = distance(pt, end);\n // if (distEnd < minDistEnd) {\n if (!isInsideObstacle && distEnd < minDistEnd) {\n minDistEnd = distEnd;\n closestToEnd = { x: c, y: r };\n }\n currentX += cellWidth;\n c++;\n }\n matrix.push(matrixRow);\n pointMatrix.push(pointMatrixRow);\n currentY -= cellHeight;\n r++;\n }\n\n // find path on matrix grid\n\n // javascript-astar ----------------------\n const graph = new Graph(matrix, { diagonal: true });\n const startOnMatrix = graph.grid[closestToStart!.y][closestToStart!.x];\n const endOnMatrix = graph.grid[closestToEnd!.y][closestToEnd!.x];\n const result: GridNode[] = astar.search(graph, startOnMatrix, endOnMatrix);\n\n const path = [startCoord];\n result.forEach(function (coord) {\n const coords = pointMatrix[coord.x][coord.y].split(\"|\");\n path.push([+coords[0], +coords[1]]); // make sure coords are numbers\n });\n path.push(endCoord);\n // ---------------------------------------\n\n // astar-andrea ------------------------\n // var result = aStar(matrix, [closestToStart.x, closestToStart.y], [closestToEnd.x, closestToEnd.y], 'DiagonalFree');\n // var path = [start.geometry.coordinates];\n // result.forEach(function (coord) {\n // var coords = pointMatrix[coord[1]][coord[0]].split('|');\n // path.push([+coords[0], +coords[1]]); // make sure coords are numbers\n // });\n // path.push(end.geometry.coordinates);\n // ---------------------------------------\n\n return cleanCoords(lineString(path));\n}\n\n/**\n * Checks if Point is inside any of the Polygons\n *\n * @private\n * @param {Feature<Point>} pt to check\n * @param {FeatureCollection<Polygon>} polygons features\n * @returns {boolean} if inside or not\n */\nfunction isInside(pt: Feature<Point>, polygons: FeatureCollection<Polygon>) {\n for (let i = 0; i < polygons.features.length; i++) {\n if (booleanPointInPolygon(pt, polygons.features[i])) {\n return true;\n }\n }\n return false;\n}\n\nexport { shortestPath };\nexport default shortestPath;\n","// javascript-astar 0.4.1\n// http://github.com/bgrins/javascript-astar\n// Freely distributable under the MIT License.\n// Implements the astar search algorithm in javascript using a Binary Heap.\n// Includes Binary Heap (with modifications) from Marijn Haverbeke.\n// http://eloquentjavascript.net/appendix2.html\n\nfunction pathTo(node) {\n var curr = node,\n path = [];\n while (curr.parent) {\n path.unshift(curr);\n curr = curr.parent;\n }\n return path;\n}\n\nfunction getHeap() {\n return new BinaryHeap(function (node) {\n return node.f;\n });\n}\n\n/**\n * Astar\n * @private\n */\nexport var astar = {\n /**\n * Perform an A* Search on a graph given a start and end node.\n *\n * @private\n * @memberof astar\n * @param {Graph} graph Graph\n * @param {GridNode} start Start\n * @param {GridNode} end End\n * @param {Object} [options] Options\n * @param {bool} [options.closest] Specifies whether to return the path to the closest node if the target is unreachable.\n * @param {Function} [options.heuristic] Heuristic function (see astar.heuristics).\n * @returns {Object} Search\n */\n search: function (graph, start, end, options) {\n graph.cleanDirty();\n options = options || {};\n var heuristic = options.heuristic || astar.heuristics.manhattan,\n closest = options.closest ?? false;\n\n var openHeap = getHeap(),\n closestNode = start; // set the start node to be the closest if required\n\n start.h = heuristic(start, end);\n\n openHeap.push(start);\n\n while (openHeap.size() > 0) {\n // Grab the lowest f(x) to process next. Heap keeps this sorted for us.\n var currentNode = openHeap.pop();\n\n // End case -- result has been found, return the traced path.\n if (currentNode === end) {\n return pathTo(currentNode);\n }\n\n // Normal case -- move currentNode from open to closed, process each of its neighbors.\n currentNode.closed = true;\n\n // Find all neighbors for the current node.\n var neighbors = graph.neighbors(currentNode);\n\n for (var i = 0, il = neighbors.length; i < il; ++i) {\n var neighbor = neighbors[i];\n\n if (neighbor.closed || neighbor.isWall()) {\n // Not a valid node to process, skip to next neighbor.\n continue;\n }\n\n // The g score is the shortest distance from start to current node.\n // We need to check if the path we have arrived at this neighbor is the shortest one we have seen yet.\n var gScore = currentNode.g + neighbor.getCost(currentNode),\n beenVisited = neighbor.visited;\n\n if (!beenVisited || gScore < neighbor.g) {\n // Found an optimal (so far) path to this node. Take score for node to see how good it is.\n neighbor.visited = true;\n neighbor.parent = currentNode;\n neighbor.h = neighbor.h || heuristic(neighbor, end);\n neighbor.g = gScore;\n neighbor.f = neighbor.g + neighbor.h;\n graph.markDirty(neighbor);\n if (closest) {\n // If the neighbour is closer than the current closestNode or if it's equally close but has\n // a cheaper path than the current closest node then it becomes the closest node\n if (\n neighbor.h < closestNode.h ||\n (neighbor.h === closestNode.h && neighbor.g < closestNode.g)\n ) {\n closestNode = neighbor;\n }\n }\n\n if (!beenVisited) {\n // Pushing to heap will put it in proper place based on the 'f' value.\n openHeap.push(neighbor);\n } else {\n // Already seen the node, but since it has been rescored we need to reorder it in the heap\n openHeap.rescoreElement(neighbor);\n }\n }\n }\n }\n\n if (closest) {\n return pathTo(closestNode);\n }\n\n // No result was found - empty array signifies failure to find path.\n return [];\n },\n // See list of heuristics: http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html\n heuristics: {\n manhattan: function (pos0, pos1) {\n var d1 = Math.abs(pos1.x - pos0.x);\n var d2 = Math.abs(pos1.y - pos0.y);\n return d1 + d2;\n },\n diagonal: function (pos0, pos1) {\n var D = 1;\n var D2 = Math.sqrt(2);\n var d1 = Math.abs(pos1.x - pos0.x);\n var d2 = Math.abs(pos1.y - pos0.y);\n return D * (d1 + d2) + (D2 - 2 * D) * Math.min(d1, d2);\n },\n },\n cleanNode: function (node) {\n node.f = 0;\n node.g = 0;\n node.h = 0;\n node.visited = false;\n node.closed = false;\n node.parent = null;\n },\n};\n\n/**\n * A graph memory structure\n *\n * @private\n * @param {Array} gridIn 2D array of input weights\n * @param {Object} [options] Options\n * @param {boolean} [options.diagonal] Specifies whether diagonal moves are allowed\n * @returns {void} Graph\n */\nexport function Graph(gridIn, options) {\n options = options || {};\n this.nodes = [];\n this.diagonal = !!options.diagonal;\n this.grid = [];\n for (var x = 0; x < gridIn.length; x++) {\n this.grid[x] = [];\n\n for (var y = 0, row = gridIn[x]; y < row.length; y++) {\n var node = new GridNode(x, y, row[y]);\n this.grid[x][y] = node;\n this.nodes.push(node);\n }\n }\n this.init();\n}\n\nGraph.prototype.init = function () {\n this.dirtyNodes = [];\n for (var i = 0; i < this.nodes.length; i++) {\n astar.cleanNode(this.nodes[i]);\n }\n};\n\nGraph.prototype.cleanDirty = function () {\n for (var i = 0; i < this.dirtyNodes.length; i++) {\n astar.cleanNode(this.dirtyNodes[i]);\n }\n this.dirtyNodes = [];\n};\n\nGraph.prototype.markDirty = function (node) {\n this.dirtyNodes.push(node);\n};\n\nGraph.prototype.neighbors = function (node) {\n var ret = [],\n x = node.x,\n y = node.y,\n grid = this.grid;\n\n // West\n if (grid[x - 1] && grid[x - 1][y]) {\n ret.push(grid[x - 1][y]);\n }\n\n // East\n if (grid[x + 1] && grid[x + 1][y]) {\n ret.push(grid[x + 1][y]);\n }\n\n // South\n if (grid[x] && grid[x][y - 1]) {\n ret.push(grid[x][y - 1]);\n }\n\n // North\n if (grid[x] && grid[x][y + 1]) {\n ret.push(grid[x][y + 1]);\n }\n\n if (this.diagonal) {\n // Southwest\n if (grid[x - 1] && grid[x - 1][y - 1]) {\n ret.push(grid[x - 1][y - 1]);\n }\n\n // Southeast\n if (grid[x + 1] && grid[x + 1][y - 1]) {\n ret.push(grid[x + 1][y - 1]);\n }\n\n // Northwest\n if (grid[x - 1] && grid[x - 1][y + 1]) {\n ret.push(grid[x - 1][y + 1]);\n }\n\n // Northeast\n if (grid[x + 1] && grid[x + 1][y + 1]) {\n ret.push(grid[x + 1][y + 1]);\n }\n }\n\n return ret;\n};\n\nGraph.prototype.toString = function () {\n var graphString = [],\n nodes = this.grid, // when using grid\n rowDebug,\n row,\n y,\n l;\n for (var x = 0, len = nodes.length; x < len; x++) {\n rowDebug = [];\n row = nodes[x];\n for (y = 0, l = row.length; y < l; y++) {\n rowDebug.push(row[y].weight);\n }\n graphString.push(rowDebug.join(\" \"));\n }\n return graphString.join(\"\\n\");\n};\n\nfunction GridNode(x, y, weight) {\n this.x = x;\n this.y = y;\n this.weight = weight;\n}\n\nGridNode.prototype.toString = function () {\n return \"[\" + this.x + \" \" + this.y + \"]\";\n};\n\nGridNode.prototype.getCost = function (fromNeighbor) {\n // Take diagonal weight into consideration.\n if (fromNeighbor && fromNeighbor.x !== this.x && fromNeighbor.y !== this.y) {\n return this.weight * 1.41421;\n }\n return this.weight;\n};\n\nGridNode.prototype.isWall = function () {\n return this.weight === 0;\n};\n\nfunction BinaryHeap(scoreFunction) {\n this.content = [];\n this.scoreFunction = scoreFunction;\n}\n\nBinaryHeap.prototype = {\n push: function (element) {\n // Add the new element to the end of the array.\n this.content.push(element);\n\n // Allow it to sink down.\n this.sinkDown(this.content.length - 1);\n },\n pop: function () {\n // Store the first element so we can return it later.\n var result = this.content[0];\n // Get the element at the end of the array.\n var end = this.content.pop();\n // If there are any elements left, put the end element at the\n // start, and let it bubble up.\n if (this.content.length > 0) {\n this.content[0] = end;\n this.bubbleUp(0);\n }\n return result;\n },\n remove: function (node) {\n var i = this.content.indexOf(node);\n\n // When it is found, the process seen in 'pop' is repeated\n // to fill up the hole.\n var end = this.content.pop();\n\n if (i !== this.content.length - 1) {\n this.content[i] = end;\n\n if (this.scoreFunction(end) < this.scoreFunction(node)) {\n this.sinkDown(i);\n } else {\n this.bubbleUp(i);\n }\n }\n },\n size: function () {\n return this.content.length;\n },\n rescoreElement: function (node) {\n this.sinkDown(this.content.indexOf(node));\n },\n sinkDown: function (n) {\n // Fetch the element that has to be sunk.\n var element = this.content[n];\n\n // When at 0, an element can not sink any further.\n while (n > 0) {\n // Compute the parent element's index, and fetch it.\n var parentN = ((n + 1) >> 1) - 1,\n parent = this.content[parentN];\n // Swap the elements if the parent is greater.\n if (this.scoreFunction(element) < this.scoreFunction(parent)) {\n this.content[parentN] = element;\n this.content[n] = parent;\n // Update 'n' to continue at the new position.\n n = parentN;\n // Found a parent that is less, no need to sink any further.\n } else {\n break;\n }\n }\n },\n bubbleUp: function (n) {\n // Look up the target element and its score.\n var length = this.content.length,\n element = this.content[n],\n elemScore = this.scoreFunction(element);\n\n while (true) {\n // Compute the indices of the child elements.\n var child2N = (n + 1) << 1,\n child1N = child2N - 1;\n // This is used to store the new position of the element, if any.\n var swap = null,\n child1Score;\n // If the first child exists (is inside the array)...\n if (child1N < length) {\n // Look it up and compute its score.\n var child1 = this.content[child1N];\n child1Score = this.scoreFunction(child1);\n\n // If the score is less than our element's, we need to swap.\n if (child1Score < elemScore) {\n swap = child1N;\n }\n }\n\n // Do the same checks for the other child.\n if (child2N < length) {\n var child2 = this.content[child2N],\n child2Score = this.scoreFunction(child2);\n if (child2Score < (swap === null ? elemScore : child1Score)) {\n swap = child2N;\n }\n }\n\n // If the element needs to be moved, swap it, and continue.\n if (swap !== null) {\n this.content[n] = this.content[swap];\n this.content[swap] = element;\n n = swap;\n // Otherwise, we are done.\n } else {\n break;\n }\n }\n },\n};\n"],"mappings":";AAQA,SAAS,YAAY;AACrB,SAAS,6BAA6B;AACtC,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,aAAa;AACxC,SAAS,mBAAmB;AAC5B,SAAS,mBAAmB;AAC5B,SAAS,UAAU,eAAe;AAClC;AAAA,EAGE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;;;ACjBP,SAAS,OAAO,MAAM;AACpB,MAAI,OAAO,MACT,OAAO,CAAC;AACV,SAAO,KAAK,QAAQ;AAClB,SAAK,QAAQ,IAAI;AACjB,WAAO,KAAK;AAAA,EACd;AACA,SAAO;AACT;AAEA,SAAS,UAAU;AACjB,SAAO,IAAI,WAAW,SAAU,MAAM;AACpC,WAAO,KAAK;AAAA,EACd,CAAC;AACH;AAMO,IAAI,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcjB,QAAQ,SAAU,OAAO,OAAO,KAAK,SAAS;AAzChD;AA0CI,UAAM,WAAW;AACjB,cAAU,WAAW,CAAC;AACtB,QA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AS,SAAS,IAAoB,UAAsC;AAC1E,WAAS,IAAI,GAAG,IAAI,SAAS,SAAS,QAAQ,KAAK;AACjD,QAAI,sBAAsB,IAAI,SAAS,SAAS,CAAC,CAAC,GAAG;AACnD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAGA,IAAO,6BAAQ;","names":[]}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@turf/shortest-path",
3
- "version": "7.1.0",
3
+ "version": "7.2.0",
4
4
  "description": "turf shortest-path module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -55,30 +55,30 @@
55
55
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
56
56
  },
57
57
  "devDependencies": {
58
- "@turf/truncate": "^7.1.0",
58
+ "@turf/truncate": "^7.2.0",
59
59
  "@types/benchmark": "^2.1.5",
60
- "@types/tape": "^4.2.32",
60
+ "@types/tape": "^4.13.4",
61
61
  "benchmark": "^2.1.4",
62
62
  "load-json-file": "^7.0.1",
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
  "write-json-file": "^5.0.0"
69
69
  },
70
70
  "dependencies": {
71
- "@turf/bbox": "^7.1.0",
72
- "@turf/bbox-polygon": "^7.1.0",
73
- "@turf/boolean-point-in-polygon": "^7.1.0",
74
- "@turf/clean-coords": "^7.1.0",
75
- "@turf/distance": "^7.1.0",
76
- "@turf/helpers": "^7.1.0",
77
- "@turf/invariant": "^7.1.0",
78
- "@turf/meta": "^7.1.0",
79
- "@turf/transform-scale": "^7.1.0",
71
+ "@turf/bbox": "^7.2.0",
72
+ "@turf/bbox-polygon": "^7.2.0",
73
+ "@turf/boolean-point-in-polygon": "^7.2.0",
74
+ "@turf/clean-coords": "^7.2.0",
75
+ "@turf/distance": "^7.2.0",
76
+ "@turf/helpers": "^7.2.0",
77
+ "@turf/invariant": "^7.2.0",
78
+ "@turf/meta": "^7.2.0",
79
+ "@turf/transform-scale": "^7.2.0",
80
80
  "@types/geojson": "^7946.0.10",
81
- "tslib": "^2.6.2"
81
+ "tslib": "^2.8.1"
82
82
  },
83
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
83
+ "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
84
84
  }
@@ -34,8 +34,7 @@ function simplifyRadialDist(points, sqTolerance) {
34
34
  prevPoint = point;
35
35
  }
36
36
  }
37
- if (prevPoint !== point)
38
- newPoints.push(point);
37
+ if (prevPoint !== point) newPoints.push(point);
39
38
  return newPoints;
40
39
  }
41
40
  function simplifyDPStep(points, first, last, sqTolerance, simplified) {
@@ -63,8 +62,7 @@ function simplifyDouglasPeucker(points, sqTolerance) {
63
62
  return simplified;
64
63
  }
65
64
  function simplify(points, tolerance, highestQuality) {
66
- if (points.length <= 2)
67
- return points;
65
+ if (points.length <= 2) return points;
68
66
  var sqTolerance = tolerance !== void 0 ? tolerance * tolerance : 1;
69
67
  points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);
70
68
  points = simplifyDouglasPeucker(points, sqTolerance);
@@ -75,17 +73,13 @@ function simplify(points, tolerance, highestQuality) {
75
73
  function simplify2(geojson, options = {}) {
76
74
  var _a, _b, _c;
77
75
  options = options != null ? options : {};
78
- if (!_helpers.isObject.call(void 0, options))
79
- throw new Error("options is invalid");
76
+ if (!_helpers.isObject.call(void 0, options)) throw new Error("options is invalid");
80
77
  const tolerance = (_a = options.tolerance) != null ? _a : 1;
81
78
  const highQuality = (_b = options.highQuality) != null ? _b : false;
82
79
  const mutate = (_c = options.mutate) != null ? _c : false;
83
- if (!geojson)
84
- throw new Error("geojson is required");
85
- if (tolerance && tolerance < 0)
86
- throw new Error("invalid tolerance");
87
- if (mutate !== true)
88
- geojson = _clone.clone.call(void 0, geojson);
80
+ if (!geojson) throw new Error("geojson is required");
81
+ if (tolerance && tolerance < 0) throw new Error("invalid tolerance");
82
+ if (mutate !== true) geojson = _clone.clone.call(void 0, geojson);
89
83
  _meta.geomEach.call(void 0, geojson, function(geom) {
90
84
  simplifyGeom(geom, tolerance, highQuality);
91
85
  });
@@ -93,8 +87,7 @@ function simplify2(geojson, options = {}) {
93
87
  }
94
88
  function simplifyGeom(geometry, tolerance, highQuality) {
95
89
  const type = geometry.type;
96
- if (type === "Point" || type === "MultiPoint")
97
- return geometry;
90
+ if (type === "Point" || type === "MultiPoint") return geometry;
98
91
  _cleancoords.cleanCoords.call(void 0, geometry, { mutate: true });
99
92
  if (type !== "GeometryCollection") {
100
93
  switch (type) {
@@ -143,8 +136,7 @@ function simplifyPolygon(coordinates, tolerance, highQuality) {
143
136
  });
144
137
  }
145
138
  function checkValidity(ring) {
146
- if (ring.length < 3)
147
- return false;
139
+ if (ring.length < 3) return false;
148
140
  return !(ring.length === 3 && ring[2][0] === ring[0][0] && ring[2][1] === ring[0][1]);
149
141
  }
150
142
  var turf_simplify_default = simplify2;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/simplify.js"],"names":["simplify"],"mappings":";AACA,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAqB,gBAAgB;;;ACMrC,SAAS,UAAU,IAAI,IAAI;AACzB,MAAI,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,GACnB,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC;AAEnB,SAAO,KAAK,KAAK,KAAK;AACxB;AAGA,SAAS,aAAa,GAAG,IAAI,IAAI;AAC/B,MAAI,IAAI,GAAG,CAAC,GACV,IAAI,GAAG,CAAC,GACR,KAAK,GAAG,CAAC,IAAI,GACb,KAAK,GAAG,CAAC,IAAI;AAEf,MAAI,OAAO,KAAK,OAAO,GAAG;AACxB,QAAI,MAAM,EAAE,CAAC,IAAI,K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;AAAA,QAC1C;AACA;AAAA,MACF,KAAK;AACH,iBAAS,cAAc;AAAA,UACrB,SAAS;AAAA,UACT;AAAA,UACA;AAAA,QACF;AACA;AAAA,MACF,KAAK;AACH,iBAAS,cAAc,SAAS,YAAY;AAAA,UAAI,CAAC,UAC/C,gBAAgB,OAAO,WAAW,WAAW;AAAA,QAC/C;AAAA,IACJ;AAAA,EACF;AAEA,SAAO;AACT;AAWA,SAAS,gBACP,aACA,WACA,aACA;AACA,SAAO,YAAY,IAAI,SAAU,MAAM;AACrC,QAAI,KAAK,SAAS,GAAG;AACnB,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACnC;AACA,QAAI,gBAAgB;AACpB,QAAI,aAAa,SAAW,MAAM,eAAe,WAAW;AAE5D,WAAO,CAAC,cAAc,UAAU,GAAG;AACjC,uBAAiB,gBAAgB;AACjC,mBAAa,SAAW,MAAM,eAAe,WAAW;AAAA,IAC1D;AACA,QACE,WAAW,WAAW,SAAS,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAC,KACxD,WAAW,WAAW,SAAS,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAC,GACxD;AACA,iBAAW,KAAK,WAAW,CAAC,CAAC;AAAA,IAC/B;AACA,WAAO;AAAA,EACT,CAAC;AACH;AASA,SAAS,cAAc,MAAkB;AACvC,MAAI,KAAK,SAAS;AAAG,WAAO;AAE5B,SAAO,EACL,KAAK,WAAW,KAChB,KAAK,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,KACxB,KAAK,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;AAE5B;AAGA,IAAO,wBAAQA","sourcesContent":["import { Geometry, Position } from \"geojson\";\nimport { cleanCoords } from \"@turf/clean-coords\";\nimport { clone } from \"@turf/clone\";\nimport { geomEach } from \"@turf/meta\";\nimport { AllGeoJSON, isObject } from \"@turf/helpers\";\nimport { simplify as simplifyJS } from \"./lib/simplify.js\";\n\n/**\n * Takes a {@link GeoJSON} object and returns a simplified version. Internally uses the 2d version of\n * [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification using the Ramer-Douglas-Peucker algorithm.\n *\n *\n * @name simplify\n * @param {GeoJSON} geojson object to be simplified\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.tolerance=1] simplification tolerance\n * @param {boolean} [options.highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a simplified GeoJSON\n * @example\n * var geojson = turf.polygon([[\n * [-70.603637, -33.399918],\n * [-70.614624, -33.395332],\n * [-70.639343, -33.392466],\n * [-70.659942, -33.394759],\n * [-70.683975, -33.404504],\n * [-70.697021, -33.419406],\n * [-70.701141, -33.434306],\n * [-70.700454, -33.446339],\n * [-70.694274, -33.458369],\n * [-70.682601, -33.465816],\n * [-70.668869, -33.472117],\n * [-70.646209, -33.473835],\n * [-70.624923, -33.472117],\n * [-70.609817, -33.468107],\n * [-70.595397, -33.458369],\n * [-70.587158, -33.442901],\n * [-70.587158, -33.426283],\n * [-70.590591, -33.414248],\n * [-70.594711, -33.406224],\n * [-70.603637, -33.399918]\n * ]]);\n * var options = {tolerance: 0.01, highQuality: false};\n * var simplified = turf.simplify(geojson, options);\n *\n * //addToMap\n * var addToMap = [geojson, simplified]\n */\nfunction simplify<T extends AllGeoJSON>(\n geojson: T,\n options: {\n tolerance?: number;\n highQuality?: boolean;\n mutate?: boolean;\n } = {}\n): T {\n // Optional parameters\n options = options ?? {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const tolerance = options.tolerance ?? 1;\n const highQuality = options.highQuality ?? false;\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n if (tolerance && tolerance < 0) throw new Error(\"invalid tolerance\");\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n geomEach(geojson, function (geom) {\n simplifyGeom(geom, tolerance, highQuality);\n });\n return geojson;\n}\n\n/**\n * Simplifies a feature's coordinates\n *\n * @private\n * @param {Geometry} geometry to be simplified\n * @param {number} [tolerance=1] simplification tolerance\n * @param {boolean} [highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @returns {Geometry} output\n */\nfunction simplifyGeom(\n geometry: Geometry,\n tolerance: number,\n highQuality: boolean\n) {\n const type = geometry.type;\n\n // \"unsimplyfiable\" geometry types\n if (type === \"Point\" || type === \"MultiPoint\") return geometry;\n\n // Remove any extra coordinates\n cleanCoords(geometry, { mutate: true });\n\n if (type !== \"GeometryCollection\") {\n // TODO should this cater for GeometryCollections too?\n switch (type) {\n case \"LineString\":\n geometry.coordinates = simplifyJS(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiLineString\":\n geometry.coordinates = geometry.coordinates.map((lines) =>\n simplifyJS(lines, tolerance, highQuality)\n );\n break;\n case \"Polygon\":\n geometry.coordinates = simplifyPolygon(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiPolygon\":\n geometry.coordinates = geometry.coordinates.map((rings) =>\n simplifyPolygon(rings, tolerance, highQuality)\n );\n }\n }\n\n return geometry;\n}\n\n/**\n * Simplifies the coordinates of a Polygon with simplify-js\n *\n * @private\n * @param {Array<number>} coordinates to be processed\n * @param {number} tolerance simplification tolerance\n * @param {boolean} highQuality whether or not to spend more time to create a higher-quality\n * @returns {Array<Array<Array<number>>>} simplified coords\n */\nfunction simplifyPolygon(\n coordinates: Position[][],\n tolerance: number,\n highQuality: boolean\n) {\n return coordinates.map(function (ring) {\n if (ring.length < 4) {\n throw new Error(\"invalid polygon\");\n }\n let ringTolerance = tolerance;\n let simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n // remove 1 percent of tolerance until enough points to make a triangle\n while (!checkValidity(simpleRing)) {\n ringTolerance -= ringTolerance * 0.01;\n simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n }\n if (\n simpleRing[simpleRing.length - 1][0] !== simpleRing[0][0] ||\n simpleRing[simpleRing.length - 1][1] !== simpleRing[0][1]\n ) {\n simpleRing.push(simpleRing[0]);\n }\n return simpleRing;\n });\n}\n\n/**\n * Returns true if ring has at least 3 coordinates and its first coordinate is the same as its last\n *\n * @private\n * @param {Array<number>} ring coordinates to be checked\n * @returns {boolean} true if valid\n */\nfunction checkValidity(ring: Position[]) {\n if (ring.length < 3) return false;\n //if the last point is the same as the first, it's not a triangle\n return !(\n ring.length === 3 &&\n ring[2][0] === ring[0][0] &&\n ring[2][1] === ring[0][1]\n );\n}\n\nexport { simplify };\nexport default simplify;\n","/*\n (c) 2013, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n var dx = p1[0] - p2[0],\n dy = p1[1] - p2[1];\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n var x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n var t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1)\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1)\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\nexport { simplify };\nexport default simplify;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-simplify/dist/cjs/index.cjs","../../index.ts","../../lib/simplify.js"],"names":["simplify"],"mappings":"AAAA;ACCA,iDAA4B;AAC5B,oCAAsB;AACtB,kCAAyB;AACzB,wCAAqC;ADCrC;AACA;AEIA,SAAS,SAAA,CAAU,EAAA,EAAI,EAAA,EAAI;AACzB,EAAA,IAAI,GAAA,EAAK,EAAA,CAAG,CAAC,EAAA,EAAI,EAAA,CAAG,CAAC,CAAA,EACnB,GAAA,EAAK,EAAA,CAAG,CAAC,EAAA,EAAI,EAAA,CAAG,CAAC,CAAA;AAEnB,EAAA,OAAO,GAAA,EAAK,GAAA,EAAK,GAAA,EAAK,EAAA;AACxB;AAGA,SAAS,YAAA,CAAa,CAAA,EAAG,EAAA,EAAI,EAAA,EAAI;AAC/B,EAAA,IAAI,EAAA,E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CAAW,UAAA,CAAW,OAAA,EAAS,CAAC,CAAA,CAAE,CAAC,EAAA,IAAM,UAAA,CAAW,CAAC,CAAA,CAAE,CAAC,CAAA,EACxD;AACA,MAAA,UAAA,CAAW,IAAA,CAAK,UAAA,CAAW,CAAC,CAAC,CAAA;AAAA,IAC/B;AACA,IAAA,OAAO,UAAA;AAAA,EACT,CAAC,CAAA;AACH;AASA,SAAS,aAAA,CAAc,IAAA,EAAkB;AACvC,EAAA,GAAA,CAAI,IAAA,CAAK,OAAA,EAAS,CAAA,EAAG,OAAO,KAAA;AAE5B,EAAA,OAAO,CAAA,CACL,IAAA,CAAK,OAAA,IAAW,EAAA,GAChB,IAAA,CAAK,CAAC,CAAA,CAAE,CAAC,EAAA,IAAM,IAAA,CAAK,CAAC,CAAA,CAAE,CAAC,EAAA,GACxB,IAAA,CAAK,CAAC,CAAA,CAAE,CAAC,EAAA,IAAM,IAAA,CAAK,CAAC,CAAA,CAAE,CAAC,CAAA,CAAA;AAE5B;AAGA,IAAO,sBAAA,EAAQA,SAAAA;ADxCf;AACE;AACA;AACF,sEAAC","file":"/home/runner/work/turf/turf/packages/turf-simplify/dist/cjs/index.cjs","sourcesContent":[null,"import { Geometry, Position } from \"geojson\";\nimport { cleanCoords } from \"@turf/clean-coords\";\nimport { clone } from \"@turf/clone\";\nimport { geomEach } from \"@turf/meta\";\nimport { AllGeoJSON, isObject } from \"@turf/helpers\";\nimport { simplify as simplifyJS } from \"./lib/simplify.js\";\n\n/**\n * Takes a {@link GeoJSON} object and returns a simplified version. Internally uses the 2d version of\n * [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification using the Ramer-Douglas-Peucker algorithm.\n *\n *\n * @function\n * @param {GeoJSON} geojson object to be simplified\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.tolerance=1] simplification tolerance\n * @param {boolean} [options.highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a simplified GeoJSON\n * @example\n * var geojson = turf.polygon([[\n * [-70.603637, -33.399918],\n * [-70.614624, -33.395332],\n * [-70.639343, -33.392466],\n * [-70.659942, -33.394759],\n * [-70.683975, -33.404504],\n * [-70.697021, -33.419406],\n * [-70.701141, -33.434306],\n * [-70.700454, -33.446339],\n * [-70.694274, -33.458369],\n * [-70.682601, -33.465816],\n * [-70.668869, -33.472117],\n * [-70.646209, -33.473835],\n * [-70.624923, -33.472117],\n * [-70.609817, -33.468107],\n * [-70.595397, -33.458369],\n * [-70.587158, -33.442901],\n * [-70.587158, -33.426283],\n * [-70.590591, -33.414248],\n * [-70.594711, -33.406224],\n * [-70.603637, -33.399918]\n * ]]);\n * var options = {tolerance: 0.01, highQuality: false};\n * var simplified = turf.simplify(geojson, options);\n *\n * //addToMap\n * var addToMap = [geojson, simplified]\n */\nfunction simplify<T extends AllGeoJSON>(\n geojson: T,\n options: {\n tolerance?: number;\n highQuality?: boolean;\n mutate?: boolean;\n } = {}\n): T {\n // Optional parameters\n options = options ?? {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const tolerance = options.tolerance ?? 1;\n const highQuality = options.highQuality ?? false;\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n if (tolerance && tolerance < 0) throw new Error(\"invalid tolerance\");\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n geomEach(geojson, function (geom) {\n simplifyGeom(geom, tolerance, highQuality);\n });\n return geojson;\n}\n\n/**\n * Simplifies a feature's coordinates\n *\n * @private\n * @param {Geometry} geometry to be simplified\n * @param {number} [tolerance=1] simplification tolerance\n * @param {boolean} [highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @returns {Geometry} output\n */\nfunction simplifyGeom(\n geometry: Geometry,\n tolerance: number,\n highQuality: boolean\n) {\n const type = geometry.type;\n\n // \"unsimplyfiable\" geometry types\n if (type === \"Point\" || type === \"MultiPoint\") return geometry;\n\n // Remove any extra coordinates\n cleanCoords(geometry, { mutate: true });\n\n if (type !== \"GeometryCollection\") {\n // TODO should this cater for GeometryCollections too?\n switch (type) {\n case \"LineString\":\n geometry.coordinates = simplifyJS(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiLineString\":\n geometry.coordinates = geometry.coordinates.map((lines) =>\n simplifyJS(lines, tolerance, highQuality)\n );\n break;\n case \"Polygon\":\n geometry.coordinates = simplifyPolygon(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiPolygon\":\n geometry.coordinates = geometry.coordinates.map((rings) =>\n simplifyPolygon(rings, tolerance, highQuality)\n );\n }\n }\n\n return geometry;\n}\n\n/**\n * Simplifies the coordinates of a Polygon with simplify-js\n *\n * @private\n * @param {Array<number>} coordinates to be processed\n * @param {number} tolerance simplification tolerance\n * @param {boolean} highQuality whether or not to spend more time to create a higher-quality\n * @returns {Array<Array<Array<number>>>} simplified coords\n */\nfunction simplifyPolygon(\n coordinates: Position[][],\n tolerance: number,\n highQuality: boolean\n) {\n return coordinates.map(function (ring) {\n if (ring.length < 4) {\n throw new Error(\"invalid polygon\");\n }\n let ringTolerance = tolerance;\n let simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n // remove 1 percent of tolerance until enough points to make a triangle\n while (!checkValidity(simpleRing)) {\n ringTolerance -= ringTolerance * 0.01;\n simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n }\n if (\n simpleRing[simpleRing.length - 1][0] !== simpleRing[0][0] ||\n simpleRing[simpleRing.length - 1][1] !== simpleRing[0][1]\n ) {\n simpleRing.push(simpleRing[0]);\n }\n return simpleRing;\n });\n}\n\n/**\n * Returns true if ring has at least 3 coordinates and its first coordinate is the same as its last\n *\n * @private\n * @param {Array<number>} ring coordinates to be checked\n * @returns {boolean} true if valid\n */\nfunction checkValidity(ring: Position[]) {\n if (ring.length < 3) return false;\n //if the last point is the same as the first, it's not a triangle\n return !(\n ring.length === 3 &&\n ring[2][0] === ring[0][0] &&\n ring[2][1] === ring[0][1]\n );\n}\n\nexport { simplify };\nexport default simplify;\n","/*\n (c) 2013, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n var dx = p1[0] - p2[0],\n dy = p1[1] - p2[1];\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n var x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n var t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1)\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1)\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\nexport { simplify };\nexport default simplify;\n"]}
@@ -5,7 +5,7 @@ import { AllGeoJSON } from '@turf/helpers';
5
5
  * [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification using the Ramer-Douglas-Peucker algorithm.
6
6
  *
7
7
  *
8
- * @name simplify
8
+ * @function
9
9
  * @param {GeoJSON} geojson object to be simplified
10
10
  * @param {Object} [options={}] Optional parameters
11
11
  * @param {number} [options.tolerance=1] simplification tolerance
@@ -5,7 +5,7 @@ import { AllGeoJSON } from '@turf/helpers';
5
5
  * [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification using the Ramer-Douglas-Peucker algorithm.
6
6
  *
7
7
  *
8
- * @name simplify
8
+ * @function
9
9
  * @param {GeoJSON} geojson object to be simplified
10
10
  * @param {Object} [options={}] Optional parameters
11
11
  * @param {number} [options.tolerance=1] simplification tolerance
@@ -34,8 +34,7 @@ function simplifyRadialDist(points, sqTolerance) {
34
34
  prevPoint = point;
35
35
  }
36
36
  }
37
- if (prevPoint !== point)
38
- newPoints.push(point);
37
+ if (prevPoint !== point) newPoints.push(point);
39
38
  return newPoints;
40
39
  }
41
40
  function simplifyDPStep(points, first, last, sqTolerance, simplified) {
@@ -63,8 +62,7 @@ function simplifyDouglasPeucker(points, sqTolerance) {
63
62
  return simplified;
64
63
  }
65
64
  function simplify(points, tolerance, highestQuality) {
66
- if (points.length <= 2)
67
- return points;
65
+ if (points.length <= 2) return points;
68
66
  var sqTolerance = tolerance !== void 0 ? tolerance * tolerance : 1;
69
67
  points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);
70
68
  points = simplifyDouglasPeucker(points, sqTolerance);
@@ -75,17 +73,13 @@ function simplify(points, tolerance, highestQuality) {
75
73
  function simplify2(geojson, options = {}) {
76
74
  var _a, _b, _c;
77
75
  options = options != null ? options : {};
78
- if (!isObject(options))
79
- throw new Error("options is invalid");
76
+ if (!isObject(options)) throw new Error("options is invalid");
80
77
  const tolerance = (_a = options.tolerance) != null ? _a : 1;
81
78
  const highQuality = (_b = options.highQuality) != null ? _b : false;
82
79
  const mutate = (_c = options.mutate) != null ? _c : false;
83
- if (!geojson)
84
- throw new Error("geojson is required");
85
- if (tolerance && tolerance < 0)
86
- throw new Error("invalid tolerance");
87
- if (mutate !== true)
88
- geojson = clone(geojson);
80
+ if (!geojson) throw new Error("geojson is required");
81
+ if (tolerance && tolerance < 0) throw new Error("invalid tolerance");
82
+ if (mutate !== true) geojson = clone(geojson);
89
83
  geomEach(geojson, function(geom) {
90
84
  simplifyGeom(geom, tolerance, highQuality);
91
85
  });
@@ -93,8 +87,7 @@ function simplify2(geojson, options = {}) {
93
87
  }
94
88
  function simplifyGeom(geometry, tolerance, highQuality) {
95
89
  const type = geometry.type;
96
- if (type === "Point" || type === "MultiPoint")
97
- return geometry;
90
+ if (type === "Point" || type === "MultiPoint") return geometry;
98
91
  cleanCoords(geometry, { mutate: true });
99
92
  if (type !== "GeometryCollection") {
100
93
  switch (type) {
@@ -143,8 +136,7 @@ function simplifyPolygon(coordinates, tolerance, highQuality) {
143
136
  });
144
137
  }
145
138
  function checkValidity(ring) {
146
- if (ring.length < 3)
147
- return false;
139
+ if (ring.length < 3) return false;
148
140
  return !(ring.length === 3 && ring[2][0] === ring[0][0] && ring[2][1] === ring[0][1]);
149
141
  }
150
142
  var turf_simplify_default = simplify2;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts","../../lib/simplify.js"],"sourcesContent":["import { Geometry, Position } from \"geojson\";\nimport { cleanCoords } from \"@turf/clean-coords\";\nimport { clone } from \"@turf/clone\";\nimport { geomEach } from \"@turf/meta\";\nimport { AllGeoJSON, isObject } from \"@turf/helpers\";\nimport { simplify as simplifyJS } from \"./lib/simplify.js\";\n\n/**\n * Takes a {@link GeoJSON} object and returns a simplified version. Internally uses the 2d version of\n * [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification using the Ramer-Douglas-Peucker algorithm.\n *\n *\n * @name simplify\n * @param {GeoJSON} geojson object to be simplified\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.tolerance=1] simplification tolerance\n * @param {boolean} [options.highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a simplified GeoJSON\n * @example\n * var geojson = turf.polygon([[\n * [-70.603637, -33.399918],\n * [-70.614624, -33.395332],\n * [-70.639343, -33.392466],\n * [-70.659942, -33.394759],\n * [-70.683975, -33.404504],\n * [-70.697021, -33.419406],\n * [-70.701141, -33.434306],\n * [-70.700454, -33.446339],\n * [-70.694274, -33.458369],\n * [-70.682601, -33.465816],\n * [-70.668869, -33.472117],\n * [-70.646209, -33.473835],\n * [-70.624923, -33.472117],\n * [-70.609817, -33.468107],\n * [-70.595397, -33.458369],\n * [-70.587158, -33.442901],\n * [-70.587158, -33.426283],\n * [-70.590591, -33.414248],\n * [-70.594711, -33.406224],\n * [-70.603637, -33.399918]\n * ]]);\n * var options = {tolerance: 0.01, highQuality: false};\n * var simplified = turf.simplify(geojson, options);\n *\n * //addToMap\n * var addToMap = [geojson, simplified]\n */\nfunction simplify<T extends AllGeoJSON>(\n geojson: T,\n options: {\n tolerance?: number;\n highQuality?: boolean;\n mutate?: boolean;\n } = {}\n): T {\n // Optional parameters\n options = options ?? {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const tolerance = options.tolerance ?? 1;\n const highQuality = options.highQuality ?? false;\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n if (tolerance && tolerance < 0) throw new Error(\"invalid tolerance\");\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n geomEach(geojson, function (geom) {\n simplifyGeom(geom, tolerance, highQuality);\n });\n return geojson;\n}\n\n/**\n * Simplifies a feature's coordinates\n *\n * @private\n * @param {Geometry} geometry to be simplified\n * @param {number} [tolerance=1] simplification tolerance\n * @param {boolean} [highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @returns {Geometry} output\n */\nfunction simplifyGeom(\n geometry: Geometry,\n tolerance: number,\n highQuality: boolean\n) {\n const type = geometry.type;\n\n // \"unsimplyfiable\" geometry types\n if (type === \"Point\" || type === \"MultiPoint\") return geometry;\n\n // Remove any extra coordinates\n cleanCoords(geometry, { mutate: true });\n\n if (type !== \"GeometryCollection\") {\n // TODO should this cater for GeometryCollections too?\n switch (type) {\n case \"LineString\":\n geometry.coordinates = simplifyJS(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiLineString\":\n geometry.coordinates = geometry.coordinates.map((lines) =>\n simplifyJS(lines, tolerance, highQuality)\n );\n break;\n case \"Polygon\":\n geometry.coordinates = simplifyPolygon(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiPolygon\":\n geometry.coordinates = geometry.coordinates.map((rings) =>\n simplifyPolygon(rings, tolerance, highQuality)\n );\n }\n }\n\n return geometry;\n}\n\n/**\n * Simplifies the coordinates of a Polygon with simplify-js\n *\n * @private\n * @param {Array<number>} coordinates to be processed\n * @param {number} tolerance simplification tolerance\n * @param {boolean} highQuality whether or not to spend more time to create a higher-quality\n * @returns {Array<Array<Array<number>>>} simplified coords\n */\nfunction simplifyPolygon(\n coordinates: Position[][],\n tolerance: number,\n highQuality: boolean\n) {\n return coordinates.map(function (ring) {\n if (ring.length < 4) {\n throw new Error(\"invalid polygon\");\n }\n let ringTolerance = tolerance;\n let simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n // remove 1 percent of tolerance until enough points to make a triangle\n while (!checkValidity(simpleRing)) {\n ringTolerance -= ringTolerance * 0.01;\n simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n }\n if (\n simpleRing[simpleRing.length - 1][0] !== simpleRing[0][0] ||\n simpleRing[simpleRing.length - 1][1] !== simpleRing[0][1]\n ) {\n simpleRing.push(simpleRing[0]);\n }\n return simpleRing;\n });\n}\n\n/**\n * Returns true if ring has at least 3 coordinates and its first coordinate is the same as its last\n *\n * @private\n * @param {Array<number>} ring coordinates to be checked\n * @returns {boolean} true if valid\n */\nfunction checkValidity(ring: Position[]) {\n if (ring.length < 3) return false;\n //if the last point is the same as the first, it's not a triangle\n return !(\n ring.length === 3 &&\n ring[2][0] === ring[0][0] &&\n ring[2][1] === ring[0][1]\n );\n}\n\nexport { simplify };\nexport default simplify;\n","/*\n (c) 2013, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n var dx = p1[0] - p2[0],\n dy = p1[1] - p2[1];\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n var x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n var t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1)\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1)\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\nexport { simplify };\nexport default simplify;\n"],"mappings":";AACA,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAqB,gBAAgB;;;ACMrC,SAAS,UAAU,IAAI,IAAI;AACzB,MAAI,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,GACnB,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC;AAEnB,SAAO,KAAK,KAAK,KAAK;AACxB;AAGA,SAAS,aAAa,GAAG,IAAI,IAAI;AAC/B,MAAI,IAAI,GAAG,CAAC,GACV,IAAI,GAAG,CAAC,GACR,KAAK,GAAG,CAAC,IAAI,GACb,K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;AAAA,MACF,KAAK;AACH,iBAAS,cAAc,SAAS,YAAY;AAAA,UAAI,CAAC,UAC/C,SAAW,OAAO,WAAW,WAAW;AAAA,QAC1C;AACA;AAAA,MACF,KAAK;AACH,iBAAS,cAAc;AAAA,UACrB,SAAS;AAAA,UACT;AAAA,UACA;AAAA,QACF;AACA;AAAA,MACF,KAAK;AACH,iBAAS,cAAc,SAAS,YAAY;AAAA,UAAI,CAAC,UAC/C,gBAAgB,OAAO,WAAW,WAAW;AAAA,QAC/C;AAAA,IACJ;AAAA,EACF;AAEA,SAAO;AACT;AAWA,SAAS,gBACP,aACA,WACA,aACA;AACA,SAAO,YAAY,IAAI,SAAU,MAAM;AACrC,QAAI,KAAK,SAAS,GAAG;AACnB,YAAM,IAAI,MAAM,iBAAiB;AAAA,IACnC;AACA,QAAI,gBAAgB;AACpB,QAAI,aAAa,SAAW,MAAM,eAAe,WAAW;AAE5D,WAAO,CAAC,cAAc,UAAU,GAAG;AACjC,uBAAiB,gBAAgB;AACjC,mBAAa,SAAW,MAAM,eAAe,WAAW;AAAA,IAC1D;AACA,QACE,WAAW,WAAW,SAAS,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAC,KACxD,WAAW,WAAW,SAAS,CAAC,EAAE,CAAC,MAAM,WAAW,CAAC,EAAE,CAAC,GACxD;AACA,iBAAW,KAAK,WAAW,CAAC,CAAC;AAAA,IAC/B;AACA,WAAO;AAAA,EACT,CAAC;AACH;AASA,SAAS,cAAc,MAAkB;AACvC,MAAI,KAAK,SAAS;AAAG,WAAO;AAE5B,SAAO,EACL,KAAK,WAAW,KAChB,KAAK,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC,KACxB,KAAK,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;AAE5B;AAGA,IAAO,wBAAQC;","names":["simplify","simplify"]}
1
+ {"version":3,"sources":["../../index.ts","../../lib/simplify.js"],"sourcesContent":["import { Geometry, Position } from \"geojson\";\nimport { cleanCoords } from \"@turf/clean-coords\";\nimport { clone } from \"@turf/clone\";\nimport { geomEach } from \"@turf/meta\";\nimport { AllGeoJSON, isObject } from \"@turf/helpers\";\nimport { simplify as simplifyJS } from \"./lib/simplify.js\";\n\n/**\n * Takes a {@link GeoJSON} object and returns a simplified version. Internally uses the 2d version of\n * [simplify-js](http://mourner.github.io/simplify-js/) to perform simplification using the Ramer-Douglas-Peucker algorithm.\n *\n *\n * @function\n * @param {GeoJSON} geojson object to be simplified\n * @param {Object} [options={}] Optional parameters\n * @param {number} [options.tolerance=1] simplification tolerance\n * @param {boolean} [options.highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated (significant performance increase if true)\n * @returns {GeoJSON} a simplified GeoJSON\n * @example\n * var geojson = turf.polygon([[\n * [-70.603637, -33.399918],\n * [-70.614624, -33.395332],\n * [-70.639343, -33.392466],\n * [-70.659942, -33.394759],\n * [-70.683975, -33.404504],\n * [-70.697021, -33.419406],\n * [-70.701141, -33.434306],\n * [-70.700454, -33.446339],\n * [-70.694274, -33.458369],\n * [-70.682601, -33.465816],\n * [-70.668869, -33.472117],\n * [-70.646209, -33.473835],\n * [-70.624923, -33.472117],\n * [-70.609817, -33.468107],\n * [-70.595397, -33.458369],\n * [-70.587158, -33.442901],\n * [-70.587158, -33.426283],\n * [-70.590591, -33.414248],\n * [-70.594711, -33.406224],\n * [-70.603637, -33.399918]\n * ]]);\n * var options = {tolerance: 0.01, highQuality: false};\n * var simplified = turf.simplify(geojson, options);\n *\n * //addToMap\n * var addToMap = [geojson, simplified]\n */\nfunction simplify<T extends AllGeoJSON>(\n geojson: T,\n options: {\n tolerance?: number;\n highQuality?: boolean;\n mutate?: boolean;\n } = {}\n): T {\n // Optional parameters\n options = options ?? {};\n if (!isObject(options)) throw new Error(\"options is invalid\");\n const tolerance = options.tolerance ?? 1;\n const highQuality = options.highQuality ?? false;\n const mutate = options.mutate ?? false;\n\n if (!geojson) throw new Error(\"geojson is required\");\n if (tolerance && tolerance < 0) throw new Error(\"invalid tolerance\");\n\n // Clone geojson to avoid side effects\n if (mutate !== true) geojson = clone(geojson);\n\n geomEach(geojson, function (geom) {\n simplifyGeom(geom, tolerance, highQuality);\n });\n return geojson;\n}\n\n/**\n * Simplifies a feature's coordinates\n *\n * @private\n * @param {Geometry} geometry to be simplified\n * @param {number} [tolerance=1] simplification tolerance\n * @param {boolean} [highQuality=false] whether or not to spend more time to create a higher-quality simplification with a different algorithm\n * @returns {Geometry} output\n */\nfunction simplifyGeom(\n geometry: Geometry,\n tolerance: number,\n highQuality: boolean\n) {\n const type = geometry.type;\n\n // \"unsimplyfiable\" geometry types\n if (type === \"Point\" || type === \"MultiPoint\") return geometry;\n\n // Remove any extra coordinates\n cleanCoords(geometry, { mutate: true });\n\n if (type !== \"GeometryCollection\") {\n // TODO should this cater for GeometryCollections too?\n switch (type) {\n case \"LineString\":\n geometry.coordinates = simplifyJS(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiLineString\":\n geometry.coordinates = geometry.coordinates.map((lines) =>\n simplifyJS(lines, tolerance, highQuality)\n );\n break;\n case \"Polygon\":\n geometry.coordinates = simplifyPolygon(\n geometry.coordinates,\n tolerance,\n highQuality\n );\n break;\n case \"MultiPolygon\":\n geometry.coordinates = geometry.coordinates.map((rings) =>\n simplifyPolygon(rings, tolerance, highQuality)\n );\n }\n }\n\n return geometry;\n}\n\n/**\n * Simplifies the coordinates of a Polygon with simplify-js\n *\n * @private\n * @param {Array<number>} coordinates to be processed\n * @param {number} tolerance simplification tolerance\n * @param {boolean} highQuality whether or not to spend more time to create a higher-quality\n * @returns {Array<Array<Array<number>>>} simplified coords\n */\nfunction simplifyPolygon(\n coordinates: Position[][],\n tolerance: number,\n highQuality: boolean\n) {\n return coordinates.map(function (ring) {\n if (ring.length < 4) {\n throw new Error(\"invalid polygon\");\n }\n let ringTolerance = tolerance;\n let simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n // remove 1 percent of tolerance until enough points to make a triangle\n while (!checkValidity(simpleRing)) {\n ringTolerance -= ringTolerance * 0.01;\n simpleRing = simplifyJS(ring, ringTolerance, highQuality);\n }\n if (\n simpleRing[simpleRing.length - 1][0] !== simpleRing[0][0] ||\n simpleRing[simpleRing.length - 1][1] !== simpleRing[0][1]\n ) {\n simpleRing.push(simpleRing[0]);\n }\n return simpleRing;\n });\n}\n\n/**\n * Returns true if ring has at least 3 coordinates and its first coordinate is the same as its last\n *\n * @private\n * @param {Array<number>} ring coordinates to be checked\n * @returns {boolean} true if valid\n */\nfunction checkValidity(ring: Position[]) {\n if (ring.length < 3) return false;\n //if the last point is the same as the first, it's not a triangle\n return !(\n ring.length === 3 &&\n ring[2][0] === ring[0][0] &&\n ring[2][1] === ring[0][1]\n );\n}\n\nexport { simplify };\nexport default simplify;\n","/*\n (c) 2013, Vladimir Agafonkin\n Simplify.js, a high-performance JS polyline simplification library\n mourner.github.io/simplify-js\n*/\n\n// to suit your point format, run search/replace for '.x' and '.y';\n// for 3D version, see 3d branch (configurability would draw significant performance overhead)\n\n// square distance between 2 points\nfunction getSqDist(p1, p2) {\n var dx = p1[0] - p2[0],\n dy = p1[1] - p2[1];\n\n return dx * dx + dy * dy;\n}\n\n// square distance from a point to a segment\nfunction getSqSegDist(p, p1, p2) {\n var x = p1[0],\n y = p1[1],\n dx = p2[0] - x,\n dy = p2[1] - y;\n\n if (dx !== 0 || dy !== 0) {\n var t = ((p[0] - x) * dx + (p[1] - y) * dy) / (dx * dx + dy * dy);\n\n if (t > 1) {\n x = p2[0];\n y = p2[1];\n } else if (t > 0) {\n x += dx * t;\n y += dy * t;\n }\n }\n\n dx = p[0] - x;\n dy = p[1] - y;\n\n return dx * dx + dy * dy;\n}\n// rest of the code doesn't care about point format\n\n// basic distance-based simplification\nfunction simplifyRadialDist(points, sqTolerance) {\n var prevPoint = points[0],\n newPoints = [prevPoint],\n point;\n\n for (var i = 1, len = points.length; i < len; i++) {\n point = points[i];\n\n if (getSqDist(point, prevPoint) > sqTolerance) {\n newPoints.push(point);\n prevPoint = point;\n }\n }\n\n if (prevPoint !== point) newPoints.push(point);\n\n return newPoints;\n}\n\nfunction simplifyDPStep(points, first, last, sqTolerance, simplified) {\n var maxSqDist = sqTolerance,\n index;\n\n for (var i = first + 1; i < last; i++) {\n var sqDist = getSqSegDist(points[i], points[first], points[last]);\n\n if (sqDist > maxSqDist) {\n index = i;\n maxSqDist = sqDist;\n }\n }\n\n if (maxSqDist > sqTolerance) {\n if (index - first > 1)\n simplifyDPStep(points, first, index, sqTolerance, simplified);\n simplified.push(points[index]);\n if (last - index > 1)\n simplifyDPStep(points, index, last, sqTolerance, simplified);\n }\n}\n\n// simplification using Ramer-Douglas-Peucker algorithm\nfunction simplifyDouglasPeucker(points, sqTolerance) {\n var last = points.length - 1;\n\n var simplified = [points[0]];\n simplifyDPStep(points, 0, last, sqTolerance, simplified);\n simplified.push(points[last]);\n\n return simplified;\n}\n\n// both algorithms combined for awesome performance\nfunction simplify(points, tolerance, highestQuality) {\n if (points.length <= 2) return points;\n\n var sqTolerance = tolerance !== undefined ? tolerance * tolerance : 1;\n\n points = highestQuality ? points : simplifyRadialDist(points, sqTolerance);\n points = simplifyDouglasPeucker(points, sqTolerance);\n\n return points;\n}\n\nexport { simplify };\nexport default simplify;\n"],"mappings":";AACA,SAAS,mBAAmB;AAC5B,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAqB,gBAAgB;;;ACMrC,SAAS,UAAU,IAAI,IAAI;AACzB,MAAI,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC,GACnB,KAAK,GAAG,CAAC,IAAI,GAAG,CAAC;AAEnB,SAAO,KAAK,KAAK,KAAK;AACxB;AAGA,SAAS,aAAa,GAAG,IAAI,IAAI;AAC/B,MAAI,IAAI,GAAG,CAAC,GACV,IAAI,GAAG,CAAC,GACR,KAAK,GAAG,CAAC,IAAI,GACb,KAAK,GAAG,CAA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
4
4
  "description": "turf simplify module",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
@@ -58,25 +58,25 @@
58
58
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
59
59
  },
60
60
  "devDependencies": {
61
- "@turf/truncate": "^7.1.0",
61
+ "@turf/truncate": "^7.2.0",
62
62
  "@types/benchmark": "^2.1.5",
63
- "@types/tape": "^4.2.32",
63
+ "@types/tape": "^4.13.4",
64
64
  "benchmark": "^2.1.4",
65
65
  "load-json-file": "^7.0.1",
66
66
  "npm-run-all": "^4.1.5",
67
- "tape": "^5.7.2",
68
- "tsup": "^8.0.1",
69
- "tsx": "^4.6.2",
70
- "typescript": "^5.2.2",
67
+ "tape": "^5.9.0",
68
+ "tsup": "^8.3.5",
69
+ "tsx": "^4.19.2",
70
+ "typescript": "^5.5.4",
71
71
  "write-json-file": "^5.0.0"
72
72
  },
73
73
  "dependencies": {
74
- "@turf/clean-coords": "^7.1.0",
75
- "@turf/clone": "^7.1.0",
76
- "@turf/helpers": "^7.1.0",
77
- "@turf/meta": "^7.1.0",
74
+ "@turf/clean-coords": "^7.2.0",
75
+ "@turf/clone": "^7.2.0",
76
+ "@turf/helpers": "^7.2.0",
77
+ "@turf/meta": "^7.2.0",
78
78
  "@types/geojson": "^7946.0.10",
79
- "tslib": "^2.6.2"
79
+ "tslib": "^2.8.1"
80
80
  },
81
- "gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef"
81
+ "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
82
82
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"names":[],"mappings":";AAAA,SAAS,gBAAgB;AAiBzB,SAAS,OAAO,MAAkB;AAChC,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAClB,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAElB,MAAI,qBAAqB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AACjE,MAAI,mBAAmB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AAC/D,MAAI,sBAAsB,kBAAkB;AAC1C,QAAI,oBAAoB,QAAQ,SAAS;AACzC,WAAO;AAAA,MACL;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,MACnC;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,IACrC;AAAA,EACF,OAAO;AACL,QAAI,sBAAsB,OAAO,QAAQ;AACzC,WAAO;AAAA,MACL,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,MACA,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AACF;AAGA,IAAO,sBAAQ","sourcesContent":["import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @name square\n * @param {BBox} bbox extent in [west, south, east, north] order\n * @returns {BBox} a square surrounding `bbox`\n * @example\n * const bbox = [-20, -20, -15, 0];\n * const squared = turf.square(bbox);\n *\n * //addToMap\n * const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]\n */\nfunction square(bbox: BBox): BBox {\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);\n var verticalDistance = distance(bbox.slice(0, 2), [west, north]);\n if (horizontalDistance >= verticalDistance) {\n var verticalMidpoint = (south + north) / 2;\n return [\n west,\n verticalMidpoint - (east - west) / 2,\n east,\n verticalMidpoint + (east - west) / 2,\n ];\n } else {\n var horizontalMidpoint = (west + east) / 2;\n return [\n horizontalMidpoint - (north - south) / 2,\n south,\n horizontalMidpoint + (north - south) / 2,\n north,\n ];\n }\n}\n\nexport { square };\nexport default square;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-square/dist/cj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oBAAA,EAAQ,MAAA;ADjBf;AACE;AACA;AACF,+DAAC","file":"/home/runner/work/turf/turf/packages/turf-square/dist/cjs/index.cjs","sourcesContent":[null,"import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @function\n * @param {BBox} bbox extent in [west, south, east, north] order\n * @returns {BBox} a square surrounding `bbox`\n * @example\n * const bbox = [-20, -20, -15, 0];\n * const squared = turf.square(bbox);\n *\n * //addToMap\n * const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]\n */\nfunction square(bbox: BBox): BBox {\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);\n var verticalDistance = distance(bbox.slice(0, 2), [west, north]);\n if (horizontalDistance >= verticalDistance) {\n var verticalMidpoint = (south + north) / 2;\n return [\n west,\n verticalMidpoint - (east - west) / 2,\n east,\n verticalMidpoint + (east - west) / 2,\n ];\n } else {\n var horizontalMidpoint = (west + east) / 2;\n return [\n horizontalMidpoint - (north - south) / 2,\n south,\n horizontalMidpoint + (north - south) / 2,\n north,\n ];\n }\n}\n\nexport { square };\nexport default square;\n"]}
@@ -4,7 +4,7 @@ import { BBox } from 'geojson';
4
4
  * Takes a bounding box and calculates the minimum square bounding box that
5
5
  * would contain the input.
6
6
  *
7
- * @name square
7
+ * @function
8
8
  * @param {BBox} bbox extent in [west, south, east, north] order
9
9
  * @returns {BBox} a square surrounding `bbox`
10
10
  * @example
@@ -4,7 +4,7 @@ import { BBox } from 'geojson';
4
4
  * Takes a bounding box and calculates the minimum square bounding box that
5
5
  * would contain the input.
6
6
  *
7
- * @name square
7
+ * @function
8
8
  * @param {BBox} bbox extent in [west, south, east, north] order
9
9
  * @returns {BBox} a square surrounding `bbox`
10
10
  * @example
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @name square\n * @param {BBox} bbox extent in [west, south, east, north] order\n * @returns {BBox} a square surrounding `bbox`\n * @example\n * const bbox = [-20, -20, -15, 0];\n * const squared = turf.square(bbox);\n *\n * //addToMap\n * const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]\n */\nfunction square(bbox: BBox): BBox {\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);\n var verticalDistance = distance(bbox.slice(0, 2), [west, north]);\n if (horizontalDistance >= verticalDistance) {\n var verticalMidpoint = (south + north) / 2;\n return [\n west,\n verticalMidpoint - (east - west) / 2,\n east,\n verticalMidpoint + (east - west) / 2,\n ];\n } else {\n var horizontalMidpoint = (west + east) / 2;\n return [\n horizontalMidpoint - (north - south) / 2,\n south,\n horizontalMidpoint + (north - south) / 2,\n north,\n ];\n }\n}\n\nexport { square };\nexport default square;\n"],"mappings":";AAAA,SAAS,gBAAgB;AAiBzB,SAAS,OAAO,MAAkB;AAChC,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAClB,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAElB,MAAI,qBAAqB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AACjE,MAAI,mBAAmB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AAC/D,MAAI,sBAAsB,kBAAkB;AAC1C,QAAI,oBAAoB,QAAQ,SAAS;AACzC,WAAO;AAAA,MACL;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,MACnC;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,IACrC;AAAA,EACF,OAAO;AACL,QAAI,sBAAsB,OAAO,QAAQ;AACzC,WAAO;AAAA,MACL,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,MACA,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AACF;AAGA,IAAO,sBAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { distance } from \"@turf/distance\";\nimport { BBox } from \"geojson\";\n\n/**\n * Takes a bounding box and calculates the minimum square bounding box that\n * would contain the input.\n *\n * @function\n * @param {BBox} bbox extent in [west, south, east, north] order\n * @returns {BBox} a square surrounding `bbox`\n * @example\n * const bbox = [-20, -20, -15, 0];\n * const squared = turf.square(bbox);\n *\n * //addToMap\n * const addToMap = [turf.bboxPolygon(bbox), turf.bboxPolygon(squared)]\n */\nfunction square(bbox: BBox): BBox {\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var horizontalDistance = distance(bbox.slice(0, 2), [east, south]);\n var verticalDistance = distance(bbox.slice(0, 2), [west, north]);\n if (horizontalDistance >= verticalDistance) {\n var verticalMidpoint = (south + north) / 2;\n return [\n west,\n verticalMidpoint - (east - west) / 2,\n east,\n verticalMidpoint + (east - west) / 2,\n ];\n } else {\n var horizontalMidpoint = (west + east) / 2;\n return [\n horizontalMidpoint - (north - south) / 2,\n south,\n horizontalMidpoint + (north - south) / 2,\n north,\n ];\n }\n}\n\nexport { square };\nexport default square;\n"],"mappings":";AAAA,SAAS,gBAAgB;AAiBzB,SAAS,OAAO,MAAkB;AAChC,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAClB,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAElB,MAAI,qBAAqB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AACjE,MAAI,mBAAmB,SAAS,KAAK,MAAM,GAAG,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC;AAC/D,MAAI,sBAAsB,kBAAkB;AAC1C,QAAI,oBAAoB,QAAQ,SAAS;AACzC,WAAO;AAAA,MACL;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,MACnC;AAAA,MACA,oBAAoB,OAAO,QAAQ;AAAA,IACrC;AAAA,EACF,OAAO;AACL,QAAI,sBAAsB,OAAO,QAAQ;AACzC,WAAO;AAAA,MACL,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,MACA,sBAAsB,QAAQ,SAAS;AAAA,MACvC;AAAA,IACF;AAAA,EACF;AACF;AAGA,IAAO,sBAAQ;","names":[]}