node-red-contrib-tak-registration 0.16.1 → 0.16.3

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 (799) hide show
  1. package/node_modules/@turf/along/README.md +3 -1
  2. package/node_modules/@turf/along/dist/cjs/index.cjs +2 -2
  3. package/node_modules/@turf/along/dist/cjs/index.cjs.map +1 -1
  4. package/node_modules/@turf/along/dist/cjs/index.d.cts +1 -1
  5. package/node_modules/@turf/along/dist/esm/index.d.ts +1 -1
  6. package/node_modules/@turf/along/dist/esm/index.js +2 -2
  7. package/node_modules/@turf/along/dist/esm/index.js.map +1 -1
  8. package/node_modules/@turf/along/package.json +12 -12
  9. package/node_modules/@turf/angle/dist/cjs/index.cjs +2 -2
  10. package/node_modules/@turf/angle/dist/cjs/index.cjs.map +1 -1
  11. package/node_modules/@turf/angle/dist/esm/index.js +2 -2
  12. package/node_modules/@turf/angle/dist/esm/index.js.map +1 -1
  13. package/node_modules/@turf/angle/package.json +16 -16
  14. package/node_modules/@turf/area/dist/cjs/index.cjs +2 -2
  15. package/node_modules/@turf/area/dist/cjs/index.cjs.map +1 -1
  16. package/node_modules/@turf/area/dist/esm/index.js +2 -2
  17. package/node_modules/@turf/area/dist/esm/index.js.map +1 -1
  18. package/node_modules/@turf/area/package.json +10 -10
  19. package/node_modules/@turf/bbox/dist/cjs/index.cjs +2 -2
  20. package/node_modules/@turf/bbox/dist/cjs/index.cjs.map +1 -1
  21. package/node_modules/@turf/bbox/dist/esm/index.js +2 -2
  22. package/node_modules/@turf/bbox/dist/esm/index.js.map +1 -1
  23. package/node_modules/@turf/bbox/package.json +9 -9
  24. package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs +2 -2
  25. package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs.map +1 -1
  26. package/node_modules/@turf/bbox-clip/dist/esm/index.js +2 -2
  27. package/node_modules/@turf/bbox-clip/dist/esm/index.js.map +1 -1
  28. package/node_modules/@turf/bbox-clip/package.json +11 -11
  29. package/node_modules/@turf/bbox-polygon/dist/cjs/index.cjs +2 -2
  30. package/node_modules/@turf/bbox-polygon/dist/cjs/index.cjs.map +1 -1
  31. package/node_modules/@turf/bbox-polygon/dist/esm/index.js +2 -2
  32. package/node_modules/@turf/bbox-polygon/dist/esm/index.js.map +1 -1
  33. package/node_modules/@turf/bbox-polygon/package.json +8 -8
  34. package/node_modules/@turf/bearing/dist/cjs/index.cjs +2 -2
  35. package/node_modules/@turf/bearing/dist/cjs/index.cjs.map +1 -1
  36. package/node_modules/@turf/bearing/dist/esm/index.js +2 -2
  37. package/node_modules/@turf/bearing/dist/esm/index.js.map +1 -1
  38. package/node_modules/@turf/bearing/package.json +11 -11
  39. package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs +2 -2
  40. package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs.map +1 -1
  41. package/node_modules/@turf/bezier-spline/dist/esm/index.js +2 -2
  42. package/node_modules/@turf/bezier-spline/dist/esm/index.js.map +1 -1
  43. package/node_modules/@turf/bezier-spline/package.json +10 -10
  44. package/node_modules/@turf/boolean-clockwise/dist/cjs/index.cjs +2 -2
  45. package/node_modules/@turf/boolean-clockwise/dist/cjs/index.cjs.map +1 -1
  46. package/node_modules/@turf/boolean-clockwise/dist/esm/index.js +2 -2
  47. package/node_modules/@turf/boolean-clockwise/dist/esm/index.js.map +1 -1
  48. package/node_modules/@turf/boolean-clockwise/package.json +10 -10
  49. package/node_modules/@turf/boolean-concave/dist/cjs/index.cjs +2 -2
  50. package/node_modules/@turf/boolean-concave/dist/cjs/index.cjs.map +1 -1
  51. package/node_modules/@turf/boolean-concave/dist/esm/index.js +2 -2
  52. package/node_modules/@turf/boolean-concave/dist/esm/index.js.map +1 -1
  53. package/node_modules/@turf/boolean-concave/package.json +10 -10
  54. package/node_modules/@turf/boolean-contains/dist/cjs/index.cjs +2 -2
  55. package/node_modules/@turf/boolean-contains/dist/cjs/index.cjs.map +1 -1
  56. package/node_modules/@turf/boolean-contains/dist/esm/index.js +2 -2
  57. package/node_modules/@turf/boolean-contains/dist/esm/index.js.map +1 -1
  58. package/node_modules/@turf/boolean-contains/package.json +13 -13
  59. package/node_modules/@turf/boolean-crosses/dist/cjs/index.cjs +2 -2
  60. package/node_modules/@turf/boolean-crosses/dist/cjs/index.cjs.map +1 -1
  61. package/node_modules/@turf/boolean-crosses/dist/esm/index.js +2 -2
  62. package/node_modules/@turf/boolean-crosses/dist/esm/index.js.map +1 -1
  63. package/node_modules/@turf/boolean-crosses/package.json +13 -13
  64. package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs +2 -2
  65. package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs.map +1 -1
  66. package/node_modules/@turf/boolean-disjoint/dist/esm/index.js +2 -2
  67. package/node_modules/@turf/boolean-disjoint/dist/esm/index.js.map +1 -1
  68. package/node_modules/@turf/boolean-disjoint/package.json +12 -12
  69. package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs +2 -2
  70. package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs.map +1 -1
  71. package/node_modules/@turf/boolean-equal/dist/esm/index.js +2 -2
  72. package/node_modules/@turf/boolean-equal/dist/esm/index.js.map +1 -1
  73. package/node_modules/@turf/boolean-equal/package.json +11 -11
  74. package/node_modules/@turf/boolean-intersects/README.md +1 -1
  75. package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs +2 -2
  76. package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs.map +1 -1
  77. package/node_modules/@turf/boolean-intersects/dist/esm/index.js +2 -2
  78. package/node_modules/@turf/boolean-intersects/dist/esm/index.js.map +1 -1
  79. package/node_modules/@turf/boolean-intersects/package.json +10 -10
  80. package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs +2 -2
  81. package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs.map +1 -1
  82. package/node_modules/@turf/boolean-overlap/dist/esm/index.js +2 -2
  83. package/node_modules/@turf/boolean-overlap/dist/esm/index.js.map +1 -1
  84. package/node_modules/@turf/boolean-overlap/package.json +13 -13
  85. package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs +2 -2
  86. package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs.map +1 -1
  87. package/node_modules/@turf/boolean-parallel/dist/esm/index.js +2 -2
  88. package/node_modules/@turf/boolean-parallel/dist/esm/index.js.map +1 -1
  89. package/node_modules/@turf/boolean-parallel/package.json +12 -12
  90. package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs +2 -2
  91. package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs.map +1 -1
  92. package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +2 -2
  93. package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
  94. package/node_modules/@turf/boolean-point-in-polygon/package.json +9 -9
  95. package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs +2 -2
  96. package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs.map +1 -1
  97. package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js +2 -2
  98. package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js.map +1 -1
  99. package/node_modules/@turf/boolean-point-on-line/package.json +11 -11
  100. package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs +2 -2
  101. package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs.map +1 -1
  102. package/node_modules/@turf/boolean-touches/dist/esm/index.js +2 -2
  103. package/node_modules/@turf/boolean-touches/dist/esm/index.js.map +1 -1
  104. package/node_modules/@turf/boolean-touches/package.json +12 -12
  105. package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs +2 -2
  106. package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs.map +1 -1
  107. package/node_modules/@turf/boolean-valid/dist/esm/index.js +2 -2
  108. package/node_modules/@turf/boolean-valid/dist/esm/index.js.map +1 -1
  109. package/node_modules/@turf/boolean-valid/package.json +17 -17
  110. package/node_modules/@turf/boolean-within/dist/cjs/index.cjs +2 -2
  111. package/node_modules/@turf/boolean-within/dist/cjs/index.cjs.map +1 -1
  112. package/node_modules/@turf/boolean-within/dist/esm/index.js +2 -2
  113. package/node_modules/@turf/boolean-within/dist/esm/index.js.map +1 -1
  114. package/node_modules/@turf/boolean-within/package.json +13 -13
  115. package/node_modules/@turf/buffer/README.md +3 -3
  116. package/node_modules/@turf/buffer/dist/cjs/index.cjs +2 -2
  117. package/node_modules/@turf/buffer/dist/cjs/index.cjs.map +1 -1
  118. package/node_modules/@turf/buffer/dist/esm/index.js +2 -2
  119. package/node_modules/@turf/buffer/dist/esm/index.js.map +1 -1
  120. package/node_modules/@turf/buffer/package.json +13 -13
  121. package/node_modules/@turf/center/dist/cjs/index.cjs +2 -2
  122. package/node_modules/@turf/center/dist/cjs/index.cjs.map +1 -1
  123. package/node_modules/@turf/center/dist/esm/index.js +2 -2
  124. package/node_modules/@turf/center/dist/esm/index.js.map +1 -1
  125. package/node_modules/@turf/center/package.json +13 -13
  126. package/node_modules/@turf/center-mean/dist/cjs/index.cjs +2 -2
  127. package/node_modules/@turf/center-mean/dist/cjs/index.cjs.map +1 -1
  128. package/node_modules/@turf/center-mean/dist/esm/index.js +2 -2
  129. package/node_modules/@turf/center-mean/dist/esm/index.js.map +1 -1
  130. package/node_modules/@turf/center-mean/package.json +14 -14
  131. package/node_modules/@turf/center-median/dist/cjs/index.cjs +2 -2
  132. package/node_modules/@turf/center-median/dist/cjs/index.cjs.map +1 -1
  133. package/node_modules/@turf/center-median/dist/esm/index.js +2 -2
  134. package/node_modules/@turf/center-median/dist/esm/index.js.map +1 -1
  135. package/node_modules/@turf/center-median/package.json +17 -17
  136. package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs +2 -2
  137. package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs.map +1 -1
  138. package/node_modules/@turf/center-of-mass/dist/esm/index.js +2 -2
  139. package/node_modules/@turf/center-of-mass/dist/esm/index.js.map +1 -1
  140. package/node_modules/@turf/center-of-mass/package.json +14 -14
  141. package/node_modules/@turf/centroid/dist/cjs/index.cjs +2 -2
  142. package/node_modules/@turf/centroid/dist/cjs/index.cjs.map +1 -1
  143. package/node_modules/@turf/centroid/dist/esm/index.js +2 -2
  144. package/node_modules/@turf/centroid/dist/esm/index.js.map +1 -1
  145. package/node_modules/@turf/centroid/package.json +11 -11
  146. package/node_modules/@turf/circle/README.md +13 -13
  147. package/node_modules/@turf/circle/dist/cjs/index.cjs +2 -2
  148. package/node_modules/@turf/circle/dist/cjs/index.cjs.map +1 -1
  149. package/node_modules/@turf/circle/dist/cjs/index.d.cts +2 -2
  150. package/node_modules/@turf/circle/dist/esm/index.d.ts +2 -2
  151. package/node_modules/@turf/circle/dist/esm/index.js +2 -2
  152. package/node_modules/@turf/circle/dist/esm/index.js.map +1 -1
  153. package/node_modules/@turf/circle/package.json +11 -11
  154. package/node_modules/@turf/clean-coords/dist/cjs/index.cjs +33 -49
  155. package/node_modules/@turf/clean-coords/dist/cjs/index.cjs.map +1 -1
  156. package/node_modules/@turf/clean-coords/dist/esm/index.js +33 -49
  157. package/node_modules/@turf/clean-coords/dist/esm/index.js.map +1 -1
  158. package/node_modules/@turf/clean-coords/package.json +15 -12
  159. package/node_modules/@turf/clone/dist/cjs/index.cjs +2 -2
  160. package/node_modules/@turf/clone/dist/cjs/index.cjs.map +1 -1
  161. package/node_modules/@turf/clone/dist/esm/index.js +2 -2
  162. package/node_modules/@turf/clone/dist/esm/index.js.map +1 -1
  163. package/node_modules/@turf/clone/package.json +9 -9
  164. package/node_modules/@turf/clusters/package.json +9 -9
  165. package/node_modules/@turf/clusters-dbscan/README.md +2 -2
  166. package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs +3 -8
  167. package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs.map +1 -1
  168. package/node_modules/@turf/clusters-dbscan/dist/cjs/index.d.cts +1 -1
  169. package/node_modules/@turf/clusters-dbscan/dist/esm/index.d.ts +1 -1
  170. package/node_modules/@turf/clusters-dbscan/dist/esm/index.js +4 -9
  171. package/node_modules/@turf/clusters-dbscan/dist/esm/index.js.map +1 -1
  172. package/node_modules/@turf/clusters-dbscan/package.json +15 -15
  173. package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs +2 -2
  174. package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs.map +1 -1
  175. package/node_modules/@turf/clusters-kmeans/dist/cjs/index.d.cts +1 -1
  176. package/node_modules/@turf/clusters-kmeans/dist/esm/index.d.ts +1 -1
  177. package/node_modules/@turf/clusters-kmeans/dist/esm/index.js +2 -2
  178. package/node_modules/@turf/clusters-kmeans/dist/esm/index.js.map +1 -1
  179. package/node_modules/@turf/clusters-kmeans/package.json +15 -15
  180. package/node_modules/@turf/collect/dist/cjs/index.cjs +3 -8
  181. package/node_modules/@turf/collect/dist/cjs/index.cjs.map +1 -1
  182. package/node_modules/@turf/collect/dist/esm/index.js +3 -8
  183. package/node_modules/@turf/collect/dist/esm/index.js.map +1 -1
  184. package/node_modules/@turf/collect/package.json +11 -11
  185. package/node_modules/@turf/combine/dist/cjs/index.cjs +2 -2
  186. package/node_modules/@turf/combine/dist/cjs/index.cjs.map +1 -1
  187. package/node_modules/@turf/combine/dist/esm/index.js +2 -2
  188. package/node_modules/@turf/combine/dist/esm/index.js.map +1 -1
  189. package/node_modules/@turf/combine/package.json +9 -9
  190. package/node_modules/@turf/concave/README.md +2 -2
  191. package/node_modules/@turf/concave/dist/cjs/index.cjs +2 -2
  192. package/node_modules/@turf/concave/dist/cjs/index.cjs.map +1 -1
  193. package/node_modules/@turf/concave/dist/cjs/index.d.cts +1 -1
  194. package/node_modules/@turf/concave/dist/esm/index.d.ts +1 -1
  195. package/node_modules/@turf/concave/dist/esm/index.js +2 -2
  196. package/node_modules/@turf/concave/dist/esm/index.js.map +1 -1
  197. package/node_modules/@turf/concave/package.json +14 -14
  198. package/node_modules/@turf/convex/dist/cjs/index.cjs +2 -2
  199. package/node_modules/@turf/convex/dist/cjs/index.cjs.map +1 -1
  200. package/node_modules/@turf/convex/dist/esm/index.js +2 -2
  201. package/node_modules/@turf/convex/dist/esm/index.js.map +1 -1
  202. package/node_modules/@turf/convex/package.json +11 -11
  203. package/node_modules/@turf/destination/README.md +2 -2
  204. package/node_modules/@turf/destination/dist/cjs/index.cjs +5 -2
  205. package/node_modules/@turf/destination/dist/cjs/index.cjs.map +1 -1
  206. package/node_modules/@turf/destination/dist/cjs/index.d.cts +1 -1
  207. package/node_modules/@turf/destination/dist/esm/index.d.ts +1 -1
  208. package/node_modules/@turf/destination/dist/esm/index.js +5 -2
  209. package/node_modules/@turf/destination/dist/esm/index.js.map +1 -1
  210. package/node_modules/@turf/destination/package.json +14 -11
  211. package/node_modules/@turf/difference/dist/cjs/index.cjs +2 -2
  212. package/node_modules/@turf/difference/dist/cjs/index.cjs.map +1 -1
  213. package/node_modules/@turf/difference/dist/esm/index.js +2 -2
  214. package/node_modules/@turf/difference/dist/esm/index.js.map +1 -1
  215. package/node_modules/@turf/difference/package.json +11 -11
  216. package/node_modules/@turf/dissolve/dist/cjs/index.cjs +2 -2
  217. package/node_modules/@turf/dissolve/dist/cjs/index.cjs.map +1 -1
  218. package/node_modules/@turf/dissolve/dist/esm/index.js +2 -2
  219. package/node_modules/@turf/dissolve/dist/esm/index.js.map +1 -1
  220. package/node_modules/@turf/dissolve/package.json +12 -12
  221. package/node_modules/@turf/distance/README.md +2 -2
  222. package/node_modules/@turf/distance/dist/cjs/index.cjs +2 -2
  223. package/node_modules/@turf/distance/dist/cjs/index.cjs.map +1 -1
  224. package/node_modules/@turf/distance/dist/cjs/index.d.cts +1 -1
  225. package/node_modules/@turf/distance/dist/esm/index.d.ts +1 -1
  226. package/node_modules/@turf/distance/dist/esm/index.js +2 -2
  227. package/node_modules/@turf/distance/dist/esm/index.js.map +1 -1
  228. package/node_modules/@turf/distance/package.json +10 -10
  229. package/node_modules/@turf/distance-weight/dist/cjs/index.cjs +2 -2
  230. package/node_modules/@turf/distance-weight/dist/cjs/index.cjs.map +1 -1
  231. package/node_modules/@turf/distance-weight/dist/esm/index.js +2 -2
  232. package/node_modules/@turf/distance-weight/dist/esm/index.js.map +1 -1
  233. package/node_modules/@turf/distance-weight/package.json +12 -12
  234. package/node_modules/@turf/ellipse/README.md +2 -2
  235. package/node_modules/@turf/ellipse/dist/cjs/index.cjs +62 -39
  236. package/node_modules/@turf/ellipse/dist/cjs/index.cjs.map +1 -1
  237. package/node_modules/@turf/ellipse/dist/cjs/index.d.cts +1 -1
  238. package/node_modules/@turf/ellipse/dist/esm/index.d.ts +1 -1
  239. package/node_modules/@turf/ellipse/dist/esm/index.js +64 -41
  240. package/node_modules/@turf/ellipse/dist/esm/index.js.map +1 -1
  241. package/node_modules/@turf/ellipse/package.json +21 -18
  242. package/node_modules/@turf/envelope/dist/cjs/index.cjs +2 -2
  243. package/node_modules/@turf/envelope/dist/cjs/index.cjs.map +1 -1
  244. package/node_modules/@turf/envelope/dist/esm/index.js +2 -2
  245. package/node_modules/@turf/envelope/dist/esm/index.js.map +1 -1
  246. package/node_modules/@turf/envelope/package.json +10 -10
  247. package/node_modules/@turf/explode/dist/cjs/index.cjs +2 -2
  248. package/node_modules/@turf/explode/dist/cjs/index.cjs.map +1 -1
  249. package/node_modules/@turf/explode/dist/esm/index.js +2 -2
  250. package/node_modules/@turf/explode/dist/esm/index.js.map +1 -1
  251. package/node_modules/@turf/explode/package.json +10 -10
  252. package/node_modules/@turf/flatten/dist/cjs/index.cjs +2 -2
  253. package/node_modules/@turf/flatten/dist/cjs/index.cjs.map +1 -1
  254. package/node_modules/@turf/flatten/dist/esm/index.js +2 -2
  255. package/node_modules/@turf/flatten/dist/esm/index.js.map +1 -1
  256. package/node_modules/@turf/flatten/package.json +10 -10
  257. package/node_modules/@turf/flip/dist/cjs/index.cjs +2 -2
  258. package/node_modules/@turf/flip/dist/cjs/index.cjs.map +1 -1
  259. package/node_modules/@turf/flip/dist/esm/index.js +2 -2
  260. package/node_modules/@turf/flip/dist/esm/index.js.map +1 -1
  261. package/node_modules/@turf/flip/package.json +11 -11
  262. package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs +2 -2
  263. package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs.map +1 -1
  264. package/node_modules/@turf/geojson-rbush/dist/esm/index.js +2 -2
  265. package/node_modules/@turf/geojson-rbush/dist/esm/index.js.map +1 -1
  266. package/node_modules/@turf/geojson-rbush/package.json +12 -12
  267. package/node_modules/@turf/great-circle/dist/cjs/index.cjs +3 -3
  268. package/node_modules/@turf/great-circle/dist/cjs/index.cjs.map +1 -1
  269. package/node_modules/@turf/great-circle/dist/esm/index.js +3 -3
  270. package/node_modules/@turf/great-circle/dist/esm/index.js.map +1 -1
  271. package/node_modules/@turf/great-circle/package.json +10 -10
  272. package/node_modules/@turf/helpers/README.md +1 -1
  273. package/node_modules/@turf/helpers/dist/cjs/index.cjs.map +1 -1
  274. package/node_modules/@turf/helpers/dist/cjs/index.d.cts +1 -1
  275. package/node_modules/@turf/helpers/dist/esm/index.d.ts +1 -1
  276. package/node_modules/@turf/helpers/dist/esm/index.js.map +1 -1
  277. package/node_modules/@turf/helpers/package.json +7 -7
  278. package/node_modules/@turf/hex-grid/README.md +7 -5
  279. package/node_modules/@turf/hex-grid/dist/cjs/index.cjs +2 -2
  280. package/node_modules/@turf/hex-grid/dist/cjs/index.cjs.map +1 -1
  281. package/node_modules/@turf/hex-grid/dist/cjs/index.d.cts +4 -4
  282. package/node_modules/@turf/hex-grid/dist/esm/index.d.ts +4 -4
  283. package/node_modules/@turf/hex-grid/dist/esm/index.js +2 -2
  284. package/node_modules/@turf/hex-grid/dist/esm/index.js.map +1 -1
  285. package/node_modules/@turf/hex-grid/package.json +14 -14
  286. package/node_modules/@turf/interpolate/README.md +7 -5
  287. package/node_modules/@turf/interpolate/dist/cjs/index.cjs +2 -2
  288. package/node_modules/@turf/interpolate/dist/cjs/index.cjs.map +1 -1
  289. package/node_modules/@turf/interpolate/dist/esm/index.js +2 -2
  290. package/node_modules/@turf/interpolate/dist/esm/index.js.map +1 -1
  291. package/node_modules/@turf/interpolate/package.json +19 -19
  292. package/node_modules/@turf/intersect/dist/cjs/index.cjs +2 -2
  293. package/node_modules/@turf/intersect/dist/cjs/index.cjs.map +1 -1
  294. package/node_modules/@turf/intersect/dist/esm/index.js +2 -2
  295. package/node_modules/@turf/intersect/dist/esm/index.js.map +1 -1
  296. package/node_modules/@turf/intersect/package.json +11 -11
  297. package/node_modules/@turf/invariant/package.json +8 -8
  298. package/node_modules/@turf/isobands/README.md +1 -1
  299. package/node_modules/@turf/isobands/dist/cjs/index.cjs +313 -9
  300. package/node_modules/@turf/isobands/dist/cjs/index.cjs.map +1 -1
  301. package/node_modules/@turf/isobands/dist/cjs/index.d.cts +1 -1
  302. package/node_modules/@turf/isobands/dist/esm/index.d.ts +1 -1
  303. package/node_modules/@turf/isobands/dist/esm/index.js +313 -9
  304. package/node_modules/@turf/isobands/dist/esm/index.js.map +1 -1
  305. package/node_modules/@turf/isobands/package.json +22 -22
  306. package/node_modules/@turf/isolines/README.md +1 -1
  307. package/node_modules/@turf/isolines/dist/cjs/index.cjs +192 -7
  308. package/node_modules/@turf/isolines/dist/cjs/index.cjs.map +1 -1
  309. package/node_modules/@turf/isolines/dist/cjs/index.d.cts +1 -1
  310. package/node_modules/@turf/isolines/dist/esm/index.d.ts +1 -1
  311. package/node_modules/@turf/isolines/dist/esm/index.js +192 -7
  312. package/node_modules/@turf/isolines/dist/esm/index.js.map +1 -1
  313. package/node_modules/@turf/isolines/package.json +19 -19
  314. package/node_modules/@turf/kinks/dist/cjs/index.cjs +2 -2
  315. package/node_modules/@turf/kinks/dist/cjs/index.cjs.map +1 -1
  316. package/node_modules/@turf/kinks/dist/esm/index.js +2 -2
  317. package/node_modules/@turf/kinks/dist/esm/index.js.map +1 -1
  318. package/node_modules/@turf/kinks/package.json +10 -10
  319. package/node_modules/@turf/length/README.md +2 -2
  320. package/node_modules/@turf/length/dist/cjs/index.cjs +2 -2
  321. package/node_modules/@turf/length/dist/cjs/index.cjs.map +1 -1
  322. package/node_modules/@turf/length/dist/cjs/index.d.cts +1 -1
  323. package/node_modules/@turf/length/dist/esm/index.d.ts +1 -1
  324. package/node_modules/@turf/length/dist/esm/index.js +2 -2
  325. package/node_modules/@turf/length/dist/esm/index.js.map +1 -1
  326. package/node_modules/@turf/length/package.json +11 -11
  327. package/node_modules/@turf/line-arc/README.md +2 -2
  328. package/node_modules/@turf/line-arc/dist/cjs/index.cjs +2 -2
  329. package/node_modules/@turf/line-arc/dist/cjs/index.cjs.map +1 -1
  330. package/node_modules/@turf/line-arc/dist/cjs/index.d.cts +1 -1
  331. package/node_modules/@turf/line-arc/dist/esm/index.d.ts +1 -1
  332. package/node_modules/@turf/line-arc/dist/esm/index.js +2 -2
  333. package/node_modules/@turf/line-arc/dist/esm/index.js.map +1 -1
  334. package/node_modules/@turf/line-arc/package.json +12 -12
  335. package/node_modules/@turf/line-chunk/README.md +2 -2
  336. package/node_modules/@turf/line-chunk/dist/cjs/index.cjs +2 -2
  337. package/node_modules/@turf/line-chunk/dist/cjs/index.cjs.map +1 -1
  338. package/node_modules/@turf/line-chunk/dist/esm/index.js +2 -2
  339. package/node_modules/@turf/line-chunk/dist/esm/index.js.map +1 -1
  340. package/node_modules/@turf/line-chunk/package.json +12 -12
  341. package/node_modules/@turf/line-intersect/dist/cjs/index.cjs +2 -2
  342. package/node_modules/@turf/line-intersect/dist/cjs/index.cjs.map +1 -1
  343. package/node_modules/@turf/line-intersect/dist/esm/index.js +2 -2
  344. package/node_modules/@turf/line-intersect/dist/esm/index.js.map +1 -1
  345. package/node_modules/@turf/line-intersect/package.json +10 -10
  346. package/node_modules/@turf/line-offset/README.md +2 -2
  347. package/node_modules/@turf/line-offset/dist/cjs/index.cjs +2 -2
  348. package/node_modules/@turf/line-offset/dist/cjs/index.cjs.map +1 -1
  349. package/node_modules/@turf/line-offset/dist/esm/index.js +2 -2
  350. package/node_modules/@turf/line-offset/dist/esm/index.js.map +1 -1
  351. package/node_modules/@turf/line-offset/package.json +11 -11
  352. package/node_modules/@turf/line-overlap/dist/cjs/index.cjs +2 -2
  353. package/node_modules/@turf/line-overlap/dist/cjs/index.cjs.map +1 -1
  354. package/node_modules/@turf/line-overlap/dist/esm/index.js +2 -2
  355. package/node_modules/@turf/line-overlap/dist/esm/index.js.map +1 -1
  356. package/node_modules/@turf/line-overlap/package.json +15 -15
  357. package/node_modules/@turf/line-segment/dist/cjs/index.cjs +2 -2
  358. package/node_modules/@turf/line-segment/dist/cjs/index.cjs.map +1 -1
  359. package/node_modules/@turf/line-segment/dist/esm/index.js +2 -2
  360. package/node_modules/@turf/line-segment/dist/esm/index.js.map +1 -1
  361. package/node_modules/@turf/line-segment/package.json +11 -11
  362. package/node_modules/@turf/line-slice/dist/cjs/index.cjs +2 -2
  363. package/node_modules/@turf/line-slice/dist/cjs/index.cjs.map +1 -1
  364. package/node_modules/@turf/line-slice/dist/esm/index.js +2 -2
  365. package/node_modules/@turf/line-slice/dist/esm/index.js.map +1 -1
  366. package/node_modules/@turf/line-slice/package.json +11 -11
  367. package/node_modules/@turf/line-slice-along/README.md +2 -2
  368. package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs +2 -2
  369. package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs.map +1 -1
  370. package/node_modules/@turf/line-slice-along/dist/esm/index.js +2 -2
  371. package/node_modules/@turf/line-slice-along/dist/esm/index.js.map +1 -1
  372. package/node_modules/@turf/line-slice-along/package.json +12 -12
  373. package/node_modules/@turf/line-split/README.md +4 -1
  374. package/node_modules/@turf/line-split/dist/cjs/index.cjs +2 -7
  375. package/node_modules/@turf/line-split/dist/cjs/index.cjs.map +1 -1
  376. package/node_modules/@turf/line-split/dist/esm/index.js +2 -7
  377. package/node_modules/@turf/line-split/dist/esm/index.js.map +1 -1
  378. package/node_modules/@turf/line-split/package.json +16 -17
  379. package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs +2 -2
  380. package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs.map +1 -1
  381. package/node_modules/@turf/line-to-polygon/dist/esm/index.js +2 -2
  382. package/node_modules/@turf/line-to-polygon/dist/esm/index.js.map +1 -1
  383. package/node_modules/@turf/line-to-polygon/package.json +12 -12
  384. package/node_modules/@turf/mask/dist/cjs/index.cjs +2 -2
  385. package/node_modules/@turf/mask/dist/cjs/index.cjs.map +1 -1
  386. package/node_modules/@turf/mask/dist/esm/index.js +2 -2
  387. package/node_modules/@turf/mask/dist/esm/index.js.map +1 -1
  388. package/node_modules/@turf/mask/package.json +10 -10
  389. package/node_modules/@turf/meta/package.json +7 -7
  390. package/node_modules/@turf/midpoint/dist/cjs/index.cjs +2 -2
  391. package/node_modules/@turf/midpoint/dist/cjs/index.cjs.map +1 -1
  392. package/node_modules/@turf/midpoint/dist/esm/index.js +2 -2
  393. package/node_modules/@turf/midpoint/dist/esm/index.js.map +1 -1
  394. package/node_modules/@turf/midpoint/package.json +11 -11
  395. package/node_modules/@turf/moran-index/dist/cjs/index.cjs +2 -2
  396. package/node_modules/@turf/moran-index/dist/cjs/index.cjs.map +1 -1
  397. package/node_modules/@turf/moran-index/dist/esm/index.js +2 -2
  398. package/node_modules/@turf/moran-index/dist/esm/index.js.map +1 -1
  399. package/node_modules/@turf/moran-index/package.json +11 -11
  400. package/node_modules/@turf/nearest-neighbor-analysis/README.md +1 -1
  401. package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.cjs +2 -2
  402. package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.cjs.map +1 -1
  403. package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.d.cts +2 -2
  404. package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.d.ts +2 -2
  405. package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js +2 -2
  406. package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js.map +1 -1
  407. package/node_modules/@turf/nearest-neighbor-analysis/package.json +17 -17
  408. package/node_modules/@turf/nearest-point/README.md +2 -2
  409. package/node_modules/@turf/nearest-point/dist/cjs/index.cjs +2 -2
  410. package/node_modules/@turf/nearest-point/dist/cjs/index.cjs.map +1 -1
  411. package/node_modules/@turf/nearest-point/dist/cjs/index.d.cts +6 -7
  412. package/node_modules/@turf/nearest-point/dist/esm/index.d.ts +6 -7
  413. package/node_modules/@turf/nearest-point/dist/esm/index.js +2 -2
  414. package/node_modules/@turf/nearest-point/dist/esm/index.js.map +1 -1
  415. package/node_modules/@turf/nearest-point/package.json +12 -12
  416. package/node_modules/@turf/nearest-point-on-line/README.md +6 -2
  417. package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs +45 -52
  418. package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs.map +1 -1
  419. package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.d.cts +5 -1
  420. package/node_modules/@turf/nearest-point-on-line/dist/esm/index.d.ts +5 -1
  421. package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js +45 -52
  422. package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js.map +1 -1
  423. package/node_modules/@turf/nearest-point-on-line/package.json +20 -15
  424. package/node_modules/@turf/nearest-point-to-line/README.md +2 -2
  425. package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.cjs +2 -2
  426. package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.cjs.map +1 -1
  427. package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.d.cts +1 -1
  428. package/node_modules/@turf/nearest-point-to-line/dist/esm/index.d.ts +1 -1
  429. package/node_modules/@turf/nearest-point-to-line/dist/esm/index.js +2 -2
  430. package/node_modules/@turf/nearest-point-to-line/dist/esm/index.js.map +1 -1
  431. package/node_modules/@turf/nearest-point-to-line/package.json +14 -14
  432. package/node_modules/@turf/planepoint/dist/cjs/index.cjs +2 -2
  433. package/node_modules/@turf/planepoint/dist/cjs/index.cjs.map +1 -1
  434. package/node_modules/@turf/planepoint/dist/esm/index.js +2 -2
  435. package/node_modules/@turf/planepoint/dist/esm/index.js.map +1 -1
  436. package/node_modules/@turf/planepoint/package.json +9 -9
  437. package/node_modules/@turf/point-grid/dist/cjs/index.cjs +2 -2
  438. package/node_modules/@turf/point-grid/dist/cjs/index.cjs.map +1 -1
  439. package/node_modules/@turf/point-grid/dist/esm/index.js +2 -2
  440. package/node_modules/@turf/point-grid/dist/esm/index.js.map +1 -1
  441. package/node_modules/@turf/point-grid/package.json +14 -14
  442. package/node_modules/@turf/point-on-feature/dist/cjs/index.cjs +2 -2
  443. package/node_modules/@turf/point-on-feature/dist/cjs/index.cjs.map +1 -1
  444. package/node_modules/@turf/point-on-feature/dist/esm/index.js +2 -2
  445. package/node_modules/@turf/point-on-feature/dist/esm/index.js.map +1 -1
  446. package/node_modules/@turf/point-on-feature/package.json +15 -15
  447. package/node_modules/@turf/point-to-line-distance/README.md +5 -4
  448. package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs +2 -2
  449. package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs.map +1 -1
  450. package/node_modules/@turf/point-to-line-distance/dist/cjs/index.d.cts +1 -2
  451. package/node_modules/@turf/point-to-line-distance/dist/esm/index.d.ts +1 -2
  452. package/node_modules/@turf/point-to-line-distance/dist/esm/index.js +2 -2
  453. package/node_modules/@turf/point-to-line-distance/dist/esm/index.js.map +1 -1
  454. package/node_modules/@turf/point-to-line-distance/package.json +18 -18
  455. package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs +3 -3
  456. package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs.map +1 -1
  457. package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js +3 -3
  458. package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js.map +1 -1
  459. package/node_modules/@turf/point-to-polygon-distance/package.json +14 -14
  460. package/node_modules/@turf/points-within-polygon/dist/cjs/index.cjs +2 -2
  461. package/node_modules/@turf/points-within-polygon/dist/cjs/index.cjs.map +1 -1
  462. package/node_modules/@turf/points-within-polygon/dist/esm/index.js +2 -2
  463. package/node_modules/@turf/points-within-polygon/dist/esm/index.js.map +1 -1
  464. package/node_modules/@turf/points-within-polygon/package.json +10 -10
  465. package/node_modules/@turf/polygon-smooth/README.md +1 -1
  466. package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs +2 -2
  467. package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs.map +1 -1
  468. package/node_modules/@turf/polygon-smooth/dist/cjs/index.d.cts +1 -1
  469. package/node_modules/@turf/polygon-smooth/dist/esm/index.d.ts +1 -1
  470. package/node_modules/@turf/polygon-smooth/dist/esm/index.js +2 -2
  471. package/node_modules/@turf/polygon-smooth/dist/esm/index.js.map +1 -1
  472. package/node_modules/@turf/polygon-smooth/package.json +11 -11
  473. package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs +2 -2
  474. package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs.map +1 -1
  475. package/node_modules/@turf/polygon-tangents/dist/esm/index.js +2 -2
  476. package/node_modules/@turf/polygon-tangents/dist/esm/index.js.map +1 -1
  477. package/node_modules/@turf/polygon-tangents/package.json +14 -14
  478. package/node_modules/@turf/polygon-to-line/dist/cjs/index.cjs +2 -2
  479. package/node_modules/@turf/polygon-to-line/dist/cjs/index.cjs.map +1 -1
  480. package/node_modules/@turf/polygon-to-line/dist/esm/index.js +2 -2
  481. package/node_modules/@turf/polygon-to-line/dist/esm/index.js.map +1 -1
  482. package/node_modules/@turf/polygon-to-line/package.json +10 -10
  483. package/node_modules/@turf/polygonize/dist/cjs/index.cjs +2 -2
  484. package/node_modules/@turf/polygonize/dist/cjs/index.cjs.map +1 -1
  485. package/node_modules/@turf/polygonize/dist/esm/index.js +2 -2
  486. package/node_modules/@turf/polygonize/dist/esm/index.js.map +1 -1
  487. package/node_modules/@turf/polygonize/package.json +13 -13
  488. package/node_modules/@turf/projection/package.json +12 -12
  489. package/node_modules/@turf/quadrat-analysis/dist/cjs/index.cjs +2 -2
  490. package/node_modules/@turf/quadrat-analysis/dist/cjs/index.cjs.map +1 -1
  491. package/node_modules/@turf/quadrat-analysis/dist/esm/index.js +2 -2
  492. package/node_modules/@turf/quadrat-analysis/dist/esm/index.js.map +1 -1
  493. package/node_modules/@turf/quadrat-analysis/package.json +18 -18
  494. package/node_modules/@turf/random/package.json +9 -9
  495. package/node_modules/@turf/rectangle-grid/dist/cjs/index.cjs +2 -2
  496. package/node_modules/@turf/rectangle-grid/dist/cjs/index.cjs.map +1 -1
  497. package/node_modules/@turf/rectangle-grid/dist/esm/index.js +2 -2
  498. package/node_modules/@turf/rectangle-grid/dist/esm/index.js.map +1 -1
  499. package/node_modules/@turf/rectangle-grid/package.json +13 -13
  500. package/node_modules/@turf/rewind/dist/cjs/index.cjs +2 -2
  501. package/node_modules/@turf/rewind/dist/cjs/index.cjs.map +1 -1
  502. package/node_modules/@turf/rewind/dist/esm/index.js +2 -2
  503. package/node_modules/@turf/rewind/dist/esm/index.js.map +1 -1
  504. package/node_modules/@turf/rewind/package.json +13 -13
  505. package/node_modules/@turf/rhumb-bearing/dist/cjs/index.cjs +2 -2
  506. package/node_modules/@turf/rhumb-bearing/dist/cjs/index.cjs.map +1 -1
  507. package/node_modules/@turf/rhumb-bearing/dist/esm/index.js +2 -2
  508. package/node_modules/@turf/rhumb-bearing/dist/esm/index.js.map +1 -1
  509. package/node_modules/@turf/rhumb-bearing/package.json +11 -11
  510. package/node_modules/@turf/rhumb-destination/README.md +2 -2
  511. package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs +2 -2
  512. package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs.map +1 -1
  513. package/node_modules/@turf/rhumb-destination/dist/cjs/index.d.cts +1 -1
  514. package/node_modules/@turf/rhumb-destination/dist/esm/index.d.ts +1 -1
  515. package/node_modules/@turf/rhumb-destination/dist/esm/index.js +2 -2
  516. package/node_modules/@turf/rhumb-destination/dist/esm/index.js.map +1 -1
  517. package/node_modules/@turf/rhumb-destination/package.json +11 -11
  518. package/node_modules/@turf/rhumb-distance/README.md +8 -9
  519. package/node_modules/@turf/rhumb-distance/dist/cjs/index.cjs +2 -2
  520. package/node_modules/@turf/rhumb-distance/dist/cjs/index.cjs.map +1 -1
  521. package/node_modules/@turf/rhumb-distance/dist/cjs/index.d.cts +2 -3
  522. package/node_modules/@turf/rhumb-distance/dist/esm/index.d.ts +2 -3
  523. package/node_modules/@turf/rhumb-distance/dist/esm/index.js +2 -2
  524. package/node_modules/@turf/rhumb-distance/dist/esm/index.js.map +1 -1
  525. package/node_modules/@turf/rhumb-distance/package.json +11 -11
  526. package/node_modules/@turf/sample/dist/cjs/index.cjs +2 -2
  527. package/node_modules/@turf/sample/dist/cjs/index.cjs.map +1 -1
  528. package/node_modules/@turf/sample/dist/esm/index.js +2 -2
  529. package/node_modules/@turf/sample/dist/esm/index.js.map +1 -1
  530. package/node_modules/@turf/sample/package.json +8 -8
  531. package/node_modules/@turf/sector/README.md +2 -2
  532. package/node_modules/@turf/sector/dist/cjs/index.cjs +2 -2
  533. package/node_modules/@turf/sector/dist/cjs/index.cjs.map +1 -1
  534. package/node_modules/@turf/sector/dist/cjs/index.d.cts +1 -1
  535. package/node_modules/@turf/sector/dist/esm/index.d.ts +1 -1
  536. package/node_modules/@turf/sector/dist/esm/index.js +2 -2
  537. package/node_modules/@turf/sector/dist/esm/index.js.map +1 -1
  538. package/node_modules/@turf/sector/package.json +14 -14
  539. package/node_modules/@turf/shortest-path/README.md +5 -3
  540. package/node_modules/@turf/shortest-path/dist/cjs/index.cjs +10 -14
  541. package/node_modules/@turf/shortest-path/dist/cjs/index.cjs.map +1 -1
  542. package/node_modules/@turf/shortest-path/dist/cjs/index.d.cts +1 -1
  543. package/node_modules/@turf/shortest-path/dist/esm/index.d.ts +1 -1
  544. package/node_modules/@turf/shortest-path/dist/esm/index.js +10 -14
  545. package/node_modules/@turf/shortest-path/dist/esm/index.js.map +1 -1
  546. package/node_modules/@turf/shortest-path/package.json +20 -19
  547. package/node_modules/@turf/simplify/README.md +13 -13
  548. package/node_modules/@turf/simplify/dist/cjs/index.cjs +6 -3
  549. package/node_modules/@turf/simplify/dist/cjs/index.cjs.map +1 -1
  550. package/node_modules/@turf/simplify/dist/cjs/index.d.cts +11 -12
  551. package/node_modules/@turf/simplify/dist/esm/index.d.ts +11 -12
  552. package/node_modules/@turf/simplify/dist/esm/index.js +6 -3
  553. package/node_modules/@turf/simplify/dist/esm/index.js.map +1 -1
  554. package/node_modules/@turf/simplify/package.json +13 -13
  555. package/node_modules/@turf/square/dist/cjs/index.cjs +2 -2
  556. package/node_modules/@turf/square/dist/cjs/index.cjs.map +1 -1
  557. package/node_modules/@turf/square/dist/esm/index.js +2 -2
  558. package/node_modules/@turf/square/dist/esm/index.js.map +1 -1
  559. package/node_modules/@turf/square/package.json +9 -9
  560. package/node_modules/@turf/square-grid/dist/cjs/index.cjs +2 -2
  561. package/node_modules/@turf/square-grid/dist/cjs/index.cjs.map +1 -1
  562. package/node_modules/@turf/square-grid/dist/esm/index.js +2 -2
  563. package/node_modules/@turf/square-grid/dist/esm/index.js.map +1 -1
  564. package/node_modules/@turf/square-grid/package.json +12 -12
  565. package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.cjs +2 -2
  566. package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.cjs.map +1 -1
  567. package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.d.cts +1 -1
  568. package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.d.ts +1 -1
  569. package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.js +2 -2
  570. package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.js.map +1 -1
  571. package/node_modules/@turf/standard-deviational-ellipse/package.json +16 -16
  572. package/node_modules/@turf/tag/dist/cjs/index.cjs +2 -2
  573. package/node_modules/@turf/tag/dist/cjs/index.cjs.map +1 -1
  574. package/node_modules/@turf/tag/dist/esm/index.js +2 -2
  575. package/node_modules/@turf/tag/dist/esm/index.js.map +1 -1
  576. package/node_modules/@turf/tag/package.json +11 -11
  577. package/node_modules/@turf/tesselate/dist/cjs/index.cjs +2 -2
  578. package/node_modules/@turf/tesselate/dist/cjs/index.cjs.map +1 -1
  579. package/node_modules/@turf/tesselate/dist/esm/index.js +2 -2
  580. package/node_modules/@turf/tesselate/dist/esm/index.js.map +1 -1
  581. package/node_modules/@turf/tesselate/package.json +8 -8
  582. package/node_modules/@turf/tin/dist/cjs/index.cjs +2 -2
  583. package/node_modules/@turf/tin/dist/cjs/index.cjs.map +1 -1
  584. package/node_modules/@turf/tin/dist/esm/index.js +2 -2
  585. package/node_modules/@turf/tin/dist/esm/index.js.map +1 -1
  586. package/node_modules/@turf/tin/package.json +8 -8
  587. package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs +2 -2
  588. package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs.map +1 -1
  589. package/node_modules/@turf/transform-rotate/dist/esm/index.js +2 -2
  590. package/node_modules/@turf/transform-rotate/dist/esm/index.js.map +1 -1
  591. package/node_modules/@turf/transform-rotate/package.json +17 -17
  592. package/node_modules/@turf/transform-scale/dist/cjs/index.cjs +2 -2
  593. package/node_modules/@turf/transform-scale/dist/cjs/index.cjs.map +1 -1
  594. package/node_modules/@turf/transform-scale/dist/esm/index.js +2 -2
  595. package/node_modules/@turf/transform-scale/dist/esm/index.js.map +1 -1
  596. package/node_modules/@turf/transform-scale/package.json +21 -21
  597. package/node_modules/@turf/transform-translate/README.md +8 -3
  598. package/node_modules/@turf/transform-translate/dist/cjs/index.cjs +2 -2
  599. package/node_modules/@turf/transform-translate/dist/cjs/index.cjs.map +1 -1
  600. package/node_modules/@turf/transform-translate/dist/cjs/index.d.cts +4 -1
  601. package/node_modules/@turf/transform-translate/dist/esm/index.d.ts +4 -1
  602. package/node_modules/@turf/transform-translate/dist/esm/index.js +2 -2
  603. package/node_modules/@turf/transform-translate/dist/esm/index.js.map +1 -1
  604. package/node_modules/@turf/transform-translate/package.json +14 -14
  605. package/node_modules/@turf/triangle-grid/dist/cjs/index.cjs +2 -2
  606. package/node_modules/@turf/triangle-grid/dist/cjs/index.cjs.map +1 -1
  607. package/node_modules/@turf/triangle-grid/dist/esm/index.js +2 -2
  608. package/node_modules/@turf/triangle-grid/dist/esm/index.js.map +1 -1
  609. package/node_modules/@turf/triangle-grid/package.json +13 -13
  610. package/node_modules/@turf/truncate/dist/cjs/index.cjs +2 -2
  611. package/node_modules/@turf/truncate/dist/cjs/index.cjs.map +1 -1
  612. package/node_modules/@turf/truncate/dist/esm/index.js +2 -2
  613. package/node_modules/@turf/truncate/dist/esm/index.js.map +1 -1
  614. package/node_modules/@turf/truncate/package.json +10 -10
  615. package/node_modules/@turf/turf/package.json +125 -125
  616. package/node_modules/@turf/turf/turf.min.js +2 -11
  617. package/node_modules/@turf/union/dist/cjs/index.cjs +2 -2
  618. package/node_modules/@turf/union/dist/cjs/index.cjs.map +1 -1
  619. package/node_modules/@turf/union/dist/esm/index.js +2 -2
  620. package/node_modules/@turf/union/dist/esm/index.js.map +1 -1
  621. package/node_modules/@turf/union/package.json +11 -11
  622. package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs +2 -2
  623. package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs.map +1 -1
  624. package/node_modules/@turf/unkink-polygon/dist/esm/index.js +2 -2
  625. package/node_modules/@turf/unkink-polygon/dist/esm/index.js.map +1 -1
  626. package/node_modules/@turf/unkink-polygon/package.json +13 -13
  627. package/node_modules/@turf/voronoi/dist/cjs/index.cjs +2 -2
  628. package/node_modules/@turf/voronoi/dist/cjs/index.cjs.map +1 -1
  629. package/node_modules/@turf/voronoi/dist/esm/index.js +2 -2
  630. package/node_modules/@turf/voronoi/dist/esm/index.js.map +1 -1
  631. package/node_modules/@turf/voronoi/package.json +12 -12
  632. package/node_modules/@types/node/README.md +1 -1
  633. package/node_modules/@types/node/assert/strict.d.ts +105 -2
  634. package/node_modules/@types/node/assert.d.ts +154 -95
  635. package/node_modules/@types/node/buffer.buffer.d.ts +9 -0
  636. package/node_modules/@types/node/buffer.d.ts +8 -4
  637. package/node_modules/@types/node/child_process.d.ts +65 -42
  638. package/node_modules/@types/node/cluster.d.ts +4 -5
  639. package/node_modules/@types/node/console.d.ts +3 -2
  640. package/node_modules/@types/node/crypto.d.ts +1173 -322
  641. package/node_modules/@types/node/dgram.d.ts +9 -8
  642. package/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
  643. package/node_modules/@types/node/dns.d.ts +6 -1
  644. package/node_modules/@types/node/events.d.ts +80 -34
  645. package/node_modules/@types/node/fs/promises.d.ts +39 -21
  646. package/node_modules/@types/node/fs.d.ts +328 -87
  647. package/node_modules/@types/node/globals.d.ts +2 -0
  648. package/node_modules/@types/node/globals.typedarray.d.ts +19 -0
  649. package/node_modules/@types/node/http.d.ts +119 -31
  650. package/node_modules/@types/node/http2.d.ts +178 -52
  651. package/node_modules/@types/node/https.d.ts +96 -62
  652. package/node_modules/@types/node/index.d.ts +3 -1
  653. package/node_modules/@types/node/inspector.d.ts +205 -4139
  654. package/node_modules/@types/node/inspector.generated.d.ts +4233 -0
  655. package/node_modules/@types/node/net.d.ts +33 -11
  656. package/node_modules/@types/node/os.d.ts +14 -3
  657. package/node_modules/@types/node/package.json +3 -3
  658. package/node_modules/@types/node/perf_hooks.d.ts +6 -8
  659. package/node_modules/@types/node/process.d.ts +19 -23
  660. package/node_modules/@types/node/readline/promises.d.ts +1 -1
  661. package/node_modules/@types/node/sea.d.ts +9 -0
  662. package/node_modules/@types/node/sqlite.d.ts +233 -10
  663. package/node_modules/@types/node/stream/consumers.d.ts +2 -2
  664. package/node_modules/@types/node/stream/web.d.ts +6 -55
  665. package/node_modules/@types/node/stream.d.ts +38 -23
  666. package/node_modules/@types/node/string_decoder.d.ts +2 -2
  667. package/node_modules/@types/node/test.d.ts +31 -26
  668. package/node_modules/@types/node/tls.d.ts +122 -66
  669. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
  670. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +16 -0
  671. package/node_modules/@types/node/ts5.6/index.d.ts +3 -1
  672. package/node_modules/@types/node/ts5.7/index.d.ts +3 -1
  673. package/node_modules/@types/node/url.d.ts +48 -16
  674. package/node_modules/@types/node/util.d.ts +23 -7
  675. package/node_modules/@types/node/v8.d.ts +38 -5
  676. package/node_modules/@types/node/vm.d.ts +169 -88
  677. package/node_modules/@types/node/wasi.d.ts +1 -1
  678. package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
  679. package/node_modules/@types/node/web-globals/events.d.ts +3 -0
  680. package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
  681. package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
  682. package/node_modules/@types/node/worker_threads.d.ts +142 -51
  683. package/node_modules/@types/node/zlib.d.ts +31 -24
  684. package/node_modules/axios/CHANGELOG.md +410 -346
  685. package/node_modules/axios/README.md +79 -51
  686. package/node_modules/axios/dist/axios.js +121 -46
  687. package/node_modules/axios/dist/axios.js.map +1 -1
  688. package/node_modules/axios/dist/axios.min.js +2 -2
  689. package/node_modules/axios/dist/axios.min.js.map +1 -1
  690. package/node_modules/axios/dist/browser/axios.cjs +126 -57
  691. package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
  692. package/node_modules/axios/dist/esm/axios.js +126 -57
  693. package/node_modules/axios/dist/esm/axios.js.map +1 -1
  694. package/node_modules/axios/dist/esm/axios.min.js +2 -2
  695. package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
  696. package/node_modules/axios/dist/node/axios.cjs +351 -97
  697. package/node_modules/axios/dist/node/axios.cjs.map +1 -1
  698. package/node_modules/axios/index.d.cts +4 -0
  699. package/node_modules/axios/index.d.ts +4 -0
  700. package/node_modules/axios/lib/adapters/adapters.js +85 -40
  701. package/node_modules/axios/lib/adapters/fetch.js +1 -1
  702. package/node_modules/axios/lib/adapters/http.js +224 -42
  703. package/node_modules/axios/lib/core/InterceptorManager.js +1 -1
  704. package/node_modules/axios/lib/core/mergeConfig.js +4 -4
  705. package/node_modules/axios/lib/env/data.js +1 -1
  706. package/node_modules/axios/lib/helpers/HttpStatusCode.js +6 -0
  707. package/node_modules/axios/lib/helpers/bind.js +7 -0
  708. package/node_modules/axios/lib/helpers/cookies.js +24 -13
  709. package/node_modules/axios/package.json +9 -4
  710. package/node_modules/fast-xml-parser/CHANGELOG.md +9 -0
  711. package/node_modules/fast-xml-parser/README.md +1 -1
  712. package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
  713. package/node_modules/fast-xml-parser/lib/fxp.d.cts +1 -1
  714. package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
  715. package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
  716. package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
  717. package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
  718. package/node_modules/fast-xml-parser/package.json +1 -1
  719. package/node_modules/fast-xml-parser/src/fxp.d.ts +2 -2
  720. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +1 -1
  721. package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +4 -4
  722. package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +297 -287
  723. package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +24 -12
  724. package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +4 -4
  725. package/node_modules/form-data/CHANGELOG.md +60 -2
  726. package/node_modules/form-data/README.md +4 -4
  727. package/node_modules/form-data/lib/form_data.js +2 -2
  728. package/node_modules/form-data/package.json +4 -4
  729. package/node_modules/undici-types/agent.d.ts +1 -4
  730. package/node_modules/undici-types/client.d.ts +0 -2
  731. package/node_modules/undici-types/diagnostics-channel.d.ts +0 -1
  732. package/node_modules/undici-types/dispatcher.d.ts +0 -6
  733. package/node_modules/undici-types/errors.d.ts +5 -15
  734. package/node_modules/undici-types/eventsource.d.ts +6 -1
  735. package/node_modules/undici-types/h2c-client.d.ts +0 -2
  736. package/node_modules/undici-types/index.d.ts +6 -1
  737. package/node_modules/undici-types/interceptors.d.ts +5 -0
  738. package/node_modules/undici-types/mock-interceptor.d.ts +0 -1
  739. package/node_modules/undici-types/package.json +1 -1
  740. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  741. package/node_modules/undici-types/webidl.d.ts +92 -21
  742. package/node_modules/undici-types/websocket.d.ts +2 -0
  743. package/package.json +5 -5
  744. package/tak-registration.js +11 -11
  745. package/node_modules/marchingsquares/.eslintrc.json +0 -81
  746. package/node_modules/marchingsquares/Changelog.md +0 -81
  747. package/node_modules/marchingsquares/LICENSE.md +0 -37
  748. package/node_modules/marchingsquares/README.md +0 -312
  749. package/node_modules/marchingsquares/VERSION +0 -1
  750. package/node_modules/marchingsquares/agpl-3.0.txt +0 -661
  751. package/node_modules/marchingsquares/dist/marchingsquares-esm.js +0 -3410
  752. package/node_modules/marchingsquares/dist/marchingsquares-isobands.js +0 -2513
  753. package/node_modules/marchingsquares/dist/marchingsquares-isobands.min.js +0 -9
  754. package/node_modules/marchingsquares/dist/marchingsquares-isocontours.js +0 -1209
  755. package/node_modules/marchingsquares/dist/marchingsquares-isocontours.min.js +0 -9
  756. package/node_modules/marchingsquares/dist/marchingsquares-isolines.js +0 -1209
  757. package/node_modules/marchingsquares/dist/marchingsquares-isolines.min.js +0 -9
  758. package/node_modules/marchingsquares/dist/marchingsquares.js +0 -3424
  759. package/node_modules/marchingsquares/dist/marchingsquares.min.js +0 -9
  760. package/node_modules/marchingsquares/examples/contour/index.html +0 -117
  761. package/node_modules/marchingsquares/examples/editor/draw-lines.js +0 -60
  762. package/node_modules/marchingsquares/examples/editor/index.html +0 -39
  763. package/node_modules/marchingsquares/examples/editor/script.js +0 -110
  764. package/node_modules/marchingsquares/examples/editor/styles.css +0 -37
  765. package/node_modules/marchingsquares/examples/require/app.js +0 -9
  766. package/node_modules/marchingsquares/examples/require/index.html +0 -14
  767. package/node_modules/marchingsquares/examples/require/main.js +0 -98
  768. package/node_modules/marchingsquares/examples/require/require.js +0 -5
  769. package/node_modules/marchingsquares/examples/simple/index.html +0 -115
  770. package/node_modules/marchingsquares/examples/vienna/index.html +0 -229
  771. package/node_modules/marchingsquares/examples/vienna/vienna_basin.png +0 -0
  772. package/node_modules/marchingsquares/examples/vienna/vienna_data.js +0 -514
  773. package/node_modules/marchingsquares/package.json +0 -47
  774. package/node_modules/marchingsquares/rollup.config.js +0 -122
  775. package/node_modules/marchingsquares/rollup.config.test.js +0 -14
  776. package/node_modules/marchingsquares/src/interpolation.js +0 -84
  777. package/node_modules/marchingsquares/src/isobands.js +0 -1883
  778. package/node_modules/marchingsquares/src/isolines.js +0 -638
  779. package/node_modules/marchingsquares/src/main.js +0 -4
  780. package/node_modules/marchingsquares/src/options.js +0 -80
  781. package/node_modules/marchingsquares/src/polygons.js +0 -531
  782. package/node_modules/marchingsquares/src/quadtree.js +0 -228
  783. package/node_modules/marchingsquares/test/data/in/isoBands-example-case.json +0 -14
  784. package/node_modules/marchingsquares/test/data/in/isoBands-issue#6-0_3.json +0 -12
  785. package/node_modules/marchingsquares/test/data/in/isoBands-issue#6-3_5.json +0 -12
  786. package/node_modules/marchingsquares/test/data/in/isoBands-issue#6-5_7.json +0 -12
  787. package/node_modules/marchingsquares/test/data/in/isoBands-minimal.json +0 -8
  788. package/node_modules/marchingsquares/test/data/in/isoBands-simple.json +0 -9
  789. package/node_modules/marchingsquares/test/data/in/isoLines-example-case.json +0 -13
  790. package/node_modules/marchingsquares/test/data/in/isoLines-simple.json +0 -8
  791. package/node_modules/marchingsquares/test/data/out/isoBands-example-case.json +0 -72
  792. package/node_modules/marchingsquares/test/data/out/isoBands-issue#6-0_3.json +0 -9
  793. package/node_modules/marchingsquares/test/data/out/isoBands-issue#6-3_5.json +0 -36
  794. package/node_modules/marchingsquares/test/data/out/isoBands-issue#6-5_7.json +0 -8
  795. package/node_modules/marchingsquares/test/data/out/isoBands-minimal.json +0 -10
  796. package/node_modules/marchingsquares/test/data/out/isoBands-simple.json +0 -25
  797. package/node_modules/marchingsquares/test/data/out/isoLines-example-case.json +0 -481
  798. package/node_modules/marchingsquares/test/data/out/isoLines-simple.json +0 -8
  799. package/node_modules/marchingsquares/test/test.js +0 -152
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n Feature,\n FeatureCollection,\n GeometryCollection,\n LineString,\n Point,\n GeoJsonProperties,\n} from \"geojson\";\nimport { Units } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { featureEach, geomEach } from \"@turf/meta\";\nimport { pointToLineDistance } from \"@turf/point-to-line-distance\";\n\n/**\n * Returns the closest {@link Point|point}, of a {@link FeatureCollection|collection} of points,\n * to a {@link LineString|line}. The returned point has a `dist` property indicating its distance to the line.\n *\n * @function\n * @param {FeatureCollection|GeometryCollection<Point>} points Point Collection\n * @param {Feature|Geometry<LineString>} line Line Feature\n * @param {Object} [options] Optional parameters\n * @param {string} [options.units='kilometers'] unit of the output distance property\n * (eg: degrees, radians, miles, or kilometers)\n * @param {Object} [options.properties={}] Translate Properties to Point\n * @returns {Feature<Point>} the closest point\n * @example\n * var pt1 = turf.point([0, 0]);\n * var pt2 = turf.point([0.5, 0.5]);\n * var points = turf.featureCollection([pt1, pt2]);\n * var line = turf.lineString([[1,1], [-1,1]]);\n *\n * var nearest = turf.nearestPointToLine(points, line);\n *\n * //addToMap\n * var addToMap = [nearest, line];\n */\nfunction nearestPointToLine<P = { dist: number; [key: string]: any }>(\n points:\n | FeatureCollection<Point>\n | Feature<GeometryCollection>\n | GeometryCollection,\n line: Feature<LineString> | LineString,\n options: {\n units?: Units;\n properties?: GeoJsonProperties;\n } = {}\n): Feature<Point, P> {\n const units = options.units;\n const properties = options.properties || {};\n\n // validation\n const pts = normalize(points);\n if (!pts.features.length) {\n throw new Error(\"points must contain features\");\n }\n\n if (!line) {\n throw new Error(\"line is required\");\n }\n if (getType(line) !== \"LineString\") {\n throw new Error(\"line must be a LineString\");\n }\n\n let dist = Infinity;\n let pt: any = null;\n\n featureEach(pts, (point) => {\n const d = pointToLineDistance(point, line, { units });\n if (d < dist) {\n dist = d;\n pt = point;\n }\n });\n /*\n * Translate Properties to final Point, priorities:\n * 1. options.properties\n * 2. inherent Point properties\n * 3. dist custom properties created by NearestPointToLine\n */\n if (pt) {\n pt.properties = { ...{ dist }, ...pt.properties, ...properties };\n }\n return pt;\n}\n\n/**\n * Convert Collection to FeatureCollection\n *\n * @private\n * @param {FeatureCollection|GeometryCollection} points Points\n * @returns {FeatureCollection<Point>} points\n */\nfunction normalize(points: any): FeatureCollection<Point> {\n const features: any[] = [];\n const type = points.geometry ? points.geometry.type : points.type;\n switch (type) {\n case \"GeometryCollection\":\n geomEach(points, (geom) => {\n if (geom.type === \"Point\") {\n features.push({ type: \"Feature\", properties: {}, geometry: geom });\n }\n });\n return { type: \"FeatureCollection\", features };\n case \"FeatureCollection\":\n points.features = points.features.filter((feature: any) => {\n return feature.geometry.type === \"Point\";\n });\n return points;\n default:\n throw new Error(\"points must be a Point Collection\");\n }\n}\n\nexport { nearestPointToLine };\nexport default nearestPointToLine;\n"],"mappings":";;;;;;;;;;;;;;;;;;AASA,SAAS,eAAe;AACxB,SAAS,aAAa,gBAAgB;AACtC,SAAS,2BAA2B;AAyBpC,SAAS,mBACP,QAIA,MACA,UAGI,CAAC,GACc;AACnB,QAAM,QAAQ,QAAQ;AACtB,QAAM,aAAa,QAAQ,cAAc,CAAC;AAG1C,QAAM,MAAM,UAAU,MAAM;AAC5B,MAAI,CAAC,IAAI,SAAS,QAAQ;AACxB,UAAM,IAAI,MAAM,8BAA8B;AAAA,EAChD;AAEA,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,kBAAkB;AAAA,EACpC;AACA,MAAI,QAAQ,IAAI,MAAM,cAAc;AAClC,UAAM,IAAI,MAAM,2BAA2B;AAAA,EAC7C;AAEA,MAAI,OAAO;AACX,MAAI,KAAU;AAEd,cAAY,KAAK,CAAC,UAAU;AAC1B,UAAM,IAAI,oBAAoB,OAAO,MAAM,EAAE,MAAM,CAAC;AACpD,QAAI,IAAI,MAAM;AACZ,aAAO;AACP,WAAK;AAAA,IACP;AAAA,EACF,CAAC;AAOD,MAAI,IAAI;AACN,OAAG,aAAa,iDAAK,EAAE,KAAK,IAAM,GAAG,aAAe;AAAA,EACtD;AACA,SAAO;AACT;AASA,SAAS,UAAU,QAAuC;AACxD,QAAM,WAAkB,CAAC;AACzB,QAAM,OAAO,OAAO,WAAW,OAAO,SAAS,OAAO,OAAO;AAC7D,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,eAAS,QAAQ,CAAC,SAAS;AACzB,YAAI,KAAK,SAAS,SAAS;AACzB,mBAAS,KAAK,EAAE,MAAM,WAAW,YAAY,CAAC,GAAG,UAAU,KAAK,CAAC;AAAA,QACnE;AAAA,MACF,CAAC;AACD,aAAO,EAAE,MAAM,qBAAqB,SAAS;AAAA,IAC/C,KAAK;AACH,aAAO,WAAW,OAAO,SAAS,OAAO,CAAC,YAAiB;AACzD,eAAO,QAAQ,SAAS,SAAS;AAAA,MACnC,CAAC;AACD,aAAO;AAAA,IACT;AACE,YAAM,IAAI,MAAM,mCAAmC;AAAA,EACvD;AACF;AAGA,IAAO,qCAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n Feature,\n FeatureCollection,\n GeometryCollection,\n LineString,\n Point,\n GeoJsonProperties,\n} from \"geojson\";\nimport { Units } from \"@turf/helpers\";\nimport { getType } from \"@turf/invariant\";\nimport { featureEach, geomEach } from \"@turf/meta\";\nimport { pointToLineDistance } from \"@turf/point-to-line-distance\";\n\n/**\n * Returns the closest {@link Point|point}, of a {@link FeatureCollection|collection} of points,\n * to a {@link LineString|line}. The returned point has a `dist` property indicating its distance to the line.\n *\n * @function\n * @param {FeatureCollection|GeometryCollection<Point>} points Point Collection\n * @param {Feature|Geometry<LineString>} line Line Feature\n * @param {Object} [options] Optional parameters\n * @param {Units} [options.units='kilometers'] unit of the output distance property. Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}.\n * (eg: degrees, radians, miles, or kilometers)\n * @param {Object} [options.properties={}] Translate Properties to Point\n * @returns {Feature<Point>} the closest point\n * @example\n * var pt1 = turf.point([0, 0]);\n * var pt2 = turf.point([0.5, 0.5]);\n * var points = turf.featureCollection([pt1, pt2]);\n * var line = turf.lineString([[1,1], [-1,1]]);\n *\n * var nearest = turf.nearestPointToLine(points, line);\n *\n * //addToMap\n * var addToMap = [nearest, line];\n */\nfunction nearestPointToLine<P = { dist: number; [key: string]: any }>(\n points:\n | FeatureCollection<Point>\n | Feature<GeometryCollection>\n | GeometryCollection,\n line: Feature<LineString> | LineString,\n options: {\n units?: Units;\n properties?: GeoJsonProperties;\n } = {}\n): Feature<Point, P> {\n const units = options.units;\n const properties = options.properties || {};\n\n // validation\n const pts = normalize(points);\n if (!pts.features.length) {\n throw new Error(\"points must contain features\");\n }\n\n if (!line) {\n throw new Error(\"line is required\");\n }\n if (getType(line) !== \"LineString\") {\n throw new Error(\"line must be a LineString\");\n }\n\n let dist = Infinity;\n let pt: any = null;\n\n featureEach(pts, (point) => {\n const d = pointToLineDistance(point, line, { units });\n if (d < dist) {\n dist = d;\n pt = point;\n }\n });\n /*\n * Translate Properties to final Point, priorities:\n * 1. options.properties\n * 2. inherent Point properties\n * 3. dist custom properties created by NearestPointToLine\n */\n if (pt) {\n pt.properties = { ...{ dist }, ...pt.properties, ...properties };\n }\n return pt;\n}\n\n/**\n * Convert Collection to FeatureCollection\n *\n * @private\n * @param {FeatureCollection|GeometryCollection} points Points\n * @returns {FeatureCollection<Point>} points\n */\nfunction normalize(points: any): FeatureCollection<Point> {\n const features: any[] = [];\n const type = points.geometry ? points.geometry.type : points.type;\n switch (type) {\n case \"GeometryCollection\":\n geomEach(points, (geom) => {\n if (geom.type === \"Point\") {\n features.push({ type: \"Feature\", properties: {}, geometry: geom });\n }\n });\n return { type: \"FeatureCollection\", features };\n case \"FeatureCollection\":\n points.features = points.features.filter((feature: any) => {\n return feature.geometry.type === \"Point\";\n });\n return points;\n default:\n throw new Error(\"points must be a Point Collection\");\n }\n}\n\nexport { nearestPointToLine };\nexport default nearestPointToLine;\n"],"mappings":";;;;;;;;;;;;;;;;;;AASA,SAAS,eAAe;AACxB,SAAS,aAAa,gBAAgB;AACtC,SAAS,2BAA2B;AAyBpC,SAAS,mBACP,QAIA,MACA,UAGI,CAAC,GACc;AACnB,QAAM,QAAQ,QAAQ;AACtB,QAAM,aAAa,QAAQ,cAAc,CAAC;AAG1C,QAAM,MAAM,UAAU,MAAM;AAC5B,MAAI,CAAC,IAAI,SAAS,QAAQ;AACxB,UAAM,IAAI,MAAM,8BAA8B;AAAA,EAChD;AAEA,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM,kBAAkB;AAAA,EACpC;AACA,MAAI,QAAQ,IAAI,MAAM,cAAc;AAClC,UAAM,IAAI,MAAM,2BAA2B;AAAA,EAC7C;AAEA,MAAI,OAAO;AACX,MAAI,KAAU;AAEd,cAAY,KAAK,CAAC,UAAU;AAC1B,UAAM,IAAI,oBAAoB,OAAO,MAAM,EAAE,MAAM,CAAC;AACpD,QAAI,IAAI,MAAM;AACZ,aAAO;AACP,WAAK;AAAA,IACP;AAAA,EACF,CAAC;AAOD,MAAI,IAAI;AACN,OAAG,aAAa,iDAAK,EAAE,KAAK,IAAM,GAAG,aAAe;AAAA,EACtD;AACA,SAAO;AACT;AASA,SAAS,UAAU,QAAuC;AACxD,QAAM,WAAkB,CAAC;AACzB,QAAM,OAAO,OAAO,WAAW,OAAO,SAAS,OAAO,OAAO;AAC7D,UAAQ,MAAM;AAAA,IACZ,KAAK;AACH,eAAS,QAAQ,CAAC,SAAS;AACzB,YAAI,KAAK,SAAS,SAAS;AACzB,mBAAS,KAAK,EAAE,MAAM,WAAW,YAAY,CAAC,GAAG,UAAU,KAAK,CAAC;AAAA,QACnE;AAAA,MACF,CAAC;AACD,aAAO,EAAE,MAAM,qBAAqB,SAAS;AAAA,IAC/C,KAAK;AACH,aAAO,WAAW,OAAO,SAAS,OAAO,CAAC,YAAiB;AACzD,eAAO,QAAQ,SAAS,SAAS;AAAA,MACnC,CAAC;AACD,aAAO;AAAA,IACT;AACE,YAAM,IAAI,MAAM,mCAAmC;AAAA,EACvD;AACF;AAGA,IAAO,gBAAQ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/nearest-point-to-line",
3
- "version": "7.2.0",
4
- "description": "turf nearest-point-to-line module",
3
+ "version": "7.3.0",
4
+ "description": "Returns the closest point, of a collection of points, to a line.",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
7
7
  "Stefano Borghi <@stebogit>"
