all these changes

This commit is contained in:
Jake Kasper
2026-04-09 13:19:47 -05:00
parent e83a51a051
commit 65315f36d1
39102 changed files with 7932979 additions and 567 deletions

20
frontend/node_modules/@turf/clusters-dbscan/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright (c) 2017 TurfJS
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

73
frontend/node_modules/@turf/clusters-dbscan/README.md generated vendored Normal file
View File

@@ -0,0 +1,73 @@
# @turf/clusters-dbscan
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## clustersDbscan
Takes a set of [points][1] and partition them into clusters according to [https://en.wikipedia.org/wiki/DBSCAN][2] data clustering algorithm.
**Parameters**
- `points` **[FeatureCollection][3]&lt;[Point][4]>** to be clustered
- `maxDistance` **[number][5]** Maximum Distance between any point of the cluster to generate the clusters (kilometers only)
- `options` **[Object][6]** Optional parameters (optional, default `{}`)
- `options.units` **[string][7]** in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`)
- `options.mutate` **[boolean][8]** Allows GeoJSON input to be mutated (optional, default `false`)
- `options.minPoints` **[number][5]** Minimum number of points to generate a single cluster,
points which do not meet this requirement will be classified as an 'edge' or 'noise'. (optional, default `3`)
**Examples**
```javascript
// create random points with random z-values in their properties
var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});
var maxDistance = 100;
var clustered = turf.clustersDbscan(points, maxDistance);
//addToMap
var addToMap = [clustered];
```
Returns **[FeatureCollection][3]&lt;[Point][4]>** Clustered Points with an additional two properties associated to each Feature:- {number} cluster - the associated clusterId
- {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[2]: DBSCAN's
[3]: https://tools.ietf.org/html/rfc7946#section-3.3
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- This file is automatically generated. Please don't edit it directly:
if you find an error, edit the source file (likely index.js), and re-run
./scripts/generate-readmes in the turf project. -->
---
This module is part of the [Turfjs project](http://turfjs.org/), an open source
module collection dedicated to geographic algorithms. It is maintained in the
[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create
PRs and issues.
### Installation
Install this module individually:
```sh
$ npm install @turf/clusters-dbscan
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

70
frontend/node_modules/@turf/clusters-dbscan/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,70 @@
import clone from "@turf/clone";
import distance from "@turf/distance";
import { coordAll } from "@turf/meta";
import { convertLength, } from "@turf/helpers";
import clustering from "density-clustering";
/**
* Takes a set of {@link Point|points} and partition them into clusters according to {@link DBSCAN's|https://en.wikipedia.org/wiki/DBSCAN} data clustering algorithm.
*
* @name clustersDbscan
* @param {FeatureCollection<Point>} points to be clustered
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers only)
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units="kilometers"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
* @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:
* - {number} cluster - the associated clusterId
* - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
* @example
* // create random points with random z-values in their properties
* var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});
* var maxDistance = 100;
* var clustered = turf.clustersDbscan(points, maxDistance);
*
* //addToMap
* var addToMap = [clustered];
*/
function clustersDbscan(points, maxDistance, options) {
// Input validation being handled by Typescript
// collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');
// if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');
// if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');
// if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');
if (options === void 0) { options = {}; }
// Clone points to prevent any mutations
if (options.mutate !== true)
points = clone(points);
// Defaults
options.minPoints = options.minPoints || 3;
// create clustered ids
var dbscan = new clustering.DBSCAN();
var clusteredIds = dbscan.run(coordAll(points), convertLength(maxDistance, options.units), options.minPoints, distance);
// Tag points to Clusters ID
var clusterId = -1;
clusteredIds.forEach(function (clusterIds) {
clusterId++;
// assign cluster ids to input points
clusterIds.forEach(function (idx) {
var clusterPoint = points.features[idx];
if (!clusterPoint.properties)
clusterPoint.properties = {};
clusterPoint.properties.cluster = clusterId;
clusterPoint.properties.dbscan = "core";
});
});
// handle noise points, if any
// edges points are tagged by DBSCAN as both 'noise' and 'cluster' as they can "reach" less than 'minPoints' number of points
dbscan.noise.forEach(function (noiseId) {
var noisePoint = points.features[noiseId];
if (!noisePoint.properties)
noisePoint.properties = {};
if (noisePoint.properties.cluster)
noisePoint.properties.dbscan = "edge";
else
noisePoint.properties.dbscan = "noise";
});
return points;
}
export default clustersDbscan;

View File

@@ -0,0 +1 @@
{"type":"module"}

View File

@@ -0,0 +1,35 @@
import { Properties, Units, FeatureCollection, Point } from "@turf/helpers";
export declare type Dbscan = "core" | "edge" | "noise";
export declare type DbscanProps = Properties & {
dbscan?: Dbscan;
cluster?: number;
};
/**
* Takes a set of {@link Point|points} and partition them into clusters according to {@link DBSCAN's|https://en.wikipedia.org/wiki/DBSCAN} data clustering algorithm.
*
* @name clustersDbscan
* @param {FeatureCollection<Point>} points to be clustered
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers only)
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units="kilometers"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
* @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:
* - {number} cluster - the associated clusterId
* - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
* @example
* // create random points with random z-values in their properties
* var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});
* var maxDistance = 100;
* var clustered = turf.clustersDbscan(points, maxDistance);
*
* //addToMap
* var addToMap = [clustered];
*/
declare function clustersDbscan(points: FeatureCollection<Point>, maxDistance: number, options?: {
units?: Units;
minPoints?: number;
mutate?: boolean;
}): FeatureCollection<Point, DbscanProps>;
export default clustersDbscan;

