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/bbox-clip/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.

68
frontend/node_modules/@turf/bbox-clip/README.md generated vendored Normal file
View File

@@ -0,0 +1,68 @@
# @turf/bbox-clip
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## bboxClip
Takes a [Feature][1] and a bbox and clips the feature to the bbox using [lineclip][2].
May result in degenerate edges when clipping Polygons.
**Parameters**
- `feature` **[Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>** feature to clip to the bbox
- `bbox` **[BBox][8]** extent in [minX, minY, maxX, maxY] order
**Examples**
```javascript
var bbox = [0, 0, 10, 10];
var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
var clipped = turf.bboxClip(poly, bbox);
//addToMap
var addToMap = [bbox, poly, clipped]
```
Returns **[Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>** clipped Feature
[1]: https://tools.ietf.org/html/rfc7946#section-3.2
[2]: https://github.com/mapbox/lineclip
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[8]: https://tools.ietf.org/html/rfc7946#section-5
<!-- 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/bbox-clip
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

68
frontend/node_modules/@turf/bbox-clip/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,68 @@
import { lineString, multiLineString, multiPolygon, polygon, } from "@turf/helpers";
import { getGeom } from "@turf/invariant";
import { lineclip, polygonclip } from "./lib/lineclip.js";
/**
* Takes a {@link Feature} and a bbox and clips the feature to the bbox using
* [lineclip](https://github.com/mapbox/lineclip).
* May result in degenerate edges when clipping Polygons.
*
* @name bboxClip
* @param {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} feature feature to clip to the bbox
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} clipped Feature
* @example
* var bbox = [0, 0, 10, 10];
* var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
*
* var clipped = turf.bboxClip(poly, bbox);
*
* //addToMap
* var addToMap = [bbox, poly, clipped]
*/
export default function bboxClip(feature, bbox) {
var geom = getGeom(feature);
var type = geom.type;
var properties = feature.type === "Feature" ? feature.properties : {};
var coords = geom.coordinates;
switch (type) {
case "LineString":
case "MultiLineString": {
var lines_1 = [];
if (type === "LineString") {
coords = [coords];
}
coords.forEach(function (line) {
lineclip(line, bbox, lines_1);
});
if (lines_1.length === 1) {
return lineString(lines_1[0], properties);
}
return multiLineString(lines_1, properties);
}
case "Polygon":
return polygon(clipPolygon(coords, bbox), properties);
case "MultiPolygon":
return multiPolygon(coords.map(function (poly) {
return clipPolygon(poly, bbox);
}), properties);
default:
throw new Error("geometry " + type + " not supported");
}
}
function clipPolygon(rings, bbox) {
var outRings = [];
for (var _i = 0, rings_1 = rings; _i < rings_1.length; _i++) {
var ring = rings_1[_i];
var clipped = polygonclip(ring, bbox);
if (clipped.length > 0) {
if (clipped[0][0] !== clipped[clipped.length - 1][0] ||
clipped[0][1] !== clipped[clipped.length - 1][1]) {
clipped.push(clipped[0]);
}
if (clipped.length >= 4) {
outRings.push(clipped);
}
}
}
return outRings;
}

107
frontend/node_modules/@turf/bbox-clip/dist/es/lib/lineclip.js generated vendored Executable file
View File

@@ -0,0 +1,107 @@
// Cohen-Sutherland line clipping algorithm, adapted to efficiently
// handle polylines rather than just segments
export function lineclip(points, bbox, result) {
var len = points.length, codeA = bitCode(points[0], bbox), part = [], i, codeB, lastCode;
var a;
var b;
if (!result)
result = [];
for (i = 1; i < len; i++) {
a = points[i - 1];
b = points[i];
codeB = lastCode = bitCode(b, bbox);
while (true) {
if (!(codeA | codeB)) {
// accept
part.push(a);
if (codeB !== lastCode) {
// segment went outside
part.push(b);
if (i < len - 1) {
// start a new line
result.push(part);
part = [];
}
}
else if (i === len - 1) {
part.push(b);
}
break;
}
else if (codeA & codeB) {
// trivial reject
break;
}
else if (codeA) {
// a outside, intersect with clip edge
a = intersect(a, b, codeA, bbox);
codeA = bitCode(a, bbox);
}
else {
// b outside
b = intersect(a, b, codeB, bbox);
codeB = bitCode(b, bbox);
}
}
codeA = lastCode;
}
if (part.length)
result.push(part);
return result;
}
// Sutherland-Hodgeman polygon clipping algorithm
export function polygonclip(points, bbox) {
var result, edge, prev, prevInside, i, p, inside;
// clip against each side of the clip rectangle
for (edge = 1; edge <= 8; edge *= 2) {
result = [];
prev = points[points.length - 1];
prevInside = !(bitCode(prev, bbox) & edge);
for (i = 0; i < points.length; i++) {
p = points[i];
inside = !(bitCode(p, bbox) & edge);
// if segment goes through the clip window, add an intersection
if (inside !== prevInside)
result.push(intersect(prev, p, edge, bbox));
if (inside)
result.push(p); // add a point if it's inside
prev = p;
prevInside = inside;
}
points = result;
if (!points.length)
break;
}
return result;
}
// intersect a segment against one of the 4 lines that make up the bbox
function intersect(a, b, edge, bbox) {
return edge & 8
? [a[0] + ((b[0] - a[0]) * (bbox[3] - a[1])) / (b[1] - a[1]), bbox[3]] // top
: edge & 4
? [a[0] + ((b[0] - a[0]) * (bbox[1] - a[1])) / (b[1] - a[1]), bbox[1]] // bottom
: edge & 2
? [bbox[2], a[1] + ((b[1] - a[1]) * (bbox[2] - a[0])) / (b[0] - a[0])] // right
: edge & 1
? [bbox[0], a[1] + ((b[1] - a[1]) * (bbox[0] - a[0])) / (b[0] - a[0])] // left
: null;
}
// bit code reflects the point position relative to the bbox:
// left mid right
// top 1001 1000 1010
// mid 0001 0000 0010
// bottom 0101 0100 0110
function bitCode(p, bbox) {
var code = 0;
if (p[0] < bbox[0])
code |= 1;
// left
else if (p[0] > bbox[2])
code |= 2; // right
if (p[1] < bbox[1])
code |= 4;
// bottom
else if (p[1] > bbox[3])
code |= 8; // top
return code;
}

View File

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

20
frontend/node_modules/@turf/bbox-clip/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,20 @@
import { BBox, Feature, LineString, MultiLineString, MultiPolygon, Polygon, Properties } from "@turf/helpers";
/**
* Takes a {@link Feature} and a bbox and clips the feature to the bbox using
* [lineclip](https://github.com/mapbox/lineclip).
* May result in degenerate edges when clipping Polygons.
*
* @name bboxClip
* @param {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} feature feature to clip to the bbox
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} clipped Feature
* @example
* var bbox = [0, 0, 10, 10];
* var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
*
* var clipped = turf.bboxClip(poly, bbox);
*
* //addToMap
* var addToMap = [bbox, poly, clipped]
*/
export default function bboxClip<G extends Polygon | MultiPolygon | LineString | MultiLineString, P = Properties>(feature: Feature<G, P> | G, bbox: BBox): Feature<LineString, {}> | Feature<MultiLineString, {}> | Feature<Polygon, {}> | Feature<MultiPolygon, {}>;

71
frontend/node_modules/@turf/bbox-clip/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
var lineclip_1 = require("./lib/lineclip");
/**
* Takes a {@link Feature} and a bbox and clips the feature to the bbox using
* [lineclip](https://github.com/mapbox/lineclip).
* May result in degenerate edges when clipping Polygons.
*
* @name bboxClip
* @param {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} feature feature to clip to the bbox
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} clipped Feature
* @example
* var bbox = [0, 0, 10, 10];
* var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
*
* var clipped = turf.bboxClip(poly, bbox);
*
* //addToMap
* var addToMap = [bbox, poly, clipped]
*/
function bboxClip(feature, bbox) {
var geom = invariant_1.getGeom(feature);
var type = geom.type;
var properties = feature.type === "Feature" ? feature.properties : {};
var coords = geom.coordinates;
switch (type) {
case "LineString":
case "MultiLineString": {
var lines_1 = [];
if (type === "LineString") {
coords = [coords];
}
coords.forEach(function (line) {
lineclip_1.lineclip(line, bbox, lines_1);
});
if (lines_1.length === 1) {
return helpers_1.lineString(lines_1[0], properties);
}
return helpers_1.multiLineString(lines_1, properties);
}
case "Polygon":
return helpers_1.polygon(clipPolygon(coords, bbox), properties);
case "MultiPolygon":
return helpers_1.multiPolygon(coords.map(function (poly) {
return clipPolygon(poly, bbox);
}), properties);
default:
throw new Error("geometry " + type + " not supported");
}
}
exports.default = bboxClip;
function clipPolygon(rings, bbox) {
var outRings = [];
for (var _i = 0, rings_1 = rings; _i < rings_1.length; _i++) {
var ring = rings_1[_i];
var clipped = lineclip_1.polygonclip(ring, bbox);
if (clipped.length > 0) {
if (clipped[0][0] !== clipped[clipped.length - 1][0] ||
clipped[0][1] !== clipped[clipped.length - 1][1]) {
clipped.push(clipped[0]);
}
if (clipped.length >= 4) {
outRings.push(clipped);
}
}
}
return outRings;
}

View File

@@ -0,0 +1,3 @@
import { BBox } from "@turf/helpers";
export declare function lineclip(points: number[][], bbox: BBox, result?: number[][][]): number[][][];
export declare function polygonclip(points: number[][], bbox: BBox): number[][];

111
frontend/node_modules/@turf/bbox-clip/dist/js/lib/lineclip.js generated vendored Executable file
View File

@@ -0,0 +1,111 @@
"use strict";
// Cohen-Sutherland line clipping algorithm, adapted to efficiently
// handle polylines rather than just segments
Object.defineProperty(exports, "__esModule", { value: true });
function lineclip(points, bbox, result) {
var len = points.length, codeA = bitCode(points[0], bbox), part = [], i, codeB, lastCode;
var a;
var b;
if (!result)
result = [];
for (i = 1; i < len; i++) {
a = points[i - 1];
b = points[i];
codeB = lastCode = bitCode(b, bbox);
while (true) {
if (!(codeA | codeB)) {
// accept
part.push(a);
if (codeB !== lastCode) {
// segment went outside
part.push(b);
if (i < len - 1) {
// start a new line
result.push(part);
part = [];
}
}
else if (i === len - 1) {
part.push(b);
}
break;
}
else if (codeA & codeB) {
// trivial reject
break;
}
else if (codeA) {
// a outside, intersect with clip edge
a = intersect(a, b, codeA, bbox);
codeA = bitCode(a, bbox);
}
else {
// b outside
b = intersect(a, b, codeB, bbox);
codeB = bitCode(b, bbox);
}
}
codeA = lastCode;
}
if (part.length)
result.push(part);
return result;
}
exports.lineclip = lineclip;
// Sutherland-Hodgeman polygon clipping algorithm
function polygonclip(points, bbox) {
var result, edge, prev, prevInside, i, p, inside;
// clip against each side of the clip rectangle
for (edge = 1; edge <= 8; edge *= 2) {
result = [];
prev = points[points.length - 1];
prevInside = !(bitCode(prev, bbox) & edge);
for (i = 0; i < points.length; i++) {
p = points[i];
inside = !(bitCode(p, bbox) & edge);
// if segment goes through the clip window, add an intersection
if (inside !== prevInside)
result.push(intersect(prev, p, edge, bbox));
if (inside)
result.push(p); // add a point if it's inside
prev = p;
prevInside = inside;
}
points = result;
if (!points.length)
break;
}
return result;
}
exports.polygonclip = polygonclip;
// intersect a segment against one of the 4 lines that make up the bbox
function intersect(a, b, edge, bbox) {
return edge & 8
? [a[0] + ((b[0] - a[0]) * (bbox[3] - a[1])) / (b[1] - a[1]), bbox[3]] // top
: edge & 4
? [a[0] + ((b[0] - a[0]) * (bbox[1] - a[1])) / (b[1] - a[1]), bbox[1]] // bottom
: edge & 2
? [bbox[2], a[1] + ((b[1] - a[1]) * (bbox[2] - a[0])) / (b[0] - a[0])] // right
: edge & 1
? [bbox[0], a[1] + ((b[1] - a[1]) * (bbox[0] - a[0])) / (b[0] - a[0])] // left
: null;
}
// bit code reflects the point position relative to the bbox:
// left mid right
// top 1001 1000 1010
// mid 0001 0000 0010
// bottom 0101 0100 0110
function bitCode(p, bbox) {
var code = 0;
if (p[0] < bbox[0])
code |= 1;
// left
else if (p[0] > bbox[2])
code |= 2; // right
if (p[1] < bbox[1])
code |= 4;
// bottom
else if (p[1] > bbox[3])
code |= 8; // top
return code;
}

71
frontend/node_modules/@turf/bbox-clip/package.json generated vendored Normal file
View File

@@ -0,0 +1,71 @@
{
"name": "@turf/bbox-clip",
"version": "6.5.0",
"description": "turf bbox-clip module",
"author": "Turf Authors",
"contributors": [
"Tim Channell <@tcql>",
"Vladimir Agafonkin <@mourner>",
"Denis Carriere <@DenisCarriere>"
],
"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",
"gis",
"bbox",
"clip"
],
"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"
},
"devDependencies": {
"@turf/bbox": "^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"
}