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/clean-coords/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.

61
frontend/node_modules/@turf/clean-coords/README.md generated vendored Normal file
View File

@@ -0,0 +1,61 @@
# @turf/clean-coords
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## cleanCoords
Removes redundant coordinates from any GeoJSON Geometry.
**Parameters**
- `geojson` **([Geometry][1] \| [Feature][2])** Feature or Geometry
- `options` **[Object][3]** Optional parameters (optional, default `{}`)
- `options.mutate` **[boolean][4]** allows GeoJSON input to be mutated (optional, default `false`)
**Examples**
```javascript
var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);
var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);
turf.cleanCoords(line).geometry.coordinates;
//= [[0, 0], [0, 10]]
turf.cleanCoords(multiPoint).geometry.coordinates;
//= [[0, 0], [2, 2]]
```
Returns **([Geometry][1] \| [Feature][2])** the cleaned input Feature/Geometry
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[4]: 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/clean-coords
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

159
frontend/node_modules/@turf/clean-coords/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,159 @@
import { feature } from "@turf/helpers";
import { getCoords, getType } from "@turf/invariant";
// To-Do => Improve Typescript GeoJSON handling
/**
* Removes redundant coordinates from any GeoJSON Geometry.
*
* @name cleanCoords
* @param {Geometry|Feature} geojson Feature or Geometry
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated
* @returns {Geometry|Feature} the cleaned input Feature/Geometry
* @example
* var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);
* var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);
*
* turf.cleanCoords(line).geometry.coordinates;
* //= [[0, 0], [0, 10]]
*
* turf.cleanCoords(multiPoint).geometry.coordinates;
* //= [[0, 0], [2, 2]]
*/
function cleanCoords(geojson, options) {
if (options === void 0) { options = {}; }
// Backwards compatible with v4.0
var mutate = typeof options === "object" ? options.mutate : options;
if (!geojson)
throw new Error("geojson is required");
var type = getType(geojson);
// Store new "clean" points in this Array
var newCoords = [];
switch (type) {
case "LineString":
newCoords = cleanLine(geojson);
break;
case "MultiLineString":
case "Polygon":
getCoords(geojson).forEach(function (line) {
newCoords.push(cleanLine(line));
});
break;
case "MultiPolygon":
getCoords(geojson).forEach(function (polygons) {
var polyPoints = [];
polygons.forEach(function (ring) {
polyPoints.push(cleanLine(ring));
});
newCoords.push(polyPoints);
});
break;
case "Point":
return geojson;
case "MultiPoint":
var existing = {};
getCoords(geojson).forEach(function (coord) {
var key = coord.join("-");
if (!Object.prototype.hasOwnProperty.call(existing, key)) {
newCoords.push(coord);
existing[key] = true;
}
});
break;
default:
throw new Error(type + " geometry not supported");
}
// Support input mutation
if (geojson.coordinates) {
if (mutate === true) {
geojson.coordinates = newCoords;
return geojson;
}
return { type: type, coordinates: newCoords };
}
else {
if (mutate === true) {
geojson.geometry.coordinates = newCoords;
return geojson;
}
return feature({ type: type, coordinates: newCoords }, geojson.properties, {
bbox: geojson.bbox,
id: geojson.id,
});
}
}
/**
* Clean Coords
*
* @private
* @param {Array<number>|LineString} line Line
* @returns {Array<number>} Cleaned coordinates
*/
function cleanLine(line) {
var points = getCoords(line);
// handle "clean" segment
if (points.length === 2 && !equals(points[0], points[1]))
return points;
var newPoints = [];
var secondToLast = points.length - 1;
var newPointsLength = newPoints.length;
newPoints.push(points[0]);
for (var i = 1; i < secondToLast; i++) {
var prevAddedPoint = newPoints[newPoints.length - 1];
if (points[i][0] === prevAddedPoint[0] &&
points[i][1] === prevAddedPoint[1])
continue;
else {
newPoints.push(points[i]);
newPointsLength = newPoints.length;
if (newPointsLength > 2) {
if (isPointOnLineSegment(newPoints[newPointsLength - 3], newPoints[newPointsLength - 1], newPoints[newPointsLength - 2]))
newPoints.splice(newPoints.length - 2, 1);
}
}
}
newPoints.push(points[points.length - 1]);
newPointsLength = newPoints.length;
if (equals(points[0], points[points.length - 1]) && newPointsLength < 4)
throw new Error("invalid polygon");
if (isPointOnLineSegment(newPoints[newPointsLength - 3], newPoints[newPointsLength - 1], newPoints[newPointsLength - 2]))
newPoints.splice(newPoints.length - 2, 1);
return newPoints;
}
/**
* Compares two points and returns if they are equals
*
* @private
* @param {Position} pt1 point
* @param {Position} pt2 point
* @returns {boolean} true if they are equals
*/
function equals(pt1, pt2) {
return pt1[0] === pt2[0] && pt1[1] === pt2[1];
}
/**
* Returns if `point` is on the segment between `start` and `end`.
* Borrowed from `@turf/boolean-point-on-line` to speed up the evaluation (instead of using the module as dependency)
*
* @private
* @param {Position} start coord pair of start of line
* @param {Position} end coord pair of end of line
* @param {Position} point coord pair of point to check
* @returns {boolean} true/false
*/
function isPointOnLineSegment(start, end, point) {
var x = point[0], y = point[1];
var startX = start[0], startY = start[1];
var endX = end[0], endY = end[1];
var dxc = x - startX;
var dyc = y - startY;
var dxl = endX - startX;
var dyl = endY - startY;
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0)
return false;
else if (Math.abs(dxl) >= Math.abs(dyl))
return dxl > 0 ? startX <= x && x <= endX : endX <= x && x <= startX;
else
return dyl > 0 ? startY <= y && y <= endY : endY <= y && y <= startY;
}
export default cleanCoords;

