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-slice-along/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.

72
frontend/node_modules/@turf/line-slice-along/README.md generated vendored Normal file
View File

@@ -0,0 +1,72 @@
# @turf/line-slice-along
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## lineSliceAlong
Takes a [line][1], a specified distance along the line to a start [Point][2],
and a specified distance along the line to a stop point
and returns a subsection of the line in-between those points.
This can be useful for extracting only the part of a route between two distances.
**Parameters**
- `line` **([Feature][3]&lt;[LineString][4]> | [LineString][4])** input line
- `startDist` **[number][5]** distance along the line to starting point
- `stopDist` **[number][5]** distance along the line to ending point
- `options` **[Object][6]** Optional parameters (optional, default `{}`)
- `options.units` **[string][7]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
**Examples**
```javascript
var line = turf.lineString([[7, 45], [9, 45], [14, 40], [14, 41]]);
var start = 12.5;
var stop = 25;
var sliced = turf.lineSliceAlong(line, start, stop, {units: 'miles'});
//addToMap
var addToMap = [line, start, stop, sliced]
```
Returns **[Feature][3]&lt;[LineString][4]>** sliced line
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[7]: 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/line-slice-along
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

View File

@@ -0,0 +1,87 @@
import bearing from '@turf/bearing';
import distance from '@turf/distance';
import destination from '@turf/destination';
import { isObject, lineString } from '@turf/helpers';
/**
* Takes a {@link LineString|line}, a specified distance along the line to a start {@link Point},
* and a specified distance along the line to a stop point
* and returns a subsection of the line in-between those points.
*
* This can be useful for extracting only the part of a route between two distances.
*
* @name lineSliceAlong
* @param {Feature<LineString>|LineString} line input line
* @param {number} startDist distance along the line to starting point
* @param {number} stopDist distance along the line to ending point
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
* @returns {Feature<LineString>} sliced line
* @example
* var line = turf.lineString([[7, 45], [9, 45], [14, 40], [14, 41]]);
* var start = 12.5;
* var stop = 25;
* var sliced = turf.lineSliceAlong(line, start, stop, {units: 'miles'});
*
* //addToMap
* var addToMap = [line, start, stop, sliced]
*/
function lineSliceAlong(line, startDist, stopDist, options) {
// Optional parameters
options = options || {};
if (!isObject(options)) throw new Error("options is invalid");
var coords;
var slice = [];
// Validation
if (line.type === "Feature") coords = line.geometry.coordinates;
else if (line.type === "LineString") coords = line.coordinates;
else throw new Error("input must be a LineString Feature or Geometry");
var origCoordsLength = coords.length;
var travelled = 0;
var overshot, direction, interpolated;
for (var i = 0; i < coords.length; i++) {
if (startDist >= travelled && i === coords.length - 1) break;
else if (travelled > startDist && slice.length === 0) {
overshot = startDist - travelled;
if (!overshot) {
slice.push(coords[i]);
return lineString(slice);
}
direction = bearing(coords[i], coords[i - 1]) - 180;
interpolated = destination(coords[i], overshot, direction, options);
slice.push(interpolated.geometry.coordinates);
}
if (travelled >= stopDist) {
overshot = stopDist - travelled;
if (!overshot) {
slice.push(coords[i]);
return lineString(slice);
}
direction = bearing(coords[i], coords[i - 1]) - 180;
interpolated = destination(coords[i], overshot, direction, options);
slice.push(interpolated.geometry.coordinates);
return lineString(slice);
}
if (travelled >= startDist) {
slice.push(coords[i]);
}
if (i === coords.length - 1) {
return lineString(slice);
}
travelled += distance(coords[i], coords[i + 1], options);
}
if (travelled < startDist && coords.length === origCoordsLength)
throw new Error("Start position is beyond line");
var last = coords[coords.length - 1];
return lineString([last, last]);
}
export default lineSliceAlong;

View File

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

View File