@@ -56,27 +56,27 @@
56
56
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
57
57
  },
58
58
  "devDependencies": {
59
- "@turf/circle": "^7.2.0",
60
- "@turf/truncate": "^7.2.0",
59
+ "@turf/circle": "7.3.0",
60
+ "@turf/truncate": "7.3.0",
61
61
  "@types/benchmark": "^2.1.5",
62
62
  "@types/object-assign": "^4.0.33",
63
- "@types/tape": "^4.13.4",
63
+ "@types/tape": "^5.8.1",
64
64
  "benchmark": "^2.1.4",
65
65
  "load-json-file": "^7.0.1",
66
66
  "npm-run-all": "^4.1.5",
67
67
  "tape": "^5.9.0",
68
- "tsup": "^8.3.5",
69
- "tsx": "^4.19.2",
70
- "typescript": "^5.5.4",
71
- "write-json-file": "^5.0.0"
68
+ "tsup": "^8.4.0",
69
+ "tsx": "^4.19.4",
70
+ "typescript": "^5.8.3",
71
+ "write-json-file": "^6.0.0"
72
72
  },
73
73
  "dependencies": {
74
- "@turf/helpers": "^7.2.0",
75
- "@turf/invariant": "^7.2.0",
76
- "@turf/meta": "^7.2.0",
77
- "@turf/point-to-line-distance": "^7.2.0",
74
+ "@turf/helpers": "7.3.0",
75
+ "@turf/invariant": "7.3.0",
76
+ "@turf/meta": "7.3.0",
77
+ "@turf/point-to-line-distance": "7.3.0",
78
78
  "@types/geojson": "^7946.0.10",
79
79
  "tslib": "^2.8.1"
80
80
  },
