node-red-contrib-tak-registration 0.16.1 → 0.16.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/node_modules/@turf/along/README.md +3 -1
- package/node_modules/@turf/along/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/along/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/along/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/along/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/along/dist/esm/index.js +2 -2
- package/node_modules/@turf/along/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/along/package.json +12 -12
- package/node_modules/@turf/angle/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/angle/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/angle/dist/esm/index.js +2 -2
- package/node_modules/@turf/angle/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/angle/package.json +16 -16
- package/node_modules/@turf/area/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/area/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/area/dist/esm/index.js +2 -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 +2 -2
- package/node_modules/@turf/bbox/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bbox/dist/esm/index.js +2 -2
- package/node_modules/@turf/bbox/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bbox/package.json +9 -9
- package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/bbox-clip/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bbox-clip/dist/esm/index.js +2 -2
- 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/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/bbox-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bbox-polygon/dist/esm/index.js +2 -2
- package/node_modules/@turf/bbox-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/bbox-polygon/package.json +8 -8
- package/node_modules/@turf/bearing/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/bearing/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bearing/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/bezier-spline/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/bezier-spline/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-clockwise/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-clockwise/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-concave/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-concave/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-contains/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-contains/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-crosses/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-crosses/dist/esm/index.js +2 -2
- 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/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/boolean-disjoint/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-disjoint/dist/esm/index.js +2 -2
- package/node_modules/@turf/boolean-disjoint/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-disjoint/package.json +12 -12
- package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/boolean-equal/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-equal/dist/esm/index.js +2 -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/README.md +1 -1
- package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/boolean-intersects/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-intersects/dist/esm/index.js +2 -2
- package/node_modules/@turf/boolean-intersects/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/boolean-intersects/package.json +10 -10
- package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/boolean-overlap/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-overlap/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-parallel/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-parallel/dist/esm/index.js +2 -2
- 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 -2
- package/node_modules/@turf/boolean-point-in-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-point-in-polygon/dist/esm/index.js +2 -2
- 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 +9 -9
- package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/boolean-point-on-line/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-point-on-line/dist/esm/index.js +2 -2
- 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 +11 -11
- package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/boolean-touches/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-touches/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-valid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-valid/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/boolean-within/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/boolean-within/dist/esm/index.js +2 -2
- 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/README.md +3 -3
- package/node_modules/@turf/buffer/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/buffer/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/buffer/dist/esm/index.js +2 -2
- package/node_modules/@turf/buffer/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/buffer/package.json +13 -13
- package/node_modules/@turf/center/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/center/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center/dist/esm/index.js +2 -2
- package/node_modules/@turf/center/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center/package.json +13 -13
- package/node_modules/@turf/center-mean/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/center-mean/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center-mean/dist/esm/index.js +2 -2
- package/node_modules/@turf/center-mean/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center-mean/package.json +14 -14
- package/node_modules/@turf/center-median/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/center-median/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center-median/dist/esm/index.js +2 -2
- 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 -2
- package/node_modules/@turf/center-of-mass/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/center-of-mass/dist/esm/index.js +2 -2
- package/node_modules/@turf/center-of-mass/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/center-of-mass/package.json +14 -14
- package/node_modules/@turf/centroid/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/centroid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/centroid/dist/esm/index.js +2 -2
- package/node_modules/@turf/centroid/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/centroid/package.json +11 -11
- package/node_modules/@turf/circle/README.md +13 -13
- package/node_modules/@turf/circle/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/circle/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/circle/dist/cjs/index.d.cts +2 -2
- package/node_modules/@turf/circle/dist/esm/index.d.ts +2 -2
- package/node_modules/@turf/circle/dist/esm/index.js +2 -2
- 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 +33 -49
- package/node_modules/@turf/clean-coords/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clean-coords/dist/esm/index.js +33 -49
- package/node_modules/@turf/clean-coords/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clean-coords/package.json +15 -12
- package/node_modules/@turf/clone/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/clone/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clone/dist/esm/index.js +2 -2
- package/node_modules/@turf/clone/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clone/package.json +9 -9
- package/node_modules/@turf/clusters/package.json +9 -9
- package/node_modules/@turf/clusters-dbscan/README.md +2 -2
- package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs +3 -8
- package/node_modules/@turf/clusters-dbscan/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/clusters-dbscan/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/clusters-dbscan/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/clusters-dbscan/dist/esm/index.js +4 -9
- package/node_modules/@turf/clusters-dbscan/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/clusters-dbscan/package.json +15 -15
- package/node_modules/@turf/clusters-kmeans/dist/cjs/index.cjs +2 -2
- 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 -2
- 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 +3 -8
- package/node_modules/@turf/collect/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/collect/dist/esm/index.js +3 -8
- 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 +2 -2
- package/node_modules/@turf/combine/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/combine/dist/esm/index.js +2 -2
- package/node_modules/@turf/combine/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/combine/package.json +9 -9
- package/node_modules/@turf/concave/README.md +2 -2
- package/node_modules/@turf/concave/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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 +2 -2
- package/node_modules/@turf/convex/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/convex/dist/esm/index.js +2 -2
- package/node_modules/@turf/convex/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/convex/package.json +11 -11
- package/node_modules/@turf/destination/README.md +2 -2
- package/node_modules/@turf/destination/dist/cjs/index.cjs +5 -2
- 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 +5 -2
- package/node_modules/@turf/destination/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/destination/package.json +14 -11
- package/node_modules/@turf/difference/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/difference/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/difference/dist/esm/index.js +2 -2
- 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/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/dissolve/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/dissolve/dist/esm/index.js +2 -2
- package/node_modules/@turf/dissolve/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/dissolve/package.json +12 -12
- package/node_modules/@turf/distance/README.md +2 -2
- package/node_modules/@turf/distance/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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 +2 -2
- package/node_modules/@turf/distance-weight/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/distance-weight/dist/esm/index.js +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/ellipse/dist/cjs/index.cjs +62 -39
- package/node_modules/@turf/ellipse/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/ellipse/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/ellipse/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/ellipse/dist/esm/index.js +64 -41
- package/node_modules/@turf/ellipse/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/ellipse/package.json +21 -18
- package/node_modules/@turf/envelope/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/envelope/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/envelope/dist/esm/index.js +2 -2
- package/node_modules/@turf/envelope/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/envelope/package.json +10 -10
- package/node_modules/@turf/explode/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/explode/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/explode/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/flatten/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/flatten/dist/esm/index.js +2 -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 +2 -2
- package/node_modules/@turf/flip/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/flip/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/geojson-rbush/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/geojson-rbush/dist/esm/index.js +2 -2
- package/node_modules/@turf/geojson-rbush/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/geojson-rbush/package.json +12 -12
- package/node_modules/@turf/great-circle/dist/cjs/index.cjs +3 -3
- package/node_modules/@turf/great-circle/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/great-circle/dist/esm/index.js +3 -3
- package/node_modules/@turf/great-circle/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/great-circle/package.json +10 -10
- package/node_modules/@turf/helpers/README.md +1 -1
- package/node_modules/@turf/helpers/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/helpers/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/helpers/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/helpers/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/helpers/package.json +7 -7
- package/node_modules/@turf/hex-grid/README.md +7 -5
- package/node_modules/@turf/hex-grid/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/hex-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/hex-grid/dist/cjs/index.d.cts +4 -4
- package/node_modules/@turf/hex-grid/dist/esm/index.d.ts +4 -4
- package/node_modules/@turf/hex-grid/dist/esm/index.js +2 -2
- 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 +7 -5
- package/node_modules/@turf/interpolate/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/interpolate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/interpolate/dist/esm/index.js +2 -2
- package/node_modules/@turf/interpolate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/interpolate/package.json +19 -19
- package/node_modules/@turf/intersect/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/intersect/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/intersect/dist/esm/index.js +2 -2
- 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/package.json +8 -8
- package/node_modules/@turf/isobands/README.md +1 -1
- package/node_modules/@turf/isobands/dist/cjs/index.cjs +313 -9
- 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 +313 -9
- package/node_modules/@turf/isobands/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/isobands/package.json +22 -22
- package/node_modules/@turf/isolines/README.md +1 -1
- package/node_modules/@turf/isolines/dist/cjs/index.cjs +192 -7
- 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 +192 -7
- package/node_modules/@turf/isolines/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/isolines/package.json +19 -19
- package/node_modules/@turf/kinks/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/kinks/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/kinks/dist/esm/index.js +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/length/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/line-arc/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/line-chunk/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/line-chunk/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-chunk/dist/esm/index.js +2 -2
- package/node_modules/@turf/line-chunk/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-chunk/package.json +12 -12
- package/node_modules/@turf/line-intersect/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/line-intersect/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-intersect/dist/esm/index.js +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/line-offset/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/line-offset/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-offset/dist/esm/index.js +2 -2
- package/node_modules/@turf/line-offset/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-offset/package.json +11 -11
- package/node_modules/@turf/line-overlap/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/line-overlap/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-overlap/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/line-segment/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-segment/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/line-slice/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-slice/dist/esm/index.js +2 -2
- package/node_modules/@turf/line-slice/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-slice/package.json +11 -11
- package/node_modules/@turf/line-slice-along/README.md +2 -2
- package/node_modules/@turf/line-slice-along/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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/README.md +4 -1
- package/node_modules/@turf/line-split/dist/cjs/index.cjs +2 -7
- package/node_modules/@turf/line-split/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-split/dist/esm/index.js +2 -7
- package/node_modules/@turf/line-split/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/line-split/package.json +16 -17
- package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/line-to-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/line-to-polygon/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/mask/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/mask/dist/esm/index.js +2 -2
- package/node_modules/@turf/mask/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/mask/package.json +10 -10
- package/node_modules/@turf/meta/package.json +7 -7
- package/node_modules/@turf/midpoint/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/midpoint/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/midpoint/dist/esm/index.js +2 -2
- package/node_modules/@turf/midpoint/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/midpoint/package.json +11 -11
- package/node_modules/@turf/moran-index/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/moran-index/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/moran-index/dist/esm/index.js +2 -2
- 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 +1 -1
- package/node_modules/@turf/nearest-neighbor-analysis/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.d.ts +2 -2
- package/node_modules/@turf/nearest-neighbor-analysis/dist/esm/index.js +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/nearest-point/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/nearest-point/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/nearest-point/dist/cjs/index.d.cts +6 -7
- package/node_modules/@turf/nearest-point/dist/esm/index.d.ts +6 -7
- package/node_modules/@turf/nearest-point/dist/esm/index.js +2 -2
- 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 +6 -2
- package/node_modules/@turf/nearest-point-on-line/dist/cjs/index.cjs +45 -52
- 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 +5 -1
- package/node_modules/@turf/nearest-point-on-line/dist/esm/index.d.ts +5 -1
- package/node_modules/@turf/nearest-point-on-line/dist/esm/index.js +45 -52
- 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 +20 -15
- package/node_modules/@turf/nearest-point-to-line/README.md +2 -2
- package/node_modules/@turf/nearest-point-to-line/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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 +2 -2
- package/node_modules/@turf/planepoint/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/planepoint/dist/esm/index.js +2 -2
- package/node_modules/@turf/planepoint/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/planepoint/package.json +9 -9
- package/node_modules/@turf/point-grid/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/point-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/point-grid/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/point-on-feature/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/point-on-feature/dist/esm/index.js +2 -2
- 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 +5 -4
- package/node_modules/@turf/point-to-line-distance/dist/cjs/index.cjs +2 -2
- 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 +1 -2
- package/node_modules/@turf/point-to-line-distance/dist/esm/index.d.ts +1 -2
- package/node_modules/@turf/point-to-line-distance/dist/esm/index.js +2 -2
- 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 -18
- package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs +3 -3
- package/node_modules/@turf/point-to-polygon-distance/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js +3 -3
- package/node_modules/@turf/point-to-polygon-distance/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/point-to-polygon-distance/package.json +14 -14
- package/node_modules/@turf/points-within-polygon/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/points-within-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/points-within-polygon/dist/esm/index.js +2 -2
- package/node_modules/@turf/points-within-polygon/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/points-within-polygon/package.json +10 -10
- package/node_modules/@turf/polygon-smooth/README.md +1 -1
- package/node_modules/@turf/polygon-smooth/dist/cjs/index.cjs +2 -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 +2 -2
- package/node_modules/@turf/polygon-smooth/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/polygon-smooth/package.json +11 -11
- package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/polygon-tangents/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygon-tangents/dist/esm/index.js +2 -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 +2 -2
- package/node_modules/@turf/polygon-to-line/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygon-to-line/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/polygonize/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/polygonize/dist/esm/index.js +2 -2
- 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/package.json +12 -12
- package/node_modules/@turf/quadrat-analysis/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/quadrat-analysis/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/quadrat-analysis/dist/esm/index.js +2 -2
- 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/package.json +9 -9
- package/node_modules/@turf/rectangle-grid/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/rectangle-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rectangle-grid/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/rewind/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rewind/dist/esm/index.js +2 -2
- 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/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/rhumb-bearing/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rhumb-bearing/dist/esm/index.js +2 -2
- 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/README.md +2 -2
- package/node_modules/@turf/rhumb-destination/dist/cjs/index.cjs +2 -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 +2 -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 +8 -9
- package/node_modules/@turf/rhumb-distance/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/rhumb-distance/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/rhumb-distance/dist/cjs/index.d.cts +2 -3
- package/node_modules/@turf/rhumb-distance/dist/esm/index.d.ts +2 -3
- package/node_modules/@turf/rhumb-distance/dist/esm/index.js +2 -2
- 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/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/sample/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/sample/dist/esm/index.js +2 -2
- package/node_modules/@turf/sample/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/sample/package.json +8 -8
- package/node_modules/@turf/sector/README.md +2 -2
- package/node_modules/@turf/sector/dist/cjs/index.cjs +2 -2
- 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 +2 -2
- 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 +5 -3
- package/node_modules/@turf/shortest-path/dist/cjs/index.cjs +10 -14
- package/node_modules/@turf/shortest-path/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/shortest-path/dist/cjs/index.d.cts +1 -1
- package/node_modules/@turf/shortest-path/dist/esm/index.d.ts +1 -1
- package/node_modules/@turf/shortest-path/dist/esm/index.js +10 -14
- package/node_modules/@turf/shortest-path/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/shortest-path/package.json +20 -19
- package/node_modules/@turf/simplify/README.md +13 -13
- package/node_modules/@turf/simplify/dist/cjs/index.cjs +6 -3
- package/node_modules/@turf/simplify/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/simplify/dist/cjs/index.d.cts +11 -12
- package/node_modules/@turf/simplify/dist/esm/index.d.ts +11 -12
- package/node_modules/@turf/simplify/dist/esm/index.js +6 -3
- 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 +2 -2
- package/node_modules/@turf/square/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/square/dist/esm/index.js +2 -2
- package/node_modules/@turf/square/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/square/package.json +9 -9
- package/node_modules/@turf/square-grid/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/square-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/square-grid/dist/esm/index.js +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 +2 -2
- package/node_modules/@turf/tag/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/tag/dist/esm/index.js +2 -2
- package/node_modules/@turf/tag/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/tag/package.json +11 -11
- package/node_modules/@turf/tesselate/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/tesselate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/tesselate/dist/esm/index.js +2 -2
- package/node_modules/@turf/tesselate/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/tesselate/package.json +8 -8
- package/node_modules/@turf/tin/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/tin/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/tin/dist/esm/index.js +2 -2
- package/node_modules/@turf/tin/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/tin/package.json +8 -8
- package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/transform-rotate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/transform-rotate/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/transform-scale/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/transform-scale/dist/esm/index.js +2 -2
- 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/README.md +8 -3
- package/node_modules/@turf/transform-translate/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/transform-translate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/transform-translate/dist/cjs/index.d.cts +4 -1
- package/node_modules/@turf/transform-translate/dist/esm/index.d.ts +4 -1
- package/node_modules/@turf/transform-translate/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/triangle-grid/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/triangle-grid/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/truncate/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/truncate/dist/esm/index.js +2 -2
- 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/package.json +125 -125
- package/node_modules/@turf/turf/turf.min.js +2 -11
- package/node_modules/@turf/union/dist/cjs/index.cjs +2 -2
- package/node_modules/@turf/union/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/union/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/unkink-polygon/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/unkink-polygon/dist/esm/index.js +2 -2
- 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 +2 -2
- package/node_modules/@turf/voronoi/dist/cjs/index.cjs.map +1 -1
- package/node_modules/@turf/voronoi/dist/esm/index.js +2 -2
- package/node_modules/@turf/voronoi/dist/esm/index.js.map +1 -1
- package/node_modules/@turf/voronoi/package.json +12 -12
- package/node_modules/@types/node/README.md +1 -1
- package/node_modules/@types/node/assert/strict.d.ts +105 -2
- package/node_modules/@types/node/assert.d.ts +154 -95
- package/node_modules/@types/node/buffer.buffer.d.ts +9 -0
- package/node_modules/@types/node/buffer.d.ts +8 -4
- package/node_modules/@types/node/child_process.d.ts +65 -42
- package/node_modules/@types/node/cluster.d.ts +4 -5
- package/node_modules/@types/node/console.d.ts +3 -2
- package/node_modules/@types/node/crypto.d.ts +1173 -322
- package/node_modules/@types/node/dgram.d.ts +9 -8
- package/node_modules/@types/node/diagnostics_channel.d.ts +0 -2
- package/node_modules/@types/node/dns.d.ts +6 -1
- package/node_modules/@types/node/events.d.ts +80 -34
- package/node_modules/@types/node/fs/promises.d.ts +39 -21
- package/node_modules/@types/node/fs.d.ts +328 -87
- package/node_modules/@types/node/globals.d.ts +2 -0
- package/node_modules/@types/node/globals.typedarray.d.ts +19 -0
- package/node_modules/@types/node/http.d.ts +119 -31
- package/node_modules/@types/node/http2.d.ts +178 -52
- package/node_modules/@types/node/https.d.ts +96 -62
- package/node_modules/@types/node/index.d.ts +3 -1
- package/node_modules/@types/node/inspector.d.ts +205 -4139
- package/node_modules/@types/node/inspector.generated.d.ts +4233 -0
- package/node_modules/@types/node/net.d.ts +33 -11
- package/node_modules/@types/node/os.d.ts +14 -3
- package/node_modules/@types/node/package.json +3 -3
- package/node_modules/@types/node/perf_hooks.d.ts +6 -8
- package/node_modules/@types/node/process.d.ts +19 -23
- package/node_modules/@types/node/readline/promises.d.ts +1 -1
- package/node_modules/@types/node/sea.d.ts +9 -0
- package/node_modules/@types/node/sqlite.d.ts +233 -10
- package/node_modules/@types/node/stream/consumers.d.ts +2 -2
- package/node_modules/@types/node/stream/web.d.ts +6 -55
- package/node_modules/@types/node/stream.d.ts +38 -23
- package/node_modules/@types/node/string_decoder.d.ts +2 -2
- package/node_modules/@types/node/test.d.ts +31 -26
- package/node_modules/@types/node/tls.d.ts +122 -66
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +10 -2
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +16 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +3 -1
- package/node_modules/@types/node/ts5.7/index.d.ts +3 -1
- package/node_modules/@types/node/url.d.ts +48 -16
- package/node_modules/@types/node/util.d.ts +23 -7
- package/node_modules/@types/node/v8.d.ts +38 -5
- package/node_modules/@types/node/vm.d.ts +169 -88
- package/node_modules/@types/node/wasi.d.ts +1 -1
- package/node_modules/@types/node/web-globals/crypto.d.ts +32 -0
- package/node_modules/@types/node/web-globals/events.d.ts +3 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +3 -0
- package/node_modules/@types/node/web-globals/streams.d.ts +22 -0
- package/node_modules/@types/node/worker_threads.d.ts +142 -51
- package/node_modules/@types/node/zlib.d.ts +31 -24
- package/node_modules/axios/CHANGELOG.md +410 -346
- package/node_modules/axios/README.md +79 -51
- package/node_modules/axios/dist/axios.js +121 -46
- package/node_modules/axios/dist/axios.js.map +1 -1
- package/node_modules/axios/dist/axios.min.js +2 -2
- package/node_modules/axios/dist/axios.min.js.map +1 -1
- package/node_modules/axios/dist/browser/axios.cjs +126 -57
- package/node_modules/axios/dist/browser/axios.cjs.map +1 -1
- package/node_modules/axios/dist/esm/axios.js +126 -57
- package/node_modules/axios/dist/esm/axios.js.map +1 -1
- package/node_modules/axios/dist/esm/axios.min.js +2 -2
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -1
- package/node_modules/axios/dist/node/axios.cjs +351 -97
- package/node_modules/axios/dist/node/axios.cjs.map +1 -1
- package/node_modules/axios/index.d.cts +4 -0
- package/node_modules/axios/index.d.ts +4 -0
- package/node_modules/axios/lib/adapters/adapters.js +85 -40
- package/node_modules/axios/lib/adapters/fetch.js +1 -1
- package/node_modules/axios/lib/adapters/http.js +224 -42
- package/node_modules/axios/lib/core/InterceptorManager.js +1 -1
- package/node_modules/axios/lib/core/mergeConfig.js +4 -4
- package/node_modules/axios/lib/env/data.js +1 -1
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +6 -0
- package/node_modules/axios/lib/helpers/bind.js +7 -0
- package/node_modules/axios/lib/helpers/cookies.js +24 -13
- package/node_modules/axios/package.json +9 -4
- package/node_modules/fast-xml-parser/CHANGELOG.md +9 -0
- package/node_modules/fast-xml-parser/README.md +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.cjs +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.d.cts +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js +1 -1
- package/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -1
- package/node_modules/fast-xml-parser/package.json +1 -1
- package/node_modules/fast-xml-parser/src/fxp.d.ts +2 -2
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +1 -1
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +4 -4
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +297 -287
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +24 -12
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +4 -4
- package/node_modules/form-data/CHANGELOG.md +60 -2
- package/node_modules/form-data/README.md +4 -4
- package/node_modules/form-data/lib/form_data.js +2 -2
- package/node_modules/form-data/package.json +4 -4
- package/node_modules/undici-types/agent.d.ts +1 -4
- package/node_modules/undici-types/client.d.ts +0 -2
- package/node_modules/undici-types/diagnostics-channel.d.ts +0 -1
- package/node_modules/undici-types/dispatcher.d.ts +0 -6
- package/node_modules/undici-types/errors.d.ts +5 -15
- package/node_modules/undici-types/eventsource.d.ts +6 -1
- package/node_modules/undici-types/h2c-client.d.ts +0 -2
- package/node_modules/undici-types/index.d.ts +6 -1
- package/node_modules/undici-types/interceptors.d.ts +5 -0
- package/node_modules/undici-types/mock-interceptor.d.ts +0 -1
- package/node_modules/undici-types/package.json +1 -1
- package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/node_modules/undici-types/webidl.d.ts +92 -21
- package/node_modules/undici-types/websocket.d.ts +2 -0
- package/package.json +5 -5
- package/tak-registration.js +11 -11
- package/node_modules/marchingsquares/.eslintrc.json +0 -81
- package/node_modules/marchingsquares/Changelog.md +0 -81
- package/node_modules/marchingsquares/LICENSE.md +0 -37
- package/node_modules/marchingsquares/README.md +0 -312
- package/node_modules/marchingsquares/VERSION +0 -1
- package/node_modules/marchingsquares/agpl-3.0.txt +0 -661
- package/node_modules/marchingsquares/dist/marchingsquares-esm.js +0 -3410
- package/node_modules/marchingsquares/dist/marchingsquares-isobands.js +0 -2513
- package/node_modules/marchingsquares/dist/marchingsquares-isobands.min.js +0 -9
- package/node_modules/marchingsquares/dist/marchingsquares-isocontours.js +0 -1209
- package/node_modules/marchingsquares/dist/marchingsquares-isocontours.min.js +0 -9
- package/node_modules/marchingsquares/dist/marchingsquares-isolines.js +0 -1209
- package/node_modules/marchingsquares/dist/marchingsquares-isolines.min.js +0 -9
- package/node_modules/marchingsquares/dist/marchingsquares.js +0 -3424
- package/node_modules/marchingsquares/dist/marchingsquares.min.js +0 -9
- package/node_modules/marchingsquares/examples/contour/index.html +0 -117
- package/node_modules/marchingsquares/examples/editor/draw-lines.js +0 -60
- package/node_modules/marchingsquares/examples/editor/index.html +0 -39
- package/node_modules/marchingsquares/examples/editor/script.js +0 -110
- package/node_modules/marchingsquares/examples/editor/styles.css +0 -37
- package/node_modules/marchingsquares/examples/require/app.js +0 -9
- package/node_modules/marchingsquares/examples/require/index.html +0 -14
- package/node_modules/marchingsquares/examples/require/main.js +0 -98
- package/node_modules/marchingsquares/examples/require/require.js +0 -5
- package/node_modules/marchingsquares/examples/simple/index.html +0 -115
- package/node_modules/marchingsquares/examples/vienna/index.html +0 -229
- package/node_modules/marchingsquares/examples/vienna/vienna_basin.png +0 -0
- package/node_modules/marchingsquares/examples/vienna/vienna_data.js +0 -514
- package/node_modules/marchingsquares/package.json +0 -47
- package/node_modules/marchingsquares/rollup.config.js +0 -122
- package/node_modules/marchingsquares/rollup.config.test.js +0 -14
- package/node_modules/marchingsquares/src/interpolation.js +0 -84
- package/node_modules/marchingsquares/src/isobands.js +0 -1883
- package/node_modules/marchingsquares/src/isolines.js +0 -638
- package/node_modules/marchingsquares/src/main.js +0 -4
- package/node_modules/marchingsquares/src/options.js +0 -80
- package/node_modules/marchingsquares/src/polygons.js +0 -531
- package/node_modules/marchingsquares/src/quadtree.js +0 -228
- package/node_modules/marchingsquares/test/data/in/isoBands-example-case.json +0 -14
- package/node_modules/marchingsquares/test/data/in/isoBands-issue#6-0_3.json +0 -12
- package/node_modules/marchingsquares/test/data/in/isoBands-issue#6-3_5.json +0 -12
- package/node_modules/marchingsquares/test/data/in/isoBands-issue#6-5_7.json +0 -12
- package/node_modules/marchingsquares/test/data/in/isoBands-minimal.json +0 -8
- package/node_modules/marchingsquares/test/data/in/isoBands-simple.json +0 -9
- package/node_modules/marchingsquares/test/data/in/isoLines-example-case.json +0 -13
- package/node_modules/marchingsquares/test/data/in/isoLines-simple.json +0 -8
- package/node_modules/marchingsquares/test/data/out/isoBands-example-case.json +0 -72
- package/node_modules/marchingsquares/test/data/out/isoBands-issue#6-0_3.json +0 -9
- package/node_modules/marchingsquares/test/data/out/isoBands-issue#6-3_5.json +0 -36
- package/node_modules/marchingsquares/test/data/out/isoBands-issue#6-5_7.json +0 -8
- package/node_modules/marchingsquares/test/data/out/isoBands-minimal.json +0 -10
- package/node_modules/marchingsquares/test/data/out/isoBands-simple.json +0 -25
- package/node_modules/marchingsquares/test/data/out/isoLines-example-case.json +0 -481
- package/node_modules/marchingsquares/test/data/out/isoLines-simple.json +0 -8
- package/node_modules/marchingsquares/test/test.js +0 -152
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-clean-coords/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,wCAAwB;AACxB,4CAAmC;AAsBnC,SAAS,WAAA,CACP,OAAA,EACA,QAAA,EAEI,CAAC,CAAA,EACL;AAEA,EAAA,IAAI,OAAA,EAAS,OAAO,QAAA,IAAY,SAAA,EAAW,OAAA,CAAQ,OAAA,EAAS,OAAA;AAC5D,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA;AACnD,EAAA,IAAI,KAAA,EAAO,gCAAA,OAAe,CAAA;AAG1B,EAAA,IAAI,UAAA,EAAY,CAAC,CAAA;AAEjB,EAAA,OAAA,CAAQ,IAAA,EAAM;AAAA,IACZ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GAAA,CAAI,MAAA,IAAU,CAAA,EAAG,OAAO,KAAA;AAAA,EAAA,KAAA,GAAA,CACf,IAAA,CAAK,GAAA,CAAI,GAAG,EAAA,GAAK,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA;AACpC,IAAA,OAAO,IAAA,EAAM,EAAA,EAAI,OAAA,GAAU,EAAA,GAAK,EAAA,GAAK,KAAA,EAAO,KAAA,GAAQ,EAAA,GAAK,EAAA,GAAK,MAAA;AAAA,EAAA,KAC3D,OAAO,IAAA,EAAM,EAAA,EAAI,OAAA,GAAU,EAAA,GAAK,EAAA,GAAK,KAAA,EAAO,KAAA,GAAQ,EAAA,GAAK,EAAA,GAAK,MAAA;AACrE;AAGA,IAAO,0BAAA,EAAQ,WAAA;ADtFf;AACE;AACA;AACF,+EAAC","file":"/home/runner/work/turf/turf/packages/turf-clean-coords/dist/cjs/index.cjs","sourcesContent":[null,"import { Position } from \"geojson\";\nimport { feature } from \"@turf/helpers\";\nimport { getCoords, getType } from \"@turf/invariant\";\n\n// To-Do => Improve Typescript GeoJSON handling\n\n/**\n * Removes redundant coordinates from any GeoJSON Geometry.\n *\n * @function\n * @param {Geometry|Feature} geojson Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated\n * @returns {Geometry|Feature} the cleaned input Feature/Geometry\n * @example\n * var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);\n * var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);\n *\n * turf.cleanCoords(line).geometry.coordinates;\n * //= [[0, 0], [0, 10]]\n *\n * turf.cleanCoords(multiPoint).geometry.coordinates;\n * //= [[0, 0], [2, 2]]\n */\nfunction cleanCoords(\n geojson: any,\n options: {\n mutate?: boolean;\n } = {}\n) {\n // Backwards compatible with v4.0\n var mutate = typeof options === \"object\" ? options.mutate : options;\n if (!geojson) throw new Error(\"geojson is required\");\n var type = getType(geojson);\n\n // Store new \"clean\" points in this Array\n var newCoords = [];\n\n switch (type) {\n case \"LineString\":\n newCoords = cleanLine(geojson, type);\n break;\n case \"MultiLineString\":\n case \"Polygon\":\n getCoords(geojson).forEach(function (line) {\n newCoords.push(cleanLine(line, type));\n });\n break;\n case \"MultiPolygon\":\n getCoords(geojson).forEach(function (polygons: any) {\n var polyPoints: Position[] = [];\n polygons.forEach(function (ring: Position[]) {\n polyPoints.push(cleanLine(ring, type));\n });\n newCoords.push(polyPoints);\n });\n break;\n case \"Point\":\n return geojson;\n case \"MultiPoint\":\n var existing: Record<string, true> = {};\n getCoords(geojson).forEach(function (coord: any) {\n var key = coord.join(\"-\");\n if (!Object.prototype.hasOwnProperty.call(existing, key)) {\n newCoords.push(coord);\n existing[key] = true;\n }\n });\n break;\n default:\n throw new Error(type + \" geometry not supported\");\n }\n\n // Support input mutation\n if (geojson.coordinates) {\n if (mutate === true) {\n geojson.coordinates = newCoords;\n return geojson;\n }\n return { type: type, coordinates: newCoords };\n } else {\n if (mutate === true) {\n geojson.geometry.coordinates = newCoords;\n return geojson;\n }\n return feature({ type: type, coordinates: newCoords }, geojson.properties, {\n bbox: geojson.bbox,\n id: geojson.id,\n });\n }\n}\n\n/**\n * Clean Coords\n *\n * @private\n * @param {Array<number>|LineString} line Line\n * @param {string} type Type of geometry\n * @returns {Array<number>} Cleaned coordinates\n */\nfunction cleanLine(line: Position[], type: string) {\n var points = getCoords(line);\n // handle \"clean\" segment\n if (points.length === 2 && !equals(points[0], points[1])) return points;\n\n var newPoints = [];\n var secondToLast = points.length - 1;\n var newPointsLength = newPoints.length;\n\n newPoints.push(points[0]);\n for (var i = 1; i < secondToLast; i++) {\n var prevAddedPoint = newPoints[newPoints.length - 1];\n if (\n points[i][0] === prevAddedPoint[0] &&\n points[i][1] === prevAddedPoint[1]\n )\n continue;\n else {\n newPoints.push(points[i]);\n newPointsLength = newPoints.length;\n if (newPointsLength > 2) {\n if (\n isPointOnLineSegment(\n newPoints[newPointsLength - 3],\n newPoints[newPointsLength - 1],\n newPoints[newPointsLength - 2]\n )\n )\n newPoints.splice(newPoints.length - 2, 1);\n }\n }\n }\n newPoints.push(points[points.length - 1]);\n newPointsLength = newPoints.length;\n\n // (Multi)Polygons must have at least 4 points, but a closed LineString with only 3 points is acceptable\n if (\n (type === \"Polygon\" || type === \"MultiPolygon\") &&\n equals(points[0], points[points.length - 1]) &&\n newPointsLength < 4\n ) {\n throw new Error(\"invalid polygon\");\n }\n\n if (type === \"LineString\" && newPointsLength < 3) {\n return newPoints;\n }\n\n if (\n isPointOnLineSegment(\n newPoints[newPointsLength - 3],\n newPoints[newPointsLength - 1],\n newPoints[newPointsLength - 2]\n )\n )\n newPoints.splice(newPoints.length - 2, 1);\n\n return newPoints;\n}\n\n/**\n * Compares two points and returns if they are equals\n *\n * @private\n * @param {Position} pt1 point\n * @param {Position} pt2 point\n * @returns {boolean} true if they are equals\n */\nfunction equals(pt1: Position, pt2: Position) {\n return pt1[0] === pt2[0] && pt1[1] === pt2[1];\n}\n\n/**\n * Returns if `point` is on the segment between `start` and `end`.\n * Borrowed from `@turf/boolean-point-on-line` to speed up the evaluation (instead of using the module as dependency)\n *\n * @private\n * @param {Position} start coord pair of start of line\n * @param {Position} end coord pair of end of line\n * @param {Position} point coord pair of point to check\n * @returns {boolean} true/false\n */\nfunction isPointOnLineSegment(start: Position, end: Position, point: Position) {\n var x = point[0],\n y = point[1];\n var startX = start[0],\n startY = start[1];\n var endX = end[0],\n endY = end[1];\n\n var dxc = x - startX;\n var dyc = y - startY;\n var dxl = endX - startX;\n var dyl = endY - startY;\n var cross = dxc * dyl - dyc * dxl;\n\n if (cross !== 0) return false;\n else if (Math.abs(dxl) >= Math.abs(dyl))\n return dxl > 0 ? startX <= x && x <= endX : endX <= x && x <= startX;\n else return dyl > 0 ? startY <= y && y <= endY : endY <= y && y <= startY;\n}\n\nexport { cleanCoords };\nexport default cleanCoords;\n"]}
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/tur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AAU,KAAA,CAAM,CAAA;AAChB,MAAA,SAAA,CAAU,GAAA,CAAI,CAAA;AACd,MAAA,SAAA,CAAU,IAAA,CAAK,SAAA,CAAU,CAAC,CAAC,CAAA;AAAA,IAC7B;AAGA,IAAA,GAAA,CAAI,SAAA,CAAU,OAAA,EAAS,CAAA,EAAG;AACxB,MAAA,MAAM,IAAI,KAAA,CAAM,sCAAsC,CAAA;AAAA,IACxD;AACA,IAAA,GAAA,CAAI,CAAC,MAAA,CAAO,SAAA,CAAU,CAAC,CAAA,EAAG,SAAA,CAAU,SAAA,CAAU,OAAA,EAAS,CAAC,CAAC,CAAA,EAAG;AAC1D,MAAA,MAAM,IAAI,KAAA,CAAM,kDAAkD,CAAA;AAAA,IACpE;AAAA,EACF;AAEA,EAAA,OAAO,SAAA;AACT;AAUA,SAAS,MAAA,CAAO,GAAA,EAAe,GAAA,EAAe;AAC5C,EAAA,OAAO,GAAA,CAAI,CAAC,EAAA,IAAM,GAAA,CAAI,CAAC,EAAA,GAAK,GAAA,CAAI,CAAC,EAAA,IAAM,GAAA,CAAI,CAAC,CAAA;AAC9C;AAGA,IAAO,cAAA,EAAQ,WAAA;ADnFf;AACE;AACA;AACF,mEAAC","file":"/home/runner/work/turf/turf/packages/turf-clean-coords/dist/cjs/index.cjs","sourcesContent":[null,"import { Position } from \"geojson\";\nimport { feature } from \"@turf/helpers\";\nimport { getCoords, getType } from \"@turf/invariant\";\nimport { booleanPointOnLine } from \"@turf/boolean-point-on-line\";\nimport { lineString } from \"@turf/helpers\";\n\n// To-Do => Improve Typescript GeoJSON handling\n\n/**\n * Removes redundant coordinates from any GeoJSON Geometry.\n *\n * @function\n * @param {Geometry|Feature} geojson Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated\n * @returns {Geometry|Feature} the cleaned input Feature/Geometry\n * @example\n * var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);\n * var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);\n *\n * turf.cleanCoords(line).geometry.coordinates;\n * //= [[0, 0], [0, 10]]\n *\n * turf.cleanCoords(multiPoint).geometry.coordinates;\n * //= [[0, 0], [2, 2]]\n */\nfunction cleanCoords(\n geojson: any,\n options: {\n mutate?: boolean;\n } = {}\n) {\n // Backwards compatible with v4.0\n var mutate = typeof options === \"object\" ? options.mutate : options;\n if (!geojson) throw new Error(\"geojson is required\");\n var type = getType(geojson);\n\n // Store new \"clean\" points in this Array\n var newCoords = [];\n\n switch (type) {\n case \"LineString\":\n newCoords = cleanLine(geojson, type);\n break;\n case \"MultiLineString\":\n case \"Polygon\":\n getCoords(geojson).forEach(function (line) {\n newCoords.push(cleanLine(line, type));\n });\n break;\n case \"MultiPolygon\":\n getCoords(geojson).forEach(function (polygons: any) {\n var polyPoints: Position[] = [];\n polygons.forEach(function (ring: Position[]) {\n polyPoints.push(cleanLine(ring, type));\n });\n newCoords.push(polyPoints);\n });\n break;\n case \"Point\":\n return geojson;\n case \"MultiPoint\":\n var existing: Record<string, true> = {};\n getCoords(geojson).forEach(function (coord: any) {\n var key = coord.join(\"-\");\n if (!Object.prototype.hasOwnProperty.call(existing, key)) {\n newCoords.push(coord);\n existing[key] = true;\n }\n });\n break;\n default:\n throw new Error(type + \" geometry not supported\");\n }\n\n // Support input mutation\n if (geojson.coordinates) {\n if (mutate === true) {\n geojson.coordinates = newCoords;\n return geojson;\n }\n return { type: type, coordinates: newCoords };\n } else {\n if (mutate === true) {\n geojson.geometry.coordinates = newCoords;\n return geojson;\n }\n return feature({ type: type, coordinates: newCoords }, geojson.properties, {\n bbox: geojson.bbox,\n id: geojson.id,\n });\n }\n}\n\n/**\n * Clean Coords\n *\n * @private\n * @param {Array<number>|LineString} line Line\n * @param {string} type Type of geometry\n * @returns {Array<number>} Cleaned coordinates\n */\nfunction cleanLine(line: Position[], type: string) {\n const points = getCoords(line);\n // handle \"clean\" segment\n if (points.length === 2 && !equals(points[0], points[1])) return points;\n\n const newPoints = [];\n\n // Segments based approach. With initial segment a-b, keep comparing to a\n // longer segment a-c and as long as b is still on a-c, b is a redundant\n // point.\n let a = 0,\n b = 1,\n c = 2;\n\n // Guaranteed we'll use the first point.\n newPoints.push(points[a]);\n // While there is still room to extend the segment ...\n while (c < points.length) {\n if (booleanPointOnLine(points[b], lineString([points[a], points[c]]))) {\n // b is on a-c, so we can discard point b, and extend a-b to be the same\n // as a-c as the basis for comparison during the next iteration.\n b = c;\n } else {\n // b is NOT on a-c, suggesting a-c is not an extension of a-b. Commit a-b\n // as a necessary segment.\n newPoints.push(points[b]);\n\n // Make our a-b for the next iteration start from the end of the segment\n // that was just locked in i.e. next a-b should be the current b-(b+1).\n a = b;\n b++;\n c = b;\n }\n // Plan to look at the next point during the next iteration.\n c++;\n }\n // No remaining points, so commit the current a-b segment.\n newPoints.push(points[b]);\n\n if (type === \"Polygon\" || type === \"MultiPolygon\") {\n // For polygons need to make sure the start / end point wasn't one of the\n // points that needed to be cleaned.\n // https://github.com/Turfjs/turf/issues/2406\n // For points [a, b, c, ..., z, a]\n // if a is on line b-z, it too can be removed. New array becomes\n // [b, c, ..., z, b]\n if (\n booleanPointOnLine(\n newPoints[0],\n lineString([newPoints[1], newPoints[newPoints.length - 2]])\n )\n ) {\n newPoints.shift(); // Discard starting point.\n newPoints.pop(); // Discard closing point.\n newPoints.push(newPoints[0]); // Duplicate the new closing point to end of array.\n }\n\n // (Multi)Polygons must have at least 4 points and be closed.\n if (newPoints.length < 4) {\n throw new Error(\"invalid polygon, fewer than 4 points\");\n }\n if (!equals(newPoints[0], newPoints[newPoints.length - 1])) {\n throw new Error(\"invalid polygon, first and last points not equal\");\n }\n }\n\n return newPoints;\n}\n\n/**\n * Compares two points and returns if they are equals\n *\n * @private\n * @param {Position} pt1 point\n * @param {Position} pt2 point\n * @returns {boolean} true if they are equals\n */\nfunction equals(pt1: Position, pt2: Position) {\n return pt1[0] === pt2[0] && pt1[1] === pt2[1];\n}\n\nexport { cleanCoords };\nexport default cleanCoords;\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// index.ts
|
|
2
2
|
import { feature } from "@turf/helpers";
|
|
3
3
|
import { getCoords, getType } from "@turf/invariant";
|
|
4
|
+
import { booleanPointOnLine } from "@turf/boolean-point-on-line";
|
|
5
|
+
import { lineString } from "@turf/helpers";
|
|
4
6
|
function cleanCoords(geojson, options = {}) {
|
|
5
7
|
var mutate = typeof options === "object" ? options.mutate : options;
|
|
6
8
|
if (!geojson) throw new Error("geojson is required");
|
|
@@ -58,65 +60,47 @@ function cleanCoords(geojson, options = {}) {
|
|
|
58
60
|
}
|
|
59
61
|
}
|
|
60
62
|
function cleanLine(line, type) {
|
|
61
|
-
|
|
63
|
+
const points = getCoords(line);
|
|
62
64
|
if (points.length === 2 && !equals(points[0], points[1])) return points;
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (newPointsLength > 2) {
|
|
75
|
-
if (isPointOnLineSegment(
|
|
76
|
-
newPoints[newPointsLength - 3],
|
|
77
|
-
newPoints[newPointsLength - 1],
|
|
78
|
-
newPoints[newPointsLength - 2]
|
|
79
|
-
))
|
|
80
|
-
newPoints.splice(newPoints.length - 2, 1);
|
|
81
|
-
}
|
|
65
|
+
const newPoints = [];
|
|
66
|
+
let a = 0, b = 1, c = 2;
|
|
67
|
+
newPoints.push(points[a]);
|
|
68
|
+
while (c < points.length) {
|
|
69
|
+
if (booleanPointOnLine(points[b], lineString([points[a], points[c]]))) {
|
|
70
|
+
b = c;
|
|
71
|
+
} else {
|
|
72
|
+
newPoints.push(points[b]);
|
|
73
|
+
a = b;
|
|
74
|
+
b++;
|
|
75
|
+
c = b;
|
|
82
76
|
}
|
|
77
|
+
c++;
|
|
83
78
|
}
|
|
84
|
-
newPoints.push(points[
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
newPoints.push(points[b]);
|
|
80
|
+
if (type === "Polygon" || type === "MultiPolygon") {
|
|
81
|
+
if (booleanPointOnLine(
|
|
82
|
+
newPoints[0],
|
|
83
|
+
lineString([newPoints[1], newPoints[newPoints.length - 2]])
|
|
84
|
+
)) {
|
|
85
|
+
newPoints.shift();
|
|
86
|
+
newPoints.pop();
|
|
87
|
+
newPoints.push(newPoints[0]);
|
|
88
|
+
}
|
|
89
|
+
if (newPoints.length < 4) {
|
|
90
|
+
throw new Error("invalid polygon, fewer than 4 points");
|
|
91
|
+
}
|
|
92
|
+
if (!equals(newPoints[0], newPoints[newPoints.length - 1])) {
|
|
93
|
+
throw new Error("invalid polygon, first and last points not equal");
|
|
94
|
+
}
|
|
91
95
|
}
|
|
92
|
-
if (isPointOnLineSegment(
|
|
93
|
-
newPoints[newPointsLength - 3],
|
|
94
|
-
newPoints[newPointsLength - 1],
|
|
95
|
-
newPoints[newPointsLength - 2]
|
|
96
|
-
))
|
|
97
|
-
newPoints.splice(newPoints.length - 2, 1);
|
|
98
96
|
return newPoints;
|
|
99
97
|
}
|
|
100
98
|
function equals(pt1, pt2) {
|
|
101
99
|
return pt1[0] === pt2[0] && pt1[1] === pt2[1];
|
|
102
100
|
}
|
|
103
|
-
|
|
104
|
-
var x = point[0], y = point[1];
|
|
105
|
-
var startX = start[0], startY = start[1];
|
|
106
|
-
var endX = end[0], endY = end[1];
|
|
107
|
-
var dxc = x - startX;
|
|
108
|
-
var dyc = y - startY;
|
|
109
|
-
var dxl = endX - startX;
|
|
110
|
-
var dyl = endY - startY;
|
|
111
|
-
var cross = dxc * dyl - dyc * dxl;
|
|
112
|
-
if (cross !== 0) return false;
|
|
113
|
-
else if (Math.abs(dxl) >= Math.abs(dyl))
|
|
114
|
-
return dxl > 0 ? startX <= x && x <= endX : endX <= x && x <= startX;
|
|
115
|
-
else return dyl > 0 ? startY <= y && y <= endY : endY <= y && y <= startY;
|
|
116
|
-
}
|
|
117
|
-
var turf_clean_coords_default = cleanCoords;
|
|
101
|
+
var index_default = cleanCoords;
|
|
118
102
|
export {
|
|
119
103
|
cleanCoords,
|
|
120
|
-
|
|
104
|
+
index_default as default
|
|
121
105
|
};
|
|
122
106
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Position } from \"geojson\";\nimport { feature } from \"@turf/helpers\";\nimport { getCoords, getType } from \"@turf/invariant\";\n\n// To-Do => Improve Typescript GeoJSON handling\n\n/**\n * Removes redundant coordinates from any GeoJSON Geometry.\n *\n * @function\n * @param {Geometry|Feature} geojson Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated\n * @returns {Geometry|Feature} the cleaned input Feature/Geometry\n * @example\n * var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);\n * var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);\n *\n * turf.cleanCoords(line).geometry.coordinates;\n * //= [[0, 0], [0, 10]]\n *\n * turf.cleanCoords(multiPoint).geometry.coordinates;\n * //= [[0, 0], [2, 2]]\n */\nfunction cleanCoords(\n geojson: any,\n options: {\n mutate?: boolean;\n } = {}\n) {\n // Backwards compatible with v4.0\n var mutate = typeof options === \"object\" ? options.mutate : options;\n if (!geojson) throw new Error(\"geojson is required\");\n var type = getType(geojson);\n\n // Store new \"clean\" points in this Array\n var newCoords = [];\n\n switch (type) {\n case \"LineString\":\n newCoords = cleanLine(geojson, type);\n break;\n case \"MultiLineString\":\n case \"Polygon\":\n getCoords(geojson).forEach(function (line) {\n newCoords.push(cleanLine(line, type));\n });\n break;\n case \"MultiPolygon\":\n getCoords(geojson).forEach(function (polygons: any) {\n var polyPoints: Position[] = [];\n polygons.forEach(function (ring: Position[]) {\n polyPoints.push(cleanLine(ring, type));\n });\n newCoords.push(polyPoints);\n });\n break;\n case \"Point\":\n return geojson;\n case \"MultiPoint\":\n var existing: Record<string, true> = {};\n getCoords(geojson).forEach(function (coord: any) {\n var key = coord.join(\"-\");\n if (!Object.prototype.hasOwnProperty.call(existing, key)) {\n newCoords.push(coord);\n existing[key] = true;\n }\n });\n break;\n default:\n throw new Error(type + \" geometry not supported\");\n }\n\n // Support input mutation\n if (geojson.coordinates) {\n if (mutate === true) {\n geojson.coordinates = newCoords;\n return geojson;\n }\n return { type: type, coordinates: newCoords };\n } else {\n if (mutate === true) {\n geojson.geometry.coordinates = newCoords;\n return geojson;\n }\n return feature({ type: type, coordinates: newCoords }, geojson.properties, {\n bbox: geojson.bbox,\n id: geojson.id,\n });\n }\n}\n\n/**\n * Clean Coords\n *\n * @private\n * @param {Array<number>|LineString} line Line\n * @param {string} type Type of geometry\n * @returns {Array<number>} Cleaned coordinates\n */\nfunction cleanLine(line: Position[], type: string) {\n
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Position } from \"geojson\";\nimport { feature } from \"@turf/helpers\";\nimport { getCoords, getType } from \"@turf/invariant\";\nimport { booleanPointOnLine } from \"@turf/boolean-point-on-line\";\nimport { lineString } from \"@turf/helpers\";\n\n// To-Do => Improve Typescript GeoJSON handling\n\n/**\n * Removes redundant coordinates from any GeoJSON Geometry.\n *\n * @function\n * @param {Geometry|Feature} geojson Feature or Geometry\n * @param {Object} [options={}] Optional parameters\n * @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated\n * @returns {Geometry|Feature} the cleaned input Feature/Geometry\n * @example\n * var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);\n * var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);\n *\n * turf.cleanCoords(line).geometry.coordinates;\n * //= [[0, 0], [0, 10]]\n *\n * turf.cleanCoords(multiPoint).geometry.coordinates;\n * //= [[0, 0], [2, 2]]\n */\nfunction cleanCoords(\n geojson: any,\n options: {\n mutate?: boolean;\n } = {}\n) {\n // Backwards compatible with v4.0\n var mutate = typeof options === \"object\" ? options.mutate : options;\n if (!geojson) throw new Error(\"geojson is required\");\n var type = getType(geojson);\n\n // Store new \"clean\" points in this Array\n var newCoords = [];\n\n switch (type) {\n case \"LineString\":\n newCoords = cleanLine(geojson, type);\n break;\n case \"MultiLineString\":\n case \"Polygon\":\n getCoords(geojson).forEach(function (line) {\n newCoords.push(cleanLine(line, type));\n });\n break;\n case \"MultiPolygon\":\n getCoords(geojson).forEach(function (polygons: any) {\n var polyPoints: Position[] = [];\n polygons.forEach(function (ring: Position[]) {\n polyPoints.push(cleanLine(ring, type));\n });\n newCoords.push(polyPoints);\n });\n break;\n case \"Point\":\n return geojson;\n case \"MultiPoint\":\n var existing: Record<string, true> = {};\n getCoords(geojson).forEach(function (coord: any) {\n var key = coord.join(\"-\");\n if (!Object.prototype.hasOwnProperty.call(existing, key)) {\n newCoords.push(coord);\n existing[key] = true;\n }\n });\n break;\n default:\n throw new Error(type + \" geometry not supported\");\n }\n\n // Support input mutation\n if (geojson.coordinates) {\n if (mutate === true) {\n geojson.coordinates = newCoords;\n return geojson;\n }\n return { type: type, coordinates: newCoords };\n } else {\n if (mutate === true) {\n geojson.geometry.coordinates = newCoords;\n return geojson;\n }\n return feature({ type: type, coordinates: newCoords }, geojson.properties, {\n bbox: geojson.bbox,\n id: geojson.id,\n });\n }\n}\n\n/**\n * Clean Coords\n *\n * @private\n * @param {Array<number>|LineString} line Line\n * @param {string} type Type of geometry\n * @returns {Array<number>} Cleaned coordinates\n */\nfunction cleanLine(line: Position[], type: string) {\n const points = getCoords(line);\n // handle \"clean\" segment\n if (points.length === 2 && !equals(points[0], points[1])) return points;\n\n const newPoints = [];\n\n // Segments based approach. With initial segment a-b, keep comparing to a\n // longer segment a-c and as long as b is still on a-c, b is a redundant\n // point.\n let a = 0,\n b = 1,\n c = 2;\n\n // Guaranteed we'll use the first point.\n newPoints.push(points[a]);\n // While there is still room to extend the segment ...\n while (c < points.length) {\n if (booleanPointOnLine(points[b], lineString([points[a], points[c]]))) {\n // b is on a-c, so we can discard point b, and extend a-b to be the same\n // as a-c as the basis for comparison during the next iteration.\n b = c;\n } else {\n // b is NOT on a-c, suggesting a-c is not an extension of a-b. Commit a-b\n // as a necessary segment.\n newPoints.push(points[b]);\n\n // Make our a-b for the next iteration start from the end of the segment\n // that was just locked in i.e. next a-b should be the current b-(b+1).\n a = b;\n b++;\n c = b;\n }\n // Plan to look at the next point during the next iteration.\n c++;\n }\n // No remaining points, so commit the current a-b segment.\n newPoints.push(points[b]);\n\n if (type === \"Polygon\" || type === \"MultiPolygon\") {\n // For polygons need to make sure the start / end point wasn't one of the\n // points that needed to be cleaned.\n // https://github.com/Turfjs/turf/issues/2406\n // For points [a, b, c, ..., z, a]\n // if a is on line b-z, it too can be removed. New array becomes\n // [b, c, ..., z, b]\n if (\n booleanPointOnLine(\n newPoints[0],\n lineString([newPoints[1], newPoints[newPoints.length - 2]])\n )\n ) {\n newPoints.shift(); // Discard starting point.\n newPoints.pop(); // Discard closing point.\n newPoints.push(newPoints[0]); // Duplicate the new closing point to end of array.\n }\n\n // (Multi)Polygons must have at least 4 points and be closed.\n if (newPoints.length < 4) {\n throw new Error(\"invalid polygon, fewer than 4 points\");\n }\n if (!equals(newPoints[0], newPoints[newPoints.length - 1])) {\n throw new Error(\"invalid polygon, first and last points not equal\");\n }\n }\n\n return newPoints;\n}\n\n/**\n * Compares two points and returns if they are equals\n *\n * @private\n * @param {Position} pt1 point\n * @param {Position} pt2 point\n * @returns {boolean} true if they are equals\n */\nfunction equals(pt1: Position, pt2: Position) {\n return pt1[0] === pt2[0] && pt1[1] === pt2[1];\n}\n\nexport { cleanCoords };\nexport default cleanCoords;\n"],"mappings":";AACA,SAAS,eAAe;AACxB,SAAS,WAAW,eAAe;AACnC,SAAS,0BAA0B;AACnC,SAAS,kBAAkB;AAsB3B,SAAS,YACP,SACA,UAEI,CA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AI,CAAC;AAC9C;AAGA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/clean-coords",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.3.0",
|
|
4
|
+
"description": "Removes redundant coordinates from a GeoJSON Geometry.",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
7
|
-
"Stefano Borghi <@stebogit>"
|
|
7
|
+
"Stefano Borghi <@stebogit>",
|
|
8
|
+
"James Beard <@smallsaucepan>"
|
|
8
9
|
],
|
|
9
10
|
"license": "MIT",
|
|
10
11
|
"bugs": {
|
|
@@ -54,23 +55,25 @@
|
|
|
54
55
|
"test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
|
-
"@turf/truncate": "
|
|
58
|
+
"@turf/truncate": "7.3.0",
|
|
58
59
|
"@types/benchmark": "^2.1.5",
|
|
59
|
-
"@types/tape": "^
|
|
60
|
+
"@types/tape": "^5.8.1",
|
|
60
61
|
"benchmark": "^2.1.4",
|
|
62
|
+
"geojson-equality-ts": "^1.0.2",
|
|
61
63
|
"load-json-file": "^7.0.1",
|
|
62
64
|
"npm-run-all": "^4.1.5",
|
|
63
65
|
"tape": "^5.9.0",
|
|
64
|
-
"tsup": "^8.
|
|
65
|
-
"tsx": "^4.19.
|
|
66
|
-
"typescript": "^5.
|
|
67
|
-
"write-json-file": "^
|
|
66
|
+
"tsup": "^8.4.0",
|
|
67
|
+
"tsx": "^4.19.4",
|
|
68
|
+
"typescript": "^5.8.3",
|
|
69
|
+
"write-json-file": "^6.0.0"
|
|
68
70
|
},
|
|
69
71
|
"dependencies": {
|
|
70
|
-
"@turf/
|
|
71
|
-
"@turf/
|
|
72
|
+
"@turf/boolean-point-on-line": "7.3.0",
|
|
73
|
+
"@turf/helpers": "7.3.0",
|
|
74
|
+
"@turf/invariant": "7.3.0",
|
|
72
75
|
"@types/geojson": "^7946.0.10",
|
|
73
76
|
"tslib": "^2.8.1"
|
|
74
77
|
},
|
|
75
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
|
|
76
79
|
}
|
|
@@ -102,10 +102,10 @@ function deepSlice(coords) {
|
|
|
102
102
|
return deepSlice(coord);
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
var
|
|
105
|
+
var index_default = clone;
|
|
106
106
|
|
|
107
107
|
|
|
108
108
|
|
|
109
109
|
|
|
110
|
-
exports.clone = clone; exports.cloneProperties = cloneProperties; exports.default =
|
|
110
|
+
exports.clone = clone; exports.cloneProperties = cloneProperties; exports.default = index_default;
|
|
111
111
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-clone/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACeA,SAAS,KAAA,CAA4B,OAAA,EAAe;AAClD,EAAA,GAAA,CAAI,CAAC,OAAA,EAAS;AACZ,IAAA,MAAM,IAAI,KAAA,CAAM,qBAAqB,CAAA;AAAA,EACvC;AAEA,EAAA,OAAA,CAAQ,OAAA,CAAQ,IAAA,EAAM;AAAA,IACpB,KAAK,SAAA;AACH,MAAA,OAAO,YAAA,CAAa,OAAO,CAAA;AAAA,IAC7B,KAAK,mBAAA;AACH,MAAA,OAAO,sBAAA,CAAuB,OAAO,CAAA;AAAA,IACvC,KAAK,OAAA;AAAA,IACL,KAAK,YAAA;AAAA,IACL,KAAK,SAAA;AAAA,IACL,KAAK,YAAA;AAAA,IACL,KAAK,iBAAA;AAAA,IACL,KAAK,cAAA;AAAA,IACL,KAAK,oBAAA;AACH,MAAA,OAAO,aAAA,CAAc,OAAO,CAAA;AAAA,IAC9B,OAAA;AACE,MAAA,MAAM,IAAI,KAAA,CAAM,sBAAsB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AAC,CAAA;AACD,EAAA,OAAO,MAAA;AACT;AASA,SAAS,aAAA,CAAc,QAAA,EAAe;AACpC,EAAA,MAAM,KAAA,EAAY,EAAE,IAAA,EAAM,QAAA,CAAS,KAAK,CAAA;AACxC,EAAA,GAAA,CAAI,QAAA,CAAS,IAAA,EAAM;AACjB,IAAA,IAAA,CAAK,KAAA,EAAO,QAAA,CAAS,IAAA;AAAA,EACvB;AAEA,EAAA,GAAA,CAAI,QAAA,CAAS,KAAA,IAAS,oBAAA,EAAsB;AAC1C,IAAA,IAAA,CAAK,WAAA,EAAa,QAAA,CAAS,UAAA,CAAW,GAAA,CAAI,CAAC,CAAA,EAAA,GAAW;AACpD,MAAA,OAAO,aAAA,CAAc,CAAC,CAAA;AAAA,IACxB,CAAC,CAAA;AACD,IAAA,OAAO,IAAA;AAAA,EACT;AACA,EAAA,IAAA,CAAK,YAAA,EAAc,SAAA,CAAU,QAAA,CAAS,WAAW,CAAA;AACjD,EAAA,OAAO,IAAA;AACT;AASA,SAAS,SAAA,CAAqB,MAAA,EAAc;AAC1C,EAAA,MAAM,OAAA,EAAc,MAAA;AACpB,EAAA,GAAA,CAAI,OAAO,MAAA,CAAO,CAAC,EAAA,IAAM,QAAA,EAAU;AACjC,IAAA,OAAO,MAAA,CAAO,KAAA,CAAM,CAAA;AAAA,EACtB;AACA,EAAA,OAAO,MAAA,CAAO,GAAA,CAAI,CAAC,KAAA,EAAA,GAAe;AAChC,IAAA,OAAO,SAAA,CAAU,KAAK,CAAA;AAAA,EACxB,CAAC,CAAA;AACH;AAGA,IAAO,cAAA,EAAQ,KAAA;ADjEf;AACE;AACA;AACA;AACF,kGAAC","file":"/home/runner/work/turf/turf/packages/turf-clone/dist/cjs/index.cjs","sourcesContent":[null,"import { Feature, GeoJsonProperties } from \"geojson\";\nimport { AllGeoJSON } from \"@turf/helpers\";\n\n/**\n * Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.\n * ~3-5x faster than the common JSON.parse + JSON.stringify combo method.\n *\n * @function\n * @param {GeoJSON} geojson GeoJSON Object\n * @returns {GeoJSON} cloned GeoJSON Object\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]], {color: 'red'});\n *\n * var lineCloned = turf.clone(line);\n */\nfunction clone<T extends AllGeoJSON>(geojson: T): T {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n\n switch (geojson.type) {\n case \"Feature\":\n return cloneFeature(geojson);\n case \"FeatureCollection\":\n return cloneFeatureCollection(geojson);\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n case \"MultiPoint\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n case \"GeometryCollection\":\n return cloneGeometry(geojson);\n default:\n throw new Error(\"unknown GeoJSON type\");\n }\n}\n\n/**\n * Clone Feature\n *\n * @private\n * @param {Feature<any>} geojson GeoJSON Feature\n * @returns {Feature<any>} cloned Feature\n */\nfunction cloneFeature(geojson: any) {\n const cloned: any = { type: \"Feature\" };\n // Preserve Foreign Members\n Object.keys(geojson).forEach((key) => {\n switch (key) {\n case \"type\":\n case \"properties\":\n case \"geometry\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add properties & geometry last\n cloned.properties = cloneProperties(geojson.properties);\n if (geojson.geometry == null) {\n cloned.geometry = null;\n } else {\n cloned.geometry = cloneGeometry(geojson.geometry);\n }\n return cloned;\n}\n\n/**\n * Clone Properties\n *\n * @private\n * @param {Object} properties GeoJSON Properties\n * @returns {Object} cloned Properties\n */\nfunction cloneProperties(properties: GeoJsonProperties) {\n const cloned: { [key: string]: any } = {};\n if (!properties) {\n return cloned;\n }\n Object.keys(properties).forEach((key) => {\n const value = properties[key];\n if (typeof value === \"object\") {\n if (value === null) {\n // handle null\n cloned[key] = null;\n } else if (Array.isArray(value)) {\n // handle Array\n cloned[key] = value.map((item) => {\n return item;\n });\n } else {\n // handle generic Object\n cloned[key] = cloneProperties(value);\n }\n } else {\n cloned[key] = value;\n }\n });\n return cloned;\n}\n\n/**\n * Clone Feature Collection\n *\n * @private\n * @param {FeatureCollection<any>} geojson GeoJSON Feature Collection\n * @returns {FeatureCollection<any>} cloned Feature Collection\n */\nfunction cloneFeatureCollection(geojson: any) {\n const cloned: any = { type: \"FeatureCollection\" };\n\n // Preserve Foreign Members\n Object.keys(geojson).forEach((key) => {\n switch (key) {\n case \"type\":\n case \"features\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add features\n cloned.features = geojson.features.map((feature: Feature<any>) => {\n return cloneFeature(feature);\n });\n return cloned;\n}\n\n/**\n * Clone Geometry\n *\n * @private\n * @param {Geometry<any>} geometry GeoJSON Geometry\n * @returns {Geometry<any>} cloned Geometry\n */\nfunction cloneGeometry(geometry: any) {\n const geom: any = { type: geometry.type };\n if (geometry.bbox) {\n geom.bbox = geometry.bbox;\n }\n\n if (geometry.type === \"GeometryCollection\") {\n geom.geometries = geometry.geometries.map((g: any) => {\n return cloneGeometry(g);\n });\n return geom;\n }\n geom.coordinates = deepSlice(geometry.coordinates);\n return geom;\n}\n\n/**\n * Deep Slice coordinates\n *\n * @private\n * @param {Coordinates} coords Coordinates\n * @returns {Coordinates} all coordinates sliced\n */\nfunction deepSlice<C = any[]>(coords: C): C {\n const cloned: any = coords;\n if (typeof cloned[0] !== \"object\") {\n return cloned.slice();\n }\n return cloned.map((coord: any) => {\n return deepSlice(coord);\n });\n}\n\nexport { clone, cloneProperties };\nexport default clone;\n"]}
|
|
@@ -102,10 +102,10 @@ function deepSlice(coords) {
|
|
|
102
102
|
return deepSlice(coord);
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
|
-
var
|
|
105
|
+
var index_default = clone;
|
|
106
106
|
export {
|
|
107
107
|
clone,
|
|
108
108
|
cloneProperties,
|
|
109
|
-
|
|
109
|
+
index_default as default
|
|
110
110
|
};
|
|
111
111
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, GeoJsonProperties } from \"geojson\";\nimport { AllGeoJSON } from \"@turf/helpers\";\n\n/**\n * Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.\n * ~3-5x faster than the common JSON.parse + JSON.stringify combo method.\n *\n * @function\n * @param {GeoJSON} geojson GeoJSON Object\n * @returns {GeoJSON} cloned GeoJSON Object\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]], {color: 'red'});\n *\n * var lineCloned = turf.clone(line);\n */\nfunction clone<T extends AllGeoJSON>(geojson: T): T {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n\n switch (geojson.type) {\n case \"Feature\":\n return cloneFeature(geojson);\n case \"FeatureCollection\":\n return cloneFeatureCollection(geojson);\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n case \"MultiPoint\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n case \"GeometryCollection\":\n return cloneGeometry(geojson);\n default:\n throw new Error(\"unknown GeoJSON type\");\n }\n}\n\n/**\n * Clone Feature\n *\n * @private\n * @param {Feature<any>} geojson GeoJSON Feature\n * @returns {Feature<any>} cloned Feature\n */\nfunction cloneFeature(geojson: any) {\n const cloned: any = { type: \"Feature\" };\n // Preserve Foreign Members\n Object.keys(geojson).forEach((key) => {\n switch (key) {\n case \"type\":\n case \"properties\":\n case \"geometry\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add properties & geometry last\n cloned.properties = cloneProperties(geojson.properties);\n if (geojson.geometry == null) {\n cloned.geometry = null;\n } else {\n cloned.geometry = cloneGeometry(geojson.geometry);\n }\n return cloned;\n}\n\n/**\n * Clone Properties\n *\n * @private\n * @param {Object} properties GeoJSON Properties\n * @returns {Object} cloned Properties\n */\nfunction cloneProperties(properties: GeoJsonProperties) {\n const cloned: { [key: string]: any } = {};\n if (!properties) {\n return cloned;\n }\n Object.keys(properties).forEach((key) => {\n const value = properties[key];\n if (typeof value === \"object\") {\n if (value === null) {\n // handle null\n cloned[key] = null;\n } else if (Array.isArray(value)) {\n // handle Array\n cloned[key] = value.map((item) => {\n return item;\n });\n } else {\n // handle generic Object\n cloned[key] = cloneProperties(value);\n }\n } else {\n cloned[key] = value;\n }\n });\n return cloned;\n}\n\n/**\n * Clone Feature Collection\n *\n * @private\n * @param {FeatureCollection<any>} geojson GeoJSON Feature Collection\n * @returns {FeatureCollection<any>} cloned Feature Collection\n */\nfunction cloneFeatureCollection(geojson: any) {\n const cloned: any = { type: \"FeatureCollection\" };\n\n // Preserve Foreign Members\n Object.keys(geojson).forEach((key) => {\n switch (key) {\n case \"type\":\n case \"features\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add features\n cloned.features = geojson.features.map((feature: Feature<any>) => {\n return cloneFeature(feature);\n });\n return cloned;\n}\n\n/**\n * Clone Geometry\n *\n * @private\n * @param {Geometry<any>} geometry GeoJSON Geometry\n * @returns {Geometry<any>} cloned Geometry\n */\nfunction cloneGeometry(geometry: any) {\n const geom: any = { type: geometry.type };\n if (geometry.bbox) {\n geom.bbox = geometry.bbox;\n }\n\n if (geometry.type === \"GeometryCollection\") {\n geom.geometries = geometry.geometries.map((g: any) => {\n return cloneGeometry(g);\n });\n return geom;\n }\n geom.coordinates = deepSlice(geometry.coordinates);\n return geom;\n}\n\n/**\n * Deep Slice coordinates\n *\n * @private\n * @param {Coordinates} coords Coordinates\n * @returns {Coordinates} all coordinates sliced\n */\nfunction deepSlice<C = any[]>(coords: C): C {\n const cloned: any = coords;\n if (typeof cloned[0] !== \"object\") {\n return cloned.slice();\n }\n return cloned.map((coord: any) => {\n return deepSlice(coord);\n });\n}\n\nexport { clone, cloneProperties };\nexport default clone;\n"],"mappings":";AAeA,SAAS,MAA4B,SAAe;AAClD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aAAO,aAAa,OAAO;AAAA,IAC7B,KAAK;AACH,aAAO,uBAAuB,OAAO;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AoB;AAGhD,SAAO,KAAK,OAAO,EAAE,QAAQ,CAAC,QAAQ;AACpC,YAAQ,KAAK;AAAA,MACX,KAAK;AAAA,MACL,KAAK;AACH;AAAA,MACF;AACE,eAAO,GAAG,IAAI,QAAQ,GAAG;AAAA,IAC7B;AAAA,EACF,CAAC;AAED,SAAO,WAAW,QAAQ,SAAS,IAAI,CAAC,YAA0B;AAChE,WAAO,aAAa,OAAO;AAAA,EAC7B,CAAC;AACD,SAAO;AACT;AASA,SAAS,cAAc,UAAe;AACpC,QAAM,OAAY,EAAE,MAAM,SAAS,KAAK;AACxC,MAAI,SAAS,MAAM;AACjB,SAAK,OAAO,SAAS;AAAA,EACvB;AAEA,MAAI,SAAS,SAAS,sBAAsB;AAC1C,SAAK,aAAa,SAAS,WAAW,IAAI,CAAC,MAAW;AACpD,aAAO,cAAc,CAAC;AAAA,IACxB,CAAC;AACD,WAAO;AAAA,EACT;AACA,OAAK,cAAc,UAAU,SAAS,WAAW;AACjD,SAAO;AACT;AASA,SAAS,UAAqB,QAAc;AAC1C,QAAM,SAAc;AACpB,MAAI,OAAO,OAAO,CAAC,MAAM,UAAU;AACjC,WAAO,OAAO,MAAM;AAAA,EACtB;AACA,SAAO,OAAO,IAAI,CAAC,UAAe;AAChC,WAAO,UAAU,KAAK;AAAA,EACxB,CAAC;AACH;AAGA,IAAO,
|
|
1
|
+
{"version":3,"sources":["../../index.ts"],"sourcesContent":["import { Feature, GeoJsonProperties } from \"geojson\";\nimport { AllGeoJSON } from \"@turf/helpers\";\n\n/**\n * Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.\n * ~3-5x faster than the common JSON.parse + JSON.stringify combo method.\n *\n * @function\n * @param {GeoJSON} geojson GeoJSON Object\n * @returns {GeoJSON} cloned GeoJSON Object\n * @example\n * var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]], {color: 'red'});\n *\n * var lineCloned = turf.clone(line);\n */\nfunction clone<T extends AllGeoJSON>(geojson: T): T {\n if (!geojson) {\n throw new Error(\"geojson is required\");\n }\n\n switch (geojson.type) {\n case \"Feature\":\n return cloneFeature(geojson);\n case \"FeatureCollection\":\n return cloneFeatureCollection(geojson);\n case \"Point\":\n case \"LineString\":\n case \"Polygon\":\n case \"MultiPoint\":\n case \"MultiLineString\":\n case \"MultiPolygon\":\n case \"GeometryCollection\":\n return cloneGeometry(geojson);\n default:\n throw new Error(\"unknown GeoJSON type\");\n }\n}\n\n/**\n * Clone Feature\n *\n * @private\n * @param {Feature<any>} geojson GeoJSON Feature\n * @returns {Feature<any>} cloned Feature\n */\nfunction cloneFeature(geojson: any) {\n const cloned: any = { type: \"Feature\" };\n // Preserve Foreign Members\n Object.keys(geojson).forEach((key) => {\n switch (key) {\n case \"type\":\n case \"properties\":\n case \"geometry\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add properties & geometry last\n cloned.properties = cloneProperties(geojson.properties);\n if (geojson.geometry == null) {\n cloned.geometry = null;\n } else {\n cloned.geometry = cloneGeometry(geojson.geometry);\n }\n return cloned;\n}\n\n/**\n * Clone Properties\n *\n * @private\n * @param {Object} properties GeoJSON Properties\n * @returns {Object} cloned Properties\n */\nfunction cloneProperties(properties: GeoJsonProperties) {\n const cloned: { [key: string]: any } = {};\n if (!properties) {\n return cloned;\n }\n Object.keys(properties).forEach((key) => {\n const value = properties[key];\n if (typeof value === \"object\") {\n if (value === null) {\n // handle null\n cloned[key] = null;\n } else if (Array.isArray(value)) {\n // handle Array\n cloned[key] = value.map((item) => {\n return item;\n });\n } else {\n // handle generic Object\n cloned[key] = cloneProperties(value);\n }\n } else {\n cloned[key] = value;\n }\n });\n return cloned;\n}\n\n/**\n * Clone Feature Collection\n *\n * @private\n * @param {FeatureCollection<any>} geojson GeoJSON Feature Collection\n * @returns {FeatureCollection<any>} cloned Feature Collection\n */\nfunction cloneFeatureCollection(geojson: any) {\n const cloned: any = { type: \"FeatureCollection\" };\n\n // Preserve Foreign Members\n Object.keys(geojson).forEach((key) => {\n switch (key) {\n case \"type\":\n case \"features\":\n return;\n default:\n cloned[key] = geojson[key];\n }\n });\n // Add features\n cloned.features = geojson.features.map((feature: Feature<any>) => {\n return cloneFeature(feature);\n });\n return cloned;\n}\n\n/**\n * Clone Geometry\n *\n * @private\n * @param {Geometry<any>} geometry GeoJSON Geometry\n * @returns {Geometry<any>} cloned Geometry\n */\nfunction cloneGeometry(geometry: any) {\n const geom: any = { type: geometry.type };\n if (geometry.bbox) {\n geom.bbox = geometry.bbox;\n }\n\n if (geometry.type === \"GeometryCollection\") {\n geom.geometries = geometry.geometries.map((g: any) => {\n return cloneGeometry(g);\n });\n return geom;\n }\n geom.coordinates = deepSlice(geometry.coordinates);\n return geom;\n}\n\n/**\n * Deep Slice coordinates\n *\n * @private\n * @param {Coordinates} coords Coordinates\n * @returns {Coordinates} all coordinates sliced\n */\nfunction deepSlice<C = any[]>(coords: C): C {\n const cloned: any = coords;\n if (typeof cloned[0] !== \"object\") {\n return cloned.slice();\n }\n return cloned.map((coord: any) => {\n return deepSlice(coord);\n });\n}\n\nexport { clone, cloneProperties };\nexport default clone;\n"],"mappings":";AAeA,SAAS,MAA4B,SAAe;AAClD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAEA,UAAQ,QAAQ,MAAM;AAAA,IACpB,KAAK;AACH,aAAO,aAAa,OAAO;AAAA,IAC7B,KAAK;AACH,aAAO,uBAAuB,OAAO;AAAA,IACvC,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO,cAAc,OAAO;AAAA,IAC9B;AACE,YAAM,IAAI,MAAM,sBAAsB;AAAA,EAC1C;AACF;AASA,SAAS,aAAa,SAAc;AAClC,QAAM,SAAc,EAAE,MAAM,UAAU;AAEtC,SAAO,KAAK,OAAO,EAAE,QAAQ,CAAC,QAAQ;AACpC,YAAQ,KAAK;A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AAY,EAAE,MAAM,SAAS,KAAK;AACxC,MAAI,SAAS,MAAM;AACjB,SAAK,OAAO,SAAS;AAAA,EACvB;AAEA,MAAI,SAAS,SAAS,sBAAsB;AAC1C,SAAK,aAAa,SAAS,WAAW,IAAI,CAAC,MAAW;AACpD,aAAO,cAAc,CAAC;AAAA,IACxB,CAAC;AACD,WAAO;AAAA,EACT;AACA,OAAK,cAAc,UAAU,SAAS,WAAW;AACjD,SAAO;AACT;AASA,SAAS,UAAqB,QAAc;AAC1C,QAAM,SAAc;AACpB,MAAI,OAAO,OAAO,CAAC,MAAM,UAAU;AACjC,WAAO,OAAO,MAAM;AAAA,EACtB;AACA,SAAO,OAAO,IAAI,CAAC,UAAe;AAChC,WAAO,UAAU,KAAK;AAAA,EACxB,CAAC;AACH;AAGA,IAAO,gBAAQ;","names":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/clone",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.3.0",
|
|
4
|
+
"description": "Returns a cloned copy of the passed GeoJSON Object, including possible 'Foreign Members'.",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Denis Carriere <@DenisCarriere>"
|
|
@@ -53,20 +53,20 @@
|
|
|
53
53
|
"test:types": "tsc --esModuleInterop --module node16 --moduleResolution node16 --noEmit --strict types.ts"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@turf/meta": "
|
|
56
|
+
"@turf/meta": "7.3.0",
|
|
57
57
|
"@types/benchmark": "^2.1.5",
|
|
58
|
-
"@types/tape": "^
|
|
58
|
+
"@types/tape": "^5.8.1",
|
|
59
59
|
"benchmark": "^2.1.4",
|
|
60
60
|
"npm-run-all": "^4.1.5",
|
|
61
61
|
"tape": "^5.9.0",
|
|
62
|
-
"tsup": "^8.
|
|
63
|
-
"tsx": "^4.19.
|
|
64
|
-
"typescript": "^5.
|
|
62
|
+
"tsup": "^8.4.0",
|
|
63
|
+
"tsx": "^4.19.4",
|
|
64
|
+
"typescript": "^5.8.3"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@turf/helpers": "
|
|
67
|
+
"@turf/helpers": "7.3.0",
|
|
68
68
|
"@types/geojson": "^7946.0.10",
|
|
69
69
|
"tslib": "^2.8.1"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
|
|
72
72
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@turf/clusters",
|
|
3
|
-
"version": "7.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "7.3.0",
|
|
4
|
+
"description": "Group points into clusters based on their spatial proximity or properties.",
|
|
5
5
|
"author": "Turf Authors",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Denis Carriere <@DenisCarriere>"
|
|
@@ -57,19 +57,19 @@
|
|
|
57
57
|
},
|
|
58
58
|
"devDependencies": {
|
|
59
59
|
"@types/benchmark": "^2.1.5",
|
|
60
|
-
"@types/tape": "^
|
|
60
|
+
"@types/tape": "^5.8.1",
|
|
61
61
|
"benchmark": "^2.1.4",
|
|
62
62
|
"npm-run-all": "^4.1.5",
|
|
63
63
|
"tape": "^5.9.0",
|
|
64
|
-
"tsup": "^8.
|
|
65
|
-
"tsx": "^4.19.
|
|
66
|
-
"typescript": "^5.
|
|
64
|
+
"tsup": "^8.4.0",
|
|
65
|
+
"tsx": "^4.19.4",
|
|
66
|
+
"typescript": "^5.8.3"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@turf/helpers": "
|
|
70
|
-
"@turf/meta": "
|
|
69
|
+
"@turf/helpers": "7.3.0",
|
|
70
|
+
"@turf/meta": "7.3.0",
|
|
71
71
|
"@types/geojson": "^7946.0.10",
|
|
72
72
|
"tslib": "^2.8.1"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "9f58a103e8f9a587ab640307ed03ba5233913ddd"
|
|
75
75
|
}
|
|
@@ -31,7 +31,7 @@ Takes a set of [points][4] and partition them into clusters according to [DBSCAN
|
|
|
31
31
|
* `maxDistance` **[number][3]** Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
|
|
32
32
|
* `options` **[Object][1]** Optional parameters (optional, default `{}`)
|
|
33
33
|
|
|
34
|
-
* `options.units` **
|
|
34
|
+
* `options.units` **Units** in which `maxDistance` is expressed, Supports all valid Turf [Units][7] (optional, default `"kilometers"`)
|
|
35
35
|
* `options.mutate` **[boolean][8]** Allows GeoJSON input to be mutated (optional, default `false`)
|
|
36
36
|
* `options.minPoints` **[number][3]** Minimum number of points to generate a single cluster,
|
|
37
37
|
points which do not meet this requirement will be classified as an 'edge' or 'noise'. (optional, default `3`)
|
|
@@ -63,7 +63,7 @@ Returns **[FeatureCollection][6]<[Point][4], [DbscanProps][9]>** Clustered Point
|
|
|
63
63
|
|
|
64
64
|
[6]: https://tools.ietf.org/html/rfc7946#section-3.3
|
|
65
65
|
|
|
66
|
-
[7]: https://
|
|
66
|
+
[7]: https://turfjs.org/docs/api/types/Units
|
|
67
67
|
|
|
68
68
|
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
|
|
69
69
|
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
var _clone = require('@turf/clone');
|
|
3
3
|
var _distance = require('@turf/distance');
|
|
4
4
|
var _helpers = require('@turf/helpers');
|
|
5
|
-
|
|
6
|
-
// lib/rbush-export.ts
|
|
7
5
|
var _rbush = require('rbush'); var _rbush2 = _interopRequireDefault(_rbush);
|
|
8
|
-
var rbush = _rbush2.default;
|
|
9
|
-
|
|
10
|
-
// index.ts
|
|
11
6
|
function clustersDbscan(points, maxDistance, options = {}) {
|
|
12
7
|
if (options.mutate !== true) points = _clone.clone.call(void 0, points);
|
|
13
8
|
const minPoints = options.minPoints || 3;
|
|
14
9
|
const latDistanceInDegrees = _helpers.lengthToDegrees.call(void 0, maxDistance, options.units);
|
|
15
|
-
var tree = new
|
|
10
|
+
var tree = new (0, _rbush2.default)(points.features.length);
|
|
16
11
|
var visited = points.features.map((_) => false);
|
|
17
12
|
var assigned = points.features.map((_) => false);
|
|
18
13
|
var isnoise = points.features.map((_) => false);
|
|
@@ -102,9 +97,9 @@ function clustersDbscan(points, maxDistance, options = {}) {
|
|
|
102
97
|
});
|
|
103
98
|
return points;
|
|
104
99
|
}
|
|
105
|
-
var
|
|
100
|
+
var index_default = clustersDbscan;
|
|
106
101
|
|
|
107
102
|
|
|
108
103
|
|
|
109
|
-
exports.clustersDbscan = clustersDbscan; exports.default =
|
|
104
|
+
exports.clustersDbscan = clustersDbscan; exports.default = index_default;
|
|
110
105
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
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,0CAAyB;AACzB,wCAAyD;ADCzD;AACA;AEDA,4EAAgB;AAET,IAAM,MAAA,EAAQ,eAAA;AFErB;AACA;ACiDA,SAAS,cAAA,CACP,MAAA,EACA,WAAA,EACA,QAAA,EAII,CAAC,CAAA,EACkC;AAQvC,EAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,IAAW,IAAA,EAAM,OAAA,EAAS,0BAAA,MAAY,CAAA;AAGlD,EAAA,MAAM,UAAA,EAAY,OAAA,CAAQ,UAAA,GAAa,CAAA;AAGvC,EAAA,MAAM,qBAAA,EAAuB,sCAAA,WAAgB,EAAa,OAAA,CAAQ,KAAK,CAAA;AAGvE,EAAA,IAAI,KAAA,EAAO,IAAI,KAAA,CAAM,MAAA,CAAO,QAAA,CAAS,MAAM,CAAA;AAG3C,EAAA,IAAI,QAAA,EAAU,MAAA,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AAAA,EACF,CAAC,CAAA;AAGD,EAAA,MAAA,CAAO,QAAA,CAAS,OAAA,CAAQ,CAAC,CAAA,EAAG,KAAA,EAAA,GAAU;AACpC,IAAA,IAAI,aAAA,EAAe,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA;AACxC,IAAA,GAAA,CAAI,CAAC,YAAA,CAAa,UAAA,EAAY;AAC5B,MAAA,YAAA,CAAa,WAAA,EAAa,CAAC,CAAA;AAAA,IAC7B;AAEA,IAAA,GAAA,CAAI,UAAA,CAAW,KAAK,EAAA,GAAK,CAAA,EAAG;AAC1B,MAAA,YAAA,CAAa,UAAA,CAAW,OAAA,EAAS,OAAA,CAAQ,KAAK,EAAA,EAAI,OAAA,EAAS,MAAA;AAC3D,MAAA,YAAA,CAAa,UAAA,CAAW,QAAA,EAAU,UAAA,CAAW,KAAK,CAAA;AAAA,IACpD,EAAA,KAAO;AACL,MAAA,YAAA,CAAa,UAAA,CAAW,OAAA,EAAS,OAAA;AAAA,IACnC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAO,MAAA;AACT;AAGA,IAAO,6BAAA,EAAQ,cAAA;ADhGf;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
|
+
{"version":3,"sources":["/home/runner/work/turf/turf/packages/turf-clusters-dbscan/dist/cjs/index.cjs","../../index.ts"],"names":[],"mappings":"AAAA;ACCA,oCAAsB;AACtB,0CAAyB;AACzB,wCAAyD;AACzD,4EAAkB;AAsDlB,SAAS,cAAA,CACP,MAAA,EACA,WAAA,EACA,QAAA,EAII,CAAC,CAAA,EACkC;AAQvC,EAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,IAAW,IAAA,EAAM,OAAA,EAAS,0BAAA,MAAY,CAAA;AAGlD,EAAA,MAAM,UAAA,EAAY,OAAA,CAAQ,UAAA,GAA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,eAAA;AACpB,MAAA,eAAA,EAAA;AACA,MAAA,OAAA,CAAQ,KAAK,EAAA,EAAI,IAAA;AACjB,MAAA,aAAA,CAAc,WAAA,EAAa,SAAS,CAAA;AAAA,IACtC,EAAA,KAAO;AACL,MAAA,OAAA,CAAQ,KAAK,EAAA,EAAI,IAAA;AAAA,IACnB;AAAA,EACF,CAAC,CAAA;AAGD,EAAA,MAAA,CAAO,QAAA,CAAS,OAAA,CAAQ,CAAC,CAAA,EAAG,KAAA,EAAA,GAAU;AACpC,IAAA,IAAI,aAAA,EAAe,MAAA,CAAO,QAAA,CAAS,KAAK,CAAA;AACxC,IAAA,GAAA,CAAI,CAAC,YAAA,CAAa,UAAA,EAAY;AAC5B,MAAA,YAAA,CAAa,WAAA,EAAa,CAAC,CAAA;AAAA,IAC7B;AAEA,IAAA,GAAA,CAAI,UAAA,CAAW,KAAK,EAAA,GAAK,CAAA,EAAG;AAC1B,MAAA,YAAA,CAAa,UAAA,CAAW,OAAA,EAAS,OAAA,CAAQ,KAAK,EAAA,EAAI,OAAA,EAAS,MAAA;AAC3D,MAAA,YAAA,CAAa,UAAA,CAAW,QAAA,EAAU,UAAA,CAAW,KAAK,CAAA;AAAA,IACpD,EAAA,KAAO;AACL,MAAA,YAAA,CAAa,UAAA,CAAW,OAAA,EAAS,OAAA;AAAA,IACnC;AAAA,EACF,CAAC,CAAA;AAED,EAAA,OAAO,MAAA;AACT;AAGA,IAAO,cAAA,EAAQ,cAAA;ADrGf;AACE;AACA;AACF,yEAAC","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 from \"rbush\";\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 {Units} [options.units=\"kilometers\"] in which `maxDistance` is expressed, Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}\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"]}
|
|
@@ -26,7 +26,7 @@ type DbscanProps = GeoJsonProperties & {
|
|
|
26
26
|
* @param {FeatureCollection<Point>} points to be clustered
|
|
27
27
|
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
|
|
28
28
|
* @param {Object} [options={}] Optional parameters
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {Units} [options.units="kilometers"] in which `maxDistance` is expressed, Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}
|
|
30
30
|
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
|
|
31
31
|
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
|
|
32
32
|
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
|
|
@@ -26,7 +26,7 @@ type DbscanProps = GeoJsonProperties & {
|
|
|
26
26
|
* @param {FeatureCollection<Point>} points to be clustered
|
|
27
27
|
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers by default, see options)
|
|
28
28
|
* @param {Object} [options={}] Optional parameters
|
|
29
|
-
* @param {
|
|
29
|
+
* @param {Units} [options.units="kilometers"] in which `maxDistance` is expressed, Supports all valid Turf {@link https://turfjs.org/docs/api/types/Units Units}
|
|
30
30
|
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
|
|
31
31
|
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
|
|
32
32
|
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
|
|
@@ -2,17 +2,12 @@
|
|
|
2
2
|
import { clone } from "@turf/clone";
|
|
3
3
|
import { distance } from "@turf/distance";
|
|
4
4
|
import { degreesToRadians, lengthToDegrees } from "@turf/helpers";
|
|
5
|
-
|
|
6
|
-
// lib/rbush-export.ts
|
|
7
|
-
import lib from "rbush";
|
|
8
|
-
var rbush = lib;
|
|
9
|
-
|
|
10
|
-
// index.ts
|
|
5
|
+
import RBush from "rbush";
|
|
11
6
|
function clustersDbscan(points, maxDistance, options = {}) {
|
|
12
7
|
if (options.mutate !== true) points = clone(points);
|
|
13
8
|
const minPoints = options.minPoints || 3;
|
|
14
9
|
const latDistanceInDegrees = lengthToDegrees(maxDistance, options.units);
|
|
15
|
-
var tree = new
|
|
10
|
+
var tree = new RBush(points.features.length);
|
|
16
11
|
var visited = points.features.map((_) => false);
|
|
17
12
|
var assigned = points.features.map((_) => false);
|
|
18
13
|
var isnoise = points.features.map((_) => false);
|
|
@@ -102,9 +97,9 @@ function clustersDbscan(points, maxDistance, options = {}) {
|
|
|
102
97
|
});
|
|
103
98
|
return points;
|
|
104
99
|
}
|
|
105
|
-
var
|
|
100
|
+
var index_default = clustersDbscan;
|
|
106
101
|
export {
|
|
107
102
|
clustersDbscan,
|
|
108
|
-
|
|
103
|
+
index_default as default
|
|
109
104
|
};
|
|
110
105
|
//# sourceMappingURL=index.js.map
|