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

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

@@ -0,0 +1,66 @@
# @turf/line-intersect
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## lineIntersect
Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
**Parameters**
- `line1` **([Geometry][1] \| [FeatureCollection][2] \| [Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>)** any LineString or Polygon
- `line2` **([Geometry][1] \| [FeatureCollection][2] \| [Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>)** any LineString or Polygon
**Examples**
```javascript
var line1 = turf.lineString([[126, -11], [129, -21]]);
var line2 = turf.lineString([[123, -18], [131, -14]]);
var intersects = turf.lineIntersect(line1, line2);
//addToMap
var addToMap = [line1, line2, intersects]
```
Returns **[FeatureCollection][2]&lt;[Point][8]>** point(s) that intersect both
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.3
[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-3.1.2
<!-- 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-intersect
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

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

@@ -0,0 +1,107 @@
import { feature, featureCollection, point, } from "@turf/helpers";
import { getCoords } from "@turf/invariant";
import lineSegment from "@turf/line-segment";
import { featureEach } from "@turf/meta";
import rbush from "geojson-rbush";
/**
* Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
*
* @name lineIntersect
* @param {GeoJSON} line1 any LineString or Polygon
* @param {GeoJSON} line2 any LineString or Polygon
* @returns {FeatureCollection<Point>} point(s) that intersect both
* @example
* var line1 = turf.lineString([[126, -11], [129, -21]]);
* var line2 = turf.lineString([[123, -18], [131, -14]]);
* var intersects = turf.lineIntersect(line1, line2);
*
* //addToMap
* var addToMap = [line1, line2, intersects]
*/
function lineIntersect(line1, line2) {
var unique = {};
var results = [];
// First, normalize geometries to features
// Then, handle simple 2-vertex segments
if (line1.type === "LineString") {
line1 = feature(line1);
}
if (line2.type === "LineString") {
line2 = feature(line2);
}
if (line1.type === "Feature" &&
line2.type === "Feature" &&
line1.geometry !== null &&
line2.geometry !== null &&
line1.geometry.type === "LineString" &&
line2.geometry.type === "LineString" &&
line1.geometry.coordinates.length === 2 &&
line2.geometry.coordinates.length === 2) {
var intersect = intersects(line1, line2);
if (intersect) {
results.push(intersect);
}
return featureCollection(results);
}
// Handles complex GeoJSON Geometries
var tree = rbush();
tree.load(lineSegment(line2));
featureEach(lineSegment(line1), function (segment) {
featureEach(tree.search(segment), function (match) {
var intersect = intersects(segment, match);
if (intersect) {
// prevent duplicate points https://github.com/Turfjs/turf/issues/688
var key = getCoords(intersect).join(",");
if (!unique[key]) {
unique[key] = true;
results.push(intersect);
}
}
});
});
return featureCollection(results);
}
/**
* Find a point that intersects LineStrings with two coordinates each
*
* @private
* @param {Feature<LineString>} line1 GeoJSON LineString (Must only contain 2 coordinates)
* @param {Feature<LineString>} line2 GeoJSON LineString (Must only contain 2 coordinates)
* @returns {Feature<Point>} intersecting GeoJSON Point
*/
function intersects(line1, line2) {
var coords1 = getCoords(line1);
var coords2 = getCoords(line2);
if (coords1.length !== 2) {
throw new Error("<intersects> line1 must only contain 2 coordinates");
}
if (coords2.length !== 2) {
throw new Error("<intersects> line2 must only contain 2 coordinates");
}
var x1 = coords1[0][0];
var y1 = coords1[0][1];
var x2 = coords1[1][0];
var y2 = coords1[1][1];
var x3 = coords2[0][0];
var y3 = coords2[0][1];
var x4 = coords2[1][0];
var y4 = coords2[1][1];
var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
if (denom === 0) {
if (numeA === 0 && numeB === 0) {
return null;
}
return null;
}
var uA = numeA / denom;
var uB = numeB / denom;
if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
var x = x1 + uA * (x2 - x1);
var y = y1 + uA * (y2 - y1);
return point([x, y]);
}
return null;
}
export default lineIntersect;

View File

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

View File

@@ -0,0 +1,18 @@
import { Feature, FeatureCollection, LineString, MultiLineString, MultiPolygon, Point, Polygon } from "@turf/helpers";
/**
* Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
*
* @name lineIntersect
* @param {GeoJSON} line1 any LineString or Polygon
* @param {GeoJSON} line2 any LineString or Polygon
* @returns {FeatureCollection<Point>} point(s) that intersect both
* @example
* var line1 = turf.lineString([[126, -11], [129, -21]]);
* var line2 = turf.lineString([[123, -18], [131, -14]]);
* var intersects = turf.lineIntersect(line1, line2);
*
* //addToMap
* var addToMap = [line1, line2, intersects]
*/
declare function lineIntersect<G1 extends LineString | MultiLineString | Polygon | MultiPolygon, G2 extends LineString | MultiLineString | Polygon | MultiPolygon>(line1: FeatureCollection<G1> | Feature<G1> | G1, line2: FeatureCollection<G2> | Feature<G2> | G2): FeatureCollection<Point>;
export default lineIntersect;

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

@@ -0,0 +1,112 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
var line_segment_1 = __importDefault(require("@turf/line-segment"));
var meta_1 = require("@turf/meta");
var geojson_rbush_1 = __importDefault(require("geojson-rbush"));
/**
* Takes any LineString or Polygon GeoJSON and returns the intersecting point(s).
*
* @name lineIntersect
* @param {GeoJSON} line1 any LineString or Polygon
* @param {GeoJSON} line2 any LineString or Polygon
* @returns {FeatureCollection<Point>} point(s) that intersect both
* @example
* var line1 = turf.lineString([[126, -11], [129, -21]]);
* var line2 = turf.lineString([[123, -18], [131, -14]]);
* var intersects = turf.lineIntersect(line1, line2);
*
* //addToMap
* var addToMap = [line1, line2, intersects]
*/
function lineIntersect(line1, line2) {
var unique = {};
var results = [];
// First, normalize geometries to features
// Then, handle simple 2-vertex segments
if (line1.type === "LineString") {
line1 = helpers_1.feature(line1);
}
if (line2.type === "LineString") {
line2 = helpers_1.feature(line2);
}
if (line1.type === "Feature" &&
line2.type === "Feature" &&
line1.geometry !== null &&
line2.geometry !== null &&
line1.geometry.type === "LineString" &&
line2.geometry.type === "LineString" &&
line1.geometry.coordinates.length === 2 &&
line2.geometry.coordinates.length === 2) {
var intersect = intersects(line1, line2);
if (intersect) {
results.push(intersect);
}
return helpers_1.featureCollection(results);
}
// Handles complex GeoJSON Geometries
var tree = geojson_rbush_1.default();
tree.load(line_segment_1.default(line2));
meta_1.featureEach(line_segment_1.default(line1), function (segment) {
meta_1.featureEach(tree.search(segment), function (match) {
var intersect = intersects(segment, match);
if (intersect) {
// prevent duplicate points https://github.com/Turfjs/turf/issues/688
var key = invariant_1.getCoords(intersect).join(",");
if (!unique[key]) {
unique[key] = true;
results.push(intersect);
}
}
});
});
return helpers_1.featureCollection(results);
}
/**
* Find a point that intersects LineStrings with two coordinates each
*
* @private
* @param {Feature<LineString>} line1 GeoJSON LineString (Must only contain 2 coordinates)
* @param {Feature<LineString>} line2 GeoJSON LineString (Must only contain 2 coordinates)
* @returns {Feature<Point>} intersecting GeoJSON Point
*/
function intersects(line1, line2) {
var coords1 = invariant_1.getCoords(line1);
var coords2 = invariant_1.getCoords(line2);
if (coords1.length !== 2) {
throw new Error("<intersects> line1 must only contain 2 coordinates");
}
if (coords2.length !== 2) {
throw new Error("<intersects> line2 must only contain 2 coordinates");
}
var x1 = coords1[0][0];
var y1 = coords1[0][1];
var x2 = coords1[1][0];
var y2 = coords1[1][1];
var x3 = coords2[0][0];
var y3 = coords2[0][1];
var x4 = coords2[1][0];
var y4 = coords2[1][1];
var denom = (y4 - y3) * (x2 - x1) - (x4 - x3) * (y2 - y1);
var numeA = (x4 - x3) * (y1 - y3) - (y4 - y3) * (x1 - x3);
var numeB = (x2 - x1) * (y1 - y3) - (y2 - y1) * (x1 - x3);
if (denom === 0) {
if (numeA === 0 && numeB === 0) {
return null;
}
return null;
}
var uA = numeA / denom;
var uB = numeB / denom;
if (uA >= 0 && uA <= 1 && uB >= 0 && uB <= 1) {
var x = x1 + uA * (x2 - x1);
var y = y1 + uA * (y2 - y1);
return helpers_1.point([x, y]);
}
return null;
}
exports.default = lineIntersect;

View File

@@ -0,0 +1,73 @@
{
"name": "@turf/line-intersect",
"version": "6.5.0",
"description": "turf line-intersect module",
"author": "Turf Authors",
"contributors": [
"Denis Carriere <@DenisCarriere>",
"Daniel Pulido <@dpmcmlxxvi>"
],
"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",
"intersect"
],
"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/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",
"@turf/line-segment": "^6.5.0",
"@turf/meta": "^6.5.0",
"geojson-rbush": "3.x"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}