@@ -0,0 +1,96 @@
'use strict';
var bearing = require('@turf/bearing');
var distance = require('@turf/distance');
var destination = require('@turf/destination');
var helpers = require('@turf/helpers');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var bearing__default = /*#__PURE__*/_interopDefaultLegacy(bearing);
var distance__default = /*#__PURE__*/_interopDefaultLegacy(distance);
var destination__default = /*#__PURE__*/_interopDefaultLegacy(destination);
/**
* Takes a {@link LineString|line}, a specified distance along the line to a start {@link Point},
* and a specified distance along the line to a stop point
* and returns a subsection of the line in-between those points.
*
* This can be useful for extracting only the part of a route between two distances.
*
* @name lineSliceAlong
* @param {Feature<LineString>|LineString} line input line
* @param {number} startDist distance along the line to starting point
* @param {number} stopDist distance along the line to ending point
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
* @returns {Feature<LineString>} sliced line
* @example
* var line = turf.lineString([[7, 45], [9, 45], [14, 40], [14, 41]]);
* var start = 12.5;
* var stop = 25;
* var sliced = turf.lineSliceAlong(line, start, stop, {units: 'miles'});
*
* //addToMap
* var addToMap = [line, start, stop, sliced]
*/
function lineSliceAlong(line, startDist, stopDist, options) {
// Optional parameters
options = options || {};
if (!helpers.isObject(options)) throw new Error("options is invalid");
var coords;
var slice = [];
// Validation
if (line.type === "Feature") coords = line.geometry.coordinates;
else if (line.type === "LineString") coords = line.coordinates;
else throw new Error("input must be a LineString Feature or Geometry");
var origCoordsLength = coords.length;
var travelled = 0;
var overshot, direction, interpolated;
for (var i = 0; i < coords.length; i++) {
if (startDist >= travelled && i === coords.length - 1) break;
else if (travelled > startDist && slice.length === 0) {
overshot = startDist - travelled;
if (!overshot) {
slice.push(coords[i]);
return helpers.lineString(slice);
}
direction = bearing__default['default'](coords[i], coords[i - 1]) - 180;
interpolated = destination__default['default'](coords[i], overshot, direction, options);
slice.push(interpolated.geometry.coordinates);
}
if (travelled >= stopDist) {
overshot = stopDist - travelled;
if (!overshot) {
slice.push(coords[i]);
return helpers.lineString(slice);
}
direction = bearing__default['default'](coords[i], coords[i - 1]) - 180;
interpolated = destination__default['default'](coords[i], overshot, direction, options);
slice.push(interpolated.geometry.coordinates);
return helpers.lineString(slice);
}
if (travelled >= startDist) {
slice.push(coords[i]);
}
if (i === coords.length - 1) {
return helpers.lineString(slice);
}
travelled += distance__default['default'](coords[i], coords[i + 1], options);
}
if (travelled < startDist && coords.length === origCoordsLength)
throw new Error("Start position is beyond line");
var last = coords[coords.length - 1];
return helpers.lineString([last, last]);
}
module.exports = lineSliceAlong;
module.exports.default = lineSliceAlong;

View File

@@ -0,0 +1,13 @@
import { Units, LineString, Feature } from "@turf/helpers";
/**
* http://turfjs.org/docs/
*/
export default function lineSliceAlong(
line: Feature<LineString> | LineString,
startDist: number,
stopDist: number,
options?: {
units?: Units;
}
): Feature<LineString>;

View File

@@ -0,0 +1,61 @@
{
"name": "@turf/line-slice-along",
"version": "6.5.0",
"description": "turf line-slice-along module",
"author": "Turf Authors",
"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",
"along",
"line-slice"
],
"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"
},
"devDependencies": {
"@turf/along": "^6.5.0",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"rollup": "*",
"tape": "*"
},
"dependencies": {
"@turf/bearing": "^6.5.0",
"@turf/destination": "^6.5.0",
"@turf/distance": "^6.5.0",
"@turf/helpers": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}