81
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
81
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
82
82
  }
@@ -25,9 +25,9 @@ function planepoint(point, triangle) {
25
25
  const z = (z3 * (x - x1) * (y - y2) + z1 * (x - x2) * (y - y3) + z2 * (x - x3) * (y - y1) - z2 * (x - x1) * (y - y3) - z3 * (x - x2) * (y - y1) - z1 * (x - x3) * (y - y2)) / ((x - x1) * (y - y2) + (x - x2) * (y - y3) + (x - x3) * (y - y1) - (x - x1) * (y - y3) - (x - x2) * (y - y1) - (x - x3) * (y - y2));
26
26
  return z;
27
27
  }
28
- var turf_planepoint_default = planepoint;
28
+ var index_default = planepoint;
29
29
 
30
30
 
31
31
 
32
- exports.default = turf_planepoint_default; exports.planepoint = planepoint;
32
+ exports.default = index_default; exports.planepoint = planepoint;
33
33
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-planepoint/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,4CAAkC;AAoClC,SAAS,UAAA,CACP,KAAA,EACA,QAAA,EACQ;AAER,EAAA,MAAM,MAAA,EAAQ,iCAAA,KAAc,CAAA;AAC5B,EAAA,MAAM,KAAA,EAAO,gCAAA,QAAgB,CAAA;AAC7B,EAAA,MAAM,OAAA,EAAS,IAAA,CAAK,WAAA;AACpB,EAAA,MAAM,MAAA,EAAQ,MAAA,CAAO,CAAC,CAAA;AACtB,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,EAAS,CAAA;AACjB,IAAA,MAAM,IAAI,KAAA,CAAM,uDAAuD,CAAA;AACzE,EAAA,MAAM,WAAA,EAAc,QAAA,CAAS,KAAA,IAAS,UAAA,GAAa,QAAA,CAAS,WAAA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,EAAI,EAAA,EAAA,EACrB,GAAA,EAAA,CAAM,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EACrB,GAAA,EAAA,CAAM,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EACrB,GAAA,EAAA,CAAM,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EACrB,GAAA,EAAA,CAAM,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,CAAA,EAAA,EAAA,CAAA,CACrB,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CACd,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CACf,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CACf,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CACf,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CACf,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,CAAA,CAAA;AAEpB,EAAA,OAAO,CAAA;AACT;AAGA,IAAO,wBAAA,EAAQ,UAAA;ADvDf;AACE;AACA;AACF,2EAAC","file":"/home/runner/work/turf/turf/packages/turf-planepoint/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, Polygon } from \"geojson\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes a triangular plane as a polygon and a point within that triangle, and\n * returns the z-value at that point.\n *\n * The Polygon should have properties `a`, `b`, and `c`\n * that define the values at its three corners. Alternatively, the z-values\n * of each triangle point can be provided by their respective 3rd coordinate\n * if their values are not provided as properties.\n *\n * @function\n * @param {Coord} point the Point for which a z-value will be calculated\n * @param {Feature<Polygon>} triangle a Polygon feature with three vertices\n * @returns {number} the z-value for `interpolatedPoint`\n * @example\n * const point = turf.point([-75.3221, 39.529]);\n * // \"a\", \"b\", and \"c\" values represent the values of the coordinates in order.\n * const triangle = turf.polygon([[\n * [-75.1221, 39.57],\n * [-75.58, 39.18],\n * [-75.97, 39.86],\n * [-75.1221, 39.57]\n * ]], {\n * \"a\": 11,\n * \"b\": 122,\n * \"c\": 44\n * });\n *\n * const zValue = turf.planepoint(point, triangle);\n * point.properties.zValue = zValue;\n *\n * //addToMap\n * const addToMap = [triangle, point];\n */\nfunction planepoint(\n point: Coord,\n triangle: Feature<Polygon> | Polygon\n): number {\n // Normalize input\n const coord = getCoord(point);\n const geom = getGeom(triangle);\n const coords = geom.coordinates;\n const outer = coords[0];\n if (outer.length < 4)\n throw new Error(\"OuterRing of a Polygon must have 4 or more Positions.\");\n const properties = (triangle.type === \"Feature\" && triangle.properties) || {};\n const a = properties.a;\n const b = properties.b;\n const c = properties.c;\n\n // Planepoint\n const x = coord[0];\n const y = coord[1];\n const x1 = outer[0][0];\n const y1 = outer[0][1];\n const z1 = a !== undefined ? a : outer[0][2];\n const x2 = outer[1][0];\n const y2 = outer[1][1];\n const z2 = b !== undefined ? b : outer[1][2];\n const x3 = outer[2][0];\n const y3 = outer[2][1];\n const z3 = c !== undefined ? c : outer[2][2];\n const z =\n (z3 * (x - x1) * (y - y2) +\n z1 * (x - x2) * (y - y3) +\n z2 * (x - x3) * (y - y1) -\n z2 * (x - x1) * (y - y3) -\n z3 * (x - x2) * (y - y1) -\n z1 * (x - x3) * (y - y2)) /\n ((x - x1) * (y - y2) +\n (x - x2) * (y - y3) +\n (x - x3) * (y - y1) -\n (x - x1) * (y - y3) -\n (x - x2) * (y - y1) -\n (x - x3) * (y - y2));\n\n return z;\n}\n\nexport { planepoint };\nexport default planepoint;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-planepoint/dist/cjs/index.cjs","../../index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,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,CAAA,CAAA;AAEpB,EAAA,OAAO,CAAA;AACT;AAGA,IAAO,cAAA,EAAQ,UAAA;ADvDf;AACE;AACA;AACF,iEAAC","file":"/home/runner/work/turf/turf/packages/turf-planepoint/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, Polygon } from \"geojson\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes a triangular plane as a polygon and a point within that triangle, and\n * returns the z-value at that point.\n *\n * The Polygon should have properties `a`, `b`, and `c`\n * that define the values at its three corners. Alternatively, the z-values\n * of each triangle point can be provided by their respective 3rd coordinate\n * if their values are not provided as properties.\n *\n * @function\n * @param {Coord} point the Point for which a z-value will be calculated\n * @param {Feature<Polygon>} triangle a Polygon feature with three vertices\n * @returns {number} the z-value for `interpolatedPoint`\n * @example\n * const point = turf.point([-75.3221, 39.529]);\n * // \"a\", \"b\", and \"c\" values represent the values of the coordinates in order.\n * const triangle = turf.polygon([[\n * [-75.1221, 39.57],\n * [-75.58, 39.18],\n * [-75.97, 39.86],\n * [-75.1221, 39.57]\n * ]], {\n * \"a\": 11,\n * \"b\": 122,\n * \"c\": 44\n * });\n *\n * const zValue = turf.planepoint(point, triangle);\n * point.properties.zValue = zValue;\n *\n * //addToMap\n * const addToMap = [triangle, point];\n */\nfunction planepoint(\n point: Coord,\n triangle: Feature<Polygon> | Polygon\n): number {\n // Normalize input\n const coord = getCoord(point);\n const geom = getGeom(triangle);\n const coords = geom.coordinates;\n const outer = coords[0];\n if (outer.length < 4)\n throw new Error(\"OuterRing of a Polygon must have 4 or more Positions.\");\n const properties = (triangle.type === \"Feature\" && triangle.properties) || {};\n const a = properties.a;\n const b = properties.b;\n const c = properties.c;\n\n // Planepoint\n const x = coord[0];\n const y = coord[1];\n const x1 = outer[0][0];\n const y1 = outer[0][1];\n const z1 = a !== undefined ? a : outer[0][2];\n const x2 = outer[1][0];\n const y2 = outer[1][1];\n const z2 = b !== undefined ? b : outer[1][2];\n const x3 = outer[2][0];\n const y3 = outer[2][1];\n const z3 = c !== undefined ? c : outer[2][2];\n const z =\n (z3 * (x - x1) * (y - y2) +\n z1 * (x - x2) * (y - y3) +\n z2 * (x - x3) * (y - y1) -\n z2 * (x - x1) * (y - y3) -\n z3 * (x - x2) * (y - y1) -\n z1 * (x - x3) * (y - y2)) /\n ((x - x1) * (y - y2) +\n (x - x2) * (y - y3) +\n (x - x3) * (y - y1) -\n (x - x1) * (y - y3) -\n (x - x2) * (y - y1) -\n (x - x3) * (y - y2));\n\n return z;\n}\n\nexport { planepoint };\nexport default planepoint;\n"]}
@@ -25,9 +25,9 @@ function planepoint(point, triangle) {
25
25
  const z = (z3 * (x - x1) * (y - y2) + z1 * (x - x2) * (y - y3) + z2 * (x - x3) * (y - y1) - z2 * (x - x1) * (y - y3) - z3 * (x - x2) * (y - y1) - z1 * (x - x3) * (y - y2)) / ((x - x1) * (y - y2) + (x - x2) * (y - y3) + (x - x3) * (y - y1) - (x - x1) * (y - y3) - (x - x2) * (y - y1) - (x - x3) * (y - y2));
26
26
  return z;
27
27
  }