75
frontend/node_modules/@turf/clusters-dbscan/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,75 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var clone_1 = __importDefault(require("@turf/clone"));
var distance_1 = __importDefault(require("@turf/distance"));
var meta_1 = require("@turf/meta");
var helpers_1 = require("@turf/helpers");
var density_clustering_1 = __importDefault(require("density-clustering"));
/**
* Takes a set of {@link Point|points} and partition them into clusters according to {@link DBSCAN's|https://en.wikipedia.org/wiki/DBSCAN} data clustering algorithm.
*
* @name clustersDbscan
* @param {FeatureCollection<Point>} points to be clustered
* @param {number} maxDistance Maximum Distance between any point of the cluster to generate the clusters (kilometers only)
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units="kilometers"] in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers
* @param {boolean} [options.mutate=false] Allows GeoJSON input to be mutated
* @param {number} [options.minPoints=3] Minimum number of points to generate a single cluster,
* points which do not meet this requirement will be classified as an 'edge' or 'noise'.
* @returns {FeatureCollection<Point>} Clustered Points with an additional two properties associated to each Feature:
* - {number} cluster - the associated clusterId
* - {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise')
* @example
* // create random points with random z-values in their properties
* var points = turf.randomPoint(100, {bbox: [0, 30, 20, 50]});
* var maxDistance = 100;
* var clustered = turf.clustersDbscan(points, maxDistance);
*
* //addToMap
* var addToMap = [clustered];
*/
function clustersDbscan(points, maxDistance, options) {
// Input validation being handled by Typescript
// collectionOf(points, 'Point', 'points must consist of a FeatureCollection of only Points');
// if (maxDistance === null || maxDistance === undefined) throw new Error('maxDistance is required');
// if (!(Math.sign(maxDistance) > 0)) throw new Error('maxDistance is invalid');
// if (!(minPoints === undefined || minPoints === null || Math.sign(minPoints) > 0)) throw new Error('options.minPoints is invalid');
if (options === void 0) { options = {}; }
// Clone points to prevent any mutations
if (options.mutate !== true)
points = clone_1.default(points);
// Defaults
options.minPoints = options.minPoints || 3;
// create clustered ids
var dbscan = new density_clustering_1.default.DBSCAN();
var clusteredIds = dbscan.run(meta_1.coordAll(points), helpers_1.convertLength(maxDistance, options.units), options.minPoints, distance_1.default);
// Tag points to Clusters ID
var clusterId = -1;
clusteredIds.forEach(function (clusterIds) {
clusterId++;
// assign cluster ids to input points
clusterIds.forEach(function (idx) {
var clusterPoint = points.features[idx];
if (!clusterPoint.properties)
clusterPoint.properties = {};
clusterPoint.properties.cluster = clusterId;
clusterPoint.properties.dbscan = "core";
});
});
// handle noise points, if any
// edges points are tagged by DBSCAN as both 'noise' and 'cluster' as they can "reach" less than 'minPoints' number of points
dbscan.noise.forEach(function (noiseId) {
var noisePoint = points.features[noiseId];
if (!noisePoint.properties)
noisePoint.properties = {};
if (noisePoint.properties.cluster)
noisePoint.properties.dbscan = "edge";
else
noisePoint.properties.dbscan = "noise";
});
return points;
}
exports.default = clustersDbscan;

View File

@@ -0,0 +1,81 @@
{
"name": "@turf/clusters-dbscan",
"version": "6.5.0",
"description": "turf clusters-dbscan module",
"author": "Turf Authors",
"contributors": [
"Lukasz <@uhho>",
"Denis Carriere <@DenisCarriere>",
"Stefano Borghi <@stebogit>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/Turfjs/turf/issues"
},
"homepage": "https://github.com/Turfjs/turf",
"repository": {
"type": "git",
"url": "git://github.com/Turfjs/turf.git"
},
"funding": "https://opencollective.com/turf",
"publishConfig": {
"access": "public"
},
"keywords": [
"turf",
"geojson",
"cluster",
"clusters",
"clustering",
"density",
"dbscan"
],
"main": "dist/js/index.js",
"module": "dist/es/index.js",
"exports": {
"./package.json": "./package.json",
".": {
"import": "./dist/es/index.js",
"require": "./dist/js/index.js"
}
},
"types": "dist/js/index.d.ts",
"sideEffects": false,
"files": [
"dist"
],
"scripts": {
"bench": "ts-node bench.js",
"build": "npm-run-all build:*",
"build:es": "tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json",
"build:js": "tsc",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "ts-node -r esm test.js",
"test:types": "tsc --esModuleInterop --noEmit types.ts"
},
"devDependencies": {
"@turf/centroid": "^6.5.0",
"@turf/clusters": "^6.5.0",
"@types/density-clustering": "^1.3.0",
"@types/tape": "*",
"benchmark": "*",
"chromatism": "*",
"concaveman": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/clone": "^6.5.0",
"@turf/distance": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/meta": "^6.5.0",
"density-clustering": "1.3.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}