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

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

@@ -0,0 +1,63 @@
# @turf/boolean-contains
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanContains
Boolean-contains returns True if the second geometry is completely contained by the first geometry.
The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
must not intersect the exterior of the primary (geometry a).
Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
**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 line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
var point = turf.point([1, 2]);
turf.booleanContains(line, point);
//=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-contains
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![esri-contains](diagrams/esri-contains.gif)

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

@@ -0,0 +1,225 @@
import calcBbox from "@turf/bbox";
import booleanPointInPolygon from "@turf/boolean-point-in-polygon";
import isPointOnLine from "@turf/boolean-point-on-line";
import { getGeom } from "@turf/invariant";
/**
* Boolean-contains returns True if the second geometry is completely contained by the first geometry.
* The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
* must not intersect the exterior of the primary (geometry a).
* Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
*
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* var point = turf.point([1, 2]);
*
* turf.booleanContains(line, point);
* //=true
*/
export default function booleanContains(feature1, feature2) {
var geom1 = getGeom(feature1);
var geom2 = getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
var coords1 = geom1.coordinates;
var coords2 = geom2.coordinates;
switch (type1) {
case "Point":
switch (type2) {
case "Point":
return compareCoords(coords1, coords2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "MultiPoint":
switch (type2) {
case "Point":
return isPointInMultiPoint(geom1, geom2);
case "MultiPoint":
return isMultiPointInMultiPoint(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "Point":
return isPointOnLine(geom2, geom1, { ignoreEndVertices: true });
case "LineString":
return isLineOnLine(geom1, geom2);
case "MultiPoint":
return isMultiPointOnLine(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "Point":
return booleanPointInPolygon(geom2, geom1, { ignoreBoundary: true });
case "LineString":
return isLineInPoly(geom1, geom2);
case "Polygon":
return isPolyInPoly(geom1, geom2);
case "MultiPoint":
return isMultiPointInPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
export function isPointInMultiPoint(multiPoint, pt) {
var i;
var output = false;
for (i = 0; i < multiPoint.coordinates.length; i++) {
if (compareCoords(multiPoint.coordinates[i], pt.coordinates)) {
output = true;
break;
}
}
return output;
}
export function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
for (var _i = 0, _a = multiPoint2.coordinates; _i < _a.length; _i++) {
var coord2 = _a[_i];
var matchFound = false;
for (var _b = 0, _c = multiPoint1.coordinates; _b < _c.length; _b++) {
var coord1 = _c[_b];
if (compareCoords(coord2, coord1)) {
matchFound = true;
break;
}
}
if (!matchFound) {
return false;
}
}
return true;
}
export function isMultiPointOnLine(lineString, multiPoint) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (isPointOnLine(coord, lineString, { ignoreEndVertices: true })) {
haveFoundInteriorPoint = true;
}
if (!isPointOnLine(coord, lineString)) {
return false;
}
}
if (haveFoundInteriorPoint) {
return true;
}
return false;
}
export function isMultiPointInPoly(polygon, multiPoint) {
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (!booleanPointInPolygon(coord, polygon, { ignoreBoundary: true })) {
return false;
}
}
return true;
}
export function isLineOnLine(lineString1, lineString2) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = lineString2.coordinates; _i < _a.length; _i++) {
var coords = _a[_i];
if (isPointOnLine({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: true,
})) {
haveFoundInteriorPoint = true;
}
if (!isPointOnLine({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: false,
})) {
return false;
}
}
return haveFoundInteriorPoint;
}
export function isLineInPoly(polygon, linestring) {
var output = false;
var i = 0;
var polyBbox = calcBbox(polygon);
var lineBbox = calcBbox(linestring);
if (!doBBoxOverlap(polyBbox, lineBbox)) {
return false;
}
for (i; i < linestring.coordinates.length - 1; i++) {
var midPoint = getMidpoint(linestring.coordinates[i], linestring.coordinates[i + 1]);
if (booleanPointInPolygon({ type: "Point", coordinates: midPoint }, polygon, {
ignoreBoundary: true,
})) {
output = true;
break;
}
}
return output;
}
/**
* Is Polygon2 in Polygon1
* Only takes into account outer rings
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
export function isPolyInPoly(feature1, feature2) {
// Handle Nulls
if (feature1.type === "Feature" && feature1.geometry === null) {
return false;
}
if (feature2.type === "Feature" && feature2.geometry === null) {
return false;
}
var poly1Bbox = calcBbox(feature1);
var poly2Bbox = calcBbox(feature2);
if (!doBBoxOverlap(poly1Bbox, poly2Bbox)) {
return false;
}
var coords = getGeom(feature2).coordinates;
for (var _i = 0, coords_1 = coords; _i < coords_1.length; _i++) {
var ring = coords_1[_i];
for (var _a = 0, ring_1 = ring; _a < ring_1.length; _a++) {
var coord = ring_1[_a];
if (!booleanPointInPolygon(coord, feature1)) {
return false;
}
}
}
return true;
}
export function doBBoxOverlap(bbox1, bbox2) {
if (bbox1[0] > bbox2[0]) {
return false;
}
if (bbox1[2] < bbox2[2]) {
return false;
}
if (bbox1[1] > bbox2[1]) {
return false;
}
if (bbox1[3] < bbox2[3]) {
return false;
}
return true;
}
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
export function compareCoords(pair1, pair2) {
return pair1[0] === pair2[0] && pair1[1] === pair2[1];
}
export function getMidpoint(pair1, pair2) {
return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
}

View File

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

View File

@@ -0,0 +1,46 @@
import { BBox, Feature, Geometry, LineString, MultiPoint, Point, Polygon } from "@turf/helpers";
/**
* Boolean-contains returns True if the second geometry is completely contained by the first geometry.
* The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
* must not intersect the exterior of the primary (geometry a).
* Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
*
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* var point = turf.point([1, 2]);
*
* turf.booleanContains(line, point);
* //=true
*/
export default function booleanContains(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
export declare function isPointInMultiPoint(multiPoint: MultiPoint, pt: Point): boolean;
export declare function isMultiPointInMultiPoint(multiPoint1: MultiPoint, multiPoint2: MultiPoint): boolean;
export declare function isMultiPointOnLine(lineString: LineString, multiPoint: MultiPoint): boolean;
export declare function isMultiPointInPoly(polygon: Polygon, multiPoint: MultiPoint): boolean;
export declare function isLineOnLine(lineString1: LineString, lineString2: LineString): boolean;
export declare function isLineInPoly(polygon: Polygon, linestring: LineString): boolean;
/**
* Is Polygon2 in Polygon1
* Only takes into account outer rings
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
export declare function isPolyInPoly(feature1: Feature<Polygon> | Polygon, feature2: Feature<Polygon> | Polygon): boolean;
export declare function doBBoxOverlap(bbox1: BBox, bbox2: BBox): boolean;
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
export declare function compareCoords(pair1: number[], pair2: number[]): boolean;
export declare function getMidpoint(pair1: number[], pair2: number[]): number[];

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

@@ -0,0 +1,241 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bbox_1 = __importDefault(require("@turf/bbox"));
var boolean_point_in_polygon_1 = __importDefault(require("@turf/boolean-point-in-polygon"));
var boolean_point_on_line_1 = __importDefault(require("@turf/boolean-point-on-line"));
var invariant_1 = require("@turf/invariant");
/**
* Boolean-contains returns True if the second geometry is completely contained by the first geometry.
* The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
* must not intersect the exterior of the primary (geometry a).
* Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
*
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* var point = turf.point([1, 2]);
*
* turf.booleanContains(line, point);
* //=true
*/
function booleanContains(feature1, feature2) {
var geom1 = invariant_1.getGeom(feature1);
var geom2 = invariant_1.getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
var coords1 = geom1.coordinates;
var coords2 = geom2.coordinates;
switch (type1) {
case "Point":
switch (type2) {
case "Point":
return compareCoords(coords1, coords2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "MultiPoint":
switch (type2) {
case "Point":
return isPointInMultiPoint(geom1, geom2);
case "MultiPoint":
return isMultiPointInMultiPoint(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "Point":
return boolean_point_on_line_1.default(geom2, geom1, { ignoreEndVertices: true });
case "LineString":
return isLineOnLine(geom1, geom2);
case "MultiPoint":
return isMultiPointOnLine(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "Point":
return boolean_point_in_polygon_1.default(geom2, geom1, { ignoreBoundary: true });
case "LineString":
return isLineInPoly(geom1, geom2);
case "Polygon":
return isPolyInPoly(geom1, geom2);
case "MultiPoint":
return isMultiPointInPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
exports.default = booleanContains;
function isPointInMultiPoint(multiPoint, pt) {
var i;
var output = false;
for (i = 0; i < multiPoint.coordinates.length; i++) {
if (compareCoords(multiPoint.coordinates[i], pt.coordinates)) {
output = true;
break;
}
}
return output;
}
exports.isPointInMultiPoint = isPointInMultiPoint;
function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
for (var _i = 0, _a = multiPoint2.coordinates; _i < _a.length; _i++) {
var coord2 = _a[_i];
var matchFound = false;
for (var _b = 0, _c = multiPoint1.coordinates; _b < _c.length; _b++) {
var coord1 = _c[_b];
if (compareCoords(coord2, coord1)) {
matchFound = true;
break;
}
}
if (!matchFound) {
return false;
}
}
return true;
}
exports.isMultiPointInMultiPoint = isMultiPointInMultiPoint;
function isMultiPointOnLine(lineString, multiPoint) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (boolean_point_on_line_1.default(coord, lineString, { ignoreEndVertices: true })) {
haveFoundInteriorPoint = true;
}
if (!boolean_point_on_line_1.default(coord, lineString)) {
return false;
}
}
if (haveFoundInteriorPoint) {
return true;
}
return false;
}
exports.isMultiPointOnLine = isMultiPointOnLine;
function isMultiPointInPoly(polygon, multiPoint) {
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (!boolean_point_in_polygon_1.default(coord, polygon, { ignoreBoundary: true })) {
return false;
}
}
return true;
}
exports.isMultiPointInPoly = isMultiPointInPoly;
function isLineOnLine(lineString1, lineString2) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = lineString2.coordinates; _i < _a.length; _i++) {
var coords = _a[_i];
if (boolean_point_on_line_1.default({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: true,
})) {
haveFoundInteriorPoint = true;
}
if (!boolean_point_on_line_1.default({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: false,
})) {
return false;
}
}
return haveFoundInteriorPoint;
}
exports.isLineOnLine = isLineOnLine;
function isLineInPoly(polygon, linestring) {
var output = false;
var i = 0;
var polyBbox = bbox_1.default(polygon);
var lineBbox = bbox_1.default(linestring);
if (!doBBoxOverlap(polyBbox, lineBbox)) {
return false;
}
for (i; i < linestring.coordinates.length - 1; i++) {
var midPoint = getMidpoint(linestring.coordinates[i], linestring.coordinates[i + 1]);
if (boolean_point_in_polygon_1.default({ type: "Point", coordinates: midPoint }, polygon, {
ignoreBoundary: true,
})) {
output = true;
break;
}
}
return output;
}
exports.isLineInPoly = isLineInPoly;
/**
* Is Polygon2 in Polygon1
* Only takes into account outer rings
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1, feature2) {
// Handle Nulls
if (feature1.type === "Feature" && feature1.geometry === null) {
return false;
}
if (feature2.type === "Feature" && feature2.geometry === null) {
return false;
}
var poly1Bbox = bbox_1.default(feature1);
var poly2Bbox = bbox_1.default(feature2);
if (!doBBoxOverlap(poly1Bbox, poly2Bbox)) {
return false;
}
var coords = invariant_1.getGeom(feature2).coordinates;
for (var _i = 0, coords_1 = coords; _i < coords_1.length; _i++) {
var ring = coords_1[_i];
for (var _a = 0, ring_1 = ring; _a < ring_1.length; _a++) {
var coord = ring_1[_a];
if (!boolean_point_in_polygon_1.default(coord, feature1)) {
return false;
}
}
}
return true;
}
exports.isPolyInPoly = isPolyInPoly;
function doBBoxOverlap(bbox1, bbox2) {
if (bbox1[0] > bbox2[0]) {
return false;
}
if (bbox1[2] < bbox2[2]) {
return false;
}
if (bbox1[1] > bbox2[1]) {
return false;
}
if (bbox1[3] < bbox2[3]) {
return false;
}
return true;
}
exports.doBBoxOverlap = doBBoxOverlap;
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
function compareCoords(pair1, pair2) {
return pair1[0] === pair2[0] && pair1[1] === pair2[1];
}
exports.compareCoords = compareCoords;
function getMidpoint(pair1, pair2) {
return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
}
exports.getMidpoint = getMidpoint;

View File

@@ -0,0 +1,73 @@
{
"name": "@turf/boolean-contains",
"version": "6.5.0",
"description": "turf boolean-contains 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",
"contains",
"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-jsts": "*",
"boolean-shapely": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/bbox": "^6.5.0",
"@turf/boolean-point-in-polygon": "^6.5.0",
"@turf/boolean-point-on-line": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}