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

69
frontend/node_modules/@turf/line-to-polygon/README.md generated vendored Normal file
View File

@@ -0,0 +1,69 @@
# @turf/line-to-polygon
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## lineToPolygon
Converts (Multi)LineString(s) to Polygon(s).
**Parameters**
- `lines` **([FeatureCollection][1] \| [Feature][2]&lt;([LineString][3] \| [MultiLineString][4])>)** Features to convert
- `options` **[Object][5]** Optional parameters (optional, default `{}`)
- `options.properties` **[Object][5]** translates GeoJSON properties to Feature (optional, default `{}`)
- `options.autoComplete` **[boolean][6]** auto complete linestrings (matches first & last coordinates) (optional, default `true`)
- `options.orderCoords` **[boolean][6]** sorts linestrings to place outer ring at the first position of the coordinates (optional, default `true`)
**Examples**
```javascript
var line = turf.lineString([[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]);
var polygon = turf.lineToPolygon(line);
//addToMap
var addToMap = [polygon];
```
Returns **[Feature][2]&lt;([Polygon][7] \| [MultiPolygon][8])>** converted to Polygons
[1]: https://tools.ietf.org/html/rfc7946#section-3.3
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[8]: https://tools.ietf.org/html/rfc7946#section-3.1.7
<!-- 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-to-polygon
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

130
frontend/node_modules/@turf/line-to-polygon/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,130 @@
import turfBBox from "@turf/bbox";
import { getCoords, getGeom } from "@turf/invariant";
import { polygon, multiPolygon, lineString, } from "@turf/helpers";
import clone from "@turf/clone";
/**
* Converts (Multi)LineString(s) to Polygon(s).
*
* @name lineToPolygon
* @param {FeatureCollection|Feature<LineString|MultiLineString>} lines Features to convert
* @param {Object} [options={}] Optional parameters
* @param {Object} [options.properties={}] translates GeoJSON properties to Feature
* @param {boolean} [options.autoComplete=true] auto complete linestrings (matches first & last coordinates)
* @param {boolean} [options.orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates
* @param {boolean} [options.mutate=false] mutate the original linestring using autoComplete (matches first & last coordinates)
* @returns {Feature<Polygon|MultiPolygon>} converted to Polygons
* @example
* var line = turf.lineString([[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]);
*
* var polygon = turf.lineToPolygon(line);
*
* //addToMap
* var addToMap = [polygon];
*/
function lineToPolygon(lines, options) {
if (options === void 0) { options = {}; }
var _a, _b, _c;
// Optional parameters
var properties = options.properties;
var autoComplete = (_a = options.autoComplete) !== null && _a !== void 0 ? _a : true;
var orderCoords = (_b = options.orderCoords) !== null && _b !== void 0 ? _b : true;
var mutate = (_c = options.mutate) !== null && _c !== void 0 ? _c : false;
if (!mutate) {
lines = clone(lines);
}
switch (lines.type) {
case "FeatureCollection":
var coords = [];
lines.features.forEach(function (line) {
coords.push(getCoords(lineStringToPolygon(line, {}, autoComplete, orderCoords)));
});
return multiPolygon(coords, properties);
default:
return lineStringToPolygon(lines, properties, autoComplete, orderCoords);
}
}
/**
* LineString to Polygon
*
* @private
* @param {Feature<LineString|MultiLineString>} line line
* @param {Object} [properties] translates GeoJSON properties to Feature
* @param {boolean} [autoComplete=true] auto complete linestrings
* @param {boolean} [orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates
* @returns {Feature<Polygon>} line converted to Polygon
*/
function lineStringToPolygon(line, properties, autoComplete, orderCoords) {
properties = properties
? properties
: line.type === "Feature"
? line.properties
: {};
var geom = getGeom(line);
var coords = geom.coordinates;
var type = geom.type;
if (!coords.length)
throw new Error("line must contain coordinates");
switch (type) {
case "LineString":
if (autoComplete)
coords = autoCompleteCoords(coords);
return polygon([coords], properties);
case "MultiLineString":
var multiCoords = [];
var largestArea = 0;
coords.forEach(function (coord) {
if (autoComplete)
coord = autoCompleteCoords(coord);
// Largest LineString to be placed in the first position of the coordinates array
if (orderCoords) {
var area = calculateArea(turfBBox(lineString(coord)));
if (area > largestArea) {
multiCoords.unshift(coord);
largestArea = area;
}
else
multiCoords.push(coord);
}
else {
multiCoords.push(coord);
}
});
return polygon(multiCoords, properties);
default:
throw new Error("geometry type " + type + " is not supported");
}
}
/**
* Auto Complete Coords - matches first & last coordinates
*
* @private
* @param {Array<Array<number>>} coords Coordinates
* @returns {Array<Array<number>>} auto completed coordinates
*/
function autoCompleteCoords(coords) {
var first = coords[0];
var x1 = first[0];
var y1 = first[1];
var last = coords[coords.length - 1];
var x2 = last[0];
var y2 = last[1];
if (x1 !== x2 || y1 !== y2) {
coords.push(first);
}
return coords;
}
/**
* area - quick approximate area calculation (used to sort)
*
* @private
* @param {Array<number>} bbox BBox [west, south, east, north]
* @returns {number} very quick area calculation
*/
function calculateArea(bbox) {
var west = bbox[0];
var south = bbox[1];
var east = bbox[2];
var north = bbox[3];
return Math.abs(west - east) * Math.abs(south - north);
}
export default lineToPolygon;

