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-overlap/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.

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

@@ -0,0 +1,71 @@
# @turf/line-overlap
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## lineOverlap
Takes any LineString or Polygon and returns the overlapping lines between both features.
**Parameters**
- `line1` **([Geometry][1] \| [Feature][2]&lt;([LineString][3] \| [MultiLineString][4] \| [Polygon][5] \| [MultiPolygon][6])>)** any LineString or Polygon
- `line2` **([Geometry][1] \| [Feature][2]&lt;([LineString][3] \| [MultiLineString][4] \| [Polygon][5] \| [MultiPolygon][6])>)** any LineString or Polygon
- `options` **[Object][7]** Optional parameters (optional, default `{}`)
- `options.tolerance` **[number][8]** Tolerance distance to match overlapping line segments (in kilometers) (optional, default `0`)
**Examples**
```javascript
var line1 = turf.lineString([[115, -35], [125, -30], [135, -30], [145, -35]]);
var line2 = turf.lineString([[115, -25], [125, -30], [135, -30], [145, -25]]);
var overlapping = turf.lineOverlap(line1, line2);
//addToMap
var addToMap = [line1, line2, overlapping]
```
Returns **[FeatureCollection][9]&lt;[LineString][3]>** lines(s) that are overlapping between both features
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[9]: https://tools.ietf.org/html/rfc7946#section-3.3
<!-- 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-overlap
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

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

@@ -0,0 +1,128 @@
import rbush from "geojson-rbush";
import lineSegment from "@turf/line-segment";
import nearestPointOnLine from "@turf/nearest-point-on-line";
import booleanPointOnLine from "@turf/boolean-point-on-line";
import { getCoords } from "@turf/invariant";
import { featureEach, segmentEach } from "@turf/meta";
import { featureCollection, isObject, } from "@turf/helpers";
import equal from "deep-equal";
/**
* Takes any LineString or Polygon and returns the overlapping lines between both features.
*
* @name lineOverlap
* @param {Geometry|Feature<LineString|MultiLineString|Polygon|MultiPolygon>} line1 any LineString or Polygon
* @param {Geometry|Feature<LineString|MultiLineString|Polygon|MultiPolygon>} line2 any LineString or Polygon
* @param {Object} [options={}] Optional parameters
* @param {number} [options.tolerance=0] Tolerance distance to match overlapping line segments (in kilometers)
* @returns {FeatureCollection<LineString>} lines(s) that are overlapping between both features
* @example
* var line1 = turf.lineString([[115, -35], [125, -30], [135, -30], [145, -35]]);
* var line2 = turf.lineString([[115, -25], [125, -30], [135, -30], [145, -25]]);
*
* var overlapping = turf.lineOverlap(line1, line2);
*
* //addToMap
* var addToMap = [line1, line2, overlapping]
*/
function lineOverlap(line1, line2, options) {
if (options === void 0) { options = {}; }
// Optional parameters
options = options || {};
if (!isObject(options))
throw new Error("options is invalid");
var tolerance = options.tolerance || 0;
// Containers
var features = [];
// Create Spatial Index
var tree = rbush();
// To-Do -- HACK way to support typescript
var line = lineSegment(line1);
tree.load(line);
var overlapSegment;
// Line Intersection
// Iterate over line segments
segmentEach(line2, function (segment) {
var doesOverlaps = false;
if (!segment) {
return;
}
// Iterate over each segments which falls within the same bounds
featureEach(tree.search(segment), function (match) {
if (doesOverlaps === false) {
var coordsSegment = getCoords(segment).sort();
var coordsMatch = getCoords(match).sort();
// Segment overlaps feature
if (equal(coordsSegment, coordsMatch)) {
doesOverlaps = true;
// Overlaps already exists - only append last coordinate of segment
if (overlapSegment)
overlapSegment = concatSegment(overlapSegment, segment);
else
overlapSegment = segment;
// Match segments which don't share nodes (Issue #901)
}
else if (tolerance === 0
? booleanPointOnLine(coordsSegment[0], match) &&
booleanPointOnLine(coordsSegment[1], match)
: nearestPointOnLine(match, coordsSegment[0]).properties.dist <=
tolerance &&
nearestPointOnLine(match, coordsSegment[1]).properties.dist <=
tolerance) {
doesOverlaps = true;
if (overlapSegment)
overlapSegment = concatSegment(overlapSegment, segment);
else
overlapSegment = segment;
}
else if (tolerance === 0
? booleanPointOnLine(coordsMatch[0], segment) &&
booleanPointOnLine(coordsMatch[1], segment)
: nearestPointOnLine(segment, coordsMatch[0]).properties.dist <=
tolerance &&
nearestPointOnLine(segment, coordsMatch[1]).properties.dist <=
tolerance) {
// Do not define (doesOverlap = true) since more matches can occur within the same segment
// doesOverlaps = true;
if (overlapSegment)
overlapSegment = concatSegment(overlapSegment, match);
else
overlapSegment = match;
}
}
});
// Segment doesn't overlap - add overlaps to results & reset
if (doesOverlaps === false && overlapSegment) {
features.push(overlapSegment);
overlapSegment = undefined;
}
});
// Add last segment if exists
if (overlapSegment)
features.push(overlapSegment);
return featureCollection(features);
}
/**
* Concat Segment
*
* @private
* @param {Feature<LineString>} line LineString
* @param {Feature<LineString>} segment 2-vertex LineString
* @returns {Feature<LineString>} concat linestring
*/
function concatSegment(line, segment) {
var coords = getCoords(segment);
var lineCoords = getCoords(line);
var start = lineCoords[0];
var end = lineCoords[lineCoords.length - 1];
var geom = line.geometry.coordinates;
if (equal(coords[0], start))
geom.unshift(coords[1]);
else if (equal(coords[0], end))
geom.push(coords[1]);
else if (equal(coords[1], start))
geom.unshift(coords[0]);
else if (equal(coords[1], end))
geom.push(coords[0]);
return line;
}
export default lineOverlap;

