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/line-offset/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.

69
frontend/node_modules/@turf/line-offset/README.md generated vendored Normal file
View File

@@ -0,0 +1,69 @@
# @turf/line-offset
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## lineOffset
Takes a [line][1] and returns a [line][1] at offset by the specified distance.
**Parameters**
- `geojson` **([Geometry][2] \| [Feature][3]&lt;([LineString][4] \| [MultiLineString][5])>)** input GeoJSON
- `distance` **[number][6]** distance to offset the line (can be of negative value)
- `options` **[Object][7]** Optional parameters (optional, default `{}`)
- `options.units` **[string][8]** can be degrees, radians, miles, kilometers, inches, yards, meters (optional, default `'kilometers'`)
**Examples**
```javascript
var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]], { "stroke": "#F00" });
var offsetLine = turf.lineOffset(line, 2, {units: 'miles'});
//addToMap
var addToMap = [offsetLine, line]
offsetLine.properties.stroke = "#00F"
```
Returns **[Feature][3]&lt;([LineString][4] \| [MultiLineString][5])>** Line offset from the input line
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[2]: https://tools.ietf.org/html/rfc7946#section-3.1
[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://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
<!-- 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/line-offset
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

243
frontend/node_modules/@turf/line-offset/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,243 @@
import { flattenEach } from '@turf/meta';
import { getType, getCoords } from '@turf/invariant';
import { isObject, lineString, multiLineString, lengthToDegrees } from '@turf/helpers';
/**
* https://github.com/rook2pawn/node-intersection
*
* Author @rook2pawn
*/
/**
* AB
*
* @private
* @param {Array<Array<number>>} segment - 2 vertex line segment
* @returns {Array<number>} coordinates [x, y]
*/
function ab(segment) {
var start = segment[0];
var end = segment[1];
return [end[0] - start[0], end[1] - start[1]];
}
/**
* Cross Product
*
* @private
* @param {Array<number>} v1 coordinates [x, y]
* @param {Array<number>} v2 coordinates [x, y]
* @returns {Array<number>} Cross Product
*/
function crossProduct(v1, v2) {
return v1[0] * v2[1] - v2[0] * v1[1];
}
/**
* Add
*
* @private
* @param {Array<number>} v1 coordinates [x, y]
* @param {Array<number>} v2 coordinates [x, y]
* @returns {Array<number>} Add
*/
function add(v1, v2) {
return [v1[0] + v2[0], v1[1] + v2[1]];
}
/**
* Sub
*
* @private
* @param {Array<number>} v1 coordinates [x, y]
* @param {Array<number>} v2 coordinates [x, y]
* @returns {Array<number>} Sub
*/
function sub(v1, v2) {
return [v1[0] - v2[0], v1[1] - v2[1]];
}
/**
* scalarMult
*
* @private
* @param {number} s scalar
* @param {Array<number>} v coordinates [x, y]
* @returns {Array<number>} scalarMult
*/
function scalarMult(s, v) {
return [s * v[0], s * v[1]];
}
/**
* Intersect Segments
*
* @private
* @param {Array<number>} a coordinates [x, y]
* @param {Array<number>} b coordinates [x, y]
* @returns {Array<number>} intersection
*/
function intersectSegments(a, b) {
var p = a[0];
var r = ab(a);
var q = b[0];
var s = ab(b);
var cross = crossProduct(r, s);
var qmp = sub(q, p);
var numerator = crossProduct(qmp, s);
var t = numerator / cross;
var intersection = add(p, scalarMult(t, r));
return intersection;
}
/**
* Is Parallel
*
* @private
* @param {Array<number>} a coordinates [x, y]
* @param {Array<number>} b coordinates [x, y]
* @returns {boolean} true if a and b are parallel (or co-linear)
*/
function isParallel(a, b) {
var r = ab(a);
var s = ab(b);
return crossProduct(r, s) === 0;
}
/**
* Intersection
*
* @private
* @param {Array<number>} a coordinates [x, y]
* @param {Array<number>} b coordinates [x, y]
* @returns {Array<number>|boolean} true if a and b are parallel (or co-linear)
*/
function intersection(a, b) {
if (isParallel(a, b)) return false;
return intersectSegments(a, b);
}
/**
* Takes a {@link LineString|line} and returns a {@link LineString|line} at offset by the specified distance.
*
* @name lineOffset
* @param {Geometry|Feature<LineString|MultiLineString>} geojson input GeoJSON
* @param {number} distance distance to offset the line (can be of negative value)
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, kilometers, inches, yards, meters
* @returns {Feature<LineString|MultiLineString>} Line offset from the input line
* @example
* var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]], { "stroke": "#F00" });
*
* var offsetLine = turf.lineOffset(line, 2, {units: 'miles'});
*
* //addToMap
* var addToMap = [offsetLine, line]
* offsetLine.properties.stroke = "#00F"
*/
function lineOffset(geojson, distance, options) {
// Optional parameters
options = options || {};
if (!isObject(options)) throw new Error("options is invalid");
var units = options.units;
// Valdiation
if (!geojson) throw new Error("geojson is required");
if (distance === undefined || distance === null || isNaN(distance))
throw new Error("distance is required");
var type = getType(geojson);
var properties = geojson.properties;
switch (type) {
case "LineString":
return lineOffsetFeature(geojson, distance, units);
case "MultiLineString":
var coords = [];
flattenEach(geojson, function (feature) {
coords.push(
lineOffsetFeature(feature, distance, units).geometry.coordinates
);
});
return multiLineString(coords, properties);
default:
throw new Error("geometry " + type + " is not supported");
}
}
/**
* Line Offset
*
* @private
* @param {Geometry|Feature<LineString>} line input line
* @param {number} distance distance to offset the line (can be of negative value)
* @param {string} [units=kilometers] units
* @returns {Feature<LineString>} Line offset from the input line
*/
function lineOffsetFeature(line, distance, units) {
var segments = [];
var offsetDegrees = lengthToDegrees(distance, units);
var coords = getCoords(line);
var finalCoords = [];
coords.forEach(function (currentCoords, index) {
if (index !== coords.length - 1) {
var segment = processSegment(
currentCoords,
coords[index + 1],
offsetDegrees
);
segments.push(segment);
if (index > 0) {
var seg2Coords = segments[index - 1];
var intersects = intersection(segment, seg2Coords);
// Handling for line segments that aren't straight
if (intersects !== false) {
seg2Coords[1] = intersects;
segment[0] = intersects;
}
finalCoords.push(seg2Coords[0]);
if (index === coords.length - 2) {
finalCoords.push(segment[0]);
finalCoords.push(segment[1]);
}
}
// Handling for lines that only have 1 segment
if (coords.length === 2) {
finalCoords.push(segment[0]);
finalCoords.push(segment[1]);
}
}
});
return lineString(finalCoords, line.properties);
}
/**
* Process Segment
* Inspiration taken from http://stackoverflow.com/questions/2825412/draw-a-parallel-line
*
* @private
* @param {Array<number>} point1 Point coordinates
* @param {Array<number>} point2 Point coordinates
* @param {number} offset Offset
* @returns {Array<Array<number>>} offset points
*/
function processSegment(point1, point2, offset) {
var L = Math.sqrt(
(point1[0] - point2[0]) * (point1[0] - point2[0]) +
(point1[1] - point2[1]) * (point1[1] - point2[1])
);
var out1x = point1[0] + (offset * (point2[1] - point1[1])) / L;
var out2x = point2[0] + (offset * (point2[1] - point1[1])) / L;
var out1y = point1[1] + (offset * (point1[0] - point2[0])) / L;
var out2y = point2[1] + (offset * (point1[0] - point2[0])) / L;
return [
[out1x, out1y],
[out2x, out2y],
];
}
export default lineOffset;

View File

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

246
frontend/node_modules/@turf/line-offset/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,246 @@
'use strict';
var meta = require('@turf/meta');
var invariant = require('@turf/invariant');
var helpers = require('@turf/helpers');
/**
* https://github.com/rook2pawn/node-intersection
*
* Author @rook2pawn
*/
/**
* AB
*
* @private
* @param {Array<Array<number>>} segment - 2 vertex line segment
* @returns {Array<number>} coordinates [x, y]
*/
function ab(segment) {
var start = segment[0];
var end = segment[1];
return [end[0] - start[0], end[1] - start[1]];
}
/**
* Cross Product
*
* @private
* @param {Array<number>} v1 coordinates [x, y]
* @param {Array<number>} v2 coordinates [x, y]
* @returns {Array<number>} Cross Product
*/
function crossProduct(v1, v2) {
return v1[0] * v2[1] - v2[0] * v1[1];
}
/**
* Add
*
* @private
* @param {Array<number>} v1 coordinates [x, y]
* @param {Array<number>} v2 coordinates [x, y]
* @returns {Array<number>} Add
*/
function add(v1, v2) {
return [v1[0] + v2[0], v1[1] + v2[1]];
}
/**
* Sub
*
* @private
* @param {Array<number>} v1 coordinates [x, y]
* @param {Array<number>} v2 coordinates [x, y]
* @returns {Array<number>} Sub
*/
function sub(v1, v2) {
return [v1[0] - v2[0], v1[1] - v2[1]];
}
/**
* scalarMult
*
* @private
* @param {number} s scalar
* @param {Array<number>} v coordinates [x, y]
* @returns {Array<number>} scalarMult
*/
function scalarMult(s, v) {
return [s * v[0], s * v[1]];
}
/**
* Intersect Segments
*
* @private
* @param {Array<number>} a coordinates [x, y]
* @param {Array<number>} b coordinates [x, y]
* @returns {Array<number>} intersection
*/
function intersectSegments(a, b) {
var p = a[0];
var r = ab(a);
var q = b[0];
var s = ab(b);
var cross = crossProduct(r, s);
var qmp = sub(q, p);
var numerator = crossProduct(qmp, s);
var t = numerator / cross;
var intersection = add(p, scalarMult(t, r));
return intersection;
}
/**
* Is Parallel
*
* @private
* @param {Array<number>} a coordinates [x, y]
* @param {Array<number>} b coordinates [x, y]
* @returns {boolean} true if a and b are parallel (or co-linear)
*/
function isParallel(a, b) {
var r = ab(a);
var s = ab(b);
return crossProduct(r, s) === 0;
}
/**
* Intersection
*
* @private
* @param {Array<number>} a coordinates [x, y]
* @param {Array<number>} b coordinates [x, y]
* @returns {Array<number>|boolean} true if a and b are parallel (or co-linear)
*/
function intersection(a, b) {
if (isParallel(a, b)) return false;
return intersectSegments(a, b);
}
/**
* Takes a {@link LineString|line} and returns a {@link LineString|line} at offset by the specified distance.
*
* @name lineOffset
* @param {Geometry|Feature<LineString|MultiLineString>} geojson input GeoJSON
* @param {number} distance distance to offset the line (can be of negative value)
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, kilometers, inches, yards, meters
* @returns {Feature<LineString|MultiLineString>} Line offset from the input line
* @example
* var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]], { "stroke": "#F00" });
*
* var offsetLine = turf.lineOffset(line, 2, {units: 'miles'});
*
* //addToMap
* var addToMap = [offsetLine, line]
* offsetLine.properties.stroke = "#00F"
*/
function lineOffset(geojson, distance, options) {
// Optional parameters
options = options || {};
if (!helpers.isObject(options)) throw new Error("options is invalid");
var units = options.units;
// Valdiation
if (!geojson) throw new Error("geojson is required");
if (distance === undefined || distance === null || isNaN(distance))
throw new Error("distance is required");
var type = invariant.getType(geojson);
var properties = geojson.properties;
switch (type) {
case "LineString":
return lineOffsetFeature(geojson, distance, units);
case "MultiLineString":
var coords = [];
meta.flattenEach(geojson, function (feature) {
coords.push(
lineOffsetFeature(feature, distance, units).geometry.coordinates
);
});
return helpers.multiLineString(coords, properties);
default:
throw new Error("geometry " + type + " is not supported");
}
}
/**
* Line Offset
*
* @private
* @param {Geometry|Feature<LineString>} line input line
* @param {number} distance distance to offset the line (can be of negative value)
* @param {string} [units=kilometers] units
* @returns {Feature<LineString>} Line offset from the input line
*/
function lineOffsetFeature(line, distance, units) {
var segments = [];
var offsetDegrees = helpers.lengthToDegrees(distance, units);
var coords = invariant.getCoords(line);
var finalCoords = [];
coords.forEach(function (currentCoords, index) {
if (index !== coords.length - 1) {
var segment = processSegment(
currentCoords,
coords[index + 1],
offsetDegrees
);
segments.push(segment);
if (index > 0) {
var seg2Coords = segments[index - 1];
var intersects = intersection(segment, seg2Coords);
// Handling for line segments that aren't straight
if (intersects !== false) {
seg2Coords[1] = intersects;
segment[0] = intersects;
}
finalCoords.push(seg2Coords[0]);
if (index === coords.length - 2) {
finalCoords.push(segment[0]);
finalCoords.push(segment[1]);
}
}
// Handling for lines that only have 1 segment
if (coords.length === 2) {
finalCoords.push(segment[0]);
finalCoords.push(segment[1]);
}
}
});
return helpers.lineString(finalCoords, line.properties);
}
/**
* Process Segment
* Inspiration taken from http://stackoverflow.com/questions/2825412/draw-a-parallel-line
*
* @private
* @param {Array<number>} point1 Point coordinates
* @param {Array<number>} point2 Point coordinates
* @param {number} offset Offset
* @returns {Array<Array<number>>} offset points
*/
function processSegment(point1, point2, offset) {
var L = Math.sqrt(
(point1[0] - point2[0]) * (point1[0] - point2[0]) +
(point1[1] - point2[1]) * (point1[1] - point2[1])
);
var out1x = point1[0] + (offset * (point2[1] - point1[1])) / L;
var out2x = point2[0] + (offset * (point2[1] - point1[1])) / L;
var out1y = point1[1] + (offset * (point1[0] - point2[0])) / L;
var out2y = point2[1] + (offset * (point1[0] - point2[0])) / L;
return [
[out1x, out1y],
[out2x, out2y],
];
}
module.exports = lineOffset;
module.exports.default = lineOffset;

12
frontend/node_modules/@turf/line-offset/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
import { Units, Feature, LineString, MultiLineString } from "@turf/helpers";
/**
* http://turfjs.org/docs/#lineoffset
*/
export default function lineOffset<T extends LineString | MultiLineString>(
line: Feature<T> | T,
distance: number,
options?: {
units?: Units;
}
): Feature<T>;

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

@@ -0,0 +1,68 @@
{
"name": "@turf/line-offset",
"version": "6.5.0",
"description": "turf line-offset module",
"author": "Turf Authors",
"contributors": [
"David Wee <@rook2pawn>",
"Rowan Winsemius <@rowanwins>",
"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": [
"line",
"linestring",
"turf",
"offset"
],
"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": "index.d.ts",
"sideEffects": false,
"files": [
"dist",
"index.d.ts"
],
"scripts": {
"bench": "node -r esm bench.js",
"build": "rollup -c ../../rollup.config.js && echo '{\"type\":\"module\"}' > dist/es/package.json",
"docs": "node ../../scripts/generate-readmes",
"test": "npm-run-all test:*",
"test:tape": "node -r esm test.js",
"test:types": "tsc --esModuleInterop --noEmit types.ts"
},
"devDependencies": {
"@turf/truncate": "^6.5.0",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"@turf/meta": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}