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/boolean-crosses/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.

64
frontend/node_modules/@turf/boolean-crosses/README.md generated vendored Normal file
View File

@@ -0,0 +1,64 @@
# @turf/boolean-crosses
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanCrosses
Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
the maximum dimension of the two source geometries and the intersection set is interior to
both source geometries.
Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
**Parameters**
- `feature1` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
- `feature2` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
**Examples**
```javascript
var line1 = turf.lineString([[-2, 2], [4, 2]]);
var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
var cross = turf.booleanCrosses(line1, line2);
//=true
```
Returns **[boolean][3]** true/false
[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/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/boolean-crosses
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![esri-crosses](diagrams/esri-crosses.gif)

166
frontend/node_modules/@turf/boolean-crosses/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,166 @@
import lineIntersect from "@turf/line-intersect";
import { polygonToLine } from "@turf/polygon-to-line";
import booleanPointInPolygon from "@turf/boolean-point-in-polygon";
import { getGeom } from "@turf/invariant";
import { point, } from "@turf/helpers";
/**
* Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
* the maximum dimension of the two source geometries and the intersection set is interior to
* both source geometries.
*
* Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
*
* @name booleanCrosses
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line1 = turf.lineString([[-2, 2], [4, 2]]);
* var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* var cross = turf.booleanCrosses(line1, line2);
* //=true
*/
function booleanCrosses(feature1, feature2) {
var geom1 = getGeom(feature1);
var geom2 = getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
switch (type1) {
case "MultiPoint":
switch (type2) {
case "LineString":
return doMultiPointAndLineStringCross(geom1, geom2);
case "Polygon":
return doesMultiPointCrossPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "MultiPoint": // An inverse operation
return doMultiPointAndLineStringCross(geom2, geom1);
case "LineString":
return doLineStringsCross(geom1, geom2);
case "Polygon":
return doLineStringAndPolygonCross(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "MultiPoint": // An inverse operation
return doesMultiPointCrossPoly(geom2, geom1);
case "LineString": // An inverse operation
return doLineStringAndPolygonCross(geom2, geom1);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
function doMultiPointAndLineStringCross(multiPoint, lineString) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
var i = 0;
while (i < pointLength && !foundIntPoint && !foundExtPoint) {
for (var i2 = 0; i2 < lineString.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString.coordinates[i2], lineString.coordinates[i2 + 1], multiPoint.coordinates[i], incEndVertices)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
i++;
}
return foundIntPoint && foundExtPoint;
}
function doLineStringsCross(lineString1, lineString2) {
var doLinesIntersect = lineIntersect(lineString1, lineString2);
if (doLinesIntersect.features.length > 0) {
for (var i = 0; i < lineString1.coordinates.length - 1; i++) {
for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString2.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString1.coordinates[i], lineString1.coordinates[i + 1], lineString2.coordinates[i2], incEndVertices)) {
return true;
}
}
}
}
return false;
}
function doLineStringAndPolygonCross(lineString, polygon) {
var line = polygonToLine(polygon);
var doLinesIntersect = lineIntersect(lineString, line);
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function doesMultiPointCrossPoly(multiPoint, polygon) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
for (var i = 0; i < pointLength && (!foundIntPoint || !foundExtPoint); i++) {
if (booleanPointInPolygon(point(multiPoint.coordinates[i]), polygon)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
return foundExtPoint && foundIntPoint;
}
/**
* Is a point on a line segment
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {number[]} lineSegmentStart coord pair of start of line
* @param {number[]} lineSegmentEnd coord pair of end of line
* @param {number[]} pt coord pair of point to check
* @param {boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt, incEnd) {
var dxc = pt[0] - lineSegmentStart[0];
var dyc = pt[1] - lineSegmentStart[1];
var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0) {
return false;
}
if (incEnd) {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0]
: lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1]
: lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];
}
else {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] < pt[0] && pt[0] < lineSegmentEnd[0]
: lineSegmentEnd[0] < pt[0] && pt[0] < lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] < pt[1] && pt[1] < lineSegmentEnd[1]
: lineSegmentEnd[1] < pt[1] && pt[1] < lineSegmentStart[1];
}
}
export default booleanCrosses;

View File

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

View File

@@ -0,0 +1,21 @@
import { Feature, Geometry } from "@turf/helpers";
/**
* Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
* the maximum dimension of the two source geometries and the intersection set is interior to
* both source geometries.
*
* Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
*
* @name booleanCrosses
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line1 = turf.lineString([[-2, 2], [4, 2]]);
* var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* var cross = turf.booleanCrosses(line1, line2);
* //=true
*/
declare function booleanCrosses(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
export default booleanCrosses;

171
frontend/node_modules/@turf/boolean-crosses/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,171 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var line_intersect_1 = __importDefault(require("@turf/line-intersect"));
var polygon_to_line_1 = require("@turf/polygon-to-line");
var boolean_point_in_polygon_1 = __importDefault(require("@turf/boolean-point-in-polygon"));
var invariant_1 = require("@turf/invariant");
var helpers_1 = require("@turf/helpers");
/**
* Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
* the maximum dimension of the two source geometries and the intersection set is interior to
* both source geometries.
*
* Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
*
* @name booleanCrosses
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line1 = turf.lineString([[-2, 2], [4, 2]]);
* var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* var cross = turf.booleanCrosses(line1, line2);
* //=true
*/
function booleanCrosses(feature1, feature2) {
var geom1 = invariant_1.getGeom(feature1);
var geom2 = invariant_1.getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
switch (type1) {
case "MultiPoint":
switch (type2) {
case "LineString":
return doMultiPointAndLineStringCross(geom1, geom2);
case "Polygon":
return doesMultiPointCrossPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "MultiPoint": // An inverse operation
return doMultiPointAndLineStringCross(geom2, geom1);
case "LineString":
return doLineStringsCross(geom1, geom2);
case "Polygon":
return doLineStringAndPolygonCross(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "MultiPoint": // An inverse operation
return doesMultiPointCrossPoly(geom2, geom1);
case "LineString": // An inverse operation
return doLineStringAndPolygonCross(geom2, geom1);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
function doMultiPointAndLineStringCross(multiPoint, lineString) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
var i = 0;
while (i < pointLength && !foundIntPoint && !foundExtPoint) {
for (var i2 = 0; i2 < lineString.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString.coordinates[i2], lineString.coordinates[i2 + 1], multiPoint.coordinates[i], incEndVertices)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
i++;
}
return foundIntPoint && foundExtPoint;
}
function doLineStringsCross(lineString1, lineString2) {
var doLinesIntersect = line_intersect_1.default(lineString1, lineString2);
if (doLinesIntersect.features.length > 0) {
for (var i = 0; i < lineString1.coordinates.length - 1; i++) {
for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString2.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString1.coordinates[i], lineString1.coordinates[i + 1], lineString2.coordinates[i2], incEndVertices)) {
return true;
}
}
}
}
return false;
}
function doLineStringAndPolygonCross(lineString, polygon) {
var line = polygon_to_line_1.polygonToLine(polygon);
var doLinesIntersect = line_intersect_1.default(lineString, line);
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function doesMultiPointCrossPoly(multiPoint, polygon) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
for (var i = 0; i < pointLength && (!foundIntPoint || !foundExtPoint); i++) {
if (boolean_point_in_polygon_1.default(helpers_1.point(multiPoint.coordinates[i]), polygon)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
return foundExtPoint && foundIntPoint;
}
/**
* Is a point on a line segment
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {number[]} lineSegmentStart coord pair of start of line
* @param {number[]} lineSegmentEnd coord pair of end of line
* @param {number[]} pt coord pair of point to check
* @param {boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt, incEnd) {
var dxc = pt[0] - lineSegmentStart[0];
var dyc = pt[1] - lineSegmentStart[1];
var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0) {
return false;
}
if (incEnd) {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0]
: lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1]
: lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];
}
else {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] < pt[0] && pt[0] < lineSegmentEnd[0]
: lineSegmentEnd[0] < pt[0] && pt[0] < lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] < pt[1] && pt[1] < lineSegmentEnd[1]
: lineSegmentEnd[1] < pt[1] && pt[1] < lineSegmentStart[1];
}
}
exports.default = booleanCrosses;

View File

@@ -0,0 +1,72 @@
{
"name": "@turf/boolean-crosses",
"version": "6.5.0",
"description": "turf boolean-crosses module",
"author": "Turf Authors",
"contributors": [
"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": [
"turf",
"equal",
"boolean",
"de-9im"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"boolean-shapely": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/boolean-point-in-polygon": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"@turf/line-intersect": "^6.5.0",
"@turf/polygon-to-line": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}