28
- var turf_planepoint_default = planepoint;
28
+ var index_default = planepoint;
29
29
  export {
30
- turf_planepoint_default as default,
30
+ index_default as default,
31
31
  planepoint
32
32
  };
33
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Polygon } from \"geojson\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes a triangular plane as a polygon and a point within that triangle, and\n * returns the z-value at that point.\n *\n * The Polygon should have properties `a`, `b`, and `c`\n * that define the values at its three corners. Alternatively, the z-values\n * of each triangle point can be provided by their respective 3rd coordinate\n * if their values are not provided as properties.\n *\n * @function\n * @param {Coord} point the Point for which a z-value will be calculated\n * @param {Feature<Polygon>} triangle a Polygon feature with three vertices\n * @returns {number} the z-value for `interpolatedPoint`\n * @example\n * const point = turf.point([-75.3221, 39.529]);\n * // \"a\", \"b\", and \"c\" values represent the values of the coordinates in order.\n * const triangle = turf.polygon([[\n * [-75.1221, 39.57],\n * [-75.58, 39.18],\n * [-75.97, 39.86],\n * [-75.1221, 39.57]\n * ]], {\n * \"a\": 11,\n * \"b\": 122,\n * \"c\": 44\n * });\n *\n * const zValue = turf.planepoint(point, triangle);\n * point.properties.zValue = zValue;\n *\n * //addToMap\n * const addToMap = [triangle, point];\n */\nfunction planepoint(\n point: Coord,\n triangle: Feature<Polygon> | Polygon\n): number {\n // Normalize input\n const coord = getCoord(point);\n const geom = getGeom(triangle);\n const coords = geom.coordinates;\n const outer = coords[0];\n if (outer.length < 4)\n throw new Error(\"OuterRing of a Polygon must have 4 or more Positions.\");\n const properties = (triangle.type === \"Feature\" && triangle.properties) || {};\n const a = properties.a;\n const b = properties.b;\n const c = properties.c;\n\n // Planepoint\n const x = coord[0];\n const y = coord[1];\n const x1 = outer[0][0];\n const y1 = outer[0][1];\n const z1 = a !== undefined ? a : outer[0][2];\n const x2 = outer[1][0];\n const y2 = outer[1][1];\n const z2 = b !== undefined ? b : outer[1][2];\n const x3 = outer[2][0];\n const y3 = outer[2][1];\n const z3 = c !== undefined ? c : outer[2][2];\n const z =\n (z3 * (x - x1) * (y - y2) +\n z1 * (x - x2) * (y - y3) +\n z2 * (x - x3) * (y - y1) -\n z2 * (x - x1) * (y - y3) -\n z3 * (x - x2) * (y - y1) -\n z1 * (x - x3) * (y - y2)) /\n ((x - x1) * (y - y2) +\n (x - x2) * (y - y3) +\n (x - x3) * (y - y1) -\n (x - x1) * (y - y3) -\n (x - x2) * (y - y1) -\n (x - x3) * (y - y2));\n\n return z;\n}\n\nexport { planepoint };\nexport default planepoint;\n"],"mappings":";AACA,SAAS,UAAU,eAAe;AAoClC,SAAS,WACP,OACA,UACQ;AAER,QAAM,QAAQ,SAAS,KAAK;AAC5B,QAAM,OAAO,QAAQ,QAAQ;AAC7B,QAAM,SAAS,KAAK;AACpB,QAAM,QAAQ,OAAO,CAAC;AACtB,MAAI,MAAM,SAAS;AACjB,UAAM,IAAI,MAAM,uDAAuD;AACzE,QAAM,aAAc,SAAS,SAAS,aAAa,SAAS,cAAe,CAAC;AAC5E,QAAM,IAAI,WAAW;AACrB,QAAM,IAAI,WAAW;AACrB,QAAM,IAAI,WAAW;AAGrB,QAAM,IAAI,MAAM,CAAC;AACjB,QAAM,IAAI,MAAM,CAAC;AACjB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,SAAY,IAAI,MAAM,CAAC,EAAE,CAAC;AAC3C,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,SAAY,IAAI,MAAM,CAAC,EAAE,CAAC;AAC3C,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,SAAY,IAAI,MAAM,CAAC,EAAE,CAAC;AAC3C,QAAM,KACH,MAAM,IAAI,OAAO,IAAI,MACpB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,SACrB,IAAI,OAAO,IAAI,OACd,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI;AAEpB,SAAO;AACT;AAGA,IAAO,0BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, Polygon } from \"geojson\";\nimport { getCoord, getGeom } from \"@turf/invariant\";\nimport { Coord } from \"@turf/helpers\";\n\n/**\n * Takes a triangular plane as a polygon and a point within that triangle, and\n * returns the z-value at that point.\n *\n * The Polygon should have properties `a`, `b`, and `c`\n * that define the values at its three corners. Alternatively, the z-values\n * of each triangle point can be provided by their respective 3rd coordinate\n * if their values are not provided as properties.\n *\n * @function\n * @param {Coord} point the Point for which a z-value will be calculated\n * @param {Feature<Polygon>} triangle a Polygon feature with three vertices\n * @returns {number} the z-value for `interpolatedPoint`\n * @example\n * const point = turf.point([-75.3221, 39.529]);\n * // \"a\", \"b\", and \"c\" values represent the values of the coordinates in order.\n * const triangle = turf.polygon([[\n * [-75.1221, 39.57],\n * [-75.58, 39.18],\n * [-75.97, 39.86],\n * [-75.1221, 39.57]\n * ]], {\n * \"a\": 11,\n * \"b\": 122,\n * \"c\": 44\n * });\n *\n * const zValue = turf.planepoint(point, triangle);\n * point.properties.zValue = zValue;\n *\n * //addToMap\n * const addToMap = [triangle, point];\n */\nfunction planepoint(\n point: Coord,\n triangle: Feature<Polygon> | Polygon\n): number {\n // Normalize input\n const coord = getCoord(point);\n const geom = getGeom(triangle);\n const coords = geom.coordinates;\n const outer = coords[0];\n if (outer.length < 4)\n throw new Error(\"OuterRing of a Polygon must have 4 or more Positions.\");\n const properties = (triangle.type === \"Feature\" && triangle.properties) || {};\n const a = properties.a;\n const b = properties.b;\n const c = properties.c;\n\n // Planepoint\n const x = coord[0];\n const y = coord[1];\n const x1 = outer[0][0];\n const y1 = outer[0][1];\n const z1 = a !== undefined ? a : outer[0][2];\n const x2 = outer[1][0];\n const y2 = outer[1][1];\n const z2 = b !== undefined ? b : outer[1][2];\n const x3 = outer[2][0];\n const y3 = outer[2][1];\n const z3 = c !== undefined ? c : outer[2][2];\n const z =\n (z3 * (x - x1) * (y - y2) +\n z1 * (x - x2) * (y - y3) +\n z2 * (x - x3) * (y - y1) -\n z2 * (x - x1) * (y - y3) -\n z3 * (x - x2) * (y - y1) -\n z1 * (x - x3) * (y - y2)) /\n ((x - x1) * (y - y2) +\n (x - x2) * (y - y3) +\n (x - x3) * (y - y1) -\n (x - x1) * (y - y3) -\n (x - x2) * (y - y1) -\n (x - x3) * (y - y2));\n\n return z;\n}\n\nexport { planepoint };\nexport default planepoint;\n"],"mappings":";AACA,SAAS,UAAU,eAAe;AAoClC,SAAS,WACP,OACA,UACQ;AAER,QAAM,QAAQ,SAAS,KAAK;AAC5B,QAAM,OAAO,QAAQ,QAAQ;AAC7B,QAAM,SAAS,KAAK;AACpB,QAAM,QAAQ,OAAO,CAAC;AACtB,MAAI,MAAM,SAAS;AACjB,UAAM,IAAI,MAAM,uDAAuD;AACzE,QAAM,aAAc,SAAS,SAAS,aAAa,SAAS,cAAe,CAAC;AAC5E,QAAM,IAAI,WAAW;AACrB,QAAM,IAAI,WAAW;AACrB,QAAM,IAAI,WAAW;AAGrB,QAAM,IAAI,MAAM,CAAC;AACjB,QAAM,IAAI,MAAM,CAAC;AACjB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,SAAY,IAAI,MAAM,CAAC,EAAE,CAAC;AAC3C,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,SAAY,IAAI,MAAM,CAAC,EAAE,CAAC;AAC3C,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,CAAC,EAAE,CAAC;AACrB,QAAM,KAAK,MAAM,SAAY,IAAI,MAAM,CAAC,EAAE,CAAC;AAC3C,QAAM,KACH,MAAM,IAAI,OAAO,IAAI,MACpB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,MACrB,MAAM,IAAI,OAAO,IAAI,SACrB,IAAI,OAAO,IAAI,OACd,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI,OACf,IAAI,OAAO,IAAI;AAEpB,SAAO;AACT;AAGA,IAAO,gBAAQ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/planepoint",
3
- "version": "7.2.0",
4
- "description": "turf planepoint module",
3
+ "version": "7.3.0",
4
+ "description": "Takes a triangular plane as a polygon and a point within that triangle, and returns the z-value at that point.",
5
5
  "author": "Turf Authors",