View File

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

View File

@@ -0,0 +1,27 @@
import { Feature, FeatureCollection, MultiLineString, LineString, Properties } from "@turf/helpers";
/**
* Converts (Multi)LineString(s) to Polygon(s).
*
* @name lineToPolygon
* @param {FeatureCollection|Feature<LineString|MultiLineString>} lines Features to convert
* @param {Object} [options={}] Optional parameters
* @param {Object} [options.properties={}] translates GeoJSON properties to Feature
* @param {boolean} [options.autoComplete=true] auto complete linestrings (matches first & last coordinates)
* @param {boolean} [options.orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates
* @param {boolean} [options.mutate=false] mutate the original linestring using autoComplete (matches first & last coordinates)
* @returns {Feature<Polygon|MultiPolygon>} converted to Polygons
* @example
* var line = turf.lineString([[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]);
*
* var polygon = turf.lineToPolygon(line);
*
* //addToMap
* var addToMap = [polygon];
*/
declare function lineToPolygon<G extends LineString | MultiLineString>(lines: Feature<G> | FeatureCollection<G> | G, options?: {
properties?: Properties;
autoComplete?: boolean;
orderCoords?: boolean;
mutate?: boolean;
}): Feature<import("@turf/helpers").MultiPolygon, Properties> | Feature<import("@turf/helpers").Polygon, Properties>;
export default lineToPolygon;