View File

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

23
frontend/node_modules/@turf/line-overlap/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,23 @@
import { FeatureCollection, Feature, LineString, MultiLineString, Polygon, MultiPolygon } from "@turf/helpers";
/**
* Takes any LineString or Polygon and returns the overlapping lines between both features.
*
* @name lineOverlap
* @param {Geometry|Feature<LineString|MultiLineString|Polygon|MultiPolygon>} line1 any LineString or Polygon
* @param {Geometry|Feature<LineString|MultiLineString|Polygon|MultiPolygon>} line2 any LineString or Polygon
* @param {Object} [options={}] Optional parameters
* @param {number} [options.tolerance=0] Tolerance distance to match overlapping line segments (in kilometers)
* @returns {FeatureCollection<LineString>} lines(s) that are overlapping between both features
* @example
* var line1 = turf.lineString([[115, -35], [125, -30], [135, -30], [145, -35]]);
* var line2 = turf.lineString([[115, -25], [125, -30], [135, -30], [145, -25]]);
*
* var overlapping = turf.lineOverlap(line1, line2);
*
* //addToMap
* var addToMap = [line1, line2, overlapping]
*/
declare function lineOverlap<G1 extends LineString | MultiLineString | Polygon | MultiPolygon, G2 extends LineString | MultiLineString | Polygon | MultiPolygon>(line1: Feature<G1> | G1, line2: Feature<G2> | G2, options?: {
tolerance?: number;
}): FeatureCollection<LineString>;
export default lineOverlap;

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