6
6
  "license": "MIT",
7
7
  "bugs": {
@@ -54,19 +54,19 @@
54
54
  },
55
55
  "devDependencies": {
56
56
  "@types/benchmark": "^2.1.5",
57
- "@types/tape": "^4.13.4",
57
+ "@types/tape": "^5.8.1",
58
58
  "benchmark": "^2.1.4",
59
59
  "npm-run-all": "^4.1.5",
60
60
  "tape": "^5.9.0",
61
- "tsup": "^8.3.5",
62
- "tsx": "^4.19.2",
63
- "typescript": "^5.5.4"
61
+ "tsup": "^8.4.0",
62
+ "tsx": "^4.19.4",
63
+ "typescript": "^5.8.3"
64
64
  },
65
65
  "dependencies": {
66
- "@turf/helpers": "^7.2.0",
67
- "@turf/invariant": "^7.2.0",
66
+ "@turf/helpers": "7.3.0",
67
+ "@turf/invariant": "7.3.0",
68
68
  "@types/geojson": "^7946.0.10",
69
69
  "tslib": "^2.8.1"
70
70
  },
71
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
71
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
72
72
  }
@@ -35,9 +35,9 @@ function pointGrid(bbox, cellSide, options = {}) {
35
35
  }
36
36
  return _helpers.featureCollection.call(void 0, results);
37
37
  }
38
- var turf_point_grid_default = pointGrid;
38
+ var index_default = pointGrid;
39
39
 
40
40
 
41
41
 
42
- exports.default = turf_point_grid_default; exports.pointGrid = pointGrid;
42
+ exports.default = index_default; exports.pointGrid = pointGrid;
43
43
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"s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UAAU,CAAA;AAG7C,EAAA,IAAI,OAAA,EAAA,CAAU,UAAA,EAAY,QAAA,EAAU,SAAA,EAAA,EAAa,CAAA;AACjD,EAAA,IAAI,OAAA,EAAA,CAAU,WAAA,EAAa,KAAA,EAAO,UAAA,EAAA,EAAc,CAAA;AAEhD,EAAA,IAAI,SAAA,EAAW,KAAA,EAAO,MAAA;AACtB,EAAA,MAAA,CAAO,SAAA,GAAY,IAAA,EAAM;AACvB,IAAA,IAAI,SAAA,EAAW,MAAA,EAAQ,MAAA;AACvB,IAAA,MAAA,CAAO,SAAA,GAAY,KAAA,EAAO;AACxB,MAAA,IAAI,OAAA,EAAS,4BAAA,CAAO,QAAA,EAAU,QAAQ,CAAA,EAAG,OAAA,CAAQ,UAAU,CAAA;AAC3D,MAAA,GAAA,CAAI,OAAA,CAAQ,IAAA,EAAM;AAChB,QAAA,GAAA,CAAI,0CAAA,MAAO,EAAQ,OAAA,CAAQ,IAAI,CAAA,EAAG,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAA;AAAA,MACvD,EAAA,KAAO;AACL,QAAA,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAA;AAAA,MACrB;AACA,MAAA,SAAA,GAAY,UAAA;AAAA,IACd;AACA,IAAA,SAAA,GAAY,SAAA;AAAA,EACd;AAEA,EAAA,OAAO,wCAAA,OAAyB,CAAA;AAClC;AAGA,IAAO,wBAAA,EAAQ,SAAA;ADzDf;AACE;AACA;AACF,yEAAC","file":"/home/runner/work/turf/turf/packages/turf-point-grid/dist/cjs/index.cjs","sourcesContent":[null,"import {\n BBox,\n Feature,\n Polygon,\n MultiPolygon,\n FeatureCollection,\n Point,\n GeoJsonProperties,\n} from \"geojson\";\nimport { booleanWithin as within } from \"@turf/boolean-within\";\nimport { distance } from \"@turf/distance\";\nimport { point, featureCollection, Units } from \"@turf/helpers\";\n\n/**\n * Creates a grid of points\n *\n * @function\n * @param {BBox} bbox extent of grid in [minX, minY, maxX, maxY] order\n * @param {number} cellSide the distance between points\n * @param {Object} [options={}] Optional parameters\n * @param {Units} [options.units='kilometers'] the units of the cellSide value. Supports all valid Turf {@link https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md Units}\n * @param {Feature<Polygon|MultiPolygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it\n * @param {Object} [options.properties={}] passed to each point of the grid\n * @returns {FeatureCollection<Point>} grid of points\n * @example\n * var extent = [-70.823364, -33.553984, -70.473175, -33.302986];\n * var cellSide = 3;\n * var options = {units: 'miles'};\n *\n * var grid = turf.pointGrid(extent, cellSide, options);\n *\n * //addToMap\n * var addToMap = [grid];\n */\nfunction pointGrid<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n cellSide: number,\n options: {\n units?: Units;\n mask?: Feature<Polygon | MultiPolygon>;\n properties?: P;\n } = {}\n): FeatureCollection<Point, P> {\n // Default parameters\n if (options.mask && !options.units) options.units = \"kilometers\";\n\n // Containers\n var results = [];\n\n // Typescript handles the Type Validation\n // if (cellSide === null || cellSide === undefined) throw new Error('cellSide is required');\n // if (!isNumber(cellSide)) throw new Error('cellSide is invalid');\n // if (!bbox) throw new Error('bbox is required');\n // if (!Array.isArray(bbox)) throw new Error('bbox must be array');\n // if (bbox.length !== 4) throw new Error('bbox must contain 4 numbers');\n // if (mask && ['Polygon', 'MultiPolygon'].indexOf(getType(mask)) === -1) throw new Error('options.mask must be a (Multi)Polygon');\n\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var xFraction = cellSide / distance([west, south], [east, south], options);\n var cellWidth = xFraction * (east - west);\n var yFraction = cellSide / distance([west, south], [west, north], options);\n var cellHeight = yFraction * (north - south);\n\n var bboxWidth = east - west;\n var bboxHeight = north - south;\n var columns = Math.floor(bboxWidth / cellWidth);\n var rows = Math.floor(bboxHeight / cellHeight);\n\n // adjust origin of the grid\n var deltaX = (bboxWidth - columns * cellWidth) / 2;\n var deltaY = (bboxHeight - rows * cellHeight) / 2;\n\n var currentX = west + deltaX;\n while (currentX <= east) {\n var currentY = south + deltaY;\n while (currentY <= north) {\n var cellPt = point([currentX, currentY], options.properties);\n if (options.mask) {\n if (within(cellPt, options.mask)) results.push(cellPt);\n } else {\n results.push(cellPt);\n }\n currentY += cellHeight;\n }\n currentX += cellWidth;\n }\n\n return featureCollection(results);\n}\n\nexport { pointGrid };\nexport default pointGrid;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-point-grid/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACSA,qDAAwC;AACxC,0CAAyB;AACzB,wCAAgD;AAuBhD,SAAS,SAAA,CACP,IAAA,EACA,QAAA,EACA,QAAA,EAII,CAAC,CAAA,EACwB;AAE7B,EAAA,GAAA,CAAI,OAAA,CAAQ,KAAA,GAAQ,CAAC,OAAA,CAAQ,KAAA,EAAO,OAAA,CAAQ,MAAA,EAAQ,YAAA;AAGpD,EAAA,IAAI,QAAA,EAAU,CAAC,CAAA;AAUf,EAAA,IAAI,KAAA,EAAO,IAAA,CAAK,CAAC,CAAA;AACjB,EAAA,IAAI,MAAA,EAAQ,IAAA,CAAK,CAAC,CAAA;AAClB,EAAA,IAAI,KAAA,EAAO,IAAA,CAAK,CAAC,CAAA;AACjB,EAAA,IAAI,MAAA,EAAQ,IAAA,CAAK,CAAC,CAAA;AAElB,EAAA,IAAI,UAAA,EAAY,SAAA,EAAW,gCAAA,CAAU,IAAA,EAAM,KAAK,CAAA,EAAG,CAAC,IAAA,EAAM,KAAK,CAAA,EAAG,OAAO,CAAA;AACzE,EAAA,IAAI,UAAA,EAAY,UAAA,EAAA,CAAa,KAAA,EAAO,IAAA,CAAA;AACpC,EAAA,IAAI,UAAA,EAAY,SAAA,EAAW,gCAAA,CAAU,IAAA,EAAM,KAAK,CAAA,EAAG,CAAC,IAAA,EAAM,KAAK,CAAA,EAAG,OAAO,CAAA;AACzE,EAAA,IAAI,WAAA,EAAa,UAAA,EAAA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s","sourcesContent":[null,"import {\n BBox,\n Feature,\n Polygon,\n MultiPolygon,\n FeatureCollection,\n Point,\n GeoJsonProperties,\n} from \"geojson\";\nimport { booleanWithin as within } from \"@turf/boolean-within\";\nimport { distance } from \"@turf/distance\";\nimport { point, featureCollection, Units } from \"@turf/helpers\";\n\n/**\n * Creates a grid of points\n *\n * @function\n * @param {BBox} bbox extent of grid in [minX, minY, maxX, maxY] order\n * @param {number} cellSide the distance between points\n * @param {Object} [options={}] Optional parameters\n * @param {Units} [options.units='kilometers'] the units of the cellSide value. Supports all valid Turf {@link https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md Units}\n * @param {Feature<Polygon|MultiPolygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it\n * @param {Object} [options.properties={}] passed to each point of the grid\n * @returns {FeatureCollection<Point>} grid of points\n * @example\n * var extent = [-70.823364, -33.553984, -70.473175, -33.302986];\n * var cellSide = 3;\n * var options = {units: 'miles'};\n *\n * var grid = turf.pointGrid(extent, cellSide, options);\n *\n * //addToMap\n * var addToMap = [grid];\n */\nfunction pointGrid<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n cellSide: number,\n options: {\n units?: Units;\n mask?: Feature<Polygon | MultiPolygon>;\n properties?: P;\n } = {}\n): FeatureCollection<Point, P> {\n // Default parameters\n if (options.mask && !options.units) options.units = \"kilometers\";\n\n // Containers\n var results = [];\n\n // Typescript handles the Type Validation\n // if (cellSide === null || cellSide === undefined) throw new Error('cellSide is required');\n // if (!isNumber(cellSide)) throw new Error('cellSide is invalid');\n // if (!bbox) throw new Error('bbox is required');\n // if (!Array.isArray(bbox)) throw new Error('bbox must be array');\n // if (bbox.length !== 4) throw new Error('bbox must contain 4 numbers');\n // if (mask && ['Polygon', 'MultiPolygon'].indexOf(getType(mask)) === -1) throw new Error('options.mask must be a (Multi)Polygon');\n\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var xFraction = cellSide / distance([west, south], [east, south], options);\n var cellWidth = xFraction * (east - west);\n var yFraction = cellSide / distance([west, south], [west, north], options);\n var cellHeight = yFraction * (north - south);\n\n var bboxWidth = east - west;\n var bboxHeight = north - south;\n var columns = Math.floor(bboxWidth / cellWidth);\n var rows = Math.floor(bboxHeight / cellHeight);\n\n // adjust origin of the grid\n var deltaX = (bboxWidth - columns * cellWidth) / 2;\n var deltaY = (bboxHeight - rows * cellHeight) / 2;\n\n var currentX = west + deltaX;\n while (currentX <= east) {\n var currentY = south + deltaY;\n while (currentY <= north) {\n var cellPt = point([currentX, currentY], options.properties);\n if (options.mask) {\n if (within(cellPt, options.mask)) results.push(cellPt);\n } else {\n results.push(cellPt);\n }\n currentY += cellHeight;\n }\n currentX += cellWidth;\n }\n\n return featureCollection(results);\n}\n\nexport { pointGrid };\nexport default pointGrid;\n"]}
@@ -35,9 +35,9 @@ function pointGrid(bbox, cellSide, options = {}) {
35
35
  }