135
frontend/node_modules/@turf/line-to-polygon/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,135 @@
"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 invariant_1 = require("@turf/invariant");
var helpers_1 = require("@turf/helpers");
var clone_1 = __importDefault(require("@turf/clone"));
/**
* Converts (Multi)LineString(s) to Polygon(s).
*
* @name lineToPolygon
* @param {FeatureCollection|Feature<LineString|MultiLineString>} lines Features to convert
* @param {Object} [options={}] Optional parameters
* @param {Object} [options.properties={}] translates GeoJSON properties to Feature
* @param {boolean} [options.autoComplete=true] auto complete linestrings (matches first & last coordinates)
* @param {boolean} [options.orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates
* @param {boolean} [options.mutate=false] mutate the original linestring using autoComplete (matches first & last coordinates)
* @returns {Feature<Polygon|MultiPolygon>} converted to Polygons
* @example
* var line = turf.lineString([[125, -30], [145, -30], [145, -20], [125, -20], [125, -30]]);
*
* var polygon = turf.lineToPolygon(line);
*
* //addToMap
* var addToMap = [polygon];
*/
function lineToPolygon(lines, options) {
if (options === void 0) { options = {}; }
var _a, _b, _c;
// Optional parameters
var properties = options.properties;
var autoComplete = (_a = options.autoComplete) !== null && _a !== void 0 ? _a : true;
var orderCoords = (_b = options.orderCoords) !== null && _b !== void 0 ? _b : true;
var mutate = (_c = options.mutate) !== null && _c !== void 0 ? _c : false;
if (!mutate) {
lines = clone_1.default(lines);
}
switch (lines.type) {
case "FeatureCollection":
var coords = [];
lines.features.forEach(function (line) {
coords.push(invariant_1.getCoords(lineStringToPolygon(line, {}, autoComplete, orderCoords)));
});
return helpers_1.multiPolygon(coords, properties);
default:
return lineStringToPolygon(lines, properties, autoComplete, orderCoords);
}
}
/**
* LineString to Polygon
*
* @private
* @param {Feature<LineString|MultiLineString>} line line
* @param {Object} [properties] translates GeoJSON properties to Feature
* @param {boolean} [autoComplete=true] auto complete linestrings
* @param {boolean} [orderCoords=true] sorts linestrings to place outer ring at the first position of the coordinates
* @returns {Feature<Polygon>} line converted to Polygon
*/
function lineStringToPolygon(line, properties, autoComplete, orderCoords) {
properties = properties
? properties
: line.type === "Feature"
? line.properties
: {};
var geom = invariant_1.getGeom(line);
var coords = geom.coordinates;
var type = geom.type;
if (!coords.length)
throw new Error("line must contain coordinates");
switch (type) {
case "LineString":
if (autoComplete)
coords = autoCompleteCoords(coords);
return helpers_1.polygon([coords], properties);
case "MultiLineString":
var multiCoords = [];
var largestArea = 0;
coords.forEach(function (coord) {
if (autoComplete)
coord = autoCompleteCoords(coord);
// Largest LineString to be placed in the first position of the coordinates array
if (orderCoords) {
var area = calculateArea(bbox_1.default(helpers_1.lineString(coord)));
if (area > largestArea) {
multiCoords.unshift(coord);
largestArea = area;
}
else
multiCoords.push(coord);
}
else {
multiCoords.push(coord);
}
});
return helpers_1.polygon(multiCoords, properties);
default:
throw new Error("geometry type " + type + " is not supported");
}
}
/**
* Auto Complete Coords - matches first & last coordinates
*
* @private
* @param {Array<Array<number>>} coords Coordinates
* @returns {Array<Array<number>>} auto completed coordinates
*/
function autoCompleteCoords(coords) {
var first = coords[0];
var x1 = first[0];
var y1 = first[1];
var last = coords[coords.length - 1];
var x2 = last[0];
var y2 = last[1];
if (x1 !== x2 || y1 !== y2) {
coords.push(first);
}
return coords;
}
/**
* area - quick approximate area calculation (used to sort)
*
* @private
* @param {Array<number>} bbox BBox [west, south, east, north]
* @returns {number} very quick area calculation
*/
function calculateArea(bbox) {
var west = bbox[0];
var south = bbox[1];
var east = bbox[2];
var north = bbox[3];
return Math.abs(west - east) * Math.abs(south - north);
}
exports.default = lineToPolygon;

View File

@@ -0,0 +1,71 @@
{
"name": "@turf/line-to-polygon",
"version": "6.5.0",
"description": "turf line-to-polygon module",
"author": "Turf Authors",
"contributors": [
"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",
"gis",
"polygon",
"linestring",
"line"
],
"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",
"test:types": "tsc --esModuleInterop --noEmit types.ts"
},
"devDependencies": {
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/bbox": "^6.5.0",
"@turf/clone": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}