@@ -0,0 +1,133 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var geojson_rbush_1 = __importDefault(require("geojson-rbush"));
var line_segment_1 = __importDefault(require("@turf/line-segment"));
var nearest_point_on_line_1 = __importDefault(require("@turf/nearest-point-on-line"));
var boolean_point_on_line_1 = __importDefault(require("@turf/boolean-point-on-line"));
var invariant_1 = require("@turf/invariant");
var meta_1 = require("@turf/meta");
var helpers_1 = require("@turf/helpers");
var deep_equal_1 = __importDefault(require("deep-equal"));
/**
* Takes any LineString or Polygon and returns the overlapping lines between both features.
*
* @name lineOverlap
* @param {Geometry|Feature<LineString|MultiLineString|Polygon|MultiPolygon>} line1 any LineString or Polygon
* @param {Geometry|Feature<LineString|MultiLineString|Polygon|MultiPolygon>} line2 any LineString or Polygon
* @param {Object} [options={}] Optional parameters
* @param {number} [options.tolerance=0] Tolerance distance to match overlapping line segments (in kilometers)
* @returns {FeatureCollection<LineString>} lines(s) that are overlapping between both features
* @example
* var line1 = turf.lineString([[115, -35], [125, -30], [135, -30], [145, -35]]);
* var line2 = turf.lineString([[115, -25], [125, -30], [135, -30], [145, -25]]);
*
* var overlapping = turf.lineOverlap(line1, line2);
*
* //addToMap
* var addToMap = [line1, line2, overlapping]
*/
function lineOverlap(line1, line2, options) {
if (options === void 0) { options = {}; }
// Optional parameters
options = options || {};
if (!helpers_1.isObject(options))
throw new Error("options is invalid");
var tolerance = options.tolerance || 0;
// Containers
var features = [];
// Create Spatial Index
var tree = geojson_rbush_1.default();
// To-Do -- HACK way to support typescript
var line = line_segment_1.default(line1);
tree.load(line);
var overlapSegment;
// Line Intersection
// Iterate over line segments
meta_1.segmentEach(line2, function (segment) {
var doesOverlaps = false;
if (!segment) {
return;
}
// Iterate over each segments which falls within the same bounds
meta_1.featureEach(tree.search(segment), function (match) {
if (doesOverlaps === false) {
var coordsSegment = invariant_1.getCoords(segment).sort();
var coordsMatch = invariant_1.getCoords(match).sort();
// Segment overlaps feature
if (deep_equal_1.default(coordsSegment, coordsMatch)) {
doesOverlaps = true;
// Overlaps already exists - only append last coordinate of segment
if (overlapSegment)
overlapSegment = concatSegment(overlapSegment, segment);
else
overlapSegment = segment;
// Match segments which don't share nodes (Issue #901)
}
else if (tolerance === 0
? boolean_point_on_line_1.default(coordsSegment[0], match) &&
boolean_point_on_line_1.default(coordsSegment[1], match)
: nearest_point_on_line_1.default(match, coordsSegment[0]).properties.dist <=
tolerance &&
nearest_point_on_line_1.default(match, coordsSegment[1]).properties.dist <=
tolerance) {
doesOverlaps = true;
if (overlapSegment)
overlapSegment = concatSegment(overlapSegment, segment);
else
overlapSegment = segment;
}
else if (tolerance === 0
? boolean_point_on_line_1.default(coordsMatch[0], segment) &&
boolean_point_on_line_1.default(coordsMatch[1], segment)
: nearest_point_on_line_1.default(segment, coordsMatch[0]).properties.dist <=
tolerance &&
nearest_point_on_line_1.default(segment, coordsMatch[1]).properties.dist <=
tolerance) {
// Do not define (doesOverlap = true) since more matches can occur within the same segment
// doesOverlaps = true;
if (overlapSegment)
overlapSegment = concatSegment(overlapSegment, match);
else
overlapSegment = match;
}
}
});
// Segment doesn't overlap - add overlaps to results & reset
if (doesOverlaps === false && overlapSegment) {
features.push(overlapSegment);
overlapSegment = undefined;
}
});
// Add last segment if exists
if (overlapSegment)
features.push(overlapSegment);
return helpers_1.featureCollection(features);
}
/**
* Concat Segment
*
* @private
* @param {Feature<LineString>} line LineString
* @param {Feature<LineString>} segment 2-vertex LineString
* @returns {Feature<LineString>} concat linestring
*/
function concatSegment(line, segment) {
var coords = invariant_1.getCoords(segment);
var lineCoords = invariant_1.getCoords(line);
var start = lineCoords[0];
var end = lineCoords[lineCoords.length - 1];
var geom = line.geometry.coordinates;
if (deep_equal_1.default(coords[0], start))
geom.unshift(coords[1]);
else if (deep_equal_1.default(coords[0], end))
geom.push(coords[1]);
else if (deep_equal_1.default(coords[1], start))
geom.unshift(coords[0]);
else if (deep_equal_1.default(coords[1], end))
geom.push(coords[0]);
return line;
}
exports.default = lineOverlap;

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

@@ -0,0 +1,76 @@
{
"name": "@turf/line-overlap",
"version": "6.5.0",
"description": "turf line-overlap module",
"author": "Turf Authors",
"contributors": [
"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",
"line",
"overlap"
],
"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": {
"@types/deep-equal": "^1.0.1",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/boolean-point-on-line": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"@turf/line-segment": "^6.5.0",
"@turf/meta": "^6.5.0",
"@turf/nearest-point-on-line": "^6.5.0",
"deep-equal": "1.x",
"geojson-rbush": "3.x"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}