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

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

@@ -0,0 +1,70 @@
# @turf/polygon-smooth
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## polygonSmooth
Smooths a [Polygon][1] or [MultiPolygon][2]. Based on [Chaikin's algorithm][3].
Warning: may create degenerate polygons.
**Parameters**
- `inputPolys` **([FeatureCollection][4] \| [Feature][5]&lt;([Polygon][6] \| [MultiPolygon][7])>)** (Multi)Polygon(s) to smooth
- `options` **[Object][8]** Optional parameters (optional, default `{}`)
- `options.iterations` **[string][9]** THe number of times to smooth the polygon. A higher value means a smoother polygon. (optional, default `1`)
**Examples**
```javascript
var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
var smoothed = turf.polygonSmooth(polygon, {iterations: 3})
//addToMap
var addToMap = [smoothed, polygon];
```
Returns **[FeatureCollection][4]&lt;[Polygon][6]>** FeatureCollection containing the smoothed polygon/poylgons
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[3]: http://graphics.cs.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm.html
[4]: https://tools.ietf.org/html/rfc7946#section-3.3
[5]: https://tools.ietf.org/html/rfc7946#section-3.2
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
<!-- 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-smooth
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

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

@@ -0,0 +1,162 @@
import { geomEach, coordEach } from '@turf/meta';
import { multiPolygon, polygon, featureCollection } from '@turf/helpers';
/**
* Smooths a {@link Polygon} or {@link MultiPolygon}. Based on [Chaikin's algorithm](http://graphics.cs.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm.html).
* Warning: may create degenerate polygons.
*
* @name polygonSmooth
* @param {FeatureCollection|Feature<Polygon|MultiPolygon>} inputPolys (Multi)Polygon(s) to smooth
* @param {Object} [options={}] Optional parameters
* @param {string} [options.iterations=1] THe number of times to smooth the polygon. A higher value means a smoother polygon.
* @returns {FeatureCollection<Polygon>} FeatureCollection containing the smoothed polygon/poylgons
* @example
* var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
*
* var smoothed = turf.polygonSmooth(polygon, {iterations: 3})
*
* //addToMap
* var addToMap = [smoothed, polygon];
*/
function polygonSmooth(inputPolys, options) {
var outPolys = [];
// Optional parameters
var iterations = options.iterations || 1;
if (!inputPolys) throw new Error("inputPolys is required");
geomEach(inputPolys, function (geom, geomIndex, properties) {
var outCoords;
var poly;
var tempOutput;
switch (geom.type) {
case "Polygon":
outCoords = [[]];
for (var i = 0; i < iterations; i++) {
tempOutput = [[]];
poly = geom;
if (i > 0) poly = polygon(outCoords).geometry;
processPolygon(poly, tempOutput);
outCoords = tempOutput.slice(0);
}
outPolys.push(polygon(outCoords, properties));
break;
case "MultiPolygon":
outCoords = [[[]]];
for (var y = 0; y < iterations; y++) {
tempOutput = [[[]]];
poly = geom;
if (y > 0) poly = multiPolygon(outCoords).geometry;
processMultiPolygon(poly, tempOutput);
outCoords = tempOutput.slice(0);
}
outPolys.push(multiPolygon(outCoords, properties));
break;
default:
throw new Error("geometry is invalid, must be Polygon or MultiPolygon");
}
});
return featureCollection(outPolys);
}
/**
* @param {poly} poly to process
* @param {poly} tempOutput to place the results in
* @private
*/
function processPolygon(poly, tempOutput) {
var prevGeomIndex = 0;
var subtractCoordIndex = 0;
coordEach(
poly,
function (
currentCoord,
coordIndex,
featureIndex,
multiFeatureIndex,
geometryIndex
) {
if (geometryIndex > prevGeomIndex) {
prevGeomIndex = geometryIndex;
subtractCoordIndex = coordIndex;
tempOutput.push([]);
}
var realCoordIndex = coordIndex - subtractCoordIndex;
var p1 = poly.coordinates[geometryIndex][realCoordIndex + 1];
var p0x = currentCoord[0];
var p0y = currentCoord[1];
var p1x = p1[0];
var p1y = p1[1];
tempOutput[geometryIndex].push([
0.75 * p0x + 0.25 * p1x,
0.75 * p0y + 0.25 * p1y,
]);
tempOutput[geometryIndex].push([
0.25 * p0x + 0.75 * p1x,
0.25 * p0y + 0.75 * p1y,
]);
},
true
);
tempOutput.forEach(function (ring) {
ring.push(ring[0]);
});
}
/**
* @param {poly} poly to process
* @param {poly} tempOutput to place the results in
* @private
*/
function processMultiPolygon(poly, tempOutput) {
var prevGeomIndex = 0;
var subtractCoordIndex = 0;
var prevMultiIndex = 0;
coordEach(
poly,
function (
currentCoord,
coordIndex,
featureIndex,
multiFeatureIndex,
geometryIndex
) {
if (multiFeatureIndex > prevMultiIndex) {
prevMultiIndex = multiFeatureIndex;
subtractCoordIndex = coordIndex;
tempOutput.push([[]]);
}
if (geometryIndex > prevGeomIndex) {
prevGeomIndex = geometryIndex;
subtractCoordIndex = coordIndex;
tempOutput[multiFeatureIndex].push([]);
}
var realCoordIndex = coordIndex - subtractCoordIndex;
var p1 =
poly.coordinates[multiFeatureIndex][geometryIndex][realCoordIndex + 1];
var p0x = currentCoord[0];
var p0y = currentCoord[1];
var p1x = p1[0];
var p1y = p1[1];
tempOutput[multiFeatureIndex][geometryIndex].push([
0.75 * p0x + 0.25 * p1x,
0.75 * p0y + 0.25 * p1y,
]);
tempOutput[multiFeatureIndex][geometryIndex].push([
0.25 * p0x + 0.75 * p1x,
0.25 * p0y + 0.75 * p1y,
]);
},
true
);
tempOutput.forEach(function (poly) {
poly.forEach(function (ring) {
ring.push(ring[0]);
});
});
}
export default polygonSmooth;

View File

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

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

@@ -0,0 +1,165 @@
'use strict';
var meta = require('@turf/meta');
var helpers = require('@turf/helpers');
/**
* Smooths a {@link Polygon} or {@link MultiPolygon}. Based on [Chaikin's algorithm](http://graphics.cs.ucdavis.edu/education/CAGDNotes/Chaikins-Algorithm/Chaikins-Algorithm.html).
* Warning: may create degenerate polygons.
*
* @name polygonSmooth
* @param {FeatureCollection|Feature<Polygon|MultiPolygon>} inputPolys (Multi)Polygon(s) to smooth
* @param {Object} [options={}] Optional parameters
* @param {string} [options.iterations=1] THe number of times to smooth the polygon. A higher value means a smoother polygon.
* @returns {FeatureCollection<Polygon>} FeatureCollection containing the smoothed polygon/poylgons
* @example
* var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
*
* var smoothed = turf.polygonSmooth(polygon, {iterations: 3})
*
* //addToMap
* var addToMap = [smoothed, polygon];
*/
function polygonSmooth(inputPolys, options) {
var outPolys = [];
// Optional parameters
var iterations = options.iterations || 1;
if (!inputPolys) throw new Error("inputPolys is required");
meta.geomEach(inputPolys, function (geom, geomIndex, properties) {
var outCoords;
var poly;
var tempOutput;
switch (geom.type) {
case "Polygon":
outCoords = [[]];
for (var i = 0; i < iterations; i++) {
tempOutput = [[]];
poly = geom;
if (i > 0) poly = helpers.polygon(outCoords).geometry;
processPolygon(poly, tempOutput);
outCoords = tempOutput.slice(0);
}
outPolys.push(helpers.polygon(outCoords, properties));
break;
case "MultiPolygon":
outCoords = [[[]]];
for (var y = 0; y < iterations; y++) {
tempOutput = [[[]]];
poly = geom;
if (y > 0) poly = helpers.multiPolygon(outCoords).geometry;
processMultiPolygon(poly, tempOutput);
outCoords = tempOutput.slice(0);
}
outPolys.push(helpers.multiPolygon(outCoords, properties));
break;
default:
throw new Error("geometry is invalid, must be Polygon or MultiPolygon");
}
});
return helpers.featureCollection(outPolys);
}
/**
* @param {poly} poly to process
* @param {poly} tempOutput to place the results in
* @private
*/
function processPolygon(poly, tempOutput) {
var prevGeomIndex = 0;
var subtractCoordIndex = 0;
meta.coordEach(
poly,
function (
currentCoord,
coordIndex,
featureIndex,
multiFeatureIndex,
geometryIndex
) {
if (geometryIndex > prevGeomIndex) {
prevGeomIndex = geometryIndex;
subtractCoordIndex = coordIndex;
tempOutput.push([]);
}
var realCoordIndex = coordIndex - subtractCoordIndex;
var p1 = poly.coordinates[geometryIndex][realCoordIndex + 1];
var p0x = currentCoord[0];
var p0y = currentCoord[1];
var p1x = p1[0];
var p1y = p1[1];
tempOutput[geometryIndex].push([
0.75 * p0x + 0.25 * p1x,
0.75 * p0y + 0.25 * p1y,
]);
tempOutput[geometryIndex].push([
0.25 * p0x + 0.75 * p1x,
0.25 * p0y + 0.75 * p1y,
]);
},
true
);
tempOutput.forEach(function (ring) {
ring.push(ring[0]);
});
}
/**
* @param {poly} poly to process
* @param {poly} tempOutput to place the results in
* @private
*/
function processMultiPolygon(poly, tempOutput) {
var prevGeomIndex = 0;
var subtractCoordIndex = 0;
var prevMultiIndex = 0;
meta.coordEach(
poly,
function (
currentCoord,
coordIndex,
featureIndex,
multiFeatureIndex,
geometryIndex
) {
if (multiFeatureIndex > prevMultiIndex) {
prevMultiIndex = multiFeatureIndex;
subtractCoordIndex = coordIndex;
tempOutput.push([[]]);
}
if (geometryIndex > prevGeomIndex) {
prevGeomIndex = geometryIndex;
subtractCoordIndex = coordIndex;
tempOutput[multiFeatureIndex].push([]);
}
var realCoordIndex = coordIndex - subtractCoordIndex;
var p1 =
poly.coordinates[multiFeatureIndex][geometryIndex][realCoordIndex + 1];
var p0x = currentCoord[0];
var p0y = currentCoord[1];
var p1x = p1[0];
var p1y = p1[1];
tempOutput[multiFeatureIndex][geometryIndex].push([
0.75 * p0x + 0.25 * p1x,
0.75 * p0y + 0.25 * p1y,
]);
tempOutput[multiFeatureIndex][geometryIndex].push([
0.25 * p0x + 0.75 * p1x,
0.25 * p0y + 0.75 * p1y,
]);
},
true
);
tempOutput.forEach(function (poly) {
poly.forEach(function (ring) {
ring.push(ring[0]);
});
});
}
module.exports = polygonSmooth;
module.exports.default = polygonSmooth;

16
frontend/node_modules/@turf/polygon-smooth/index.d.ts generated vendored Normal file
View File

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

View File

@@ -0,0 +1,64 @@
{
"name": "@turf/polygon-smooth",
"version": "6.5.0",
"description": "turf polygon smooth module",
"author": "Turf Authors",
"contributors": [
"Rowan Winsemius <@rowanwins>"
],
"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",
"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": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/meta": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}