36
36
  return featureCollection(results);
37
37
  }
38
- var turf_point_grid_default = pointGrid;
38
+ var index_default = pointGrid;
39
39
  export {
40
- turf_point_grid_default as default,
40
+ index_default as default,
41
41
  pointGrid
42
42
  };
43
43
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n BBox,\n Feature,\n Polygon,\n MultiPolygon,\n FeatureCollection,\n Point,\n GeoJsonProperties,\n} from \"geojson\";\nimport { booleanWithin as within } from \"@turf/boolean-within\";\nimport { distance } from \"@turf/distance\";\nimport { point, featureCollection, Units } from \"@turf/helpers\";\n\n/**\n * Creates a grid of points\n *\n * @function\n * @param {BBox} bbox extent of grid in [minX, minY, maxX, maxY] order\n * @param {number} cellSide the distance between points\n * @param {Object} [options={}] Optional parameters\n * @param {Units} [options.units='kilometers'] the units of the cellSide value. Supports all valid Turf {@link https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md Units}\n * @param {Feature<Polygon|MultiPolygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it\n * @param {Object} [options.properties={}] passed to each point of the grid\n * @returns {FeatureCollection<Point>} grid of points\n * @example\n * var extent = [-70.823364, -33.553984, -70.473175, -33.302986];\n * var cellSide = 3;\n * var options = {units: 'miles'};\n *\n * var grid = turf.pointGrid(extent, cellSide, options);\n *\n * //addToMap\n * var addToMap = [grid];\n */\nfunction pointGrid<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n cellSide: number,\n options: {\n units?: Units;\n mask?: Feature<Polygon | MultiPolygon>;\n properties?: P;\n } = {}\n): FeatureCollection<Point, P> {\n // Default parameters\n if (options.mask && !options.units) options.units = \"kilometers\";\n\n // Containers\n var results = [];\n\n // Typescript handles the Type Validation\n // if (cellSide === null || cellSide === undefined) throw new Error('cellSide is required');\n // if (!isNumber(cellSide)) throw new Error('cellSide is invalid');\n // if (!bbox) throw new Error('bbox is required');\n // if (!Array.isArray(bbox)) throw new Error('bbox must be array');\n // if (bbox.length !== 4) throw new Error('bbox must contain 4 numbers');\n // if (mask && ['Polygon', 'MultiPolygon'].indexOf(getType(mask)) === -1) throw new Error('options.mask must be a (Multi)Polygon');\n\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var xFraction = cellSide / distance([west, south], [east, south], options);\n var cellWidth = xFraction * (east - west);\n var yFraction = cellSide / distance([west, south], [west, north], options);\n var cellHeight = yFraction * (north - south);\n\n var bboxWidth = east - west;\n var bboxHeight = north - south;\n var columns = Math.floor(bboxWidth / cellWidth);\n var rows = Math.floor(bboxHeight / cellHeight);\n\n // adjust origin of the grid\n var deltaX = (bboxWidth - columns * cellWidth) / 2;\n var deltaY = (bboxHeight - rows * cellHeight) / 2;\n\n var currentX = west + deltaX;\n while (currentX <= east) {\n var currentY = south + deltaY;\n while (currentY <= north) {\n var cellPt = point([currentX, currentY], options.properties);\n if (options.mask) {\n if (within(cellPt, options.mask)) results.push(cellPt);\n } else {\n results.push(cellPt);\n }\n currentY += cellHeight;\n }\n currentX += cellWidth;\n }\n\n return featureCollection(results);\n}\n\nexport { pointGrid };\nexport default pointGrid;\n"],"mappings":";AASA,SAAS,iBAAiB,cAAc;AACxC,SAAS,gBAAgB;AACzB,SAAS,OAAO,yBAAgC;AAuBhD,SAAS,UACP,MACA,UACA,UAII,CAAC,GACwB;AAE7B,MAAI,QAAQ,QAAQ,CAAC,QAAQ,MAAO,SAAQ,QAAQ;AAGpD,MAAI,UAAU,CAAC;AAUf,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAClB,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAElB,MAAI,YAAY,WAAW,SAAS,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,GAAG,OAAO;AACzE,MAAI,YAAY,aAAa,OAAO;AACpC,MAAI,YAAY,WAAW,SAAS,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,GAAG,OAAO;AACzE,MAAI,aAAa,aAAa,QAAQ;AAEtC,MAAI,YAAY,OAAO;AACvB,MAAI,aAAa,QAAQ;AACzB,MAAI,UAAU,KAAK,MAAM,YAAY,SAAS;AAC9C,MAAI,OAAO,KAAK,MAAM,aAAa,UAAU;AAG7C,MAAI,UAAU,YAAY,UAAU,aAAa;AACjD,MAAI,UAAU,aAAa,OAAO,cAAc;AAEhD,MAAI,WAAW,OAAO;AACtB,SAAO,YAAY,MAAM;AACvB,QAAI,WAAW,QAAQ;AACvB,WAAO,YAAY,OAAO;AACxB,UAAI,SAAS,MAAM,CAAC,UAAU,QAAQ,GAAG,QAAQ,UAAU;AAC3D,UAAI,QAAQ,MAAM;AAChB,YAAI,OAAO,QAAQ,QAAQ,IAAI,EAAG,SAAQ,KAAK,MAAM;AAAA,MACvD,OAAO;AACL,gBAAQ,KAAK,MAAM;AAAA,MACrB;AACA,kBAAY;AAAA,IACd;AACA,gBAAY;AAAA,EACd;AAEA,SAAO,kBAAkB,OAAO;AAClC;AAGA,IAAO,0BAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n BBox,\n Feature,\n Polygon,\n MultiPolygon,\n FeatureCollection,\n Point,\n GeoJsonProperties,\n} from \"geojson\";\nimport { booleanWithin as within } from \"@turf/boolean-within\";\nimport { distance } from \"@turf/distance\";\nimport { point, featureCollection, Units } from \"@turf/helpers\";\n\n/**\n * Creates a grid of points\n *\n * @function\n * @param {BBox} bbox extent of grid in [minX, minY, maxX, maxY] order\n * @param {number} cellSide the distance between points\n * @param {Object} [options={}] Optional parameters\n * @param {Units} [options.units='kilometers'] the units of the cellSide value. Supports all valid Turf {@link https://github.com/Turfjs/turf/blob/master/packages/turf-helpers/README_UNITS.md Units}\n * @param {Feature<Polygon|MultiPolygon>} [options.mask] if passed a Polygon or MultiPolygon, the grid Points will be created only inside it\n * @param {Object} [options.properties={}] passed to each point of the grid\n * @returns {FeatureCollection<Point>} grid of points\n * @example\n * var extent = [-70.823364, -33.553984, -70.473175, -33.302986];\n * var cellSide = 3;\n * var options = {units: 'miles'};\n *\n * var grid = turf.pointGrid(extent, cellSide, options);\n *\n * //addToMap\n * var addToMap = [grid];\n */\nfunction pointGrid<P extends GeoJsonProperties = GeoJsonProperties>(\n bbox: BBox,\n cellSide: number,\n options: {\n units?: Units;\n mask?: Feature<Polygon | MultiPolygon>;\n properties?: P;\n } = {}\n): FeatureCollection<Point, P> {\n // Default parameters\n if (options.mask && !options.units) options.units = \"kilometers\";\n\n // Containers\n var results = [];\n\n // Typescript handles the Type Validation\n // if (cellSide === null || cellSide === undefined) throw new Error('cellSide is required');\n // if (!isNumber(cellSide)) throw new Error('cellSide is invalid');\n // if (!bbox) throw new Error('bbox is required');\n // if (!Array.isArray(bbox)) throw new Error('bbox must be array');\n // if (bbox.length !== 4) throw new Error('bbox must contain 4 numbers');\n // if (mask && ['Polygon', 'MultiPolygon'].indexOf(getType(mask)) === -1) throw new Error('options.mask must be a (Multi)Polygon');\n\n var west = bbox[0];\n var south = bbox[1];\n var east = bbox[2];\n var north = bbox[3];\n\n var xFraction = cellSide / distance([west, south], [east, south], options);\n var cellWidth = xFraction * (east - west);\n var yFraction = cellSide / distance([west, south], [west, north], options);\n var cellHeight = yFraction * (north - south);\n\n var bboxWidth = east - west;\n var bboxHeight = north - south;\n var columns = Math.floor(bboxWidth / cellWidth);\n var rows = Math.floor(bboxHeight / cellHeight);\n\n // adjust origin of the grid\n var deltaX = (bboxWidth - columns * cellWidth) / 2;\n var deltaY = (bboxHeight - rows * cellHeight) / 2;\n\n var currentX = west + deltaX;\n while (currentX <= east) {\n var currentY = south + deltaY;\n while (currentY <= north) {\n var cellPt = point([currentX, currentY], options.properties);\n if (options.mask) {\n if (within(cellPt, options.mask)) results.push(cellPt);\n } else {\n results.push(cellPt);\n }\n currentY += cellHeight;\n }\n currentX += cellWidth;\n }\n\n return featureCollection(results);\n}\n\nexport { pointGrid };\nexport default pointGrid;\n"],"mappings":";AASA,SAAS,iBAAiB,cAAc;AACxC,SAAS,gBAAgB;AACzB,SAAS,OAAO,yBAAgC;AAuBhD,SAAS,UACP,MACA,UACA,UAII,CAAC,GACwB;AAE7B,MAAI,QAAQ,QAAQ,CAAC,QAAQ,MAAO,SAAQ,QAAQ;AAGpD,MAAI,UAAU,CAAC;AAUf,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAClB,MAAI,OAAO,KAAK,CAAC;AACjB,MAAI,QAAQ,KAAK,CAAC;AAElB,MAAI,YAAY,WAAW,SAAS,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,GAAG,OAAO;AACzE,MAAI,YAAY,aAAa,OAAO;AACpC,MAAI,YAAY,WAAW,SAAS,CAAC,MAAM,KAAK,GAAG,CAAC,MAAM,KAAK,GAAG,OAAO;AACzE,MAAI,aAAa,aAAa,QAAQ;AAEtC,MAAI,YAAY,OAAO;AACvB,MAAI,aAAa,QAAQ;AACzB,MAAI,UAAU,KAAK,MAAM,YAAY,SAAS;AAC9C,MAAI,OAAO,KAAK,MAAM,aAAa,UAAU;AAG7C,MAAI,UAAU,YAAY,UAAU,aAAa;AACjD,MAAI,UAAU,aAAa,OAAO,cAAc;AAEhD,MAAI,WAAW,OAAO;AACtB,SAAO,YAAY,MAAM;AACvB,QAAI,WAAW,QAAQ;AACvB,WAAO,YAAY,OAAO;AACxB,UAAI,SAAS,MAAM,CAAC,UAAU,QAAQ,GAAG,QAAQ,UAAU;AAC3D,UAAI,QAAQ,MAAM;AAChB,YAAI,OAAO,QAAQ,QAAQ,IAAI,EAAG,SAAQ,KAAK,MAAM;AAAA,MACvD,OAAO;AACL,gBAAQ,KAAK,MAAM;AAAA,MACrB;AACA,kBAAY;AAAA,IACd;AACA,gBAAY;AAAA,EACd;AAEA,SAAO,kBAAkB,OAAO;AAClC;AAGA,IAAO,gBAAQ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/point-grid",
3
- "version": "7.2.0",
4
- "description": "turf point-grid module",
3
+ "version": "7.3.0",
4
+ "description": "Creates a grid of points within a bounding box.",
5
5
  "author": "Turf Authors",
6
6
  "contributors": [
7
7
  "Stefano Borghi <@stebogit>",
@@ -56,26 +56,26 @@
56
56
  "test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
57
57
  },
58
58
  "devDependencies": {
59
- "@turf/bbox-polygon": "^7.2.0",
60
- "@turf/truncate": "^7.2.0",
59
+ "@turf/bbox-polygon": "7.3.0",
60
+ "@turf/truncate": "7.3.0",
61
61
  "@types/benchmark": "^2.1.5",
62
- "@types/tape": "^4.13.4",
62
+ "@types/tape": "^5.8.1",
63
63
  "benchmark": "^2.1.4",
64
64
  "load-json-file": "^7.0.1",
65
65
  "npm-run-all": "^4.1.5",
66
66
  "tape": "^5.9.0",
67
- "tsup": "^8.3.5",
68
- "tsx": "^4.19.2",
69
- "typescript": "^5.5.4",
70
- "write-json-file": "^5.0.0"
67
+ "tsup": "^8.4.0",
68
+ "tsx": "^4.19.4",
69
+ "typescript": "^5.8.3",
70
+ "write-json-file": "^6.0.0"
71
71
  },
72
72
  "dependencies": {
73
- "@turf/boolean-within": "^7.2.0",
74
- "@turf/distance": "^7.2.0",
75
- "@turf/helpers": "^7.2.0",
76
- "@turf/invariant": "^7.2.0",
73
+ "@turf/boolean-within": "7.3.0",
74
+ "@turf/distance": "7.3.0",
75
+ "@turf/helpers": "7.3.0",
76
+ "@turf/invariant": "7.3.0",
77
77
  "@types/geojson": "^7946.0.10",
78
78
  "tslib": "^2.8.1"
79
79
  },
80
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
80
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
81
81
  }
@@ -97,9 +97,9 @@ function pointOnSegment(x, y, x1, y1, x2, y2) {
97
97
  const pb = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));
98
98
  return ab === ap + pb;
99
99
  }
100
- var turf_point_on_feature_default = pointOnFeature;
100
+ var index_default = pointOnFeature;
101
101
 
102
102
 
103
103
 