View File

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

22
frontend/node_modules/@turf/clean-coords/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,22 @@
/**
* Removes redundant coordinates from any GeoJSON Geometry.
*
* @name cleanCoords
* @param {Geometry|Feature} geojson Feature or Geometry
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated
* @returns {Geometry|Feature} the cleaned input Feature/Geometry
* @example
* var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);
* var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);
*
* turf.cleanCoords(line).geometry.coordinates;
* //= [[0, 0], [0, 10]]
*
* turf.cleanCoords(multiPoint).geometry.coordinates;
* //= [[0, 0], [2, 2]]
*/
declare function cleanCoords(geojson: any, options?: {
mutate?: boolean;
}): any;
export default cleanCoords;

161
frontend/node_modules/@turf/clean-coords/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,161 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
// To-Do => Improve Typescript GeoJSON handling
/**
* Removes redundant coordinates from any GeoJSON Geometry.
*
* @name cleanCoords
* @param {Geometry|Feature} geojson Feature or Geometry
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.mutate=false] allows GeoJSON input to be mutated
* @returns {Geometry|Feature} the cleaned input Feature/Geometry
* @example
* var line = turf.lineString([[0, 0], [0, 2], [0, 5], [0, 8], [0, 8], [0, 10]]);
* var multiPoint = turf.multiPoint([[0, 0], [0, 0], [2, 2]]);
*
* turf.cleanCoords(line).geometry.coordinates;
* //= [[0, 0], [0, 10]]
*
* turf.cleanCoords(multiPoint).geometry.coordinates;
* //= [[0, 0], [2, 2]]
*/
function cleanCoords(geojson, options) {
if (options === void 0) { options = {}; }
// Backwards compatible with v4.0
var mutate = typeof options === "object" ? options.mutate : options;
if (!geojson)
throw new Error("geojson is required");
var type = invariant_1.getType(geojson);
// Store new "clean" points in this Array
var newCoords = [];
switch (type) {
case "LineString":
newCoords = cleanLine(geojson);
break;
case "MultiLineString":
case "Polygon":
invariant_1.getCoords(geojson).forEach(function (line) {
newCoords.push(cleanLine(line));
});
break;
case "MultiPolygon":
invariant_1.getCoords(geojson).forEach(function (polygons) {
var polyPoints = [];
polygons.forEach(function (ring) {
polyPoints.push(cleanLine(ring));
});
newCoords.push(polyPoints);
});
break;
case "Point":
return geojson;
case "MultiPoint":
var existing = {};
invariant_1.getCoords(geojson).forEach(function (coord) {
var key = coord.join("-");
if (!Object.prototype.hasOwnProperty.call(existing, key)) {
newCoords.push(coord);
existing[key] = true;
}
});
break;
default:
throw new Error(type + " geometry not supported");
}
// Support input mutation
if (geojson.coordinates) {
if (mutate === true) {
geojson.coordinates = newCoords;
return geojson;
}
return { type: type, coordinates: newCoords };
}
else {
if (mutate === true) {
geojson.geometry.coordinates = newCoords;
return geojson;
}
return helpers_1.feature({ type: type, coordinates: newCoords }, geojson.properties, {
bbox: geojson.bbox,
id: geojson.id,
});
}
}
/**
* Clean Coords
*
* @private
* @param {Array<number>|LineString} line Line
* @returns {Array<number>} Cleaned coordinates
*/
function cleanLine(line) {
var points = invariant_1.getCoords(line);
// handle "clean" segment
if (points.length === 2 && !equals(points[0], points[1]))
return points;
var newPoints = [];
var secondToLast = points.length - 1;
var newPointsLength = newPoints.length;
newPoints.push(points[0]);
for (var i = 1; i < secondToLast; i++) {
var prevAddedPoint = newPoints[newPoints.length - 1];
if (points[i][0] === prevAddedPoint[0] &&
points[i][1] === prevAddedPoint[1])
continue;
else {
newPoints.push(points[i]);
newPointsLength = newPoints.length;
if (newPointsLength > 2) {
if (isPointOnLineSegment(newPoints[newPointsLength - 3], newPoints[newPointsLength - 1], newPoints[newPointsLength - 2]))
newPoints.splice(newPoints.length - 2, 1);
}
}
}
newPoints.push(points[points.length - 1]);
newPointsLength = newPoints.length;
if (equals(points[0], points[points.length - 1]) && newPointsLength < 4)
throw new Error("invalid polygon");
if (isPointOnLineSegment(newPoints[newPointsLength - 3], newPoints[newPointsLength - 1], newPoints[newPointsLength - 2]))
newPoints.splice(newPoints.length - 2, 1);
return newPoints;
}
/**
* Compares two points and returns if they are equals
*
* @private
* @param {Position} pt1 point
* @param {Position} pt2 point
* @returns {boolean} true if they are equals
*/
function equals(pt1, pt2) {
return pt1[0] === pt2[0] && pt1[1] === pt2[1];
}
/**
* Returns if `point` is on the segment between `start` and `end`.
* Borrowed from `@turf/boolean-point-on-line` to speed up the evaluation (instead of using the module as dependency)
*
* @private
* @param {Position} start coord pair of start of line
* @param {Position} end coord pair of end of line
* @param {Position} point coord pair of point to check
* @returns {boolean} true/false
*/
function isPointOnLineSegment(start, end, point) {
var x = point[0], y = point[1];
var startX = start[0], startY = start[1];
var endX = end[0], endY = end[1];
var dxc = x - startX;
var dyc = y - startY;
var dxl = endX - startX;
var dyl = endY - startY;
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0)
return false;
else if (Math.abs(dxl) >= Math.abs(dyl))
return dxl > 0 ? startX <= x && x <= endX : endX <= x && x <= startX;
else
return dyl > 0 ? startY <= y && y <= endY : endY <= y && y <= startY;
}
exports.default = cleanCoords;

68
frontend/node_modules/@turf/clean-coords/package.json generated vendored Normal file
View File

@@ -0,0 +1,68 @@
{
"name": "@turf/clean-coords",
"version": "6.5.0",
"description": "turf clean-coords module",
"author": "Turf Authors",
"contributors": [
"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",
"gis",
"clean-coords"
],
"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/truncate": "^6.5.0",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}