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/polygon-tangents/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.

67
frontend/node_modules/@turf/polygon-tangents/README.md generated vendored Normal file
View File

@@ -0,0 +1,67 @@
# @turf/polygon-tangents
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## polygonTangents
Finds the tangents of a [(Multi)Polygon][1] from a [Point][2].
**Parameters**
- `pt` **[Coord][3]** to calculate the tangent points from
- `polygon` **[Feature][4]&lt;([Polygon][5] \| [MultiPolygon][6])>** to get tangents from
**Examples**
```javascript
var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
var point = turf.point([61, 5]);
var tangents = turf.polygonTangents(point, polygon)
//addToMap
var addToMap = [tangents, point, polygon];
```
Returns **[FeatureCollection][7]&lt;[Point][8]>** Feature Collection containing the two tangent points
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.1
[4]: https://tools.ietf.org/html/rfc7946#section-3.2
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[7]: https://tools.ietf.org/html/rfc7946#section-3.3
[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/polygon-tangents
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

147
frontend/node_modules/@turf/polygon-tangents/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,147 @@
import { getCoords, getType } from '@turf/invariant';
import { featureCollection, point } from '@turf/helpers';
import calcBbox from '@turf/bbox';
import explode from '@turf/explode';
import nearestPoint from '@turf/nearest-point';
/**
* Finds the tangents of a {@link Polygon|(Multi)Polygon} from a {@link Point}.
*
* @name polygonTangents
* @param {Coord} pt to calculate the tangent points from
* @param {Feature<Polygon|MultiPolygon>} polygon to get tangents from
* @returns {FeatureCollection<Point>} Feature Collection containing the two tangent points
* @example
* var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
* var point = turf.point([61, 5]);
*
* var tangents = turf.polygonTangents(point, polygon)
*
* //addToMap
* var addToMap = [tangents, point, polygon];
*/
function polygonTangents(pt, polygon) {
var pointCoords = getCoords(pt);
var polyCoords = getCoords(polygon);
var rtan;
var ltan;
var enext;
var eprev;
var bbox = calcBbox(polygon);
var nearestPtIndex = 0;
var nearest = null;
// If the point lies inside the polygon bbox then we need to be a bit trickier
// otherwise points lying inside reflex angles on concave polys can have issues
if (
pointCoords[0] > bbox[0] &&
pointCoords[0] < bbox[2] &&
pointCoords[1] > bbox[1] &&
pointCoords[1] < bbox[3]
) {
nearest = nearestPoint(pt, explode(polygon));
nearestPtIndex = nearest.properties.featureIndex;
}
var type = getType(polygon);
switch (type) {
case "Polygon":
rtan = polyCoords[0][nearestPtIndex];
ltan = polyCoords[0][0];
if (nearest !== null) {
if (nearest.geometry.coordinates[1] < pointCoords[1])
ltan = polyCoords[0][nearestPtIndex];
}
eprev = isLeft(
polyCoords[0][0],
polyCoords[0][polyCoords[0].length - 1],
pointCoords
);
var out = processPolygon(
polyCoords[0],
pointCoords,
eprev,
enext,
rtan,
ltan);
rtan = out[0];
ltan = out[1];
break;
case "MultiPolygon":
var closestFeature = 0;
var closestVertex = 0;
var verticesCounted = 0;
for (var i = 0; i < polyCoords[0].length; i++) {
closestFeature = i;
var verticeFound = false;
for (var i2 = 0; i2 < polyCoords[0][i].length; i2++) {
closestVertex = i2;
if (verticesCounted === nearestPtIndex) {
verticeFound = true;
break;
}
verticesCounted++;
}
if (verticeFound) break;
}
rtan = polyCoords[0][closestFeature][closestVertex];
ltan = polyCoords[0][closestFeature][closestVertex];
eprev = isLeft(
polyCoords[0][0][0],
polyCoords[0][0][polyCoords[0][0].length - 1],
pointCoords
);
polyCoords.forEach(function (ring) {
var out = processPolygon(
ring[0],
pointCoords,
eprev,
enext,
rtan,
ltan);
rtan = out[0];
ltan = out[1];
});
break;
}
return featureCollection([point(rtan), point(ltan)]);
}
function processPolygon(polygonCoords, ptCoords, eprev, enext, rtan, ltan) {
for (var i = 0; i < polygonCoords.length; i++) {
var currentCoords = polygonCoords[i];
var nextCoordPair = polygonCoords[i + 1];
if (i === polygonCoords.length - 1) {
nextCoordPair = polygonCoords[0];
}
enext = isLeft(currentCoords, nextCoordPair, ptCoords);
if (eprev <= 0 && enext > 0) {
if (!isBelow(ptCoords, currentCoords, rtan)) {
rtan = currentCoords;
}
} else if (eprev > 0 && enext <= 0) {
if (!isAbove(ptCoords, currentCoords, ltan)) {
ltan = currentCoords;
}
}
eprev = enext;
}
return [rtan, ltan];
}
function isAbove(point1, point2, point3) {
return isLeft(point1, point2, point3) > 0;
}
function isBelow(point1, point2, point3) {
return isLeft(point1, point2, point3) < 0;
}
function isLeft(point1, point2, point3) {
return (
(point2[0] - point1[0]) * (point3[1] - point1[1]) -
(point3[0] - point1[0]) * (point2[1] - point1[1])
);
}
export default polygonTangents;

View File

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

156
frontend/node_modules/@turf/polygon-tangents/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,156 @@
'use strict';
var invariant = require('@turf/invariant');
var helpers = require('@turf/helpers');
var calcBbox = require('@turf/bbox');
var explode = require('@turf/explode');
var nearestPoint = require('@turf/nearest-point');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var calcBbox__default = /*#__PURE__*/_interopDefaultLegacy(calcBbox);
var explode__default = /*#__PURE__*/_interopDefaultLegacy(explode);
var nearestPoint__default = /*#__PURE__*/_interopDefaultLegacy(nearestPoint);
/**
* Finds the tangents of a {@link Polygon|(Multi)Polygon} from a {@link Point}.
*
* @name polygonTangents
* @param {Coord} pt to calculate the tangent points from
* @param {Feature<Polygon|MultiPolygon>} polygon to get tangents from
* @returns {FeatureCollection<Point>} Feature Collection containing the two tangent points
* @example
* var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
* var point = turf.point([61, 5]);
*
* var tangents = turf.polygonTangents(point, polygon)
*
* //addToMap
* var addToMap = [tangents, point, polygon];
*/
function polygonTangents(pt, polygon) {
var pointCoords = invariant.getCoords(pt);
var polyCoords = invariant.getCoords(polygon);
var rtan;
var ltan;
var enext;
var eprev;
var bbox = calcBbox__default['default'](polygon);
var nearestPtIndex = 0;
var nearest = null;
// If the point lies inside the polygon bbox then we need to be a bit trickier
// otherwise points lying inside reflex angles on concave polys can have issues
if (
pointCoords[0] > bbox[0] &&
pointCoords[0] < bbox[2] &&
pointCoords[1] > bbox[1] &&
pointCoords[1] < bbox[3]
) {
nearest = nearestPoint__default['default'](pt, explode__default['default'](polygon));
nearestPtIndex = nearest.properties.featureIndex;
}
var type = invariant.getType(polygon);
switch (type) {
case "Polygon":
rtan = polyCoords[0][nearestPtIndex];
ltan = polyCoords[0][0];
if (nearest !== null) {
if (nearest.geometry.coordinates[1] < pointCoords[1])
ltan = polyCoords[0][nearestPtIndex];
}
eprev = isLeft(
polyCoords[0][0],
polyCoords[0][polyCoords[0].length - 1],
pointCoords
);
var out = processPolygon(
polyCoords[0],
pointCoords,
eprev,
enext,
rtan,
ltan);
rtan = out[0];
ltan = out[1];
break;
case "MultiPolygon":
var closestFeature = 0;
var closestVertex = 0;
var verticesCounted = 0;
for (var i = 0; i < polyCoords[0].length; i++) {
closestFeature = i;
var verticeFound = false;
for (var i2 = 0; i2 < polyCoords[0][i].length; i2++) {
closestVertex = i2;
if (verticesCounted === nearestPtIndex) {
verticeFound = true;
break;
}
verticesCounted++;
}
if (verticeFound) break;
}
rtan = polyCoords[0][closestFeature][closestVertex];
ltan = polyCoords[0][closestFeature][closestVertex];
eprev = isLeft(
polyCoords[0][0][0],
polyCoords[0][0][polyCoords[0][0].length - 1],
pointCoords
);
polyCoords.forEach(function (ring) {
var out = processPolygon(
ring[0],
pointCoords,
eprev,
enext,
rtan,
ltan);
rtan = out[0];
ltan = out[1];
});
break;
}
return helpers.featureCollection([helpers.point(rtan), helpers.point(ltan)]);
}
function processPolygon(polygonCoords, ptCoords, eprev, enext, rtan, ltan) {
for (var i = 0; i < polygonCoords.length; i++) {
var currentCoords = polygonCoords[i];
var nextCoordPair = polygonCoords[i + 1];
if (i === polygonCoords.length - 1) {
nextCoordPair = polygonCoords[0];
}
enext = isLeft(currentCoords, nextCoordPair, ptCoords);
if (eprev <= 0 && enext > 0) {
if (!isBelow(ptCoords, currentCoords, rtan)) {
rtan = currentCoords;
}
} else if (eprev > 0 && enext <= 0) {
if (!isAbove(ptCoords, currentCoords, ltan)) {
ltan = currentCoords;
}
}
eprev = enext;
}
return [rtan, ltan];
}
function isAbove(point1, point2, point3) {
return isLeft(point1, point2, point3) > 0;
}
function isBelow(point1, point2, point3) {
return isLeft(point1, point2, point3) < 0;
}
function isLeft(point1, point2, point3) {
return (
(point2[0] - point1[0]) * (point3[1] - point1[1]) -
(point3[0] - point1[0]) * (point2[1] - point1[1])
);
}
module.exports = polygonTangents;
module.exports.default = polygonTangents;

View File

@@ -0,0 +1,16 @@
import {
Feature,
FeatureCollection,
Coord,
Point,
Polygon,
MultiPolygon,
} from "@turf/helpers";
/**
* http://turfjs.org/docs/#polygontangents
*/
export default function <T extends Polygon | MultiPolygon>(
point: Coord,
polygon: Feature<T> | T
): FeatureCollection<Point>;

View File

@@ -0,0 +1,70 @@
{
"name": "@turf/polygon-tangents",
"version": "6.5.0",
"description": "turf polygon tangents 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",
"geojson",
"point",
"tangent",
"polygon"
],
"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": {
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/bbox": "^6.5.0",
"@turf/boolean-within": "^6.5.0",
"@turf/explode": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"@turf/nearest-point": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}