node-red-contrib-tak-registration 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@turf/along/README.md +3 -5
- package/node_modules/@turf/along/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/along/dist/cjs/index.d.cts +3 -3
- package/node_modules/@turf/along/dist/esm/index.d.ts +3 -3
- package/node_modules/@turf/along/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/along/package.json +13 -13
- package/node_modules/@turf/angle/dist/cjs/index.cjs +10 -7
- package/node_modules/@turf/angle/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/angle/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/angle/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/angle/dist/esm/index.js +10 -7
- package/node_modules/@turf/angle/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/angle/package.json +15 -15
- package/node_modules/@turf/area/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/area/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/area/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/area/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/area/dist/esm/index.js +1 -2
- package/node_modules/@turf/area/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/area/package.json +10 -10
- package/node_modules/@turf/bbox/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bbox/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/bbox/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/bbox/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bbox/package.json +10 -10
- package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs +9 -18
- package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bbox-clip/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/bbox-clip/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/bbox-clip/dist/esm/index.js +9 -18
- package/node_modules/@turf/bbox-clip/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bbox-clip/package.json +11 -11
- package/node_modules/@turf/bbox-polygon/README.md +6 -6
- package/node_modules/@turf/bbox-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bbox-polygon/dist/cjs/index.d.cts +2 -2
- package/node_modules/@turf/bbox-polygon/dist/esm/index.d.ts +2 -2
- package/node_modules/@turf/bbox-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bbox-polygon/package.json +9 -9
- package/node_modules/@turf/bearing/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bearing/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/bearing/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/bearing/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bearing/package.json +11 -11
- package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bezier-spline/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bezier-spline/package.json +10 -10
- package/node_modules/@turf/boolean-clockwise/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-clockwise/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-clockwise/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-clockwise/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-clockwise/package.json +10 -10
- package/node_modules/@turf/boolean-concave/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-concave/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-concave/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-concave/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-concave/package.json +10 -10
- package/node_modules/@turf/boolean-contains/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-contains/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-contains/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-contains/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-contains/package.json +13 -13
- package/node_modules/@turf/boolean-crosses/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-crosses/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-crosses/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-crosses/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-crosses/package.json +13 -13
- package/node_modules/@turf/boolean-disjoint/README.md +1 -1
- package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs +3 -3
- package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-disjoint/dist/cjs/index.d.cts +3 -3
- package/node_modules/@turf/boolean-disjoint/dist/esm/index.d.ts +3 -3
- package/node_modules/@turf/boolean-disjoint/dist/esm/index.js +3 -3
- package/node_modules/@turf/boolean-disjoint/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-disjoint/package.json +13 -13
- package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-equal/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-equal/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-equal/dist/esm/index.js +1 -2
- package/node_modules/@turf/boolean-equal/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-equal/package.json +11 -11
- package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs +3 -3
- package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-intersects/dist/cjs/index.d.cts +3 -3
- package/node_modules/@turf/boolean-intersects/dist/esm/index.d.ts +3 -3
- package/node_modules/@turf/boolean-intersects/dist/esm/index.js +3 -3
- package/node_modules/@turf/boolean-intersects/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-intersects/package.json +11 -11
- package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-overlap/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-overlap/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-overlap/dist/esm/index.js +3 -6
- package/node_modules/@turf/boolean-overlap/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-overlap/package.json +13 -13
- package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs +7 -14
- package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-parallel/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-parallel/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-parallel/dist/esm/index.js +7 -14
- package/node_modules/@turf/boolean-parallel/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-parallel/package.json +12 -12
- package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +2 -4
- package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-point-in-polygon/package.json +10 -10
- package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs +10 -0
- package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-point-on-line/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js +10 -0
- package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-point-on-line/package.json +10 -10
- package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-touches/dist/cjs/index.d.cts +2 -1
- package/node_modules/@turf/boolean-touches/dist/esm/index.d.ts +2 -1
- package/node_modules/@turf/boolean-touches/dist/esm/index.js +2 -4
- package/node_modules/@turf/boolean-touches/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-touches/package.json +12 -12
- package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs +14 -28
- package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-valid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-valid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-valid/dist/esm/index.js +14 -28
- package/node_modules/@turf/boolean-valid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-valid/package.json +17 -17
- package/node_modules/@turf/boolean-within/dist/cjs/index.cjs +4 -8
- package/node_modules/@turf/boolean-within/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-within/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/boolean-within/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/boolean-within/dist/esm/index.js +4 -8
- package/node_modules/@turf/boolean-within/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-within/package.json +13 -13
- package/node_modules/@turf/buffer/dist/cjs/index.cjs +12 -24
- package/node_modules/@turf/buffer/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/buffer/dist/esm/index.js +12 -24
- package/node_modules/@turf/buffer/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/buffer/package.json +12 -12
- package/node_modules/@turf/center/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/center/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/center/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center/package.json +12 -12
- package/node_modules/@turf/center-mean/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center-mean/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/center-mean/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/center-mean/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center-mean/package.json +13 -13
- package/node_modules/@turf/center-median/dist/cjs/index.cjs +5 -10
- package/node_modules/@turf/center-median/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center-median/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/center-median/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/center-median/dist/esm/index.js +5 -10
- package/node_modules/@turf/center-median/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center-median/package.json +17 -17
- package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center-of-mass/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/center-of-mass/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/center-of-mass/dist/esm/index.js +2 -4
- package/node_modules/@turf/center-of-mass/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center-of-mass/package.json +13 -13
- package/node_modules/@turf/centroid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/centroid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/centroid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/centroid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/centroid/package.json +10 -10
- package/node_modules/@turf/circle/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/circle/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/circle/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/circle/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/circle/package.json +11 -11
- package/node_modules/@turf/clean-coords/dist/cjs/index.cjs +4 -8
- package/node_modules/@turf/clean-coords/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clean-coords/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/clean-coords/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/clean-coords/dist/esm/index.js +4 -8
- package/node_modules/@turf/clean-coords/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clean-coords/package.json +11 -11
- package/node_modules/@turf/clone/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clone/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/clone/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/clone/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clone/package.json +10 -10
- package/node_modules/@turf/clusters/README.md +8 -2
- package/node_modules/@turf/clusters/dist/cjs/index.cjs +9 -18
- package/node_modules/@turf/clusters/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clusters/dist/cjs/index.d.cts +9 -8
- package/node_modules/@turf/clusters/dist/esm/index.d.ts +9 -8
- package/node_modules/@turf/clusters/dist/esm/index.js +9 -18
- package/node_modules/@turf/clusters/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clusters/package.json +10 -10
- package/node_modules/@turf/clusters-dbscan/README.md +38 -15
- package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clusters-dbscan/dist/cjs/index.d.cts +16 -3
- package/node_modules/@turf/clusters-dbscan/dist/esm/index.d.ts +16 -3
- package/node_modules/@turf/clusters-dbscan/dist/esm/index.js +2 -4
- package/node_modules/@turf/clusters-dbscan/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clusters-dbscan/package.json +14 -14
- package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clusters-kmeans/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/clusters-kmeans/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/clusters-kmeans/dist/esm/index.js +2 -4
- package/node_modules/@turf/clusters-kmeans/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clusters-kmeans/package.json +15 -15
- package/node_modules/@turf/collect/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/collect/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/collect/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/collect/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/collect/package.json +11 -11
- package/node_modules/@turf/combine/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/combine/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/combine/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/combine/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/combine/package.json +10 -10
- package/node_modules/@turf/concave/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/concave/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/concave/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/concave/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/concave/package.json +14 -14
- package/node_modules/@turf/convex/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/convex/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/convex/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/convex/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/convex/package.json +10 -10
- package/node_modules/@turf/destination/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/destination/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/destination/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/destination/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/destination/package.json +11 -11
- package/node_modules/@turf/difference/dist/cjs/index.cjs +8 -10
- package/node_modules/@turf/difference/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/difference/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/difference/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/difference/dist/esm/index.js +7 -9
- package/node_modules/@turf/difference/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/difference/package.json +11 -11
- package/node_modules/@turf/dissolve/README.md +11 -12
- package/node_modules/@turf/dissolve/dist/cjs/index.cjs +5 -6
- package/node_modules/@turf/dissolve/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/dissolve/dist/cjs/index.d.cts +3 -3
- package/node_modules/@turf/dissolve/dist/esm/index.d.ts +3 -3
- package/node_modules/@turf/dissolve/dist/esm/index.js +4 -5
- package/node_modules/@turf/dissolve/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/dissolve/package.json +13 -13
- package/node_modules/@turf/distance/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/distance/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/distance/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/distance/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/distance/package.json +10 -10
- package/node_modules/@turf/distance-weight/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/distance-weight/dist/cjs/index.d.cts +3 -1
- package/node_modules/@turf/distance-weight/dist/esm/index.d.ts +3 -1
- package/node_modules/@turf/distance-weight/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/distance-weight/package.json +12 -12
- package/node_modules/@turf/ellipse/dist/cjs/index.cjs +8 -16
- package/node_modules/@turf/ellipse/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/ellipse/dist/esm/index.js +8 -16
- package/node_modules/@turf/ellipse/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/ellipse/package.json +16 -16
- package/node_modules/@turf/envelope/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/envelope/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/envelope/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/envelope/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/envelope/package.json +11 -11
- package/node_modules/@turf/explode/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/explode/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/explode/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/explode/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/explode/package.json +10 -10
- package/node_modules/@turf/flatten/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/flatten/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/flatten/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/flatten/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/flatten/dist/esm/index.js +1 -2
- package/node_modules/@turf/flatten/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/flatten/package.json +10 -10
- package/node_modules/@turf/flip/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/flip/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/flip/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/flip/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/flip/dist/esm/index.js +3 -6
- package/node_modules/@turf/flip/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/flip/package.json +11 -11
- package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs +9 -18
- package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/geojson-rbush/dist/esm/index.js +9 -18
- package/node_modules/@turf/geojson-rbush/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/geojson-rbush/package.json +11 -11
- package/node_modules/@turf/great-circle/README.md +2 -1
- package/node_modules/@turf/great-circle/dist/cjs/index.cjs +7 -2
- package/node_modules/@turf/great-circle/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/great-circle/dist/esm/index.js +7 -2
- package/node_modules/@turf/great-circle/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/great-circle/package.json +9 -9
- package/node_modules/@turf/helpers/README.md +199 -154
- package/node_modules/@turf/helpers/dist/cjs/index.cjs +10 -7
- package/node_modules/@turf/helpers/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/helpers/dist/cjs/index.d.cts +149 -110
- package/node_modules/@turf/helpers/dist/esm/index.d.ts +149 -110
- package/node_modules/@turf/helpers/dist/esm/index.js +10 -7
- package/node_modules/@turf/helpers/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/helpers/package.json +8 -8
- package/node_modules/@turf/hex-grid/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/hex-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/hex-grid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/hex-grid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/hex-grid/dist/esm/index.js +2 -4
- package/node_modules/@turf/hex-grid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/hex-grid/package.json +14 -14
- package/node_modules/@turf/interpolate/README.md +5 -2
- package/node_modules/@turf/interpolate/dist/cjs/index.cjs +10 -15
- package/node_modules/@turf/interpolate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/interpolate/dist/cjs/index.d.cts +3 -1
- package/node_modules/@turf/interpolate/dist/esm/index.d.ts +3 -1
- package/node_modules/@turf/interpolate/dist/esm/index.js +11 -16
- package/node_modules/@turf/interpolate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/interpolate/package.json +18 -18
- package/node_modules/@turf/intersect/dist/cjs/index.cjs +7 -11
- package/node_modules/@turf/intersect/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/intersect/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/intersect/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/intersect/dist/esm/index.js +6 -10
- package/node_modules/@turf/intersect/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/intersect/package.json +11 -11
- package/node_modules/@turf/invariant/README.md +4 -0
- package/node_modules/@turf/invariant/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/invariant/dist/cjs/index.d.cts +6 -6
- package/node_modules/@turf/invariant/dist/esm/index.d.ts +6 -6
- package/node_modules/@turf/invariant/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/invariant/package.json +9 -9
- package/node_modules/@turf/isobands/dist/cjs/index.cjs +10 -20
- package/node_modules/@turf/isobands/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/isobands/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/isobands/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/isobands/dist/esm/index.js +10 -20
- package/node_modules/@turf/isobands/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/isobands/package.json +20 -20
- package/node_modules/@turf/isolines/dist/cjs/index.cjs +10 -20
- package/node_modules/@turf/isolines/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/isolines/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/isolines/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/isolines/dist/esm/index.js +10 -20
- package/node_modules/@turf/isolines/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/isolines/package.json +17 -17
- package/node_modules/@turf/jsts/dist/jsts.min.js +1 -1
- package/node_modules/@turf/jsts/dist/jsts.min.js.map +1 -0
- package/node_modules/@turf/jsts/package.json +17 -17
- package/node_modules/@turf/kinks/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/kinks/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/kinks/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/kinks/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/kinks/package.json +10 -10
- package/node_modules/@turf/length/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/length/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/length/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/length/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/length/package.json +11 -11
- package/node_modules/@turf/line-arc/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-arc/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/line-arc/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/line-arc/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-arc/package.json +12 -12
- package/node_modules/@turf/line-chunk/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/line-chunk/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-chunk/dist/esm/index.js +3 -6
- package/node_modules/@turf/line-chunk/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-chunk/package.json +11 -11
- package/node_modules/@turf/line-intersect/README.md +1 -1
- package/node_modules/@turf/line-intersect/dist/cjs/index.cjs +3 -5
- package/node_modules/@turf/line-intersect/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-intersect/dist/cjs/index.d.cts +2 -2
- package/node_modules/@turf/line-intersect/dist/esm/index.d.ts +2 -2
- package/node_modules/@turf/line-intersect/dist/esm/index.js +3 -5
- package/node_modules/@turf/line-intersect/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-intersect/package.json +10 -10
- package/node_modules/@turf/line-offset/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/line-offset/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-offset/dist/esm/index.js +3 -6
- package/node_modules/@turf/line-offset/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-offset/package.json +10 -10
- package/node_modules/@turf/line-overlap/dist/cjs/index.cjs +10 -20
- package/node_modules/@turf/line-overlap/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-overlap/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/line-overlap/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/line-overlap/dist/esm/index.js +10 -20
- package/node_modules/@turf/line-overlap/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-overlap/package.json +15 -15
- package/node_modules/@turf/line-segment/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-segment/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/line-segment/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/line-segment/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-segment/package.json +11 -11
- package/node_modules/@turf/line-slice/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-slice/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-slice/package.json +10 -10
- package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs +5 -10
- package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-slice-along/dist/esm/index.js +5 -10
- package/node_modules/@turf/line-slice-along/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-slice-along/package.json +12 -12
- package/node_modules/@turf/line-split/dist/cjs/index.cjs +7 -14
- package/node_modules/@turf/line-split/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-split/dist/esm/index.js +7 -14
- package/node_modules/@turf/line-split/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-split/package.json +16 -16
- package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs +4 -8
- package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-to-polygon/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/line-to-polygon/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/line-to-polygon/dist/esm/index.js +4 -8
- package/node_modules/@turf/line-to-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-to-polygon/package.json +12 -12
- package/node_modules/@turf/mask/dist/cjs/index.cjs +7 -7
- package/node_modules/@turf/mask/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/mask/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/mask/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/mask/dist/esm/index.js +6 -6
- package/node_modules/@turf/mask/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/mask/package.json +11 -11
- package/node_modules/@turf/meta/README.md +145 -93
- package/node_modules/@turf/meta/dist/cjs/index.cjs +22 -44
- package/node_modules/@turf/meta/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/meta/dist/esm/index.js +22 -44
- package/node_modules/@turf/meta/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/meta/package.json +7 -7
- package/node_modules/@turf/midpoint/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/midpoint/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/midpoint/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/midpoint/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/midpoint/package.json +12 -12
- package/node_modules/@turf/moran-index/README.md +25 -47
- package/node_modules/@turf/moran-index/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/moran-index/dist/cjs/index.d.cts +16 -8
- package/node_modules/@turf/moran-index/dist/esm/index.d.ts +16 -8
- package/node_modules/@turf/moran-index/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/moran-index/package.json +11 -11
- package/node_modules/@turf/nearest-neighbor-analysis/README.md +50 -21
- package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.d.cts +25 -6
- package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.d.ts +25 -6
- package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/nearest-neighbor-analysis/package.json +17 -17
- package/node_modules/@turf/nearest-point/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/nearest-point/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/nearest-point/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/nearest-point/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/nearest-point/dist/esm/index.js +2 -4
- package/node_modules/@turf/nearest-point/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/nearest-point/package.json +12 -12
- package/node_modules/@turf/nearest-point-on-line/README.md +9 -9
- package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs +97 -53
- package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.d.cts +2 -2
- package/node_modules/@turf/nearest-point-on-line/dist/esm/index.d.ts +2 -2
- package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js +99 -55
- package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/nearest-point-on-line/package.json +15 -18
- package/node_modules/@turf/nearest-point-to-line/README.md +1 -9
- package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/nearest-point-to-line/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/nearest-point-to-line/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/nearest-point-to-line/package.json +14 -14
- package/node_modules/@turf/planepoint/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/planepoint/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/planepoint/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/planepoint/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/planepoint/package.json +10 -10
- package/node_modules/@turf/point-grid/dist/cjs/index.cjs +2 -4
- package/node_modules/@turf/point-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/point-grid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/point-grid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/point-grid/dist/esm/index.js +2 -4
- package/node_modules/@turf/point-grid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/point-grid/package.json +14 -14
- package/node_modules/@turf/point-on-feature/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/point-on-feature/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/point-on-feature/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/point-on-feature/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/point-on-feature/package.json +15 -15
- package/node_modules/@turf/point-to-line-distance/README.md +10 -10
- package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs +21 -19
- package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/point-to-line-distance/dist/cjs/index.d.cts +3 -3
- package/node_modules/@turf/point-to-line-distance/dist/esm/index.d.ts +3 -3
- package/node_modules/@turf/point-to-line-distance/dist/esm/index.js +22 -20
- package/node_modules/@turf/point-to-line-distance/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/point-to-line-distance/package.json +18 -17
- package/node_modules/@turf/point-to-polygon-distance/LICENSE +20 -0
- package/node_modules/@turf/point-to-polygon-distance/README.md +61 -0
- package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs +49 -0
- package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs.map +1 -0
- package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.d.cts +23 -0
- package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.d.ts +23 -0
- package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js +49 -0
- package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js.map +1 -0
- package/node_modules/@turf/point-to-polygon-distance/package.json +80 -0
- package/node_modules/@turf/points-within-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/points-within-polygon/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/points-within-polygon/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/points-within-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/points-within-polygon/package.json +11 -11
- package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygon-smooth/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/polygon-smooth/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/polygon-smooth/dist/esm/index.js +1 -2
- package/node_modules/@turf/polygon-smooth/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/polygon-smooth/package.json +10 -10
- package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygon-tangents/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/polygon-tangents/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/polygon-tangents/dist/esm/index.js +1 -2
- package/node_modules/@turf/polygon-tangents/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/polygon-tangents/package.json +14 -14
- package/node_modules/@turf/polygon-to-line/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygon-to-line/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/polygon-to-line/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/polygon-to-line/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/polygon-to-line/package.json +10 -10
- package/node_modules/@turf/polygonize/dist/cjs/index.cjs +20 -40
- package/node_modules/@turf/polygonize/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygonize/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/polygonize/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/polygonize/dist/esm/index.js +20 -40
- package/node_modules/@turf/polygonize/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/polygonize/package.json +13 -13
- package/node_modules/@turf/projection/README.md +2 -2
- package/node_modules/@turf/projection/dist/cjs/index.cjs +6 -12
- package/node_modules/@turf/projection/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/projection/dist/cjs/index.d.cts +2 -2
- package/node_modules/@turf/projection/dist/esm/index.d.ts +2 -2
- package/node_modules/@turf/projection/dist/esm/index.js +6 -12
- package/node_modules/@turf/projection/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/projection/package.json +12 -12
- package/node_modules/@turf/quadrat-analysis/README.md +10 -10
- package/node_modules/@turf/quadrat-analysis/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/quadrat-analysis/dist/cjs/index.d.cts +4 -4
- package/node_modules/@turf/quadrat-analysis/dist/esm/index.d.ts +4 -4
- package/node_modules/@turf/quadrat-analysis/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/quadrat-analysis/package.json +18 -18
- package/node_modules/@turf/random/README.md +27 -29
- package/node_modules/@turf/random/dist/cjs/index.cjs +1 -3
- package/node_modules/@turf/random/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/random/dist/cjs/index.d.cts +11 -11
- package/node_modules/@turf/random/dist/esm/index.d.ts +11 -11
- package/node_modules/@turf/random/dist/esm/index.js +1 -3
- package/node_modules/@turf/random/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/random/package.json +9 -9
- package/node_modules/@turf/rectangle-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rectangle-grid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/rectangle-grid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/rectangle-grid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/rectangle-grid/package.json +13 -13
- package/node_modules/@turf/rewind/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/rewind/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rewind/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/rewind/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/rewind/dist/esm/index.js +3 -6
- package/node_modules/@turf/rewind/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/rewind/package.json +13 -13
- package/node_modules/@turf/rhumb-bearing/README.md +1 -1
- package/node_modules/@turf/rhumb-bearing/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rhumb-bearing/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/rhumb-bearing/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/rhumb-bearing/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/rhumb-bearing/package.json +11 -11
- package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rhumb-destination/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/rhumb-destination/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/rhumb-destination/dist/esm/index.js +1 -2
- package/node_modules/@turf/rhumb-destination/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/rhumb-destination/package.json +11 -11
- package/node_modules/@turf/rhumb-distance/README.md +1 -1
- package/node_modules/@turf/rhumb-distance/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rhumb-distance/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/rhumb-distance/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/rhumb-distance/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/rhumb-distance/package.json +11 -11
- package/node_modules/@turf/sample/README.md +2 -1
- package/node_modules/@turf/sample/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/sample/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/sample/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/sample/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/sample/dist/esm/index.js +3 -6
- package/node_modules/@turf/sample/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/sample/package.json +9 -9
- package/node_modules/@turf/sector/dist/cjs/index.cjs +4 -8
- package/node_modules/@turf/sector/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/sector/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/sector/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/sector/dist/esm/index.js +4 -8
- package/node_modules/@turf/sector/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/sector/package.json +14 -14
- package/node_modules/@turf/shortest-path/README.md +13 -19
- package/node_modules/@turf/shortest-path/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/shortest-path/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/shortest-path/dist/cjs/index.d.cts +5 -5
- package/node_modules/@turf/shortest-path/dist/esm/index.d.ts +5 -5
- package/node_modules/@turf/shortest-path/dist/esm/index.js +3 -6
- package/node_modules/@turf/shortest-path/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/shortest-path/package.json +18 -18
- package/node_modules/@turf/simplify/dist/cjs/index.cjs +8 -16
- package/node_modules/@turf/simplify/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/simplify/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/simplify/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/simplify/dist/esm/index.js +8 -16
- package/node_modules/@turf/simplify/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/simplify/package.json +13 -13
- package/node_modules/@turf/square/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/square/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/square/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/square/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/square/package.json +10 -10
- package/node_modules/@turf/square-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/square-grid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/square-grid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/square-grid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/square-grid/package.json +12 -12
- package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/standard-deviational-ellipse/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.js +3 -6
- package/node_modules/@turf/standard-deviational-ellipse/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/standard-deviational-ellipse/package.json +16 -16
- package/node_modules/@turf/tag/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/tag/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/tag/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/tag/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/tag/dist/esm/index.js +1 -2
- package/node_modules/@turf/tag/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/tag/package.json +12 -12
- package/node_modules/@turf/tesselate/dist/cjs/index.cjs +1 -2
- package/node_modules/@turf/tesselate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/tesselate/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/tesselate/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/tesselate/dist/esm/index.js +1 -2
- package/node_modules/@turf/tesselate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/tesselate/package.json +9 -9
- package/node_modules/@turf/tin/dist/cjs/index.cjs +13 -14
- package/node_modules/@turf/tin/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/tin/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/tin/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/tin/dist/esm/index.js +13 -14
- package/node_modules/@turf/tin/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/tin/package.json +9 -9
- package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs +4 -8
- package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/transform-rotate/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/transform-rotate/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/transform-rotate/dist/esm/index.js +4 -8
- package/node_modules/@turf/transform-rotate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/transform-rotate/package.json +17 -17
- package/node_modules/@turf/transform-scale/dist/cjs/index.cjs +18 -12
- package/node_modules/@turf/transform-scale/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/transform-scale/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/transform-scale/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/transform-scale/dist/esm/index.js +18 -12
- package/node_modules/@turf/transform-scale/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/transform-scale/package.json +21 -21
- package/node_modules/@turf/transform-translate/dist/cjs/index.cjs +4 -8
- package/node_modules/@turf/transform-translate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/transform-translate/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/transform-translate/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/transform-translate/dist/esm/index.js +4 -8
- package/node_modules/@turf/transform-translate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/transform-translate/package.json +14 -14
- package/node_modules/@turf/triangle-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/triangle-grid/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/triangle-grid/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/triangle-grid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/triangle-grid/package.json +13 -13
- package/node_modules/@turf/truncate/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/truncate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/truncate/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/truncate/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/truncate/dist/esm/index.js +3 -6
- package/node_modules/@turf/truncate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/truncate/package.json +10 -10
- package/node_modules/@turf/turf/dist/cjs/index.cjs +3 -1
- package/node_modules/@turf/turf/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/turf/dist/cjs/index.d.cts +1 -0
- package/node_modules/@turf/turf/dist/esm/index.d.ts +1 -0
- package/node_modules/@turf/turf/dist/esm/index.js +2 -0
- package/node_modules/@turf/turf/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/turf/package.json +126 -125
- package/node_modules/@turf/turf/turf.min.js +3 -26
- package/node_modules/@turf/union/README.md +44 -24
- package/node_modules/@turf/union/dist/cjs/index.cjs +9 -12
- package/node_modules/@turf/union/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/union/dist/cjs/index.d.cts +40 -21
- package/node_modules/@turf/union/dist/esm/index.d.ts +40 -21
- package/node_modules/@turf/union/dist/esm/index.js +8 -11
- package/node_modules/@turf/union/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/union/package.json +11 -11
- package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs +14 -28
- package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/unkink-polygon/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/unkink-polygon/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/unkink-polygon/dist/esm/index.js +14 -28
- package/node_modules/@turf/unkink-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/unkink-polygon/package.json +13 -13
- package/node_modules/@turf/voronoi/dist/cjs/index.cjs +3 -6
- package/node_modules/@turf/voronoi/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/voronoi/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/voronoi/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/voronoi/dist/esm/index.js +3 -6
- package/node_modules/@turf/voronoi/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/voronoi/package.json +11 -11
- package/node_modules/@types/geojson/README.md +1 -1
- package/node_modules/@types/geojson/index.d.ts +4 -1
- package/node_modules/@types/geojson/package.json +4 -3
- package/node_modules/@types/node/README.md +2 -2
- package/node_modules/@types/node/assert.d.ts +2 -2
- package/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +23 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/node_modules/@types/node/crypto.d.ts +33 -9
- package/node_modules/@types/node/events.d.ts +3 -3
- package/node_modules/@types/node/fs/promises.d.ts +16 -5
- package/node_modules/@types/node/fs.d.ts +14 -8
- package/node_modules/@types/node/globals.d.ts +25 -54
- package/node_modules/@types/node/http.d.ts +38 -1
- package/node_modules/@types/node/http2.d.ts +4 -1
- package/node_modules/@types/node/https.d.ts +0 -1
- package/node_modules/@types/node/index.d.ts +8 -10
- package/node_modules/@types/node/module.d.ts +112 -4
- package/node_modules/@types/node/net.d.ts +3 -0
- package/node_modules/@types/node/package.json +5 -9
- package/node_modules/@types/node/perf_hooks.d.ts +24 -0
- package/node_modules/@types/node/process.d.ts +96 -12
- package/node_modules/@types/node/readline/promises.d.ts +14 -2
- package/node_modules/@types/node/readline.d.ts +58 -9
- package/node_modules/@types/node/sqlite.d.ts +30 -9
- package/node_modules/@types/node/stream/promises.d.ts +8 -1
- package/node_modules/@types/node/stream/web.d.ts +5 -2
- package/node_modules/@types/node/stream.d.ts +2 -2
- package/node_modules/@types/node/test.d.ts +155 -5
- package/node_modules/@types/node/timers/promises.d.ts +1 -1
- package/node_modules/@types/node/tls.d.ts +6 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +8 -10
- package/node_modules/@types/node/url.d.ts +7 -4
- package/node_modules/@types/node/util.d.ts +80 -10
- package/node_modules/@types/node/v8.d.ts +1 -1
- package/node_modules/@types/node/vm.d.ts +81 -27
- package/node_modules/@types/node/worker_threads.d.ts +34 -1
- package/node_modules/axios/CHANGELOG.md +49 -0
- package/node_modules/axios/README.md +20 -8
- package/node_modules/axios/dist/axios.js +34 -63
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -1
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +40 -71
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +40 -71
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +1 -1
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +45 -75
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +5 -1
- package/node_modules/axios/index.d.ts +8 -1
- package/node_modules/axios/lib/adapters/http.js +4 -4
- package/node_modules/axios/lib/core/Axios.js +7 -2
- package/node_modules/axios/lib/core/mergeConfig.js +5 -5
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/buildURL.js +7 -1
- package/node_modules/axios/lib/helpers/formDataToStream.js +2 -2
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +12 -65
- package/node_modules/axios/lib/helpers/validator.js +8 -0
- package/node_modules/axios/package.json +3 -3
- package/node_modules/bignumber.js/CHANGELOG.md +295 -0
- package/node_modules/bignumber.js/LICENCE.md +26 -0
- package/node_modules/bignumber.js/README.md +286 -0
- package/node_modules/bignumber.js/bignumber.d.ts +1831 -0
- package/node_modules/bignumber.js/bignumber.js +2922 -0
- package/node_modules/bignumber.js/bignumber.mjs +2907 -0
- package/node_modules/bignumber.js/doc/API.html +2249 -0
- package/node_modules/bignumber.js/package.json +50 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +4 -0
- package/node_modules/fast-xml-parser/README.md +3 -2
- package/node_modules/fast-xml-parser/package.json +1 -1
- package/node_modules/fast-xml-parser/src/v5/XmlPartReader.js +21 -17
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +1 -0
- package/node_modules/long/index.d.ts +1 -456
- package/node_modules/long/package.json +1 -1
- package/node_modules/long/umd/index.d.ts +456 -1
- package/node_modules/point-in-polygon-hao/README.md +8 -7
- package/node_modules/point-in-polygon-hao/dist/cjs/index.cjs +322 -0
- package/node_modules/point-in-polygon-hao/dist/esm/index.d.ts +10 -0
- package/node_modules/point-in-polygon-hao/dist/esm/index.js +56 -0
- package/node_modules/point-in-polygon-hao/dist/pointInPolygon.js +286 -42
- package/node_modules/point-in-polygon-hao/dist/pointInPolygon.min.js +1 -1
- package/node_modules/point-in-polygon-hao/package.json +24 -20
- package/node_modules/polyclip-ts/LICENSE +21 -0
- package/node_modules/{polygon-clipping → polyclip-ts}/README.md +35 -36
- package/node_modules/polyclip-ts/dist/cjs/index.cjs +1179 -0
- package/node_modules/polyclip-ts/dist/cjs/index.cjs.map +1 -0
- package/node_modules/polyclip-ts/dist/cjs/index.d.cts +12 -0
- package/node_modules/polyclip-ts/dist/esm/index.d.ts +12 -0
- package/node_modules/polyclip-ts/dist/esm/index.js +1138 -0
- package/node_modules/polyclip-ts/dist/esm/index.js.map +1 -0
- package/node_modules/polyclip-ts/dist/polyclip-ts.umd.js +4811 -0
- package/node_modules/polyclip-ts/dist/polyclip-ts.umd.min.js +2 -0
- package/node_modules/polyclip-ts/package.json +72 -0
- package/node_modules/splaytree-ts/LICENSE +29 -0
- package/node_modules/splaytree-ts/README.md +296 -0
- package/node_modules/splaytree-ts/dist/cjs/index.cjs +714 -0
- package/node_modules/splaytree-ts/dist/cjs/index.cjs.map +1 -0
- package/node_modules/splaytree-ts/dist/cjs/index.d.cts +105 -0
- package/node_modules/splaytree-ts/dist/esm/index.d.ts +105 -0
- package/node_modules/splaytree-ts/dist/esm/index.js +688 -0
- package/node_modules/splaytree-ts/dist/esm/index.js.map +1 -0
- package/node_modules/splaytree-ts/dist/splaytree-ts.umd.js +736 -0
- package/node_modules/splaytree-ts/dist/splaytree-ts.umd.min.js +2 -0
- package/node_modules/splaytree-ts/package.json +59 -0
- package/node_modules/tslib/modules/index.d.ts +1 -0
- package/node_modules/tslib/modules/index.js +2 -0
- package/node_modules/tslib/package.json +1 -1
- package/node_modules/tslib/tslib.d.ts +7 -0
- package/node_modules/tslib/tslib.es6.js +24 -1
- package/node_modules/tslib/tslib.es6.mjs +24 -1
- package/node_modules/tslib/tslib.js +56 -1
- package/node_modules/undici-types/eventsource.d.ts +0 -2
- package/node_modules/undici-types/filereader.d.ts +1 -1
- package/node_modules/undici-types/interceptors.d.ts +3 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/patch.d.ts +0 -38
- package/node_modules/undici-types/websocket.d.ts +0 -2
- package/node_modules/uuid/README.md +82 -156
- package/node_modules/uuid/dist/cjs/index.d.ts +15 -0
- package/node_modules/uuid/dist/cjs/index.js +31 -0
- package/node_modules/uuid/dist/cjs/max.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/max.js +3 -0
- package/node_modules/uuid/dist/cjs/md5.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/md5.js +13 -0
- package/node_modules/uuid/dist/cjs/native.d.ts +6 -0
- package/node_modules/uuid/dist/cjs/native.js +4 -0
- package/node_modules/uuid/dist/cjs/nil.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/nil.js +3 -0
- package/node_modules/uuid/dist/cjs/package.json +1 -0
- package/node_modules/uuid/dist/cjs/parse.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/parse.js +11 -0
- package/node_modules/uuid/dist/cjs/regex.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/regex.js +3 -0
- package/node_modules/uuid/dist/cjs/rng.d.ts +1 -0
- package/node_modules/uuid/dist/cjs/rng.js +13 -0
- package/node_modules/uuid/dist/cjs/sha1.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/sha1.js +13 -0
- package/node_modules/uuid/dist/cjs/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/cjs/stringify.js +39 -0
- package/node_modules/uuid/dist/cjs/types.d.ts +21 -0
- package/node_modules/uuid/dist/cjs/types.js +2 -0
- package/node_modules/uuid/dist/cjs/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/cjs/uuid-bin.js +72 -0
- package/node_modules/uuid/dist/cjs/v1.d.ts +11 -0
- package/node_modules/uuid/dist/cjs/v1.js +87 -0
- package/node_modules/uuid/dist/cjs/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/v1ToV6.js +13 -0
- package/node_modules/uuid/dist/cjs/v3.d.ts +9 -0
- package/node_modules/uuid/dist/cjs/v3.js +14 -0
- package/node_modules/uuid/dist/cjs/v35.d.ts +7 -0
- package/node_modules/uuid/dist/cjs/v35.js +41 -0
- package/node_modules/uuid/dist/cjs/v4.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/v4.js +29 -0
- package/node_modules/uuid/dist/cjs/v5.d.ts +9 -0
- package/node_modules/uuid/dist/cjs/v5.js +14 -0
- package/node_modules/uuid/dist/cjs/v6.d.ts +4 -0
- package/node_modules/uuid/dist/cjs/v6.js +19 -0
- package/node_modules/uuid/dist/cjs/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/v6ToV1.js +13 -0
- package/node_modules/uuid/dist/cjs/v7.d.ts +9 -0
- package/node_modules/uuid/dist/cjs/v7.js +69 -0
- package/node_modules/uuid/dist/cjs/validate.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/validate.js +7 -0
- package/node_modules/uuid/dist/cjs/version.d.ts +2 -0
- package/node_modules/uuid/dist/cjs/version.js +10 -0
- package/node_modules/uuid/dist/cjs-browser/index.d.ts +15 -0
- package/node_modules/uuid/dist/cjs-browser/index.js +31 -0
- package/node_modules/uuid/dist/cjs-browser/max.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/max.js +3 -0
- package/node_modules/uuid/dist/cjs-browser/md5.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/md5.js +137 -0
- package/node_modules/uuid/dist/cjs-browser/native.d.ts +4 -0
- package/node_modules/uuid/dist/cjs-browser/native.js +4 -0
- package/node_modules/uuid/dist/cjs-browser/nil.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/nil.js +3 -0
- package/node_modules/uuid/dist/cjs-browser/package.json +1 -0
- package/node_modules/uuid/dist/cjs-browser/parse.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/parse.js +11 -0
- package/node_modules/uuid/dist/cjs-browser/regex.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/regex.js +3 -0
- package/node_modules/uuid/dist/cjs-browser/rng.d.ts +1 -0
- package/node_modules/uuid/dist/cjs-browser/rng.js +14 -0
- package/node_modules/uuid/dist/cjs-browser/sha1.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/sha1.js +72 -0
- package/node_modules/uuid/dist/cjs-browser/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/cjs-browser/stringify.js +39 -0
- package/node_modules/uuid/dist/cjs-browser/types.d.ts +21 -0
- package/node_modules/uuid/dist/cjs-browser/types.js +2 -0
- package/node_modules/uuid/dist/cjs-browser/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/cjs-browser/uuid-bin.js +72 -0
- package/node_modules/uuid/dist/cjs-browser/v1.d.ts +11 -0
- package/node_modules/uuid/dist/cjs-browser/v1.js +87 -0
- package/node_modules/uuid/dist/cjs-browser/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/v1ToV6.js +13 -0
- package/node_modules/uuid/dist/cjs-browser/v3.d.ts +9 -0
- package/node_modules/uuid/dist/cjs-browser/v3.js +14 -0
- package/node_modules/uuid/dist/cjs-browser/v35.d.ts +7 -0
- package/node_modules/uuid/dist/cjs-browser/v35.js +41 -0
- package/node_modules/uuid/dist/cjs-browser/v4.d.ts +4 -0
- package/node_modules/uuid/dist/cjs-browser/v4.js +29 -0
- package/node_modules/uuid/dist/cjs-browser/v5.d.ts +9 -0
- package/node_modules/uuid/dist/cjs-browser/v5.js +14 -0
- package/node_modules/uuid/dist/cjs-browser/v6.d.ts +4 -0
- package/node_modules/uuid/dist/cjs-browser/v6.js +19 -0
- package/node_modules/uuid/dist/cjs-browser/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/v6ToV1.js +13 -0
- package/node_modules/uuid/dist/cjs-browser/v7.d.ts +9 -0
- package/node_modules/uuid/dist/cjs-browser/v7.js +69 -0
- package/node_modules/uuid/dist/cjs-browser/validate.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/validate.js +7 -0
- package/node_modules/uuid/dist/cjs-browser/version.d.ts +2 -0
- package/node_modules/uuid/dist/cjs-browser/version.js +10 -0
- package/node_modules/uuid/dist/esm/bin/uuid +2 -0
- package/node_modules/uuid/dist/esm/index.d.ts +15 -0
- package/node_modules/uuid/dist/{esm-node → esm}/index.js +1 -1
- package/node_modules/uuid/dist/esm/max.d.ts +2 -0
- package/node_modules/uuid/dist/esm/max.js +1 -0
- package/node_modules/uuid/dist/esm/md5.d.ts +4 -0
- package/node_modules/uuid/dist/esm/md5.js +11 -0
- package/node_modules/uuid/dist/esm/native.d.ts +6 -0
- package/node_modules/uuid/dist/esm/native.js +2 -0
- package/node_modules/uuid/dist/esm/nil.d.ts +2 -0
- package/node_modules/uuid/dist/esm/nil.js +1 -0
- package/node_modules/uuid/dist/esm/parse.d.ts +2 -0
- package/node_modules/uuid/dist/esm/parse.js +9 -0
- package/node_modules/uuid/dist/esm/regex.d.ts +2 -0
- package/node_modules/uuid/dist/{esm-node → esm}/regex.js +1 -1
- package/node_modules/uuid/dist/esm/rng.d.ts +1 -0
- package/node_modules/uuid/dist/esm/rng.js +10 -0
- package/node_modules/uuid/dist/esm/sha1.d.ts +4 -0
- package/node_modules/uuid/dist/esm/sha1.js +11 -0
- package/node_modules/uuid/dist/esm/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/esm/stringify.js +35 -0
- package/node_modules/uuid/dist/esm/types.d.ts +21 -0
- package/node_modules/uuid/dist/esm/types.js +1 -0
- package/node_modules/uuid/dist/esm/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/esm/uuid-bin.js +70 -0
- package/node_modules/uuid/dist/esm/v1.d.ts +11 -0
- package/node_modules/uuid/dist/esm/v1.js +83 -0
- package/node_modules/uuid/dist/esm/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/esm/v1ToV6.js +10 -0
- package/node_modules/uuid/dist/esm/v3.d.ts +9 -0
- package/node_modules/uuid/dist/esm/v3.js +9 -0
- package/node_modules/uuid/dist/esm/v35.d.ts +7 -0
- package/node_modules/uuid/dist/esm/v35.js +36 -0
- package/node_modules/uuid/dist/esm/v4.d.ts +4 -0
- package/node_modules/uuid/dist/esm/v4.js +27 -0
- package/node_modules/uuid/dist/esm/v5.d.ts +9 -0
- package/node_modules/uuid/dist/esm/v5.js +9 -0
- package/node_modules/uuid/dist/esm/v6.d.ts +4 -0
- package/node_modules/uuid/dist/esm/v6.js +17 -0
- package/node_modules/uuid/dist/esm/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/esm/v6ToV1.js +10 -0
- package/node_modules/uuid/dist/esm/v7.d.ts +9 -0
- package/node_modules/uuid/dist/esm/v7.js +65 -0
- package/node_modules/uuid/dist/esm/validate.d.ts +2 -0
- package/node_modules/uuid/dist/esm/validate.js +5 -0
- package/node_modules/uuid/dist/esm/version.d.ts +2 -0
- package/node_modules/uuid/dist/esm/version.js +8 -0
- package/node_modules/uuid/dist/esm-browser/index.d.ts +15 -0
- package/node_modules/uuid/dist/esm-browser/index.js +1 -1
- package/node_modules/uuid/dist/esm-browser/max.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/max.js +1 -1
- package/node_modules/uuid/dist/esm-browser/md5.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/md5.js +113 -172
- package/node_modules/uuid/dist/esm-browser/native.d.ts +4 -0
- package/node_modules/uuid/dist/esm-browser/native.js +2 -4
- package/node_modules/uuid/dist/esm-browser/nil.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/nil.js +1 -1
- package/node_modules/uuid/dist/esm-browser/parse.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/parse.js +6 -34
- package/node_modules/uuid/dist/esm-browser/regex.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/regex.js +1 -1
- package/node_modules/uuid/dist/esm-browser/rng.d.ts +1 -0
- package/node_modules/uuid/dist/esm-browser/rng.js +8 -14
- package/node_modules/uuid/dist/esm-browser/sha1.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/sha1.js +62 -68
- package/node_modules/uuid/dist/esm-browser/stringify.d.ts +3 -0
- package/node_modules/uuid/dist/esm-browser/stringify.js +29 -25
- package/node_modules/uuid/dist/esm-browser/types.d.ts +21 -0
- package/node_modules/uuid/dist/esm-browser/types.js +1 -0
- package/node_modules/uuid/dist/esm-browser/uuid-bin.d.ts +1 -0
- package/node_modules/uuid/dist/esm-browser/uuid-bin.js +70 -0
- package/node_modules/uuid/dist/esm-browser/v1.d.ts +11 -0
- package/node_modules/uuid/dist/esm-browser/v1.js +75 -117
- package/node_modules/uuid/dist/esm-browser/v1ToV6.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/v1ToV6.js +6 -16
- package/node_modules/uuid/dist/esm-browser/v3.d.ts +9 -0
- package/node_modules/uuid/dist/esm-browser/v3.js +8 -3
- package/node_modules/uuid/dist/esm-browser/v35.d.ts +7 -0
- package/node_modules/uuid/dist/esm-browser/v35.js +28 -47
- package/node_modules/uuid/dist/esm-browser/v4.d.ts +4 -0
- package/node_modules/uuid/dist/esm-browser/v4.js +21 -19
- package/node_modules/uuid/dist/esm-browser/v5.d.ts +9 -0
- package/node_modules/uuid/dist/esm-browser/v5.js +8 -3
- package/node_modules/uuid/dist/esm-browser/v6.d.ts +4 -0
- package/node_modules/uuid/dist/esm-browser/v6.js +13 -32
- package/node_modules/uuid/dist/esm-browser/v6ToV1.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/v6ToV1.js +5 -15
- package/node_modules/uuid/dist/esm-browser/v7.d.ts +9 -0
- package/node_modules/uuid/dist/esm-browser/v7.js +58 -139
- package/node_modules/uuid/dist/esm-browser/validate.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/validate.js +2 -2
- package/node_modules/uuid/dist/esm-browser/version.d.ts +2 -0
- package/node_modules/uuid/dist/esm-browser/version.js +5 -5
- package/node_modules/uuid/package.json +65 -75
- package/package.json +6 -6
- package/tak-registration.js +1 -4
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- package/node_modules/point-in-polygon-hao/.eslintrc +0 -10
- package/node_modules/point-in-polygon-hao/CHANGES.md +0 -8
- package/node_modules/point-in-polygon-hao/FUNDING.yml +0 -2
- package/node_modules/point-in-polygon-hao/dist/pointInPolygon.mjs +0 -76
- package/node_modules/point-in-polygon-hao/rollup.config.js +0 -19
- package/node_modules/point-in-polygon-hao/src/index.js +0 -74
- package/node_modules/polygon-clipping/LICENSE.md +0 -11
- package/node_modules/polygon-clipping/dist/polygon-clipping.cjs.js +0 -1803
- package/node_modules/polygon-clipping/dist/polygon-clipping.d.ts +0 -14
- package/node_modules/polygon-clipping/dist/polygon-clipping.esm.js +0 -1532
- package/node_modules/polygon-clipping/dist/polygon-clipping.umd.js +0 -2496
- package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js +0 -24
- package/node_modules/polygon-clipping/dist/polygon-clipping.umd.min.js.map +0 -1
- package/node_modules/polygon-clipping/package.json +0 -79
- package/node_modules/splaytree/Readme.md +0 -222
- package/node_modules/splaytree/dist/splay.esm.js +0 -686
- package/node_modules/splaytree/dist/splay.esm.js.map +0 -1
- package/node_modules/splaytree/dist/splay.js +0 -694
- package/node_modules/splaytree/dist/splay.js.map +0 -1
- package/node_modules/splaytree/package.json +0 -91
- package/node_modules/splaytree/src/index.ts +0 -679
- package/node_modules/splaytree/src/node.ts +0 -15
- package/node_modules/splaytree/src/types.ts +0 -2
- package/node_modules/splaytree/typings/index.d.ts +0 -82
- package/node_modules/splaytree/typings/node.d.ts +0 -8
- package/node_modules/splaytree/typings/types.d.ts +0 -2
- package/node_modules/uuid/CHANGELOG.md +0 -292
- package/node_modules/uuid/CONTRIBUTING.md +0 -18
- package/node_modules/uuid/dist/bin/uuid +0 -2
- package/node_modules/uuid/dist/commonjs-browser/index.js +0 -104
- package/node_modules/uuid/dist/commonjs-browser/max.js +0 -7
- package/node_modules/uuid/dist/commonjs-browser/md5.js +0 -200
- package/node_modules/uuid/dist/commonjs-browser/native.js +0 -10
- package/node_modules/uuid/dist/commonjs-browser/nil.js +0 -7
- package/node_modules/uuid/dist/commonjs-browser/parse.js +0 -44
- package/node_modules/uuid/dist/commonjs-browser/regex.js +0 -7
- package/node_modules/uuid/dist/commonjs-browser/rng.js +0 -23
- package/node_modules/uuid/dist/commonjs-browser/sha1.js +0 -82
- package/node_modules/uuid/dist/commonjs-browser/stringify.js +0 -38
- package/node_modules/uuid/dist/commonjs-browser/v1.js +0 -131
- package/node_modules/uuid/dist/commonjs-browser/v1ToV6.js +0 -26
- package/node_modules/uuid/dist/commonjs-browser/v3.js +0 -11
- package/node_modules/uuid/dist/commonjs-browser/v35.js +0 -63
- package/node_modules/uuid/dist/commonjs-browser/v4.js +0 -32
- package/node_modules/uuid/dist/commonjs-browser/v5.js +0 -11
- package/node_modules/uuid/dist/commonjs-browser/v6.js +0 -42
- package/node_modules/uuid/dist/commonjs-browser/v6ToV1.js +0 -26
- package/node_modules/uuid/dist/commonjs-browser/v7.js +0 -152
- package/node_modules/uuid/dist/commonjs-browser/validate.js +0 -12
- package/node_modules/uuid/dist/commonjs-browser/version.js +0 -15
- package/node_modules/uuid/dist/esm-node/max.js +0 -1
- package/node_modules/uuid/dist/esm-node/md5.js +0 -10
- package/node_modules/uuid/dist/esm-node/native.js +0 -4
- package/node_modules/uuid/dist/esm-node/nil.js +0 -1
- package/node_modules/uuid/dist/esm-node/parse.js +0 -37
- package/node_modules/uuid/dist/esm-node/rng.js +0 -10
- package/node_modules/uuid/dist/esm-node/sha1.js +0 -10
- package/node_modules/uuid/dist/esm-node/stringify.js +0 -31
- package/node_modules/uuid/dist/esm-node/v1.js +0 -125
- package/node_modules/uuid/dist/esm-node/v1ToV6.js +0 -20
- package/node_modules/uuid/dist/esm-node/v3.js +0 -4
- package/node_modules/uuid/dist/esm-node/v35.js +0 -55
- package/node_modules/uuid/dist/esm-node/v4.js +0 -25
- package/node_modules/uuid/dist/esm-node/v5.js +0 -4
- package/node_modules/uuid/dist/esm-node/v6.js +0 -32
- package/node_modules/uuid/dist/esm-node/v6ToV1.js +0 -20
- package/node_modules/uuid/dist/esm-node/v7.js +0 -146
- package/node_modules/uuid/dist/esm-node/validate.js +0 -5
- package/node_modules/uuid/dist/esm-node/version.js +0 -8
- package/node_modules/uuid/dist/index.js +0 -104
- package/node_modules/uuid/dist/max.js +0 -7
- package/node_modules/uuid/dist/md5-browser.js +0 -200
- package/node_modules/uuid/dist/md5.js +0 -17
- package/node_modules/uuid/dist/native-browser.js +0 -10
- package/node_modules/uuid/dist/native.js +0 -11
- package/node_modules/uuid/dist/nil.js +0 -7
- package/node_modules/uuid/dist/parse.js +0 -44
- package/node_modules/uuid/dist/regex.js +0 -7
- package/node_modules/uuid/dist/rng-browser.js +0 -23
- package/node_modules/uuid/dist/rng.js +0 -17
- package/node_modules/uuid/dist/sha1-browser.js +0 -82
- package/node_modules/uuid/dist/sha1.js +0 -17
- package/node_modules/uuid/dist/stringify.js +0 -38
- package/node_modules/uuid/dist/uuid-bin.js +0 -75
- package/node_modules/uuid/dist/v1.js +0 -131
- package/node_modules/uuid/dist/v1ToV6.js +0 -26
- package/node_modules/uuid/dist/v3.js +0 -11
- package/node_modules/uuid/dist/v35.js +0 -63
- package/node_modules/uuid/dist/v4.js +0 -32
- package/node_modules/uuid/dist/v5.js +0 -11
- package/node_modules/uuid/dist/v6.js +0 -38
- package/node_modules/uuid/dist/v6ToV1.js +0 -26
- package/node_modules/uuid/dist/v7.js +0 -152
- package/node_modules/uuid/dist/validate.js +0 -12
- package/node_modules/uuid/dist/version.js +0 -15
- package/node_modules/uuid/wrapper.mjs +0 -15
- /package/node_modules/point-in-polygon-hao/{index.d.ts → dist/cjs/index.d.cts} +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/LICENSE +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/README.md +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/esm/incircle.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/esm/insphere.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/esm/orient2d.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/esm/orient3d.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/esm/util.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/index.d.ts +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/index.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/package.json +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/incircle.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/incircle.min.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/insphere.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/insphere.min.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/orient2d.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/orient2d.min.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/orient3d.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/orient3d.min.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/predicates.js +0 -0
- /package/node_modules/{polygon-clipping → point-in-polygon-hao}/node_modules/robust-predicates/umd/predicates.min.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"names":[],"mappings":";AAMA,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AA+BlC,SAAS,WAGP,SAAkC,QAAsC;AAExE,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,QAAQ,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC;AACvD,MAAI,WAAW,UAAa,WAAW;AACrC,UAAM,IAAI,MAAM,oBAAoB;AAGtC,MAAI,WAA4B,CAAC;AACjC,cAAkB,SAAS,SAAU,SAAS;AAC5C,QAAI,YAAY,QAAQ,YAAY,MAAM;AAAG,eAAS,KAAK,OAAO;AAAA,EACpE,CAAC;AACD,SAAO,kBAAkB,QAAQ;AACnC;AAmDA,SAAS,YAIP,SACA,UACA,UAKM;AAEN,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,QAAQ,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC;AACvD,MAAI,aAAa,UAAa,aAAa;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAGxC,MAAI,OAAO,WAAW,SAAS,QAAQ;AACvC,MAAI,SAAS,OAAO,KAAK,IAAI;AAC7B,WAAS,QAAQ,GAAG,QAAQ,OAAO,QAAQ,SAAS;AAClD,QAAI,QAAQ,OAAO,KAAK;AACxB,QAAI,MAAM,KAAK,KAAK;AACpB,QAAI,WAAW,CAAC;AAChB,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,eAAS,KAAK,QAAQ,SAA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,OAAO,OAAO,KAAK,MAAM;AAC7B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,MAAM,KAAK,CAAC;AAChB,QAAI,WAAW,GAAG,MAAM,OAAO,GAAG;AAAG,aAAO;AAAA,EAC9C;AACA,SAAO;AACT;AAaA,SAAS,iBACP,YACA,MACK;AACL,MAAI,CAAC;AAAM,WAAO,CAAC;AACnB,MAAI,CAAC,KAAK;AAAQ,WAAO,CAAC;AAE1B,MAAI,gBAAqC,CAAC;AAC1C,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,MAAM,KAAK,CAAC;AAChB,QAAI,OAAO,UAAU,eAAe,KAAK,YAAY,GAAG;AACtD,oBAAc,GAAG,IAAI,WAAW,GAAG;AAAA,EACvC;AACA,SAAO;AACT","sourcesContent":["import {\n Feature,\n FeatureCollection,\n GeoJsonProperties,\n GeometryObject,\n} from \"geojson\";\nimport { featureEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\n\n/**\n * Get Cluster\n *\n * @name getCluster\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {*} filter Filter used on GeoJSON properties to get Cluster\n * @returns {FeatureCollection} Single Cluster filtered by GeoJSON Properties\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {'marker-symbol': 'circle'}),\n * turf.point([2, 4], {'marker-symbol': 'star'}),\n * turf.point([3, 6], {'marker-symbol': 'star'}),\n * turf.point([5, 1], {'marker-symbol': 'square'}),\n * turf.point([4, 2], {'marker-symbol': 'circle'})\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Retrieve first cluster (0)\n * var cluster = turf.getCluster(clustered, {cluster: 0});\n * //= cluster\n *\n * // Retrieve cluster based on custom properties\n * turf.getCluster(clustered, {'marker-symbol': 'circle'}).length;\n * //= 2\n * turf.getCluster(clustered, {'marker-symbol': 'square'}).length;\n * //= 1\n */\nfunction getCluster<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(geojson: FeatureCollection<G, P>, filter: any): FeatureCollection<G, P> {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (filter === undefined || filter === null)\n throw new Error(\"filter is required\");\n\n // Filter Features\n var features: Feature<G, P>[] = [];\n featureEach<G, P>(geojson, function (feature) {\n if (applyFilter(feature.properties, filter)) features.push(feature);\n });\n return featureCollection(features);\n}\n\n/**\n * Callback for clusterEach\n *\n * @callback clusterEachCallback\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {*} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the array.Starts at index 0\n * @returns {void}\n */\n\n/**\n * clusterEach\n *\n * @name clusterEach\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {Function} callback a method that takes (cluster, clusterValue, currentIndex)\n * @returns {void}\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue, currentIndex) {\n * //= cluster\n * //= clusterValue\n * //= currentIndex\n * })\n *\n * // Calculate the total number of clusters\n * var total = 0\n * turf.clusterEach(clustered, 'cluster', function () {\n * total++;\n * });\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = []\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue) {\n * values.push(clusterValue);\n * });\n */\nfunction clusterEach<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void\n): void {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (property === undefined || property === null)\n throw new Error(\"property is required\");\n\n // Create clusters based on property values\n var bins = createBins(geojson, property);\n var values = Object.keys(bins);\n for (var index = 0; index < values.length; index++) {\n var value = values[index];\n var bin = bins[value];\n var features = [];\n for (var i = 0; i < bin.length; i++) {\n features.push(geojson.features[bin[i]]);\n }\n callback(featureCollection(features), value, index);\n }\n}\n\n/**\n * Callback for clusterReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback clusterReduceCallback\n * @param {*} [previousValue] The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {*} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the\n * array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n */\n\n/**\n * Reduce clusters in GeoJSON Features, similar to Array.reduce()\n *\n * @name clusterReduce\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {Function} callback a method that takes (previousValue, cluster, clusterValue, currentIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster and perform a calculation\n * var initialValue = 0\n * turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue, currentIndex) {\n * //=previousValue\n * //=cluster\n * //=clusterValue\n * //=currentIndex\n * return previousValue++;\n * }, initialValue);\n *\n * // Calculate the total number of clusters\n * var total = turf.clusterReduce(clustered, 'cluster', function (previousValue) {\n * return previousValue++;\n * }, 0);\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue) {\n * return previousValue.concat(clusterValue);\n * }, []);\n */\nfunction clusterReduce<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n previousValue: any | undefined,\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void,\n initialValue?: any\n): void {\n var previousValue = initialValue;\n clusterEach(\n geojson,\n property,\n function (cluster, clusterValue, currentIndex) {\n if (currentIndex === 0 && initialValue === undefined)\n previousValue = cluster;\n else\n previousValue = callback(\n previousValue,\n cluster,\n clusterValue,\n currentIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Create Bins\n *\n * @private\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property Property values are used to create bins\n * @returns {Object} bins with Feature IDs\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {cluster: 0, foo: 'null'}),\n * turf.point([2, 4], {cluster: 1, foo: 'bar'}),\n * turf.point([5, 1], {0: 'foo'}),\n * turf.point([3, 6], {cluster: 1}),\n * ]);\n * createBins(geojson, 'cluster');\n * //= { '0': [ 0 ], '1': [ 1, 3 ] }\n */\nfunction createBins(\n geojson: FeatureCollection<any>,\n property: string | number\n) {\n var bins: Record<string, number[]> = {};\n\n featureEach(geojson, function (feature, i) {\n var properties = feature.properties || {};\n if (Object.prototype.hasOwnProperty.call(properties, String(property))) {\n var value = properties[property];\n if (Object.prototype.hasOwnProperty.call(bins, value))\n bins[value].push(i);\n else bins[value] = [i];\n }\n });\n return bins;\n}\n\n/**\n * Apply Filter\n *\n * @private\n * @param {*} properties Properties\n * @param {*} filter Filter\n * @returns {boolean} applied Filter to properties\n */\nfunction applyFilter(properties: any, filter: any) {\n if (properties === undefined) return false;\n var filterType = typeof filter;\n\n // String & Number\n if (filterType === \"number\" || filterType === \"string\")\n return Object.prototype.hasOwnProperty.call(properties, filter);\n // Array\n else if (Array.isArray(filter)) {\n for (var i = 0; i < filter.length; i++) {\n if (!applyFilter(properties, filter[i])) return false;\n }\n return true;\n // Object\n } else {\n return propertiesContainsFilter(properties, filter);\n }\n}\n\n/**\n * Properties contains filter (does not apply deepEqual operations)\n *\n * @private\n * @param {*} properties Properties\n * @param {Object} filter Filter\n * @returns {boolean} does filter equal Properties\n * @example\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 0})\n * //= true\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 1})\n * //= false\n */\nfunction propertiesContainsFilter(properties: any, filter: any): boolean {\n var keys = Object.keys(filter);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (properties[key] !== filter[key]) return false;\n }\n return true;\n}\n\n/**\n * Filter Properties\n *\n * @private\n * @param {*} properties Properties\n * @param {Array<string>} keys Used to filter Properties\n * @returns {*} filtered Properties\n * @example\n * filterProperties({foo: 'bar', cluster: 0}, ['cluster'])\n * //= {cluster: 0}\n */\nfunction filterProperties(\n properties: Record<string, any>,\n keys: string[]\n): any {\n if (!keys) return {};\n if (!keys.length) return {};\n\n var newProperties: Record<string, any> = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (Object.prototype.hasOwnProperty.call(properties, key))\n newProperties[key] = properties[key];\n }\n return newProperties;\n}\n\nexport {\n getCluster,\n clusterEach,\n clusterReduce,\n createBins,\n applyFilter,\n propertiesContainsFilter,\n filterProperties,\n};\n//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feature,\n FeatureCollection,\n GeoJsonProperties,\n GeometryObject,\n} from \"geojson\";\nimport { featureEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\n\n/**\n * Get Cluster\n *\n * @function\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {*} filter Filter used on GeoJSON properties to get Cluster\n * @returns {FeatureCollection} Single Cluster filtered by GeoJSON Properties\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {'marker-symbol': 'circle'}),\n * turf.point([2, 4], {'marker-symbol': 'star'}),\n * turf.point([3, 6], {'marker-symbol': 'star'}),\n * turf.point([5, 1], {'marker-symbol': 'square'}),\n * turf.point([4, 2], {'marker-symbol': 'circle'})\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Retrieve first cluster (0)\n * var cluster = turf.getCluster(clustered, {cluster: 0});\n * //= cluster\n *\n * // Retrieve cluster based on custom properties\n * turf.getCluster(clustered, {'marker-symbol': 'circle'}).length;\n * //= 2\n * turf.getCluster(clustered, {'marker-symbol': 'square'}).length;\n * //= 1\n */\nfunction getCluster<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(geojson: FeatureCollection<G, P>, filter: any): FeatureCollection<G, P> {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (filter === undefined || filter === null)\n throw new Error(\"filter is required\");\n\n // Filter Features\n var features: Feature<G, P>[] = [];\n featureEach<G, P>(geojson, function (feature) {\n if (applyFilter(feature.properties, filter)) features.push(feature);\n });\n return featureCollection(features);\n}\n\n/**\n * Callback for clusterEach\n *\n * @callback clusterEachCallback\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {any} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the array.Starts at index 0\n * @returns {void}\n */\n\n/**\n * clusterEach\n *\n * @function\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {clusterEachCallback} callback a method that takes (cluster, clusterValue, currentIndex)\n * @returns {void}\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue, currentIndex) {\n * //= cluster\n * //= clusterValue\n * //= currentIndex\n * })\n *\n * // Calculate the total number of clusters\n * var total = 0\n * turf.clusterEach(clustered, 'cluster', function () {\n * total++;\n * });\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = []\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue) {\n * values.push(clusterValue);\n * });\n */\nfunction clusterEach<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void\n): void {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (property === undefined || property === null)\n throw new Error(\"property is required\");\n\n // Create clusters based on property values\n var bins = createBins(geojson, property);\n var values = Object.keys(bins);\n for (var index = 0; index < values.length; index++) {\n var value = values[index];\n var bin = bins[value];\n var features = [];\n for (var i = 0; i < bin.length; i++) {\n features.push(geojson.features[bin[i]]);\n }\n callback(featureCollection(features), value, index);\n }\n}\n\n/**\n * Callback for clusterReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback clusterReduceCallback\n * @param {*} [previousValue] The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {*} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the\n * array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n * @returns {void}\n */\n\n/**\n * Reduce clusters in GeoJSON Features, similar to Array.reduce()\n *\n * @function\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {clusterReduceCallback} callback a method that takes (previousValue, cluster, clusterValue, currentIndex)\n * @param {any} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {any} The value that results from the reduction.\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster and perform a calculation\n * var initialValue = 0\n * turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue, currentIndex) {\n * //=previousValue\n * //=cluster\n * //=clusterValue\n * //=currentIndex\n * return previousValue++;\n * }, initialValue);\n *\n * // Calculate the total number of clusters\n * var total = turf.clusterReduce(clustered, 'cluster', function (previousValue) {\n * return previousValue++;\n * }, 0);\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue) {\n * return previousValue.concat(clusterValue);\n * }, []);\n */\nfunction clusterReduce<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n previousValue: any | undefined,\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void,\n initialValue?: any\n): void {\n var previousValue = initialValue;\n clusterEach(\n geojson,\n property,\n function (cluster, clusterValue, currentIndex) {\n if (currentIndex === 0 && initialValue === undefined)\n previousValue = cluster;\n else\n previousValue = callback(\n previousValue,\n cluster,\n clusterValue,\n currentIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Create Bins\n *\n * @private\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property Property values are used to create bins\n * @returns {Object} bins with Feature IDs\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {cluster: 0, foo: 'null'}),\n * turf.point([2, 4], {cluster: 1, foo: 'bar'}),\n * turf.point([5, 1], {0: 'foo'}),\n * turf.point([3, 6], {cluster: 1}),\n * ]);\n * createBins(geojson, 'cluster');\n * //= { '0': [ 0 ], '1': [ 1, 3 ] }\n */\nfunction createBins(\n geojson: FeatureCollection<any>,\n property: string | number\n) {\n var bins: Record<string, number[]> = {};\n\n featureEach(geojson, function (feature, i) {\n var properties = feature.properties || {};\n if (Object.prototype.hasOwnProperty.call(properties, String(property))) {\n var value = properties[property];\n if (Object.prototype.hasOwnProperty.call(bins, value))\n bins[value].push(i);\n else bins[value] = [i];\n }\n });\n return bins;\n}\n\n/**\n * Apply Filter\n *\n * @private\n * @param {*} properties Properties\n * @param {*} filter Filter\n * @returns {boolean} applied Filter to properties\n */\nfunction applyFilter(properties: any, filter: any) {\n if (properties === undefined) return false;\n var filterType = typeof filter;\n\n // String & Number\n if (filterType === \"number\" || filterType === \"string\")\n return Object.prototype.hasOwnProperty.call(properties, filter);\n // Array\n else if (Array.isArray(filter)) {\n for (var i = 0; i < filter.length; i++) {\n if (!applyFilter(properties, filter[i])) return false;\n }\n return true;\n // Object\n } else {\n return propertiesContainsFilter(properties, filter);\n }\n}\n\n/**\n * Properties contains filter (does not apply deepEqual operations)\n *\n * @private\n * @param {*} properties Properties\n * @param {Object} filter Filter\n * @returns {boolean} does filter equal Properties\n * @example\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 0})\n * //= true\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 1})\n * //= false\n */\nfunction propertiesContainsFilter(properties: any, filter: any): boolean {\n var keys = Object.keys(filter);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (properties[key] !== filter[key]) return false;\n }\n return true;\n}\n\n/**\n * Filter Properties\n *\n * @private\n * @param {*} properties Properties\n * @param {Array<string>} keys Used to filter Properties\n * @returns {*} filtered Properties\n * @example\n * filterProperties({foo: 'bar', cluster: 0}, ['cluster'])\n * //= {cluster: 0}\n */\nfunction filterProperties(\n properties: Record<string, any>,\n keys: string[]\n): any {\n if (!keys) return {};\n if (!keys.length) return {};\n\n var newProperties: Record<string, any> = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (Object.prototype.hasOwnProperty.call(properties, key))\n newProperties[key] = properties[key];\n }\n return newProperties;\n}\n\nexport {\n getCluster,\n clusterEach,\n clusterReduce,\n createBins,\n applyFilter,\n propertiesContainsFilter,\n filterProperties,\n};\n// No default export!\n"]}
|
|
@@ -3,7 +3,7 @@ import { GeometryObject, GeoJsonProperties, FeatureCollection } from 'geojson';
|
|
|
3
3
|
/**
|
|
4
4
|
* Get Cluster
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @function
|
|
7
7
|
* @param {FeatureCollection} geojson GeoJSON Features
|
|
8
8
|
* @param {*} filter Filter used on GeoJSON properties to get Cluster
|
|
9
9
|
* @returns {FeatureCollection} Single Cluster filtered by GeoJSON Properties
|
|
@@ -35,17 +35,17 @@ declare function getCluster<G extends GeometryObject, P extends GeoJsonPropertie
|
|
|
35
35
|
*
|
|
36
36
|
* @callback clusterEachCallback
|
|
37
37
|
* @param {FeatureCollection} [cluster] The current cluster being processed.
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {any} [clusterValue] Value used to create cluster being processed.
|
|
39
39
|
* @param {number} [currentIndex] The index of the current element being processed in the array.Starts at index 0
|
|
40
40
|
* @returns {void}
|
|
41
41
|
*/
|
|
42
42
|
/**
|
|
43
43
|
* clusterEach
|
|
44
44
|
*
|
|
45
|
-
* @
|
|
45
|
+
* @function
|
|
46
46
|
* @param {FeatureCollection} geojson GeoJSON Features
|
|
47
47
|
* @param {string|number} property GeoJSON property key/value used to create clusters
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {clusterEachCallback} callback a method that takes (cluster, clusterValue, currentIndex)
|
|
49
49
|
* @returns {void}
|
|
50
50
|
* @example
|
|
51
51
|
* var geojson = turf.featureCollection([
|
|
@@ -100,16 +100,17 @@ declare function clusterEach<G extends GeometryObject, P extends GeoJsonProperti
|
|
|
100
100
|
* @param {*} [clusterValue] Value used to create cluster being processed.
|
|
101
101
|
* @param {number} [currentIndex] The index of the current element being processed in the
|
|
102
102
|
* array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.
|
|
103
|
+
* @returns {void}
|
|
103
104
|
*/
|
|
104
105
|
/**
|
|
105
106
|
* Reduce clusters in GeoJSON Features, similar to Array.reduce()
|
|
106
107
|
*
|
|
107
|
-
* @
|
|
108
|
+
* @function
|
|
108
109
|
* @param {FeatureCollection} geojson GeoJSON Features
|
|
109
110
|
* @param {string|number} property GeoJSON property key/value used to create clusters
|
|
110
|
-
* @param {
|
|
111
|
-
* @param {
|
|
112
|
-
* @returns {
|
|
111
|
+
* @param {clusterReduceCallback} callback a method that takes (previousValue, cluster, clusterValue, currentIndex)
|
|
112
|
+
* @param {any} [initialValue] Value to use as the first argument to the first call of the callback.
|
|
113
|
+
* @returns {any} The value that results from the reduction.
|
|
113
114
|
* @example
|
|
114
115
|
* var geojson = turf.featureCollection([
|
|
115
116
|
* turf.point([0, 0]),
|
|
@@ -3,7 +3,7 @@ import { GeometryObject, GeoJsonProperties, FeatureCollection } from 'geojson';
|
|
|
3
3
|
/**
|
|
4
4
|
* Get Cluster
|
|
5
5
|
*
|
|
6
|
-
* @
|
|
6
|
+
* @function
|
|
7
7
|
* @param {FeatureCollection} geojson GeoJSON Features
|
|
8
8
|
* @param {*} filter Filter used on GeoJSON properties to get Cluster
|
|
9
9
|
* @returns {FeatureCollection} Single Cluster filtered by GeoJSON Properties
|
|
@@ -35,17 +35,17 @@ declare function getCluster<G extends GeometryObject, P extends GeoJsonPropertie
|
|
|
35
35
|
*
|
|
36
36
|
* @callback clusterEachCallback
|
|
37
37
|
* @param {FeatureCollection} [cluster] The current cluster being processed.
|
|
38
|
-
* @param {
|
|
38
|
+
* @param {any} [clusterValue] Value used to create cluster being processed.
|
|
39
39
|
* @param {number} [currentIndex] The index of the current element being processed in the array.Starts at index 0
|
|
40
40
|
* @returns {void}
|
|
41
41
|
*/
|
|
42
42
|
/**
|
|
43
43
|
* clusterEach
|
|
44
44
|
*
|
|
45
|
-
* @
|
|
45
|
+
* @function
|
|
46
46
|
* @param {FeatureCollection} geojson GeoJSON Features
|
|
47
47
|
* @param {string|number} property GeoJSON property key/value used to create clusters
|
|
48
|
-
* @param {
|
|
48
|
+
* @param {clusterEachCallback} callback a method that takes (cluster, clusterValue, currentIndex)
|
|
49
49
|
* @returns {void}
|
|
50
50
|
* @example
|
|
51
51
|
* var geojson = turf.featureCollection([
|
|
@@ -100,16 +100,17 @@ declare function clusterEach<G extends GeometryObject, P extends GeoJsonProperti
|
|
|
100
100
|
* @param {*} [clusterValue] Value used to create cluster being processed.
|
|
101
101
|
* @param {number} [currentIndex] The index of the current element being processed in the
|
|
102
102
|
* array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.
|
|
103
|
+
* @returns {void}
|
|
103
104
|
*/
|
|
104
105
|
/**
|
|
105
106
|
* Reduce clusters in GeoJSON Features, similar to Array.reduce()
|
|
106
107
|
*
|
|
107
|
-
* @
|
|
108
|
+
* @function
|
|
108
109
|
* @param {FeatureCollection} geojson GeoJSON Features
|
|
109
110
|
* @param {string|number} property GeoJSON property key/value used to create clusters
|
|
110
|
-
* @param {
|
|
111
|
-
* @param {
|
|
112
|
-
* @returns {
|
|
111
|
+
* @param {clusterReduceCallback} callback a method that takes (previousValue, cluster, clusterValue, currentIndex)
|
|
112
|
+
* @param {any} [initialValue] Value to use as the first argument to the first call of the callback.
|
|
113
|
+
* @returns {any} The value that results from the reduction.
|
|
113
114
|
* @example
|
|
114
115
|
* var geojson = turf.featureCollection([
|
|
115
116
|
* turf.point([0, 0]),
|
|
@@ -2,22 +2,19 @@
|
|
|
2
2
|
import { featureEach } from "@turf/meta";
|
|
3
3
|
import { featureCollection } from "@turf/helpers";
|
|
4
4
|
function getCluster(geojson, filter) {
|
|
5
|
-
if (!geojson)
|
|
6
|
-
throw new Error("geojson is required");
|
|
5
|
+
if (!geojson) throw new Error("geojson is required");
|
|
7
6
|
if (geojson.type !== "FeatureCollection")
|
|
8
7
|
throw new Error("geojson must be a FeatureCollection");
|
|
9
8
|
if (filter === void 0 || filter === null)
|
|
10
9
|
throw new Error("filter is required");
|
|
11
10
|
var features = [];
|
|
12
11
|
featureEach(geojson, function(feature) {
|
|
13
|
-
if (applyFilter(feature.properties, filter))
|
|
14
|
-
features.push(feature);
|
|
12
|
+
if (applyFilter(feature.properties, filter)) features.push(feature);
|
|
15
13
|
});
|
|
16
14
|
return featureCollection(features);
|
|
17
15
|
}
|
|
18
16
|
function clusterEach(geojson, property, callback) {
|
|
19
|
-
if (!geojson)
|
|
20
|
-
throw new Error("geojson is required");
|
|
17
|
+
if (!geojson) throw new Error("geojson is required");
|
|
21
18
|
if (geojson.type !== "FeatureCollection")
|
|
22
19
|
throw new Error("geojson must be a FeatureCollection");
|
|
23
20
|
if (property === void 0 || property === null)
|
|
@@ -61,22 +58,19 @@ function createBins(geojson, property) {
|
|
|
61
58
|
var value = properties[property];
|
|
62
59
|
if (Object.prototype.hasOwnProperty.call(bins, value))
|
|
63
60
|
bins[value].push(i);
|
|
64
|
-
else
|
|
65
|
-
bins[value] = [i];
|
|
61
|
+
else bins[value] = [i];
|
|
66
62
|
}
|
|
67
63
|
});
|
|
68
64
|
return bins;
|
|
69
65
|
}
|
|
70
66
|
function applyFilter(properties, filter) {
|
|
71
|
-
if (properties === void 0)
|
|
72
|
-
return false;
|
|
67
|
+
if (properties === void 0) return false;
|
|
73
68
|
var filterType = typeof filter;
|
|
74
69
|
if (filterType === "number" || filterType === "string")
|
|
75
70
|
return Object.prototype.hasOwnProperty.call(properties, filter);
|
|
76
71
|
else if (Array.isArray(filter)) {
|
|
77
72
|
for (var i = 0; i < filter.length; i++) {
|
|
78
|
-
if (!applyFilter(properties, filter[i]))
|
|
79
|
-
return false;
|
|
73
|
+
if (!applyFilter(properties, filter[i])) return false;
|
|
80
74
|
}
|
|
81
75
|
return true;
|
|
82
76
|
} else {
|
|
@@ -87,16 +81,13 @@ function propertiesContainsFilter(properties, filter) {
|
|
|
87
81
|
var keys = Object.keys(filter);
|
|
88
82
|
for (var i = 0; i < keys.length; i++) {
|
|
89
83
|
var key = keys[i];
|
|
90
|
-
if (properties[key] !== filter[key])
|
|
91
|
-
return false;
|
|
84
|
+
if (properties[key] !== filter[key]) return false;
|
|
92
85
|
}
|
|
93
86
|
return true;
|
|
94
87
|
}
|
|
95
88
|
function filterProperties(properties, keys) {
|
|
96
|
-
if (!keys)
|
|
97
|
-
|
|
98
|
-
if (!keys.length)
|
|
99
|
-
return {};
|
|
89
|
+
if (!keys) return {};
|
|
90
|
+
if (!keys.length) return {};
|
|
100
91
|
var newProperties = {};
|
|
101
92
|
for (var i = 0; i < keys.length; i++) {
|
|
102
93
|
var key = keys[i];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n Feature,\n FeatureCollection,\n GeoJsonProperties,\n GeometryObject,\n} from \"geojson\";\nimport { featureEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\n\n/**\n * Get Cluster\n *\n * @name getCluster\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {*} filter Filter used on GeoJSON properties to get Cluster\n * @returns {FeatureCollection} Single Cluster filtered by GeoJSON Properties\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {'marker-symbol': 'circle'}),\n * turf.point([2, 4], {'marker-symbol': 'star'}),\n * turf.point([3, 6], {'marker-symbol': 'star'}),\n * turf.point([5, 1], {'marker-symbol': 'square'}),\n * turf.point([4, 2], {'marker-symbol': 'circle'})\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Retrieve first cluster (0)\n * var cluster = turf.getCluster(clustered, {cluster: 0});\n * //= cluster\n *\n * // Retrieve cluster based on custom properties\n * turf.getCluster(clustered, {'marker-symbol': 'circle'}).length;\n * //= 2\n * turf.getCluster(clustered, {'marker-symbol': 'square'}).length;\n * //= 1\n */\nfunction getCluster<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(geojson: FeatureCollection<G, P>, filter: any): FeatureCollection<G, P> {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (filter === undefined || filter === null)\n throw new Error(\"filter is required\");\n\n // Filter Features\n var features: Feature<G, P>[] = [];\n featureEach<G, P>(geojson, function (feature) {\n if (applyFilter(feature.properties, filter)) features.push(feature);\n });\n return featureCollection(features);\n}\n\n/**\n * Callback for clusterEach\n *\n * @callback clusterEachCallback\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {*} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the array.Starts at index 0\n * @returns {void}\n */\n\n/**\n * clusterEach\n *\n * @name clusterEach\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {Function} callback a method that takes (cluster, clusterValue, currentIndex)\n * @returns {void}\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue, currentIndex) {\n * //= cluster\n * //= clusterValue\n * //= currentIndex\n * })\n *\n * // Calculate the total number of clusters\n * var total = 0\n * turf.clusterEach(clustered, 'cluster', function () {\n * total++;\n * });\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = []\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue) {\n * values.push(clusterValue);\n * });\n */\nfunction clusterEach<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void\n): void {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (property === undefined || property === null)\n throw new Error(\"property is required\");\n\n // Create clusters based on property values\n var bins = createBins(geojson, property);\n var values = Object.keys(bins);\n for (var index = 0; index < values.length; index++) {\n var value = values[index];\n var bin = bins[value];\n var features = [];\n for (var i = 0; i < bin.length; i++) {\n features.push(geojson.features[bin[i]]);\n }\n callback(featureCollection(features), value, index);\n }\n}\n\n/**\n * Callback for clusterReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback clusterReduceCallback\n * @param {*} [previousValue] The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {*} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the\n * array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n */\n\n/**\n * Reduce clusters in GeoJSON Features, similar to Array.reduce()\n *\n * @name clusterReduce\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {Function} callback a method that takes (previousValue, cluster, clusterValue, currentIndex)\n * @param {*} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {*} The value that results from the reduction.\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster and perform a calculation\n * var initialValue = 0\n * turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue, currentIndex) {\n * //=previousValue\n * //=cluster\n * //=clusterValue\n * //=currentIndex\n * return previousValue++;\n * }, initialValue);\n *\n * // Calculate the total number of clusters\n * var total = turf.clusterReduce(clustered, 'cluster', function (previousValue) {\n * return previousValue++;\n * }, 0);\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue) {\n * return previousValue.concat(clusterValue);\n * }, []);\n */\nfunction clusterReduce<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n previousValue: any | undefined,\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void,\n initialValue?: any\n): void {\n var previousValue = initialValue;\n clusterEach(\n geojson,\n property,\n function (cluster, clusterValue, currentIndex) {\n if (currentIndex === 0 && initialValue === undefined)\n previousValue = cluster;\n else\n previousValue = callback(\n previousValue,\n cluster,\n clusterValue,\n currentIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Create Bins\n *\n * @private\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property Property values are used to create bins\n * @returns {Object} bins with Feature IDs\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {cluster: 0, foo: 'null'}),\n * turf.point([2, 4], {cluster: 1, foo: 'bar'}),\n * turf.point([5, 1], {0: 'foo'}),\n * turf.point([3, 6], {cluster: 1}),\n * ]);\n * createBins(geojson, 'cluster');\n * //= { '0': [ 0 ], '1': [ 1, 3 ] }\n */\nfunction createBins(\n geojson: FeatureCollection<any>,\n property: string | number\n) {\n var bins: Record<string, number[]> = {};\n\n featureEach(geojson, function (feature, i) {\n var properties = feature.properties || {};\n if (Object.prototype.hasOwnProperty.call(properties, String(property))) {\n var value = properties[property];\n if (Object.prototype.hasOwnProperty.call(bins, value))\n bins[value].push(i);\n else bins[value] = [i];\n }\n });\n return bins;\n}\n\n/**\n * Apply Filter\n *\n * @private\n * @param {*} properties Properties\n * @param {*} filter Filter\n * @returns {boolean} applied Filter to properties\n */\nfunction applyFilter(properties: any, filter: any) {\n if (properties === undefined) return false;\n var filterType = typeof filter;\n\n // String & Number\n if (filterType === \"number\" || filterType === \"string\")\n return Object.prototype.hasOwnProperty.call(properties, filter);\n // Array\n else if (Array.isArray(filter)) {\n for (var i = 0; i < filter.length; i++) {\n if (!applyFilter(properties, filter[i])) return false;\n }\n return true;\n // Object\n } else {\n return propertiesContainsFilter(properties, filter);\n }\n}\n\n/**\n * Properties contains filter (does not apply deepEqual operations)\n *\n * @private\n * @param {*} properties Properties\n * @param {Object} filter Filter\n * @returns {boolean} does filter equal Properties\n * @example\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 0})\n * //= true\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 1})\n * //= false\n */\nfunction propertiesContainsFilter(properties: any, filter: any): boolean {\n var keys = Object.keys(filter);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (properties[key] !== filter[key]) return false;\n }\n return true;\n}\n\n/**\n * Filter Properties\n *\n * @private\n * @param {*} properties Properties\n * @param {Array<string>} keys Used to filter Properties\n * @returns {*} filtered Properties\n * @example\n * filterProperties({foo: 'bar', cluster: 0}, ['cluster'])\n * //= {cluster: 0}\n */\nfunction filterProperties(\n properties: Record<string, any>,\n keys: string[]\n): any {\n if (!keys) return {};\n if (!keys.length) return {};\n\n var newProperties: Record<string, any> = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (Object.prototype.hasOwnProperty.call(properties, key))\n newProperties[key] = properties[key];\n }\n return newProperties;\n}\n\nexport {\n getCluster,\n clusterEach,\n clusterReduce,\n createBins,\n applyFilter,\n propertiesContainsFilter,\n filterProperties,\n};\n// No default export!\n"],"mappings":";AAMA,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AA+BlC,SAAS,WAGP,SAAkC,QAAsC;AAExE,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,QAAQ,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC;AACvD,MAAI,WAAW,UAAa,WAAW;AACrC,UAAM,IAAI,MAAM,oBAAoB;AAGtC,MAAI,WAA4B,CAAC;AACjC,cAAkB,SAAS,SAAU,SAAS;AAC5C,QAAI,YAAY,QAAQ,YAAY,MAAM;AAAG,eAAS,KAAK,OAAO;AAAA,EACpE,CAAC;AACD,SAAO,kBAAkB,QAAQ;AACnC;AAmDA,SAAS,YAIP,SACA,UACA,UAKM;AAEN,MAAI,CAAC;AAAS,UAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,QAAQ,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC;AACvD,MAAI,aAAa,UAAa,aAAa;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAGxC,MAAI,OAAO,WAAW,SAAS,QAAQ;AACvC,MAAI,SAAS,OAAO,KAAK,IAAI;AAC7B,WAAS,QA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,KAAK;AACtC,UAAI,CAAC,YAAY,YAAY,OAAO,CAAC,CAAC;AAAG,eAAO;AAAA,IAClD;AACA,WAAO;AAAA,EAET,OAAO;AACL,WAAO,yBAAyB,YAAY,MAAM;AAAA,EACpD;AACF;AAeA,SAAS,yBAAyB,YAAiB,QAAsB;AACvE,MAAI,OAAO,OAAO,KAAK,MAAM;AAC7B,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,MAAM,KAAK,CAAC;AAChB,QAAI,WAAW,GAAG,MAAM,OAAO,GAAG;AAAG,aAAO;AAAA,EAC9C;AACA,SAAO;AACT;AAaA,SAAS,iBACP,YACA,MACK;AACL,MAAI,CAAC;AAAM,WAAO,CAAC;AACnB,MAAI,CAAC,KAAK;AAAQ,WAAO,CAAC;AAE1B,MAAI,gBAAqC,CAAC;AAC1C,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,MAAM,KAAK,CAAC;AAChB,QAAI,OAAO,UAAU,eAAe,KAAK,YAAY,GAAG;AACtD,oBAAc,GAAG,IAAI,WAAW,GAAG;AAAA,EACvC;AACA,SAAO;AACT;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import {\n Feature,\n FeatureCollection,\n GeoJsonProperties,\n GeometryObject,\n} from \"geojson\";\nimport { featureEach } from \"@turf/meta\";\nimport { featureCollection } from \"@turf/helpers\";\n\n/**\n * Get Cluster\n *\n * @function\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {*} filter Filter used on GeoJSON properties to get Cluster\n * @returns {FeatureCollection} Single Cluster filtered by GeoJSON Properties\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {'marker-symbol': 'circle'}),\n * turf.point([2, 4], {'marker-symbol': 'star'}),\n * turf.point([3, 6], {'marker-symbol': 'star'}),\n * turf.point([5, 1], {'marker-symbol': 'square'}),\n * turf.point([4, 2], {'marker-symbol': 'circle'})\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Retrieve first cluster (0)\n * var cluster = turf.getCluster(clustered, {cluster: 0});\n * //= cluster\n *\n * // Retrieve cluster based on custom properties\n * turf.getCluster(clustered, {'marker-symbol': 'circle'}).length;\n * //= 2\n * turf.getCluster(clustered, {'marker-symbol': 'square'}).length;\n * //= 1\n */\nfunction getCluster<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(geojson: FeatureCollection<G, P>, filter: any): FeatureCollection<G, P> {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (filter === undefined || filter === null)\n throw new Error(\"filter is required\");\n\n // Filter Features\n var features: Feature<G, P>[] = [];\n featureEach<G, P>(geojson, function (feature) {\n if (applyFilter(feature.properties, filter)) features.push(feature);\n });\n return featureCollection(features);\n}\n\n/**\n * Callback for clusterEach\n *\n * @callback clusterEachCallback\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {any} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the array.Starts at index 0\n * @returns {void}\n */\n\n/**\n * clusterEach\n *\n * @function\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {clusterEachCallback} callback a method that takes (cluster, clusterValue, currentIndex)\n * @returns {void}\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue, currentIndex) {\n * //= cluster\n * //= clusterValue\n * //= currentIndex\n * })\n *\n * // Calculate the total number of clusters\n * var total = 0\n * turf.clusterEach(clustered, 'cluster', function () {\n * total++;\n * });\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = []\n * turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue) {\n * values.push(clusterValue);\n * });\n */\nfunction clusterEach<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void\n): void {\n // Validation\n if (!geojson) throw new Error(\"geojson is required\");\n if (geojson.type !== \"FeatureCollection\")\n throw new Error(\"geojson must be a FeatureCollection\");\n if (property === undefined || property === null)\n throw new Error(\"property is required\");\n\n // Create clusters based on property values\n var bins = createBins(geojson, property);\n var values = Object.keys(bins);\n for (var index = 0; index < values.length; index++) {\n var value = values[index];\n var bin = bins[value];\n var features = [];\n for (var i = 0; i < bin.length; i++) {\n features.push(geojson.features[bin[i]]);\n }\n callback(featureCollection(features), value, index);\n }\n}\n\n/**\n * Callback for clusterReduce\n *\n * The first time the callback function is called, the values provided as arguments depend\n * on whether the reduce method has an initialValue argument.\n *\n * If an initialValue is provided to the reduce method:\n * - The previousValue argument is initialValue.\n * - The currentValue argument is the value of the first element present in the array.\n *\n * If an initialValue is not provided:\n * - The previousValue argument is the value of the first element present in the array.\n * - The currentValue argument is the value of the second element present in the array.\n *\n * @callback clusterReduceCallback\n * @param {*} [previousValue] The accumulated value previously returned in the last invocation\n * of the callback, or initialValue, if supplied.\n * @param {FeatureCollection} [cluster] The current cluster being processed.\n * @param {*} [clusterValue] Value used to create cluster being processed.\n * @param {number} [currentIndex] The index of the current element being processed in the\n * array. Starts at index 0, if an initialValue is provided, and at index 1 otherwise.\n * @returns {void}\n */\n\n/**\n * Reduce clusters in GeoJSON Features, similar to Array.reduce()\n *\n * @function\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property GeoJSON property key/value used to create clusters\n * @param {clusterReduceCallback} callback a method that takes (previousValue, cluster, clusterValue, currentIndex)\n * @param {any} [initialValue] Value to use as the first argument to the first call of the callback.\n * @returns {any} The value that results from the reduction.\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0]),\n * turf.point([2, 4]),\n * turf.point([3, 6]),\n * turf.point([5, 1]),\n * turf.point([4, 2])\n * ]);\n *\n * // Create a cluster using K-Means (adds `cluster` to GeoJSON properties)\n * var clustered = turf.clustersKmeans(geojson);\n *\n * // Iterate over each cluster and perform a calculation\n * var initialValue = 0\n * turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue, currentIndex) {\n * //=previousValue\n * //=cluster\n * //=clusterValue\n * //=currentIndex\n * return previousValue++;\n * }, initialValue);\n *\n * // Calculate the total number of clusters\n * var total = turf.clusterReduce(clustered, 'cluster', function (previousValue) {\n * return previousValue++;\n * }, 0);\n *\n * // Create an Array of all the values retrieved from the 'cluster' property\n * var values = turf.clusterReduce(clustered, 'cluster', function (previousValue, cluster, clusterValue) {\n * return previousValue.concat(clusterValue);\n * }, []);\n */\nfunction clusterReduce<\n G extends GeometryObject,\n P extends GeoJsonProperties = GeoJsonProperties,\n>(\n geojson: FeatureCollection<G, P>,\n property: number | string,\n callback: (\n previousValue: any | undefined,\n cluster: FeatureCollection<G, P>,\n clusterValue?: any,\n currentIndex?: number\n ) => void,\n initialValue?: any\n): void {\n var previousValue = initialValue;\n clusterEach(\n geojson,\n property,\n function (cluster, clusterValue, currentIndex) {\n if (currentIndex === 0 && initialValue === undefined)\n previousValue = cluster;\n else\n previousValue = callback(\n previousValue,\n cluster,\n clusterValue,\n currentIndex\n );\n }\n );\n return previousValue;\n}\n\n/**\n * Create Bins\n *\n * @private\n * @param {FeatureCollection} geojson GeoJSON Features\n * @param {string|number} property Property values are used to create bins\n * @returns {Object} bins with Feature IDs\n * @example\n * var geojson = turf.featureCollection([\n * turf.point([0, 0], {cluster: 0, foo: 'null'}),\n * turf.point([2, 4], {cluster: 1, foo: 'bar'}),\n * turf.point([5, 1], {0: 'foo'}),\n * turf.point([3, 6], {cluster: 1}),\n * ]);\n * createBins(geojson, 'cluster');\n * //= { '0': [ 0 ], '1': [ 1, 3 ] }\n */\nfunction createBins(\n geojson: FeatureCollection<any>,\n property: string | number\n) {\n var bins: Record<string, number[]> = {};\n\n featureEach(geojson, function (feature, i) {\n var properties = feature.properties || {};\n if (Object.prototype.hasOwnProperty.call(properties, String(property))) {\n var value = properties[property];\n if (Object.prototype.hasOwnProperty.call(bins, value))\n bins[value].push(i);\n else bins[value] = [i];\n }\n });\n return bins;\n}\n\n/**\n * Apply Filter\n *\n * @private\n * @param {*} properties Properties\n * @param {*} filter Filter\n * @returns {boolean} applied Filter to properties\n */\nfunction applyFilter(properties: any, filter: any) {\n if (properties === undefined) return false;\n var filterType = typeof filter;\n\n // String & Number\n if (filterType === \"number\" || filterType === \"string\")\n return Object.prototype.hasOwnProperty.call(properties, filter);\n // Array\n else if (Array.isArray(filter)) {\n for (var i = 0; i < filter.length; i++) {\n if (!applyFilter(properties, filter[i])) return false;\n }\n return true;\n // Object\n } else {\n return propertiesContainsFilter(properties, filter);\n }\n}\n\n/**\n * Properties contains filter (does not apply deepEqual operations)\n *\n * @private\n * @param {*} properties Properties\n * @param {Object} filter Filter\n * @returns {boolean} does filter equal Properties\n * @example\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 0})\n * //= true\n * propertiesContainsFilter({foo: 'bar', cluster: 0}, {cluster: 1})\n * //= false\n */\nfunction propertiesContainsFilter(properties: any, filter: any): boolean {\n var keys = Object.keys(filter);\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (properties[key] !== filter[key]) return false;\n }\n return true;\n}\n\n/**\n * Filter Properties\n *\n * @private\n * @param {*} properties Properties\n * @param {Array<string>} keys Used to filter Properties\n * @returns {*} filtered Properties\n * @example\n * filterProperties({foo: 'bar', cluster: 0}, ['cluster'])\n * //= {cluster: 0}\n */\nfunction filterProperties(\n properties: Record<string, any>,\n keys: string[]\n): any {\n if (!keys) return {};\n if (!keys.length) return {};\n\n var newProperties: Record<string, any> = {};\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n if (Object.prototype.hasOwnProperty.call(properties, key))\n newProperties[key] = properties[key];\n }\n return newProperties;\n}\n\nexport {\n getCluster,\n clusterEach,\n clusterReduce,\n createBins,\n applyFilter,\n propertiesContainsFilter,\n filterProperties,\n};\n// No default export!\n"],"mappings":";AAMA,SAAS,mBAAmB;AAC5B,SAAS,yBAAyB;AA+BlC,SAAS,WAGP,SAAkC,QAAsC;AAExE,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,QAAQ,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC;AACvD,MAAI,WAAW,UAAa,WAAW;AACrC,UAAM,IAAI,MAAM,oBAAoB;AAGtC,MAAI,WAA4B,CAAC;AACjC,cAAkB,SAAS,SAAU,SAAS;AAC5C,QAAI,YAAY,QAAQ,YAAY,MAAM,EAAG,UAAS,KAAK,OAAO;AAAA,EACpE,CAAC;AACD,SAAO,kBAAkB,QAAQ;AACnC;AAmDA,SAAS,YAIP,SACA,UACA,UAKM;AAEN,MAAI,CAAC,QAAS,OAAM,IAAI,MAAM,qBAAqB;AACnD,MAAI,QAAQ,SAAS;AACnB,UAAM,IAAI,MAAM,qCAAqC;AACvD,MAAI,aAAa,UAAa,aAAa;AACzC,UAAM,IAAI,MAAM,sBAAsB;AAGxC,MAAI,OAAO,WAAW,SAAS,QAAQ;AACvC,MAAI,SAAS,OAAO,KAAK,IAAI;AAC7B,WAAS,QAAQ,GAAG,QAAQ,OAAO,QAAQ,SAAS;AAClD,QAAI,QAAQ,OAAO,KAAK;AACxB,QAAI,MAAM,KAAK,KAAK;AACpB,QAAI,WAAW,CAAC;AAChB,aAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACnC,eAAS,KAAK,QAAQ,SAAS,IAAI,CAAC,CAAC,CAAC;AAAA,IACxC;AACA,aA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AAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,MAAM,KAAK,CAAC;AAChB,QAAI,WAAW,GAAG,MAAM,OAAO,GAAG,EAAG,QAAO;AAAA,EAC9C;AACA,SAAO;AACT;AAaA,SAAS,iBACP,YACA,MACK;AACL,MAAI,CAAC,KAAM,QAAO,CAAC;AACnB,MAAI,CAAC,KAAK,OAAQ,QAAO,CAAC;AAE1B,MAAI,gBAAqC,CAAC;AAC1C,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,QAAI,MAAM,KAAK,CAAC;AAChB,QAAI,OAAO,UAAU,eAAe,KAAK,YAAY,GAAG;AACtD,oBAAc,GAAG,IAAI,WAAW,GAAG;AAAA,EACvC;AACA,SAAO;AACT;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/clusters",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "turf clusters module",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/benchmark": "^2.1.5",
|
|
60
|
-
"@types/tape": "^4.
|
|
60
|
+
"@types/tape": "^4.13.4",
|
|
61
61
|
"benchmark": "^2.1.4",
|
|
62
62
|
"npm-run-all": "^4.1.5",
|
|
63
|
-
"tape": "^5.
|
|
64
|
-
"tsup": "^8.
|
|
65
|
-
"tsx": "^4.
|
|
66
|
-
"typescript": "^5.
|
|
63
|
+
"tape": "^5.9.0",
|
|
64
|
+
"tsup": "^8.3.5",
|
|
65
|
+
"tsx": "^4.19.2",
|
|
66
|
+
"typescript": "^5.5.4"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@turf/helpers": "^7.
|
|
70
|
-
"@turf/meta": "^7.
|
|
69
|
+
"@turf/helpers": "^7.2.0",
|
|
70
|
+
"@turf/meta": "^7.2.0",
|
|
71
71
|
"@types/geojson": "^7946.0.10",
|
|
72
|
-
"tslib": "^2.
|
|
72
|
+
"tslib": "^2.8.1"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867"
|
|
75
75
|
}
|
|
@@ -2,19 +2,38 @@
|
|
|
2
2
|
|
|
3
3
|
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
|
|
4
4
|
|
|
5
|
+
## Dbscan
|
|
6
|
+
|
|
7
|
+
Point classification within the cluster.
|
|
8
|
+
|
|
9
|
+
Type: (`"core"` | `"edge"` | `"noise"`)
|
|
10
|
+
|
|
11
|
+
## DbscanProps
|
|
12
|
+
|
|
13
|
+
**Extends GeoJsonProperties**
|
|
14
|
+
|
|
15
|
+
Properties assigned to each clustered point.
|
|
16
|
+
|
|
17
|
+
Type: [object][1]
|
|
18
|
+
|
|
19
|
+
### Properties
|
|
20
|
+
|
|
21
|
+
* `dbscan` **[Dbscan][2]?** type of point it has been classified as
|
|
22
|
+
* `cluster` **[number][3]?** associated clusterId
|
|
23
|
+
|
|
5
24
|
## clustersDbscan
|
|
6
25
|
|
|
7
|
-
Takes a set of [points][
|
|
26
|
+
Takes a set of [points][4] and partition them into clusters according to [DBSCAN's][5] data clustering algorithm.
|
|
8
27
|
|
|
9
28
|
### Parameters
|
|
10
29
|
|
|
11
|
-
* `points` **[FeatureCollection][
|
|
12
|
-
* `maxDistance` **[number][
|
|
13
|
-
* `options` **[Object][
|
|
30
|
+
* `points` **[FeatureCollection][6]<[Point][4]>** to be clustered
|
|
31
|
+
* `maxDistance` **[number][3]** Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
|
|
32
|
+
* `options` **[Object][1]** Optional parameters (optional, default `{}`)
|
|
14
33
|
|
|
15
|
-
* `options.units` **[string][
|
|
16
|
-
* `options.mutate` **[boolean][
|
|
17
|
-
* `options.minPoints` **[number][
|
|
34
|
+
* `options.units` **[string][7]** in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`)
|
|
35
|
+
* `options.mutate` **[boolean][8]** Allows GeoJSON input to be mutated (optional, default `false`)
|
|
36
|
+
* `options.minPoints` **[number][3]** Minimum number of points to generate a single cluster,
|
|
18
37
|
points which do not meet this requirement will be classified as an 'edge' or 'noise'. (optional, default `3`)
|
|
19
38
|
|
|
20
39
|
### Examples
|
|
@@ -29,22 +48,26 @@ var clustered = turf.clustersDbscan(points, maxDistance);
|
|
|
29
48
|
var addToMap = [clustered];
|
|
30
49
|
```
|
|
31
50
|
|
|
32
|
-
Returns **[FeatureCollection][
|
|
51
|
+
Returns **[FeatureCollection][6]<[Point][4], [DbscanProps][9]>** Clustered Points with an additional two properties associated to each Feature:* {number} cluster - the associated clusterId
|
|
33
52
|
* {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
|
|
34
53
|
|
|
35
|
-
[1]: https://
|
|
54
|
+
[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
|
|
55
|
+
|
|
56
|
+
[2]: #dbscan
|
|
57
|
+
|
|
58
|
+
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
|
|
36
59
|
|
|
37
|
-
[
|
|
60
|
+
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2
|
|
38
61
|
|
|
39
|
-
[
|
|
62
|
+
[5]: https://en.wikipedia.org/wiki/DBSCAN
|
|
40
63
|
|
|
41
|
-
[
|
|
64
|
+
[6]: https://tools.ietf.org/html/rfc7946#section-3.3
|
|
42
65
|
|
|
43
|
-
[
|
|
66
|
+
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
|
|
44
67
|
|
|
45
|
-
[
|
|
68
|
+
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
46
69
|
|
|
47
|
-
[
|
|
70
|
+
[9]: #dbscanprops
|
|
48
71
|
|
|
49
72
|
<!-- 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. -->
|
|
50
73
|
|
|
@@ -9,8 +9,7 @@ var rbush = _rbush2.default;
|
|
|
9
9
|
|
|
10
10
|
// index.ts
|
|
11
11
|
function clustersDbscan(points, maxDistance, options = {}) {
|
|
12
|
-
if (options.mutate !== true)
|
|
13
|
-
points = _clone.clone.call(void 0, points);
|
|
12
|
+
if (options.mutate !== true) points = _clone.clone.call(void 0, points);
|
|
14
13
|
const minPoints = options.minPoints || 3;
|
|
15
14
|
const latDistanceInDegrees = _helpers.lengthToDegrees.call(void 0, maxDistance, options.units);
|
|
16
15
|
var tree = new rbush(points.features.length);
|
|
@@ -78,8 +77,7 @@ function clustersDbscan(points, maxDistance, options = {}) {
|
|
|
78
77
|
};
|
|
79
78
|
var nextClusteredId = 0;
|
|
80
79
|
points.features.forEach((_, index) => {
|
|
81
|
-
if (visited[index])
|
|
82
|
-
return;
|
|
80
|
+
if (visited[index]) return;
|
|
83
81
|
const neighbors = regionQuery(index);
|
|
84
82
|
if (neighbors.length >= minPoints) {
|
|
85
83
|
const clusteredId = nextClusteredId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts","../../lib/rbush-export.ts"],"names":[],"mappings":";AACA,SAAS,aAAa;AACtB,SAAS,gBAAgB;AACzB,SAAS,kBAAkB,uBAA8B;;;ACCzD,OAAO,SAAS;AAET,IAAM,QAAQ;;;ADsCrB,SAAS,eACP,QACA,aACA,UAII,CAAC,GACkC;AAQvC,MAAI,QAAQ,WAAW;AAAM,aAAS,MAAM,MAAM;AAGlD,QAAM,YAAY,QAAQ,aAAa;AAGvC,QAAM,uBAAuB,gBAAgB,aAAa,QAAQ,KAAK;AAGvE,MAAI,OAAO,IAAI,MAAM,OAAO,SAAS,MAAM;AAG3C,MAAI,UAAU,OAAO,SAAS,IAAI,CAAC,MAAM,KAAK;AAG9C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ent":["import { GeoJsonProperties, FeatureCollection, Point } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { distance } from \"@turf/distance\";\nimport { degreesToRadians, lengthToDegrees, Units } from \"@turf/helpers\";\nimport { rbush as RBush } from \"./lib/rbush-export.js\";\n\ntype Dbscan = \"core\" | \"edge\" | \"noise\";\ntype DbscanProps = GeoJsonProperties & {\n dbscan?: Dbscan;\n cluster?: number;\n};\n\n// Structure of a point in the spatial index\ntype IndexedPoint = {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n index: number;\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters according to {@link DBSCAN's|https://en.wikipedia.org/wiki/DBSCAN} data clustering algorithm.\n *\n * @name clustersDbscan\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers\n * @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated\n * @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,\n * points which do not meet this requirement will be classified as an 'edge' or 'noise'.\n * @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var maxDistance = 100;\n * var clustered = turf.clustersDbscan(points, maxDistance);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersDbscan(\n points: FeatureCollection<Point>,\n maxDistance: number,\n options: {\n units?: Units;\n minPoints?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, DbscanProps> {\n // Input validation being handled by Typescript\n // collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');\n // if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');\n // if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');\n // if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');\n\n // Clone points to prevent any mutations\n if (options.mutate !== true) points = clone(points);\n\n // Defaults\n const minPoints = options.minPoints || 3;\n\n // Calculate the distance in degrees for region queries\n const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units);\n\n // Create a spatial index\n var tree = new RBush(points.features.length);\n\n // Keeps track of whether a point has been visited or not.\n var visited = points.features.map((_) => false);\n\n // Keeps track of whether a point is assigned to a cluster or not.\n var assigned = points.features.map((_) => false);\n\n // Keeps track of whether a point is noise|edge or not.\n var isnoise = points.features.map((_) => false);\n\n // Keeps track of the clusterId for each point\n var clusterIds: number[] = points.features.map((_) => -1);\n\n // Index each point for spatial queries\n tree.load(\n points.features.map((point, index) => {\n var [x, y] = point.geometry.coordinates;\n return {\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n index: index,\n } as IndexedPoint;\n })\n );\n\n // Function to find neighbors of a point within a given distance\n const regionQuery = (index: number): IndexedPoint[] => {\n const point = points.features[index];\n const [x, y] = point.geometry.coordinates;\n\n const minY = Math.max(y - latDistanceInDegrees, -90.0);\n const maxY = Math.min(y + latDistanceInDegrees, 90.0);\n\n const lonDistanceInDegrees = (function () {\n // Handle the case where the bounding box crosses the poles\n if (minY < 0 && maxY > 0) {\n return latDistanceInDegrees;\n }\n if (Math.abs(minY) < Math.abs(maxY)) {\n return latDistanceInDegrees / Math.cos(degreesToRadians(maxY));\n } else {\n return latDistanceInDegrees / Math.cos(degreesToRadians(minY));\n }\n })();\n\n const minX = Math.max(x - lonDistanceInDegrees, -360.0);\n const maxX = Math.min(x + lonDistanceInDegrees, 360.0);\n\n // Calculate the bounding box for the region query\n const bbox = { minX, minY, maxX, maxY };\n return (tree.search(bbox) as ReadonlyArray<IndexedPoint>).filter(\n (neighbor) => {\n const neighborIndex = neighbor.index;\n const neighborPoint = points.features[neighborIndex];\n const distanceInKm = distance(point, neighborPoint, {\n units: \"kilometers\",\n });\n return distanceInKm <= maxDistance;\n }\n );\n };\n\n // Function to expand a cluster\n const expandCluster = (clusteredId: number, neighbors: IndexedPoint[]) => {\n for (var i = 0; i < neighbors.length; i++) {\n var neighbor = neighbors[i];\n const neighborIndex = neighbor.index;\n if (!visited[neighborIndex]) {\n visited[neighborIndex] = true;\n const nextNeighbors = regionQuery(neighborIndex);\n if (nextNeighbors.length >= minPoints) {\n neighbors.push(...nextNeighbors);\n }\n }\n if (!assigned[neighborIndex]) {\n assigned[neighborIndex] = true;\n clusterIds[neighborIndex] = clusteredId;\n }\n }\n };\n\n // Main DBSCAN clustering algorithm\n var nextClusteredId = 0;\n points.features.forEach((_, index) => {\n if (visited[index]) return;\n const neighbors = regionQuery(index);\n if (neighbors.length >= minPoints) {\n const clusteredId = nextClusteredId;\n nextClusteredId++;\n visited[index] = true;\n expandCluster(clusteredId, neighbors);\n } else {\n isnoise[index] = true;\n }\n });\n\n // Assign DBSCAN properties to each point\n points.features.forEach((_, index) => {\n var clusterPoint = points.features[index];\n if (!clusterPoint.properties) {\n clusterPoint.properties = {};\n }\n\n if (clusterIds[index] >= 0) {\n clusterPoint.properties.dbscan = isnoise[index] ? \"edge\" : \"core\";\n clusterPoint.properties.cluster = clusterIds[index];\n } else {\n clusterPoint.properties.dbscan = \"noise\";\n }\n });\n\n return points as FeatureCollection<Point, DbscanProps>;\n}\n\nexport { Dbscan, DbscanProps, clustersDbscan };\nexport default clustersDbscan;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-clusters-dbscan/dist/cjs/index.cjs","../../index.ts","../../lib/rbush-export.ts"],"names":[],"mappings":"AAAA;ACCA,oCAAsB;AACtB,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AACE;AACA;AACF,wFAAC","file":"/home/runner/work/turf/turf/packages/turf-clusters-dbscan/dist/cjs/index.cjs","sourcesContent":[null,"import { GeoJsonProperties, FeatureCollection, Point } from \"geojson\";\nimport { clone } from \"@turf/clone\";\nimport { distance } from \"@turf/distance\";\nimport { degreesToRadians, lengthToDegrees, Units } from \"@turf/helpers\";\nimport { rbush as RBush } from \"./lib/rbush-export.js\";\n\n/**\n * Point classification within the cluster.\n *\n * @typedef {\"core\" | \"edge\" | \"noise\"} Dbscan\n */\ntype Dbscan = \"core\" | \"edge\" | \"noise\";\n\n/**\n * Properties assigned to each clustered point.\n *\n * @extends GeoJsonProperties\n * @typedef {object} DbscanProps\n * @property {Dbscan} [dbscan] type of point it has been classified as\n * @property {number} [cluster] associated clusterId\n */\ntype DbscanProps = GeoJsonProperties & {\n dbscan?: Dbscan;\n cluster?: number;\n};\n\n// Structure of a point in the spatial index\ntype IndexedPoint = {\n minX: number;\n minY: number;\n maxX: number;\n maxY: number;\n index: number;\n};\n\n/**\n * Takes a set of {@link Point|points} and partition them into clusters according to {@link https://en.wikipedia.org/wiki/DBSCAN|DBSCAN's} data clustering algorithm.\n *\n * @function\n * @param {FeatureCollection<Point>} points to be clustered\n * @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)\n * @param {Object} [options={}] Optional parameters\n * @param {string} [options.units=\"kilometers\"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers\n * @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated\n * @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,\n * points which do not meet this requirement will be classified as an 'edge' or 'noise'.\n * @returns {FeatureCollection<Point, DbscanProps>} Clustered Points with an additional two properties associated to each Feature:\n * - {number} cluster - the associated clusterId\n * - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')\n * @example\n * // create random points with random z-values in their properties\n * var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});\n * var maxDistance = 100;\n * var clustered = turf.clustersDbscan(points, maxDistance);\n *\n * //addToMap\n * var addToMap = [clustered];\n */\nfunction clustersDbscan(\n points: FeatureCollection<Point>,\n maxDistance: number,\n options: {\n units?: Units;\n minPoints?: number;\n mutate?: boolean;\n } = {}\n): FeatureCollection<Point, DbscanProps> {\n // Input validation being handled by Typescript\n // collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');\n // if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');\n // if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');\n // if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');\n\n // Clone points to prevent any mutations\n if (options.mutate !== true) points = clone(points);\n\n // Defaults\n const minPoints = options.minPoints || 3;\n\n // Calculate the distance in degrees for region queries\n const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units);\n\n // Create a spatial index\n var tree = new RBush(points.features.length);\n\n // Keeps track of whether a point has been visited or not.\n var visited = points.features.map((_) => false);\n\n // Keeps track of whether a point is assigned to a cluster or not.\n var assigned = points.features.map((_) => false);\n\n // Keeps track of whether a point is noise|edge or not.\n var isnoise = points.features.map((_) => false);\n\n // Keeps track of the clusterId for each point\n var clusterIds: number[] = points.features.map((_) => -1);\n\n // Index each point for spatial queries\n tree.load(\n points.features.map((point, index) => {\n var [x, y] = point.geometry.coordinates;\n return {\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n index: index,\n } as IndexedPoint;\n })\n );\n\n // Function to find neighbors of a point within a given distance\n const regionQuery = (index: number): IndexedPoint[] => {\n const point = points.features[index];\n const [x, y] = point.geometry.coordinates;\n\n const minY = Math.max(y - latDistanceInDegrees, -90.0);\n const maxY = Math.min(y + latDistanceInDegrees, 90.0);\n\n const lonDistanceInDegrees = (function () {\n // Handle the case where the bounding box crosses the poles\n if (minY < 0 && maxY > 0) {\n return latDistanceInDegrees;\n }\n if (Math.abs(minY) < Math.abs(maxY)) {\n return latDistanceInDegrees / Math.cos(degreesToRadians(maxY));\n } else {\n return latDistanceInDegrees / Math.cos(degreesToRadians(minY));\n }\n })();\n\n const minX = Math.max(x - lonDistanceInDegrees, -360.0);\n const maxX = Math.min(x + lonDistanceInDegrees, 360.0);\n\n // Calculate the bounding box for the region query\n const bbox = { minX, minY, maxX, maxY };\n return (tree.search(bbox) as ReadonlyArray<IndexedPoint>).filter(\n (neighbor) => {\n const neighborIndex = neighbor.index;\n const neighborPoint = points.features[neighborIndex];\n const distanceInKm = distance(point, neighborPoint, {\n units: \"kilometers\",\n });\n return distanceInKm <= maxDistance;\n }\n );\n };\n\n // Function to expand a cluster\n const expandCluster = (clusteredId: number, neighbors: IndexedPoint[]) => {\n for (var i = 0; i < neighbors.length; i++) {\n var neighbor = neighbors[i];\n const neighborIndex = neighbor.index;\n if (!visited[neighborIndex]) {\n visited[neighborIndex] = true;\n const nextNeighbors = regionQuery(neighborIndex);\n if (nextNeighbors.length >= minPoints) {\n neighbors.push(...nextNeighbors);\n }\n }\n if (!assigned[neighborIndex]) {\n assigned[neighborIndex] = true;\n clusterIds[neighborIndex] = clusteredId;\n }\n }\n };\n\n // Main DBSCAN clustering algorithm\n var nextClusteredId = 0;\n points.features.forEach((_, index) => {\n if (visited[index]) return;\n const neighbors = regionQuery(index);\n if (neighbors.length >= minPoints) {\n const clusteredId = nextClusteredId;\n nextClusteredId++;\n visited[index] = true;\n expandCluster(clusteredId, neighbors);\n } else {\n isnoise[index] = true;\n }\n });\n\n // Assign DBSCAN properties to each point\n points.features.forEach((_, index) => {\n var clusterPoint = points.features[index];\n if (!clusterPoint.properties) {\n clusterPoint.properties = {};\n }\n\n if (clusterIds[index] >= 0) {\n clusterPoint.properties.dbscan = isnoise[index] ? \"edge\" : \"core\";\n clusterPoint.properties.cluster = clusterIds[index];\n } else {\n clusterPoint.properties.dbscan = \"noise\";\n }\n });\n\n return points as FeatureCollection<Point, DbscanProps>;\n}\n\nexport { Dbscan, DbscanProps, clustersDbscan };\nexport default clustersDbscan;\n","// Get around problems with moduleResolution node16 and some older libraries.\n// Manifests as \"This expression is not callable ... has no call signatures\"\n// https://stackoverflow.com/a/74709714\n\nimport lib from \"rbush\";\n\nexport const rbush = lib as unknown as typeof lib.default;\n"]}
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { GeoJsonProperties, FeatureCollection, Point } from 'geojson';
|
|
2
2
|
import { Units } from '@turf/helpers';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Point classification within the cluster.
|
|
6
|
+
*
|
|
7
|
+
* @typedef {"core" | "edge" | "noise"} Dbscan
|
|
8
|
+
*/
|
|
4
9
|
type Dbscan = "core" | "edge" | "noise";
|
|
10
|
+
/**
|
|
11
|
+
* Properties assigned to each clustered point.
|
|
12
|
+
*
|
|
13
|
+
* @extends GeoJsonProperties
|
|
14
|
+
* @typedef {object} DbscanProps
|
|
15
|
+
* @property {Dbscan} [dbscan] type of point it has been classified as
|
|
16
|
+
* @property {number} [cluster] associated clusterId
|
|
17
|
+
*/
|
|
5
18
|
type DbscanProps = GeoJsonProperties & {
|
|
6
19
|
dbscan?: Dbscan;
|
|
7
20
|
cluster?: number;
|
|
8
21
|
};
|
|
9
22
|
/**
|
|
10
|
-
* Takes a set of {@link Point|points} and partition them into clusters according to {@link
|
|
23
|
+
* Takes a set of {@link Point|points} and partition them into clusters according to {@link https://en.wikipedia.org/wiki/DBSCAN|DBSCAN's} data clustering algorithm.
|
|
11
24
|
*
|
|
12
|
-
* @
|
|
25
|
+
* @function
|
|
13
26
|
* @param {FeatureCollection<Point>} points to be clustered
|
|
14
27
|
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
|
|
15
28
|
* @param {Object} [options={}] Optional parameters
|
|
@@ -17,7 +30,7 @@ type DbscanProps = GeoJsonProperties & {
|
|
|
17
30
|
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
|
|
18
31
|
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
|
|
19
32
|
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
|
|
20
|
-
* @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:
|
|
33
|
+
* @returns {FeatureCollection<Point, DbscanProps>} Clustered Points with an additional two properties associated to each Feature:
|
|
21
34
|
* - {number} cluster - the associated clusterId
|
|
22
35
|
* - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
|
|
23
36
|
* @example
|
|
@@ -1,15 +1,28 @@
|
|
|
1
1
|
import { GeoJsonProperties, FeatureCollection, Point } from 'geojson';
|
|
2
2
|
import { Units } from '@turf/helpers';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Point classification within the cluster.
|
|
6
|
+
*
|
|
7
|
+
* @typedef {"core" | "edge" | "noise"} Dbscan
|
|
8
|
+
*/
|
|
4
9
|
type Dbscan = "core" | "edge" | "noise";
|
|
10
|
+
/**
|
|
11
|
+
* Properties assigned to each clustered point.
|
|
12
|
+
*
|
|
13
|
+
* @extends GeoJsonProperties
|
|
14
|
+
* @typedef {object} DbscanProps
|
|
15
|
+
* @property {Dbscan} [dbscan] type of point it has been classified as
|
|
16
|
+
* @property {number} [cluster] associated clusterId
|
|
17
|
+
*/
|
|
5
18
|
type DbscanProps = GeoJsonProperties & {
|
|
6
19
|
dbscan?: Dbscan;
|
|
7
20
|
cluster?: number;
|
|
8
21
|
};
|
|
9
22
|
/**
|
|
10
|
-
* Takes a set of {@link Point|points} and partition them into clusters according to {@link
|
|
23
|
+
* Takes a set of {@link Point|points} and partition them into clusters according to {@link https://en.wikipedia.org/wiki/DBSCAN|DBSCAN's} data clustering algorithm.
|
|
11
24
|
*
|
|
12
|
-
* @
|
|
25
|
+
* @function
|
|
13
26
|
* @param {FeatureCollection<Point>} points to be clustered
|
|
14
27
|
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
|
|
15
28
|
* @param {Object} [options={}] Optional parameters
|
|
@@ -17,7 +30,7 @@ type DbscanProps = GeoJsonProperties & {
|
|
|
17
30
|
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
|
|
18
31
|
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
|
|
19
32
|
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
|
|
20
|
-
* @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:
|
|
33
|
+
* @returns {FeatureCollection<Point, DbscanProps>} Clustered Points with an additional two properties associated to each Feature:
|
|
21
34
|
* - {number} cluster - the associated clusterId
|
|
22
35
|
* - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
|
|
23
36
|
* @example
|
|
@@ -9,8 +9,7 @@ var rbush = lib;
|
|
|
9
9
|
|
|
10
10
|
// index.ts
|
|
11
11
|
function clustersDbscan(points, maxDistance, options = {}) {
|
|
12
|
-
if (options.mutate !== true)
|
|
13
|
-
points = clone(points);
|
|
12
|
+
if (options.mutate !== true) points = clone(points);
|
|
14
13
|
const minPoints = options.minPoints || 3;
|
|
15
14
|
const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units);
|
|
16
15
|
var tree = new rbush(points.features.length);
|
|
@@ -78,8 +77,7 @@ function clustersDbscan(points, maxDistance, options = {}) {
|
|
|
78
77
|
};
|
|
79
78
|
var nextClusteredId = 0;
|
|
80
79
|
points.features.forEach((_, index) => {
|
|
81
|
-
if (visited[index])
|
|
82
|
-
return;
|
|
80
|
+
if (visited[index]) return;
|
|
83
81
|
const neighbors = regionQuery(index);
|
|
84
82
|
if (neighbors.length >= minPoints) {
|
|
85
83
|
const clusteredId = nextClusteredId;
|