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/rhumb-destination/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.

View File

@@ -0,0 +1,73 @@
# @turf/rhumb-destination
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## rhumbDestination
Returns the destination [Point][1] having travelled the given distance along a Rhumb line from the
origin Point with the (varant) given bearing.
**Parameters**
- `origin` **[Coord][2]** starting point
- `distance` **[number][3]** distance from the starting point
- `bearing` **[number][3]** varant bearing angle ranging from -180 to 180 degrees from north
- `options` **[Object][4]** Optional parameters (optional, default `{}`)
- `options.units` **[string][5]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`)
- `options.properties` **[Object][4]** translate properties to destination point (optional, default `{}`)
**Examples**
```javascript
var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
var distance = 50;
var bearing = 90;
var options = {units: 'miles'};
var destination = turf.rhumbDestination(pt, distance, bearing, options);
//addToMap
var addToMap = [pt, destination]
destination.properties['marker-color'] = '#00F';
```
Returns **[Feature][6]&lt;[Point][7]>** Destination point.
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.1
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[6]: https://tools.ietf.org/html/rfc7946#section-3.2
[7]: 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/rhumb-destination
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

View File

@@ -0,0 +1,86 @@
// https://en.wikipedia.org/wiki/Rhumb_line
import { convertLength, degreesToRadians, earthRadius, point, } from "@turf/helpers";
import { getCoord } from "@turf/invariant";
/**
* Returns the destination {@link Point} having travelled the given distance along a Rhumb line from the
* origin Point with the (varant) given bearing.
*
* @name rhumbDestination
* @param {Coord} origin starting point
* @param {number} distance distance from the starting point
* @param {number} bearing varant bearing angle ranging from -180 to 180 degrees from north
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
* @param {Object} [options.properties={}] translate properties to destination point
* @returns {Feature<Point>} Destination point.
* @example
* var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
* var distance = 50;
* var bearing = 90;
* var options = {units: 'miles'};
*
* var destination = turf.rhumbDestination(pt, distance, bearing, options);
*
* //addToMap
* var addToMap = [pt, destination]
* destination.properties['marker-color'] = '#00F';
*/
function rhumbDestination(origin, distance, bearing, options) {
if (options === void 0) { options = {}; }
var wasNegativeDistance = distance < 0;
var distanceInMeters = convertLength(Math.abs(distance), options.units, "meters");
if (wasNegativeDistance)
distanceInMeters = -Math.abs(distanceInMeters);
var coords = getCoord(origin);
var destination = calculateRhumbDestination(coords, distanceInMeters, bearing);
// compensate the crossing of the 180th meridian (https://macwright.org/2016/09/26/the-180th-meridian.html)
// solution from https://github.com/mapbox/mapbox-gl-js/issues/3250#issuecomment-294887678
destination[0] +=
destination[0] - coords[0] > 180
? -360
: coords[0] - destination[0] > 180
? 360
: 0;
return point(destination, options.properties);
}
/**
* Returns the destination point having travelled along a rhumb line from origin point the given
* distance on the given bearing.
* Adapted from Geodesy: http://www.movable-type.co.uk/scripts/latlong.html#rhumblines
*
* @private
* @param {Array<number>} origin - point
* @param {number} distance - Distance travelled, in same units as earth radius (default: metres).
* @param {number} bearing - Bearing in degrees from north.
* @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).
* @returns {Array<number>} Destination point.
*/
function calculateRhumbDestination(origin, distance, bearing, radius) {
// φ => phi
// λ => lambda
// ψ => psi
// Δ => Delta
// δ => delta
// θ => theta
radius = radius === undefined ? earthRadius : Number(radius);
var delta = distance / radius; // angular distance in radians
var lambda1 = (origin[0] * Math.PI) / 180; // to radians, but without normalize to 𝜋
var phi1 = degreesToRadians(origin[1]);
var theta = degreesToRadians(bearing);
var DeltaPhi = delta * Math.cos(theta);
var phi2 = phi1 + DeltaPhi;
// check for some daft bugger going past the pole, normalise latitude if so
if (Math.abs(phi2) > Math.PI / 2) {
phi2 = phi2 > 0 ? Math.PI - phi2 : -Math.PI - phi2;
}
var DeltaPsi = Math.log(Math.tan(phi2 / 2 + Math.PI / 4) / Math.tan(phi1 / 2 + Math.PI / 4));
// E-W course becomes ill-conditioned with 0/0
var q = Math.abs(DeltaPsi) > 10e-12 ? DeltaPhi / DeltaPsi : Math.cos(phi1);
var DeltaLambda = (delta * Math.sin(theta)) / q;
var lambda2 = lambda1 + DeltaLambda;
return [
(((lambda2 * 180) / Math.PI + 540) % 360) - 180,
(phi2 * 180) / Math.PI,
]; // normalise to 180..+180°
}
export default rhumbDestination;

View File

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

View File

@@ -0,0 +1,30 @@
import { Coord, Feature, Point, Properties, Units } from "@turf/helpers";
/**
* Returns the destination {@link Point} having travelled the given distance along a Rhumb line from the
* origin Point with the (varant) given bearing.
*
* @name rhumbDestination
* @param {Coord} origin starting point
* @param {number} distance distance from the starting point
* @param {number} bearing varant bearing angle ranging from -180 to 180 degrees from north
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
* @param {Object} [options.properties={}] translate properties to destination point
* @returns {Feature<Point>} Destination point.
* @example
* var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
* var distance = 50;
* var bearing = 90;
* var options = {units: 'miles'};
*
* var destination = turf.rhumbDestination(pt, distance, bearing, options);
*
* //addToMap
* var addToMap = [pt, destination]
* destination.properties['marker-color'] = '#00F';
*/
declare function rhumbDestination<P = Properties>(origin: Coord, distance: number, bearing: number, options?: {
units?: Units;
properties?: P;
}): Feature<Point, P>;
export default rhumbDestination;

View File

@@ -0,0 +1,88 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// https://en.wikipedia.org/wiki/Rhumb_line
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
/**
* Returns the destination {@link Point} having travelled the given distance along a Rhumb line from the
* origin Point with the (varant) given bearing.
*
* @name rhumbDestination
* @param {Coord} origin starting point
* @param {number} distance distance from the starting point
* @param {number} bearing varant bearing angle ranging from -180 to 180 degrees from north
* @param {Object} [options={}] Optional parameters
* @param {string} [options.units='kilometers'] can be degrees, radians, miles, or kilometers
* @param {Object} [options.properties={}] translate properties to destination point
* @returns {Feature<Point>} Destination point.
* @example
* var pt = turf.point([-75.343, 39.984], {"marker-color": "F00"});
* var distance = 50;
* var bearing = 90;
* var options = {units: 'miles'};
*
* var destination = turf.rhumbDestination(pt, distance, bearing, options);
*
* //addToMap
* var addToMap = [pt, destination]
* destination.properties['marker-color'] = '#00F';
*/
function rhumbDestination(origin, distance, bearing, options) {
if (options === void 0) { options = {}; }
var wasNegativeDistance = distance < 0;
var distanceInMeters = helpers_1.convertLength(Math.abs(distance), options.units, "meters");
if (wasNegativeDistance)
distanceInMeters = -Math.abs(distanceInMeters);
var coords = invariant_1.getCoord(origin);
var destination = calculateRhumbDestination(coords, distanceInMeters, bearing);
// compensate the crossing of the 180th meridian (https://macwright.org/2016/09/26/the-180th-meridian.html)
// solution from https://github.com/mapbox/mapbox-gl-js/issues/3250#issuecomment-294887678
destination[0] +=
destination[0] - coords[0] > 180
? -360
: coords[0] - destination[0] > 180
? 360
: 0;
return helpers_1.point(destination, options.properties);
}
/**
* Returns the destination point having travelled along a rhumb line from origin point the given
* distance on the given bearing.
* Adapted from Geodesy: http://www.movable-type.co.uk/scripts/latlong.html#rhumblines
*
* @private
* @param {Array<number>} origin - point
* @param {number} distance - Distance travelled, in same units as earth radius (default: metres).
* @param {number} bearing - Bearing in degrees from north.
* @param {number} [radius=6371e3] - (Mean) radius of earth (defaults to radius in metres).
* @returns {Array<number>} Destination point.
*/
function calculateRhumbDestination(origin, distance, bearing, radius) {
// φ => phi
// λ => lambda
// ψ => psi
// Δ => Delta
// δ => delta
// θ => theta
radius = radius === undefined ? helpers_1.earthRadius : Number(radius);
var delta = distance / radius; // angular distance in radians
var lambda1 = (origin[0] * Math.PI) / 180; // to radians, but without normalize to 𝜋
var phi1 = helpers_1.degreesToRadians(origin[1]);
var theta = helpers_1.degreesToRadians(bearing);
var DeltaPhi = delta * Math.cos(theta);
var phi2 = phi1 + DeltaPhi;
// check for some daft bugger going past the pole, normalise latitude if so
if (Math.abs(phi2) > Math.PI / 2) {
phi2 = phi2 > 0 ? Math.PI - phi2 : -Math.PI - phi2;
}
var DeltaPsi = Math.log(Math.tan(phi2 / 2 + Math.PI / 4) / Math.tan(phi1 / 2 + Math.PI / 4));
// E-W course becomes ill-conditioned with 0/0
var q = Math.abs(DeltaPsi) > 10e-12 ? DeltaPhi / DeltaPsi : Math.cos(phi1);
var DeltaLambda = (delta * Math.sin(theta)) / q;
var lambda2 = lambda1 + DeltaLambda;
return [
(((lambda2 * 180) / Math.PI + 540) % 360) - 180,
(phi2 * 180) / Math.PI,
]; // normalise to 180..+180°
}
exports.default = rhumbDestination;

View File

@@ -0,0 +1,75 @@
{
"name": "@turf/rhumb-destination",
"version": "6.5.0",
"description": "turf rhumb-destination module",
"author": "Turf Authors",
"contributors": [
"Chris Veness <@chrisveness>",
"Stefano Borghi <@stebogit>",
"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",
"distance",
"destination",
"bearing",
"loxodrome",
"rhumb",
"rhumb line",
"miles",
"km"
],
"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": {
"@turf/truncate": "^6.5.0",
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}