104
- exports.default = turf_point_on_feature_default; exports.pointOnFeature = pointOnFeature;
104
+ exports.default = index_default; exports.pointOnFeature = pointOnFeature;
105
105
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-point-on-feature/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACEA,wCAAwB;AACxB,sCAAmC;AACnC,mDAA6B;AAC7B,uEAAsC;AACtC,wCAAkD;AA4BlD,SAAS,cAAA,CAAe,OAAA,EAAqC;AAE3D,EAAA,MAAM,GAAA,EAAK,SAAA,CAAU,OAAO,CAAA;AAG5B,EAAA,MAAM,KAAA,EAAO,4BAAA,EAAW,CAAA;AAGxB,EAAA,IAAI,UAAA,EAAY,KAAA;AAChB,EAAA,IAAI,EAAA,EAAI,CAAA;AACR,EAAA,MAAA,CAAO,CA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A,EAAA,CAAM,GAAA,EAAK,CAAA,CAAE,CAAA;AAC9D,EAAA,OAAO,GAAA,IAAO,GAAA,EAAK,EAAA;AACrB;AAGA,IAAO,8BAAA,EAAQ,cAAA;AD1Df;AACE;AACA;AACF,yFAAC","file":"/home/runner/work/turf/turf/packages/turf-point-on-feature/dist/cjs/index.cjs","sourcesContent":[null,"import type { Feature, Point } from \"geojson\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport { explode } from \"@turf/explode\";\nimport { center as centroid } from \"@turf/center\";\nimport { nearestPoint } from \"@turf/nearest-point\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { featureCollection, feature, point } from \"@turf/helpers\";\n\n/**\n * Takes a Feature or FeatureCollection and returns a {@link Point} guaranteed to be on the surface of the feature.\n *\n * * Given a {@link Polygon}, the point will be in the area of the polygon\n * * Given a {@link LineString}, the point will be along the string\n * * Given a {@link Point}, the point will the same as the input\n *\n * @function\n * @param {GeoJSON} geojson any Feature or FeatureCollection\n * @returns {Feature<Point>} a point on the surface of `input`\n * @example\n * var polygon = turf.polygon([[\n * [116, -36],\n * [131, -32],\n * [146, -43],\n * [155, -25],\n * [133, -9],\n * [111, -22],\n * [116, -36]\n * ]]);\n *\n * var pointOnPolygon = turf.pointOnFeature(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, pointOnPolygon];\n */\nfunction pointOnFeature(geojson: AllGeoJSON): Feature<Point> {\n // normalize\n const fc = normalize(geojson);\n\n // get centroid\n const cent = centroid(fc);\n\n // check to see if centroid is on surface\n let onSurface = false;\n let i = 0;\n while (!onSurface && i < fc.features.length) {\n const geom = fc.features[i].geometry;\n let x, y, x1, y1, x2, y2;\n let onLine = false;\n if (geom.type === \"Point\") {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[0] &&\n cent.geometry.coordinates[1] === geom.coordinates[1]\n ) {\n onSurface = true;\n }\n } else if (geom.type === \"MultiPoint\") {\n let onMultiPoint = false;\n let k = 0;\n while (!onMultiPoint && k < geom.coordinates.length) {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[k][0] &&\n cent.geometry.coordinates[1] === geom.coordinates[k][1]\n ) {\n onSurface = true;\n onMultiPoint = true;\n }\n k++;\n }\n } else if (geom.type === \"LineString\") {\n let k = 0;\n while (!onLine && k < geom.coordinates.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = geom.coordinates[k][0];\n y1 = geom.coordinates[k][1];\n x2 = geom.coordinates[k + 1][0];\n y2 = geom.coordinates[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n } else if (geom.type === \"MultiLineString\") {\n let j = 0;\n while (j < geom.coordinates.length) {\n onLine = false;\n let k = 0;\n const line = geom.coordinates[j];\n while (!onLine && k < line.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = line[k][0];\n y1 = line[k][1];\n x2 = line[k + 1][0];\n y2 = line[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n j++;\n }\n } else if (geom.type === \"Polygon\" || geom.type === \"MultiPolygon\") {\n if (booleanPointInPolygon(cent, geom)) {\n onSurface = true;\n }\n }\n i++;\n }\n if (onSurface) {\n return cent;\n } else {\n const vertices = featureCollection<Point>([]);\n for (let f = 0; f < fc.features.length; f++) {\n vertices.features = vertices.features.concat(\n explode(fc.features[f]).features\n );\n }\n // Remove distanceToPoint properties from nearestPoint()\n return point(nearestPoint(cent, vertices).geometry.coordinates);\n }\n}\n\n/**\n * Normalizes any GeoJSON to a FeatureCollection\n *\n * @private\n * @name normalize\n * @param {GeoJSON} geojson Any GeoJSON\n * @returns {FeatureCollection} FeatureCollection\n */\nfunction normalize(geojson: AllGeoJSON) {\n if (geojson.type !== \"FeatureCollection\") {\n if (geojson.type !== \"Feature\") {\n return featureCollection([feature(geojson)]);\n }\n return featureCollection([geojson]);\n }\n return geojson;\n}\n\nfunction pointOnSegment(\n x: number,\n y: number,\n x1: number,\n y1: number,\n x2: number,\n y2: number\n) {\n const ab = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n const ap = Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));\n const pb = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));\n return ab === ap + pb;\n}\n\nexport { pointOnFeature };\nexport default pointOnFeature;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-point-on-feature/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACEA,wCAAwB;AACxB,sCAAmC;AACnC,mDAA6B;AAC7B,uEAAsC;AACtC,wCAAkD;AA4BlD,SAAS,cAAA,CAAe,OAAA,EAAqC;AAE3D,EAAA,MAAM,GAAA,EAAK,SAAA,CAAU,OAAO,CAAA;AAG5B,EAAA,MAAM,KAAA,EAAO,4BAAA,EAAW,CAAA;AAGxB,EAAA,IAAI,UAAA,EAAY,KAAA;AAChB,EAAA,IAAI,EAAA,EAAI,CAAA;AACR,EAAA,MAAA,CAAO,CAAC,UAAA,GAAa,EAAA,EAAI,EAAA,CAAG,QAAA,CAAS,MAAA,EAAQ;AAC3C,IAAA,MAAM,KAAA,EAAO,EAAA,CAAG,QAAA,CAAS,CAAC,CAAA,CAAE,QAAA;AAC5B,IAAA,IAAI,CAAA,EAAG,CAAA,EAAG,EAAA,EAAI,EAAA,EAAI,EAAA,EAAI,EAAA;AACtB,IAAA,IAAI,OAAA,EAAS,KAAA;AACb,IAAA,GAAA,CAAI,IAAA,CAAK,KAAA,IAAS,OAAA,EAAS;AACzB,MAAA,GAAA,CACE,IAAA,CAAK,QAAA,CAAS,WAAA,CAAY,CAAC,EAAA,IAAM,IAAA,CAAK,WAAA,CAAY,CAAC,EAAA,GACnD,IAAA,CAAK,QAAA,CAAS,WAAA,CAAY,CAAC,EAAA,IAAM,IAAA,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AACA,IAAA,OAAO,wCAAA,CAAmB,OAAO,CAAC,CAAA;AAAA,EACpC;AACA,EAAA,OAAO,OAAA;AACT;AAEA,SAAS,cAAA,CACP,CAAA,EACA,CAAA,EACA,EAAA,EACA,EAAA,EACA,EAAA,EACA,EAAA,EACA;AACA,EAAA,MAAM,GAAA,EAAK,IAAA,CAAK,IAAA,CAAA,CAAM,GAAA,EAAK,EAAA,EAAA,EAAA,CAAO,GAAA,EAAK,EAAA,EAAA,EAAA,CAAO,GAAA,EAAK,EAAA,EAAA,EAAA,CAAO,GAAA,EAAK,EAAA,CAAG,CAAA;AAClE,EAAA,MAAM,GAAA,EAAK,IAAA,CAAK,IAAA,CAAA,CAAM,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,EAAA,EAAA,CAAO,EAAA,EAAI,EAAA,CAAG,CAAA;AAC9D,EAAA,MAAM,GAAA,EAAK,IAAA,CAAK,IAAA,CAAA,CAAM,GAAA,EAAK,CAAA,EAAA,EAAA,CAAM,GAAA,EAAK,CAAA,EAAA,EAAA,CAAM,GAAA,EAAK,CAAA,EAAA,EAAA,CAAM,GAAA,EAAK,CAAA,CAAE,CAAA;AAC9D,EAAA,OAAO,GAAA,IAAO,GAAA,EAAK,EAAA;AACrB;AAGA,IAAO,cAAA,EAAQ,cAAA;AD1Df;AACE;AACA;AACF,yEAAC","file":"/home/runner/work/turf/turf/packages/turf-point-on-feature/dist/cjs/index.cjs","sourcesContent":[null,"import type { Feature, Point } from \"geojson\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport { explode } from \"@turf/explode\";\nimport { center as centroid } from \"@turf/center\";\nimport { nearestPoint } from \"@turf/nearest-point\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { featureCollection, feature, point } from \"@turf/helpers\";\n\n/**\n * Takes a Feature or FeatureCollection and returns a {@link Point} guaranteed to be on the surface of the feature.\n *\n * * Given a {@link Polygon}, the point will be in the area of the polygon\n * * Given a {@link LineString}, the point will be along the string\n * * Given a {@link Point}, the point will the same as the input\n *\n * @function\n * @param {GeoJSON} geojson any Feature or FeatureCollection\n * @returns {Feature<Point>} a point on the surface of `input`\n * @example\n * var polygon = turf.polygon([[\n * [116, -36],\n * [131, -32],\n * [146, -43],\n * [155, -25],\n * [133, -9],\n * [111, -22],\n * [116, -36]\n * ]]);\n *\n * var pointOnPolygon = turf.pointOnFeature(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, pointOnPolygon];\n */\nfunction pointOnFeature(geojson: AllGeoJSON): Feature<Point> {\n // normalize\n const fc = normalize(geojson);\n\n // get centroid\n const cent = centroid(fc);\n\n // check to see if centroid is on surface\n let onSurface = false;\n let i = 0;\n while (!onSurface && i < fc.features.length) {\n const geom = fc.features[i].geometry;\n let x, y, x1, y1, x2, y2;\n let onLine = false;\n if (geom.type === \"Point\") {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[0] &&\n cent.geometry.coordinates[1] === geom.coordinates[1]\n ) {\n onSurface = true;\n }\n } else if (geom.type === \"MultiPoint\") {\n let onMultiPoint = false;\n let k = 0;\n while (!onMultiPoint && k < geom.coordinates.length) {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[k][0] &&\n cent.geometry.coordinates[1] === geom.coordinates[k][1]\n ) {\n onSurface = true;\n onMultiPoint = true;\n }\n k++;\n }\n } else if (geom.type === \"LineString\") {\n let k = 0;\n while (!onLine && k < geom.coordinates.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = geom.coordinates[k][0];\n y1 = geom.coordinates[k][1];\n x2 = geom.coordinates[k + 1][0];\n y2 = geom.coordinates[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n } else if (geom.type === \"MultiLineString\") {\n let j = 0;\n while (j < geom.coordinates.length) {\n onLine = false;\n let k = 0;\n const line = geom.coordinates[j];\n while (!onLine && k < line.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = line[k][0];\n y1 = line[k][1];\n x2 = line[k + 1][0];\n y2 = line[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n j++;\n }\n } else if (geom.type === \"Polygon\" || geom.type === \"MultiPolygon\") {\n if (booleanPointInPolygon(cent, geom)) {\n onSurface = true;\n }\n }\n i++;\n }\n if (onSurface) {\n return cent;\n } else {\n const vertices = featureCollection<Point>([]);\n for (let f = 0; f < fc.features.length; f++) {\n vertices.features = vertices.features.concat(\n explode(fc.features[f]).features\n );\n }\n // Remove distanceToPoint properties from nearestPoint()\n return point(nearestPoint(cent, vertices).geometry.coordinates);\n }\n}\n\n/**\n * Normalizes any GeoJSON to a FeatureCollection\n *\n * @private\n * @name normalize\n * @param {GeoJSON} geojson Any GeoJSON\n * @returns {FeatureCollection} FeatureCollection\n */\nfunction normalize(geojson: AllGeoJSON) {\n if (geojson.type !== \"FeatureCollection\") {\n if (geojson.type !== \"Feature\") {\n return featureCollection([feature(geojson)]);\n }\n return featureCollection([geojson]);\n }\n return geojson;\n}\n\nfunction pointOnSegment(\n x: number,\n y: number,\n x1: number,\n y1: number,\n x2: number,\n y2: number\n) {\n const ab = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n const ap = Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));\n const pb = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));\n return ab === ap + pb;\n}\n\nexport { pointOnFeature };\nexport default pointOnFeature;\n"]}
@@ -97,9 +97,9 @@ function pointOnSegment(x, y, x1, y1, x2, y2) {
97
97
  const pb = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));
98
98
  return ab === ap + pb;
99
99
  }
100
- var turf_point_on_feature_default = pointOnFeature;
100
+ var index_default = pointOnFeature;
101
101
  export {
102
- turf_point_on_feature_default as default,
102
+ index_default as default,
103
103
  pointOnFeature
104
104
  };
105
105
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../index.ts"],"sourcesContent":["import type { Feature, Point } from \"geojson\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport { explode } from \"@turf/explode\";\nimport { center as centroid } from \"@turf/center\";\nimport { nearestPoint } from \"@turf/nearest-point\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { featureCollection, feature, point } from \"@turf/helpers\";\n\n/**\n * Takes a Feature or FeatureCollection and returns a {@link Point} guaranteed to be on the surface of the feature.\n *\n * * Given a {@link Polygon}, the point will be in the area of the polygon\n * * Given a {@link LineString}, the point will be along the string\n * * Given a {@link Point}, the point will the same as the input\n *\n * @function\n * @param {GeoJSON} geojson any Feature or FeatureCollection\n * @returns {Feature<Point>} a point on the surface of `input`\n * @example\n * var polygon = turf.polygon([[\n * [116, -36],\n * [131, -32],\n * [146, -43],\n * [155, -25],\n * [133, -9],\n * [111, -22],\n * [116, -36]\n * ]]);\n *\n * var pointOnPolygon = turf.pointOnFeature(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, pointOnPolygon];\n */\nfunction pointOnFeature(geojson: AllGeoJSON): Feature<Point> {\n // normalize\n const fc = normalize(geojson);\n\n // get centroid\n const cent = centroid(fc);\n\n // check to see if centroid is on surface\n let onSurface = false;\n let i = 0;\n while (!onSurface && i < fc.features.length) {\n const geom = fc.features[i].geometry;\n let x, y, x1, y1, x2, y2;\n let onLine = false;\n if (geom.type === \"Point\") {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[0] &&\n cent.geometry.coordinates[1] === geom.coordinates[1]\n ) {\n onSurface = true;\n }\n } else if (geom.type === \"MultiPoint\") {\n let onMultiPoint = false;\n let k = 0;\n while (!onMultiPoint && k < geom.coordinates.length) {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[k][0] &&\n cent.geometry.coordinates[1] === geom.coordinates[k][1]\n ) {\n onSurface = true;\n onMultiPoint = true;\n }\n k++;\n }\n } else if (geom.type === \"LineString\") {\n let k = 0;\n while (!onLine && k < geom.coordinates.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = geom.coordinates[k][0];\n y1 = geom.coordinates[k][1];\n x2 = geom.coordinates[k + 1][0];\n y2 = geom.coordinates[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n } else if (geom.type === \"MultiLineString\") {\n let j = 0;\n while (j < geom.coordinates.length) {\n onLine = false;\n let k = 0;\n const line = geom.coordinates[j];\n while (!onLine && k < line.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = line[k][0];\n y1 = line[k][1];\n x2 = line[k + 1][0];\n y2 = line[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n j++;\n }\n } else if (geom.type === \"Polygon\" || geom.type === \"MultiPolygon\") {\n if (booleanPointInPolygon(cent, geom)) {\n onSurface = true;\n }\n }\n i++;\n }\n if (onSurface) {\n return cent;\n } else {\n const vertices = featureCollection<Point>([]);\n for (let f = 0; f < fc.features.length; f++) {\n vertices.features = vertices.features.concat(\n explode(fc.features[f]).features\n );\n }\n // Remove distanceToPoint properties from nearestPoint()\n return point(nearestPoint(cent, vertices).geometry.coordinates);\n }\n}\n\n/**\n * Normalizes any GeoJSON to a FeatureCollection\n *\n * @private\n * @name normalize\n * @param {GeoJSON} geojson Any GeoJSON\n * @returns {FeatureCollection} FeatureCollection\n */\nfunction normalize(geojson: AllGeoJSON) {\n if (geojson.type !== \"FeatureCollection\") {\n if (geojson.type !== \"Feature\") {\n return featureCollection([feature(geojson)]);\n }\n return featureCollection([geojson]);\n }\n return geojson;\n}\n\nfunction pointOnSegment(\n x: number,\n y: number,\n x1: number,\n y1: number,\n x2: number,\n y2: number\n) {\n const ab = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n const ap = Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));\n const pb = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));\n return ab === ap + pb;\n}\n\nexport { pointOnFeature };\nexport default pointOnFeature;\n"],"mappings":";AAEA,SAAS,eAAe;AACxB,SAAS,UAAU,gBAAgB;AACnC,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,mBAAmB,SAAS,aAAa;AA4BlD,SAAS,eAAe,SAAqC;AAE3D,QAAM,KAAK,UAAU,OAAO;AAG5B,QAAM,OAAO,SAAS,EAAE;AAGxB,MAAI,YAAY;AAChB,MAAI,IAAI;AACR,SAAO,CAAC,aAAa,IAAI,GAAG,SAAS,QAAQ;AAC3C,UAAM,OAAO,GAAG,SAAS,CAAC,EAAE;AAC5B,QAAI,GAAG,GAAG,IAAI,IAAI,IAAI;AACtB,QAAI,SAAS;AACb,QAAI,KAAK,SAAS,SAAS;AACzB,UACE,KAAK,SAAS,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,KACnD,KAAK,SAAS,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,GACnD;AACA,oBAAY;AAAA,MACd;AAAA,IACF,WAAW,KAAK,SAAS,cAAc;AACrC,UAAI,eAAe;AACnB,UAAI,IAAI;AACR,aAAO,CAAC,gBAAgB,IAAI,KAAK,YAAY,QAAQ;AACnD,YACE,KAAK,SAAS,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,EAAE,CAAC,KACtD,KAAK,SAAS,YAAY,CAAC,MAAM,KAAK,YAAY,CAAC,EAAE,CAAC,GACtD;AACA,sBAAY;AACZ,yBAAe;AAAA,QACjB;AACA;AAAA,MACF;AAAA,IACF,WAAW,KAAK,SAAS,cAAc;AACrC,UAAI,IAAI;AACR,aAAO,CAAC,UAAU,IAAI,KAAK,YAAY,SAAS,GAAG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WAAW,SAAS,SAAS;AAAA,QACpC,QAAQ,GAAG,SAAS,CAAC,CAAC,EAAE;AAAA,MAC1B;AAAA,IACF;AAEA,WAAO,MAAM,aAAa,MAAM,QAAQ,EAAE,SAAS,WAAW;AAAA,EAChE;AACF;AAUA,SAAS,UAAU,SAAqB;AACtC,MAAI,QAAQ,SAAS,qBAAqB;AACxC,QAAI,QAAQ,SAAS,WAAW;AAC9B,aAAO,kBAAkB,CAAC,QAAQ,OAAO,CAAC,CAAC;AAAA,IAC7C;AACA,WAAO,kBAAkB,CAAC,OAAO,CAAC;AAAA,EACpC;AACA,SAAO;AACT;AAEA,SAAS,eACP,GACA,GACA,IACA,IACA,IACA,IACA;AACA,QAAM,KAAK,KAAK,MAAM,KAAK,OAAO,KAAK,OAAO,KAAK,OAAO,KAAK,GAAG;AAClE,QAAM,KAAK,KAAK,MAAM,IAAI,OAAO,IAAI,OAAO,IAAI,OAAO,IAAI,GAAG;AAC9D,QAAM,KAAK,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,EAAE;AAC9D,SAAO,OAAO,KAAK;AACrB;AAGA,IAAO,gCAAQ;","names":[]}
1
+ {"version":3,"sources":["../../index.ts"],"sourcesContent":["import type { Feature, Point } from \"geojson\";\nimport type { AllGeoJSON } from \"@turf/helpers\";\nimport { explode } from \"@turf/explode\";\nimport { center as centroid } from \"@turf/center\";\nimport { nearestPoint } from \"@turf/nearest-point\";\nimport { booleanPointInPolygon } from \"@turf/boolean-point-in-polygon\";\nimport { featureCollection, feature, point } from \"@turf/helpers\";\n\n/**\n * Takes a Feature or FeatureCollection and returns a {@link Point} guaranteed to be on the surface of the feature.\n *\n * * Given a {@link Polygon}, the point will be in the area of the polygon\n * * Given a {@link LineString}, the point will be along the string\n * * Given a {@link Point}, the point will the same as the input\n *\n * @function\n * @param {GeoJSON} geojson any Feature or FeatureCollection\n * @returns {Feature<Point>} a point on the surface of `input`\n * @example\n * var polygon = turf.polygon([[\n * [116, -36],\n * [131, -32],\n * [146, -43],\n * [155, -25],\n * [133, -9],\n * [111, -22],\n * [116, -36]\n * ]]);\n *\n * var pointOnPolygon = turf.pointOnFeature(polygon);\n *\n * //addToMap\n * var addToMap = [polygon, pointOnPolygon];\n */\nfunction pointOnFeature(geojson: AllGeoJSON): Feature<Point> {\n // normalize\n const fc = normalize(geojson);\n\n // get centroid\n const cent = centroid(fc);\n\n // check to see if centroid is on surface\n let onSurface = false;\n let i = 0;\n while (!onSurface && i < fc.features.length) {\n const geom = fc.features[i].geometry;\n let x, y, x1, y1, x2, y2;\n let onLine = false;\n if (geom.type === \"Point\") {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[0] &&\n cent.geometry.coordinates[1] === geom.coordinates[1]\n ) {\n onSurface = true;\n }\n } else if (geom.type === \"MultiPoint\") {\n let onMultiPoint = false;\n let k = 0;\n while (!onMultiPoint && k < geom.coordinates.length) {\n if (\n cent.geometry.coordinates[0] === geom.coordinates[k][0] &&\n cent.geometry.coordinates[1] === geom.coordinates[k][1]\n ) {\n onSurface = true;\n onMultiPoint = true;\n }\n k++;\n }\n } else if (geom.type === \"LineString\") {\n let k = 0;\n while (!onLine && k < geom.coordinates.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = geom.coordinates[k][0];\n y1 = geom.coordinates[k][1];\n x2 = geom.coordinates[k + 1][0];\n y2 = geom.coordinates[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n } else if (geom.type === \"MultiLineString\") {\n let j = 0;\n while (j < geom.coordinates.length) {\n onLine = false;\n let k = 0;\n const line = geom.coordinates[j];\n while (!onLine && k < line.length - 1) {\n x = cent.geometry.coordinates[0];\n y = cent.geometry.coordinates[1];\n x1 = line[k][0];\n y1 = line[k][1];\n x2 = line[k + 1][0];\n y2 = line[k + 1][1];\n if (pointOnSegment(x, y, x1, y1, x2, y2)) {\n onLine = true;\n onSurface = true;\n }\n k++;\n }\n j++;\n }\n } else if (geom.type === \"Polygon\" || geom.type === \"MultiPolygon\") {\n if (booleanPointInPolygon(cent, geom)) {\n onSurface = true;\n }\n }\n i++;\n }\n if (onSurface) {\n return cent;\n } else {\n const vertices = featureCollection<Point>([]);\n for (let f = 0; f < fc.features.length; f++) {\n vertices.features = vertices.features.concat(\n explode(fc.features[f]).features\n );\n }\n // Remove distanceToPoint properties from nearestPoint()\n return point(nearestPoint(cent, vertices).geometry.coordinates);\n }\n}\n\n/**\n * Normalizes any GeoJSON to a FeatureCollection\n *\n * @private\n * @name normalize\n * @param {GeoJSON} geojson Any GeoJSON\n * @returns {FeatureCollection} FeatureCollection\n */\nfunction normalize(geojson: AllGeoJSON) {\n if (geojson.type !== \"FeatureCollection\") {\n if (geojson.type !== \"Feature\") {\n return featureCollection([feature(geojson)]);\n }\n return featureCollection([geojson]);\n }\n return geojson;\n}\n\nfunction pointOnSegment(\n x: number,\n y: number,\n x1: number,\n y1: number,\n x2: number,\n y2: number\n) {\n const ab = Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n const ap = Math.sqrt((x - x1) * (x - x1) + (y - y1) * (y - y1));\n const pb = Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y));\n return ab === ap + pb;\n}\n\nexport { pointOnFeature };\nexport default pointOnFeature;\n"],"mappings":";AAEA,SAAS,eAAe;AACxB,SAAS,UAAU,gBAAgB;AACnC,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,SAAS,mBAAmB,SAAS,aAAa;AA4BlD,SAAS,eAAe,SAAqC;AAE3D,QAAM,KAAK,UAAU,OAAO;AAG5B,QAAM,OAAO,SAAS,EAAE;AAGxB,MAAI,YAAY;AAChB,MAAI,IAAI;AACR,SAAO,CAAC,aAAa,IAAI,GAAG,SAAS,QAAQ;AAC3C,UAAM,OAAO,GAAG,SAAS,CAAC,EAAE;AAC5B,QAAI,GAAG,GAAG,IAAI,IAAI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AM,KAAK,MAAM,KAAK,MAAM,KAAK,MAAM,KAAK,EAAE;AAC9D,SAAO,OAAO,KAAK;AACrB;AAGA,IAAO,gBAAQ;","names":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@turf/point-on-feature",
3
- "version": "7.2.0",
4
- "description": "turf point-on-feature module",
3
+ "version": "7.3.0",
4
+ "description": "Takes a Feature or FeatureCollection and returns a Point guaranteed to be on the surface of the feature.",
5
5
  "author": "Turf Authors",
6
6
  "license": "MIT",
7
7
  "bugs": {
@@ -53,26 +53,26 @@
53
53
  "test:tape": "tsx test.ts"
54
54
  },
55
55
  "devDependencies": {
56
- "@turf/meta": "^7.2.0",
57
- "@turf/truncate": "^7.2.0",
56
+ "@turf/meta": "7.3.0",
57
+ "@turf/truncate": "7.3.0",
58
58
  "@types/benchmark": "^2.1.5",
59
- "@types/tape": "^4.13.4",
59
+ "@types/tape": "^5.8.1",
60
60
  "benchmark": "^2.1.4",
61
61
  "npm-run-all": "^4.1.5",
62
62
  "tape": "^5.9.0",
63
- "tsup": "^8.3.5",
64
- "tsx": "^4.19.2",
65
- "typescript": "^5.5.4",
66
- "write-json-file": "^5.0.0"
63
+ "tsup": "^8.4.0",
64
+ "tsx": "^4.19.4",
65
+ "typescript": "^5.8.3",
66
+ "write-json-file": "^6.0.0"
67
67
  },
68
68
  "dependencies": {
69
- "@turf/boolean-point-in-polygon": "^7.2.0",
70
- "@turf/center": "^7.2.0",
71
- "@turf/explode": "^7.2.0",
72
- "@turf/helpers": "^7.2.0",
73
- "@turf/nearest-point": "^7.2.0",
69
+ "@turf/boolean-point-in-polygon": "7.3.0",
70
+ "@turf/center": "7.3.0",
71
+ "@turf/explode": "7.3.0",
72
+ "@turf/helpers": "7.3.0",
73
+ "@turf/nearest-point": "7.3.0",
74
74
  "@types/geojson": "^7946.0.10",
75
75
  "tslib": "^2.8.1"
76
76
  },
77
- "gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
77
+ "gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
78
78
  }
@@ -13,9 +13,8 @@ line. Sometimes referred to as the cross track distance.
13
13
  * `line` **[Feature][1]<[LineString][5]>** GeoJSON Feature or Geometry
14
14
  * `options` **[Object][6]** Optional parameters (optional, default `{}`)
15
15
 
16
- * `options.units` **[string][7]** can be anything supported by turf/convertLength
17
- (ex: degrees, radians, miles, or kilometers) (optional, default `"kilometers"`)
18
- * `options.method` **[string][7]** whether to calculate the distance based on geodesic (spheroid) or
16
+ * `options.units` **Units** Supports all valid Turf [Units][7] (optional, default `"kilometers"`)
17
+ * `options.method` **[string][8]** whether to calculate the distance based on geodesic (spheroid) or
19
18
  planar (flat) method. Valid options are 'geodesic' or 'planar'. (optional, default `"geodesic"`)
20
19
 
21
20
  ### Examples
@@ -42,7 +41,9 @@ Returns **[number][4]** distance between point and line
42
41
 
43
42
  [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
44
43
 
45
- [7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
44
+ [7]: https://turfjs.org/docs/api/types/Units
45
+
46
+ [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
46
47
 
47
48
  <!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run "yarn docs" from the root of the turf project. -->
48
49
 
@@ -71,9 +71,9 @@ function distanceToSegment(p, a, b, options) {
71
71
  function dot(u, v) {
72
72
  return u[0] * v[0] + u[1] * v[1];
73
73
  }
74
- var turf_point_to_line_distance_default = pointToLineDistance;
74
+ var index_default = pointToLineDistance;
75
75
 
76
76
 
77
77
 
78
- exports.default = turf_point_to_line_distance_default; exports.pointToLineDistance = pointToLineDistance;
78
+ exports.default = index_default; exports.pointToLineDistance = pointToLineDistance;
79
79
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-point-to-line-distance/dist/cjs/index.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-_lines.html\nimport { Feature, LineString } from \"geojson\";\nimport {\n convertLength,\n Coord,\n feature,\n lineString,\n point,\n Units,\n} from \"@turf/helpers\";\nimport { nearestPointOnLine } from \"@turf/nearest-point-on-line\";\nimport { featureOf } from \"@turf/invariant\";\nimport { segmentEach } from \"@turf/meta\";\nimport { rhumbDistance } from \"@turf/rhumb-distance\";\n\n/**\n * Calculates the distance between a given point and the nearest point on a\n * line. Sometimes referred to as the cross track distance.\n *\n * @function\n * @param {Feature<Point>|Array<number>} pt Feature or Geometry\n * @param {Feature<LineString>} line GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] can be anything supported by turf/convertLength\n * (ex: degrees, radians, miles, or kilometers)\n * @param {string} [options.method=\"geodesic\"] whether to calculate the distance based on geodesic (spheroid) or\n * planar (flat) method. Valid options are 'geodesic' or 'planar'.\n * @returns {number} distance between point and line\n * @example\n * var pt = turf.point([0, 0]);\n * var line = turf.lineString([[1, 1],[-1, 1]]);\n *\n * var distance = turf.pointToLineDistance(pt, line, {units: 'miles'});\n * //=69.11854715938406\n */\nfunction pointToLineDistance(\n pt: Coord,\n line: Feature<LineString> | LineString,\n options: {\n units?: Units;\n method?: \"geodesic\" | \"planar\";\n } = {}\n): number {\n // Optional parameters\n const method = options.method ?? \"geodesic\";\n const units = options.units ?? \"kilometers\";\n\n // validation\n if (!pt) {\n throw new Error(\"pt is required\");\n }\n if (Array.isArray(pt)) {\n pt = point(pt);\n } else if (pt.type === \"Point\") {\n pt = feature(pt);\n } else {\n featureOf(pt, \"Point\", \"point\");\n }\n\n if (!line) {\n throw new Error(\"line is required\");\n }\n if (Array.isArray(line)) {\n line = lineString(line);\n } else if (line.type === \"LineString\") {\n line = feature(line);\n } else {\n featureOf(line, \"LineString\", \"line\");\n }\n\n let distance = Infinity;\n const p = pt.geometry.coordinates;\n segmentEach(line, (segment) => {\n if (segment) {\n const a = segment.geometry.coordinates[0];\n const b = segment.geometry.coordinates[1];\n const d = distanceToSegment(p, a, b, { method });\n if (d < distance) {\n distance = d;\n }\n }\n });\n return convertLength(distance, \"degrees\", units);\n}\n\n/**\n * Returns the distance between a point P on a segment AB.\n *\n * @private\n * @param {Array<number>} p external point\n * @param {Array<number>} a first segment point\n * @param {Array<number>} b second segment point\n * @param {Object} [options={}] Optional parameters\n * @returns {number} distance\n */\nfunction distanceToSegment(\n p: number[], // point to measure from\n a: number[], // start point of the segment to measure to\n b: number[], // end point of the segment to measure to\n options: {\n method: \"geodesic\" | \"planar\";\n }\n) {\n // Internally just use degrees, and then convert to the user's requested units\n // in the calling function.\n if (options.method === \"geodesic\") {\n // Use nearestPointOnLine to properly calculate distances on a spherical\n // Earth.\n const nearest = nearestPointOnLine(lineString([a, b]).geometry, p, {\n units: \"degrees\",\n });\n return nearest.properties.dist;\n }\n\n // Perform scalar calculations instead using rhumb lines.\n const v = [b[0] - a[0], b[1] - a[1]];\n const w = [p[0] - a[0], p[1] - a[1]];\n\n const c1 = dot(w, v);\n if (c1 <= 0) {\n return rhumbDistance(p, a, { units: \"degrees\" });\n }\n const c2 = dot(v, v);\n if (c2 <= c1) {\n return rhumbDistance(p, b, { units: \"degrees\" });\n }\n const b2 = c1 / c2;\n const Pb = [a[0] + b2 * v[0], a[1] + b2 * v[1]];\n\n return rhumbDistance(p, Pb, { units: \"degrees\" });\n}\n\nfunction dot(u: number[], v: number[]) {\n return u[0] * v[0] + u[1] * v[1];\n}\n\nexport { pointToLineDistance };\nexport default pointToLineDistance;\n"]}
1
+ {"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-point-to-line-distance/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACEA;AACE;AAEA;AACA;AACA;AAAA,wCAEK;AACP,iEAAmC;AACnC,4CAA0B;AAC1B,kCAA4B;AAC5B,qDAA8B;AAqB9B,SAAS,mBAAA,CACP,EAAA,EACA,IAAA,EACA,QAAA,EAGI,CAAC,CAAA,EACG;AAzCV,EAAA,IAAA,E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GAAA,CAAI,GAAA,GAAM,CAAA,EAAG;AACX,IAAA,OAAO,0CAAA,CAAc,EAAG,CAAA,EAAG,EAAE,KAAA,EAAO,UAAU,CAAC,CAAA;AAAA,EACjD;AACA,EAAA,MAAM,GAAA,EAAK,GAAA,CAAI,CAAA,EAAG,CAAC,CAAA;AACnB,EAAA,GAAA,CAAI,GAAA,GAAM,EAAA,EAAI;AACZ,IAAA,OAAO,0CAAA,CAAc,EAAG,CAAA,EAAG,EAAE,KAAA,EAAO,UAAU,CAAC,CAAA;AAAA,EACjD;AACA,EAAA,MAAM,GAAA,EAAK,GAAA,EAAK,EAAA;AAChB,EAAA,MAAM,GAAA,EAAK,CAAC,CAAA,CAAE,CAAC,EAAA,EAAI,GAAA,EAAK,CAAA,CAAE,CAAC,CAAA,EAAG,CAAA,CAAE,CAAC,EAAA,EAAI,GAAA,EAAK,CAAA,CAAE,CAAC,CAAC,CAAA;AAE9C,EAAA,OAAO,0CAAA,CAAc,EAAG,EAAA,EAAI,EAAE,KAAA,EAAO,UAAU,CAAC,CAAA;AAClD;AAEA,SAAS,GAAA,CAAI,CAAA,EAAa,CAAA,EAAa;AACrC,EAAA,OAAO,CAAA,CAAE,CAAC,EAAA,EAAI,CAAA,CAAE,CAAC,EAAA,EAAI,CAAA,CAAE,CAAC,EAAA,EAAI,CAAA,CAAE,CAAC,CAAA;AACjC;AAGA,IAAO,cAAA,EAAQ,mBAAA;AD9Df;AACE;AACA;AACF,mFAAC","file":"/home/runner/work/turf/turf/packages/turf-point-to-line-distance/dist/cjs/index.cjs","sourcesContent":[null,"// Taken from http://geomalgorithms.com/a02-_lines.html\nimport { Feature, LineString } from \"geojson\";\nimport {\n convertLength,\n Coord,\n feature,\n lineString,\n point,\n Units,\n} from \"@turf/helpers\";\nimport { nearestPointOnLine } from \"@turf/nearest-point-on-line\";\nimport { featureOf } from \"@turf/invariant\";\nimport { segmentEach } from \"@turf/meta\";\nimport { rhumbDistance } from \"@turf/rhumb-distance\";\n\n/**\n * Calculates the distance between a given point and the nearest point on a\n * line. Sometimes referred to as the cross track distance.\n *\n * @function\n * @param {Feature<Point>|Array<number>} pt Feature or Geometry\n * @param {Feature<LineString>} line GeoJSON Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {Units} [options.units=\"kilometers\"] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}\n * @param {string} [options.method=\"geodesic\"] whether to calculate the distance based on geodesic (spheroid) or\n * planar (flat) method. Valid options are 'geodesic' or 'planar'.\n * @returns {number} distance between point and line\n * @example\n * var pt = turf.point([0, 0]);\n * var line = turf.lineString([[1, 1],[-1, 1]]);\n *\n * var distance = turf.pointToLineDistance(pt, line, {units: 'miles'});\n * //=69.11854715938406\n */\nfunction pointToLineDistance(\n pt: Coord,\n line: Feature<LineString> | LineString,\n options: {\n units?: Units;\n method?: \"geodesic\" | \"planar\";\n } = {}\n): number {\n // Optional parameters\n const method = options.method ?? \"geodesic\";\n const units = options.units ?? \"kilometers\";\n\n // validation\n if (!pt) {\n throw new Error(\"pt is required\");\n }\n if (Array.isArray(pt)) {\n pt = point(pt);\n } else if (pt.type === \"Point\") {\n pt = feature(pt);\n } else {\n featureOf(pt, \"Point\", \"point\");\n }\n\n if (!line) {\n throw new Error(\"line is required\");\n }\n if (Array.isArray(line)) {\n line = lineString(line);\n } else if (line.type === \"LineString\") {\n line = feature(line);\n } else {\n featureOf(line, \"LineString\", \"line\");\n }\n\n let distance = Infinity;\n const p = pt.geometry.coordinates;\n segmentEach(line, (segment) => {\n if (segment) {\n const a = segment.geometry.coordinates[0];\n const b = segment.geometry.coordinates[1];\n const d = distanceToSegment(p, a, b, { method });\n if (d < distance) {\n distance = d;\n }\n }\n });\n return convertLength(distance, \"degrees\", units);\n}\n\n/**\n * Returns the distance between a point P on a segment AB.\n *\n * @private\n * @param {Array<number>} p external point\n * @param {Array<number>} a first segment point\n * @param {Array<number>} b second segment point\n * @param {Object} [options={}] Optional parameters\n * @returns {number} distance\n */\nfunction distanceToSegment(\n p: number[], // point to measure from\n a: number[], // start point of the segment to measure to\n b: number[], // end point of the segment to measure to\n options: {\n method: \"geodesic\" | \"planar\";\n }\n) {\n // Internally just use degrees, and then convert to the user's requested units\n // in the calling function.\n if (options.method === \"geodesic\") {\n // Use nearestPointOnLine to properly calculate distances on a spherical\n // Earth.\n const nearest = nearestPointOnLine(lineString([a, b]).geometry, p, {\n units: \"degrees\",\n });\n return nearest.properties.dist;\n }\n\n // Perform scalar calculations instead using rhumb lines.\n const v = [b[0] - a[0], b[1] - a[1]];\n const w = [p[0] - a[0], p[1] - a[1]];\n\n const c1 = dot(w, v);\n if (c1 <= 0) {\n return rhumbDistance(p, a, { units: \"degrees\" });\n }\n const c2 = dot(v, v);\n if (c2 <= c1) {\n return rhumbDistance(p, b, { units: \"degrees\" });\n }\n const b2 = c1 / c2;\n const Pb = [a[0] + b2 * v[0], a[1] + b2 * v[1]];\n\n return rhumbDistance(p, Pb, { units: \"degrees\" });\n}\n\nfunction dot(u: number[], v: number[]) {\n return u[0] * v[0] + u[1] * v[1];\n}\n\nexport { pointToLineDistance };\nexport default pointToLineDistance;\n"]}
@@ -9,8 +9,7 @@ import { Coord, Units } from '@turf/helpers';
9
9
  * @param {Feature<Point>|Array<number>} pt Feature or Geometry
10
10
  * @param {Feature<LineString>} line GeoJSON Feature or Geometry
11
11
  * @param {Object} [options={}] Optional parameters
12
- * @param {string} [options.units="kilometers"] can be anything supported by turf/convertLength
13
- * (ex: degrees, radians, miles, or kilometers)
12
+ * @param {Units} [options.units="kilometers"] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}
14
13
  * @param {string} [options.method="geodesic"] whether to calculate the distance based on geodesic (spheroid) or
15
14
  * planar (flat) method. Valid options are 'geodesic' or 'planar'.
16
15
  * @returns {number} distance between point and line
@@ -9,8 +9,7 @@ import { Coord, Units } from '@turf/helpers';
9
9
  * @param {Feature<Point>|Array<number>} pt Feature or Geometry
10
10
  * @param {Feature<LineString>} line GeoJSON Feature or Geometry
11
11
  * @param {Object} [options={}] Optional parameters
12
- * @param {string} [options.units="kilometers"] can be anything supported by turf/convertLength
13
- * (ex: degrees, radians, miles, or kilometers)
12
+ * @param {Units} [options.units="kilometers"] Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}
14
13
  * @param {string} [options.method="geodesic"] whether to calculate the distance based on geodesic (spheroid) or
15
14
  * planar (flat) method. Valid options are 'geodesic' or 'planar'.
16
15
  * @returns {number} distance between point and line
@@ -71,9 +71,9 @@ function distanceToSegment(p, a, b, options) {
71
71
  function dot(u, v) {
72
72
  return u[0] * v[0] + u[1] * v[1];
73
73
  }
74
- var turf_point_to_line_distance_default = pointToLineDistance;
74
+ var index_default = pointToLineDistance;
75
75
  export {
76
- turf_point_to_line_distance_default as default,
76
+ index_default as default,
77
77
  pointToLineDistance
78
78
  };
79
79
  //# sourceMappingURL=index.js.map