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

69
frontend/node_modules/@turf/along/README.md generated vendored Normal file
View File

@@ -0,0 +1,69 @@
# @turf/along
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## along
Takes a [LineString][1] and returns a [Point][2] at a specified distance along the line.
**Parameters**
- `line` **[Feature][3]&lt;[LineString][4]>** input line
- `distance` **[number][5]** distance along the line
- `options` **[Object][6]?** Optional parameters
- `options.units` **[string][7]** can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`)
**Examples**
```javascript
var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
var options = {units: 'miles'};
var along = turf.along(line, 200, options);
//addToMap
var addToMap = [along, line]
```
Returns **[Feature][3]&lt;[Point][8]>** Point `distance` `units` along the 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
[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/along
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

50
frontend/node_modules/@turf/along/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,50 @@
import bearing from "@turf/bearing";
import destination from "@turf/destination";
import measureDistance from "@turf/distance";
import { point } from "@turf/helpers";
import { getGeom } from "@turf/invariant";
/**
* Takes a {@link LineString} and returns a {@link Point} at a specified distance along the line.
*
* @name along
* @param {Feature<LineString>} line input line
* @param {number} distance distance along the line
* @param {Object} [options] Optional parameters
* @param {string} [options.units="kilometers"] can be degrees, radians, miles, or kilometers
* @returns {Feature<Point>} Point `distance` `units` along the line
* @example
* var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
* var options = {units: 'miles'};
*
* var along = turf.along(line, 200, options);
*
* //addToMap
* var addToMap = [along, line]
*/
export default function along(line, distance, options) {
if (options === void 0) { options = {}; }
// Get Coords
var geom = getGeom(line);
var coords = geom.coordinates;
var travelled = 0;
for (var i = 0; i < coords.length; i++) {
if (distance >= travelled && i === coords.length - 1) {
break;
}
else if (travelled >= distance) {
var overshot = distance - travelled;
if (!overshot) {
return point(coords[i]);
}
else {
var direction = bearing(coords[i], coords[i - 1]) - 180;
var interpolated = destination(coords[i], overshot, direction, options);
return interpolated;
}
}
else {
travelled += measureDistance(coords[i], coords[i + 1], options);
}
}
return point(coords[coords.length - 1]);
}

View File

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

22
frontend/node_modules/@turf/along/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,22 @@
import { Feature, LineString, Point, Units } from "@turf/helpers";
/**
* Takes a {@link LineString} and returns a {@link Point} at a specified distance along the line.
*
* @name along
* @param {Feature<LineString>} line input line
* @param {number} distance distance along the line
* @param {Object} [options] Optional parameters
* @param {string} [options.units="kilometers"] can be degrees, radians, miles, or kilometers
* @returns {Feature<Point>} Point `distance` `units` along the line
* @example
* var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
* var options = {units: 'miles'};
*
* var along = turf.along(line, 200, options);
*
* //addToMap
* var addToMap = [along, line]
*/
export default function along(line: Feature<LineString> | LineString, distance: number, options?: {
units?: Units;
}): Feature<Point>;

56
frontend/node_modules/@turf/along/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,56 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bearing_1 = __importDefault(require("@turf/bearing"));
var destination_1 = __importDefault(require("@turf/destination"));
var distance_1 = __importDefault(require("@turf/distance"));
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
/**
* Takes a {@link LineString} and returns a {@link Point} at a specified distance along the line.
*
* @name along
* @param {Feature<LineString>} line input line
* @param {number} distance distance along the line
* @param {Object} [options] Optional parameters
* @param {string} [options.units="kilometers"] can be degrees, radians, miles, or kilometers
* @returns {Feature<Point>} Point `distance` `units` along the line
* @example
* var line = turf.lineString([[-83, 30], [-84, 36], [-78, 41]]);
* var options = {units: 'miles'};
*
* var along = turf.along(line, 200, options);
*
* //addToMap
* var addToMap = [along, line]
*/
function along(line, distance, options) {
if (options === void 0) { options = {}; }
// Get Coords
var geom = invariant_1.getGeom(line);
var coords = geom.coordinates;
var travelled = 0;
for (var i = 0; i < coords.length; i++) {
if (distance >= travelled && i === coords.length - 1) {
break;
}
else if (travelled >= distance) {
var overshot = distance - travelled;
if (!overshot) {
return helpers_1.point(coords[i]);
}
else {
var direction = bearing_1.default(coords[i], coords[i - 1]) - 180;
var interpolated = destination_1.default(coords[i], overshot, direction, options);
return interpolated;
}
}
else {
travelled += distance_1.default(coords[i], coords[i + 1], options);
}
}
return helpers_1.point(coords[coords.length - 1]);
}
exports.default = along;

67
frontend/node_modules/@turf/along/package.json generated vendored Normal file
View File

@@ -0,0 +1,67 @@
{
"name": "@turf/along",
"version": "6.5.0",
"description": "turf 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": [
"along",
"line",
"linestring",
"turf",
"distance"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/bearing": "^6.5.0",
"@turf/destination": "^6.5.0",
"@turf/distance": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/angle/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.

64
frontend/node_modules/@turf/angle/README.md generated vendored Normal file
View File

@@ -0,0 +1,64 @@
# @turf/angle
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## angle
Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)
angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.
**Parameters**
- `startPoint` **[Coord][1]** Start Point Coordinates
- `midPoint` **[Coord][1]** Mid Point Coordinates
- `endPoint` **[Coord][1]** End Point Coordinates
- `options` **[Object][2]** Optional parameters (optional, default `{}`)
- `options.explementary` **[boolean][3]** Returns the explementary angle instead (360 - angle) (optional, default `false`)
- `options.mercator` **[boolean][3]** if calculations should be performed over Mercator or WGS84 projection (optional, default `false`)
**Examples**
```javascript
turf.angle([5, 5], [5, 6], [3, 4]);
//=45
```
Returns **[number][4]** Angle between the provided points, or its explementary.
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.1
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
<!-- 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/angle
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![turf-angle](diagrams/turf-angle.png)

50
frontend/node_modules/@turf/angle/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,50 @@
import bearing from "@turf/bearing";
import { bearingToAzimuth, isObject } from "@turf/helpers";
import rhumbBearing from "@turf/rhumb-bearing";
/**
* Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)
* angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.
*
* @name angle
* @param {Coord} startPoint Start Point Coordinates
* @param {Coord} midPoint Mid Point Coordinates
* @param {Coord} endPoint End Point Coordinates
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)
* @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection
* @returns {number} Angle between the provided points, or its explementary.
* @example
* turf.angle([5, 5], [5, 6], [3, 4]);
* //=45
*/
function angle(startPoint, midPoint, endPoint, options) {
if (options === void 0) { options = {}; }
// Optional Parameters
if (!isObject(options)) {
throw new Error("options is invalid");
}
// Validation
if (!startPoint) {
throw new Error("startPoint is required");
}
if (!midPoint) {
throw new Error("midPoint is required");
}
if (!endPoint) {
throw new Error("endPoint is required");
}
// Rename to shorter variables
var A = startPoint;
var O = midPoint;
var B = endPoint;
// Main
var azimuthAO = bearingToAzimuth(options.mercator !== true ? bearing(A, O) : rhumbBearing(A, O));
var azimuthBO = bearingToAzimuth(options.mercator !== true ? bearing(B, O) : rhumbBearing(B, O));
var angleAO = Math.abs(azimuthAO - azimuthBO);
// Explementary angle
if (options.explementary === true) {
return 360 - angleAO;
}
return angleAO;
}
export default angle;

View File

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

22
frontend/node_modules/@turf/angle/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,22 @@
import { Coord } from "@turf/helpers";
/**
* Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)
* angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.
*
* @name angle
* @param {Coord} startPoint Start Point Coordinates
* @param {Coord} midPoint Mid Point Coordinates
* @param {Coord} endPoint End Point Coordinates
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)
* @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection
* @returns {number} Angle between the provided points, or its explementary.
* @example
* turf.angle([5, 5], [5, 6], [3, 4]);
* //=45
*/
declare function angle(startPoint: Coord, midPoint: Coord, endPoint: Coord, options?: {
explementary?: boolean;
mercator?: boolean;
}): number;
export default angle;

55
frontend/node_modules/@turf/angle/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,55 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var bearing_1 = __importDefault(require("@turf/bearing"));
var helpers_1 = require("@turf/helpers");
var rhumb_bearing_1 = __importDefault(require("@turf/rhumb-bearing"));
/**
* Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)
* angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.
*
* @name angle
* @param {Coord} startPoint Start Point Coordinates
* @param {Coord} midPoint Mid Point Coordinates
* @param {Coord} endPoint End Point Coordinates
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)
* @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection
* @returns {number} Angle between the provided points, or its explementary.
* @example
* turf.angle([5, 5], [5, 6], [3, 4]);
* //=45
*/
function angle(startPoint, midPoint, endPoint, options) {
if (options === void 0) { options = {}; }
// Optional Parameters
if (!helpers_1.isObject(options)) {
throw new Error("options is invalid");
}
// Validation
if (!startPoint) {
throw new Error("startPoint is required");
}
if (!midPoint) {
throw new Error("midPoint is required");
}
if (!endPoint) {
throw new Error("endPoint is required");
}
// Rename to shorter variables
var A = startPoint;
var O = midPoint;
var B = endPoint;
// Main
var azimuthAO = helpers_1.bearingToAzimuth(options.mercator !== true ? bearing_1.default(A, O) : rhumb_bearing_1.default(A, O));
var azimuthBO = helpers_1.bearingToAzimuth(options.mercator !== true ? bearing_1.default(B, O) : rhumb_bearing_1.default(B, O));
var angleAO = Math.abs(azimuthAO - azimuthBO);
// Explementary angle
if (options.explementary === true) {
return 360 - angleAO;
}
return angleAO;
}
exports.default = angle;

71
frontend/node_modules/@turf/angle/package.json generated vendored Normal file
View File

@@ -0,0 +1,71 @@
{
"name": "@turf/angle",
"version": "6.5.0",
"description": "turf angle module",
"author": "Turf Authors",
"contributors": [
"Denis <@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",
"angle"
],
"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/distance": "^6.5.0",
"@turf/sector": "^6.5.0",
"@turf/truncate": "^6.5.0",
"@types/tape": "*",
"benchmark": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/bearing": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"@turf/rhumb-bearing": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/area/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.

54
frontend/node_modules/@turf/area/README.md generated vendored Normal file
View File

@@ -0,0 +1,54 @@
# @turf/area
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## area
Takes one or more features and returns their area in square meters.
**Parameters**
- `geojson` **[GeoJSON][1]** input GeoJSON feature(s)
**Examples**
```javascript
var polygon = turf.polygon([[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]);
var area = turf.area(polygon);
//addToMap
var addToMap = [polygon]
polygon.properties.area = area
```
Returns **[number][2]** area in square meters
[1]: https://tools.ietf.org/html/rfc7946#section-3
[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
<!-- 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/area
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

114
frontend/node_modules/@turf/area/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,114 @@
import { geomReduce } from "@turf/meta";
// Note: change RADIUS => earthRadius
var RADIUS = 6378137;
/**
* Takes one or more features and returns their area in square meters.
*
* @name area
* @param {GeoJSON} geojson input GeoJSON feature(s)
* @returns {number} area in square meters
* @example
* var polygon = turf.polygon([[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]);
*
* var area = turf.area(polygon);
*
* //addToMap
* var addToMap = [polygon]
* polygon.properties.area = area
*/
export default function area(geojson) {
return geomReduce(geojson, function (value, geom) {
return value + calculateArea(geom);
}, 0);
}
/**
* Calculate Area
*
* @private
* @param {Geometry} geom GeoJSON Geometries
* @returns {number} area
*/
function calculateArea(geom) {
var total = 0;
var i;
switch (geom.type) {
case "Polygon":
return polygonArea(geom.coordinates);
case "MultiPolygon":
for (i = 0; i < geom.coordinates.length; i++) {
total += polygonArea(geom.coordinates[i]);
}
return total;
case "Point":
case "MultiPoint":
case "LineString":
case "MultiLineString":
return 0;
}
return 0;
}
function polygonArea(coords) {
var total = 0;
if (coords && coords.length > 0) {
total += Math.abs(ringArea(coords[0]));
for (var i = 1; i < coords.length; i++) {
total -= Math.abs(ringArea(coords[i]));
}
}
return total;
}
/**
* @private
* Calculate the approximate area of the polygon were it projected onto the earth.
* Note that this area will be positive if ring is oriented clockwise, otherwise it will be negative.
*
* Reference:
* Robert. G. Chamberlain and William H. Duquette, "Some Algorithms for Polygons on a Sphere",
* JPL Publication 07-03, Jet Propulsion
* Laboratory, Pasadena, CA, June 2007 https://trs.jpl.nasa.gov/handle/2014/40409
*
* @param {Array<Array<number>>} coords Ring Coordinates
* @returns {number} The approximate signed geodesic area of the polygon in square meters.
*/
function ringArea(coords) {
var p1;
var p2;
var p3;
var lowerIndex;
var middleIndex;
var upperIndex;
var i;
var total = 0;
var coordsLength = coords.length;
if (coordsLength > 2) {
for (i = 0; i < coordsLength; i++) {
if (i === coordsLength - 2) {
// i = N-2
lowerIndex = coordsLength - 2;
middleIndex = coordsLength - 1;
upperIndex = 0;
}
else if (i === coordsLength - 1) {
// i = N-1
lowerIndex = coordsLength - 1;
middleIndex = 0;
upperIndex = 1;
}
else {
// i = 0 to N-3
lowerIndex = i;
middleIndex = i + 1;
upperIndex = i + 2;
}
p1 = coords[lowerIndex];
p2 = coords[middleIndex];
p3 = coords[upperIndex];
total += (rad(p3[0]) - rad(p1[0])) * Math.sin(rad(p2[1]));
}
total = (total * RADIUS * RADIUS) / 2;
}
return total;
}
function rad(num) {
return (num * Math.PI) / 180;
}

View File

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

17
frontend/node_modules/@turf/area/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,17 @@
import { Feature, FeatureCollection, Geometry } from "@turf/helpers";
/**
* Takes one or more features and returns their area in square meters.
*
* @name area
* @param {GeoJSON} geojson input GeoJSON feature(s)
* @returns {number} area in square meters
* @example
* var polygon = turf.polygon([[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]);
*
* var area = turf.area(polygon);
*
* //addToMap
* var addToMap = [polygon]
* polygon.properties.area = area
*/
export default function area(geojson: Feature<any> | FeatureCollection<any> | Geometry): number;

117
frontend/node_modules/@turf/area/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,117 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var meta_1 = require("@turf/meta");
// Note: change RADIUS => earthRadius
var RADIUS = 6378137;
/**
* Takes one or more features and returns their area in square meters.
*
* @name area
* @param {GeoJSON} geojson input GeoJSON feature(s)
* @returns {number} area in square meters
* @example
* var polygon = turf.polygon([[[125, -15], [113, -22], [154, -27], [144, -15], [125, -15]]]);
*
* var area = turf.area(polygon);
*
* //addToMap
* var addToMap = [polygon]
* polygon.properties.area = area
*/
function area(geojson) {
return meta_1.geomReduce(geojson, function (value, geom) {
return value + calculateArea(geom);
}, 0);
}
exports.default = area;
/**
* Calculate Area
*
* @private
* @param {Geometry} geom GeoJSON Geometries
* @returns {number} area
*/
function calculateArea(geom) {
var total = 0;
var i;
switch (geom.type) {
case "Polygon":
return polygonArea(geom.coordinates);
case "MultiPolygon":
for (i = 0; i < geom.coordinates.length; i++) {
total += polygonArea(geom.coordinates[i]);
}
return total;
case "Point":
case "MultiPoint":
case "LineString":
case "MultiLineString":
return 0;
}
return 0;
}
function polygonArea(coords) {
var total = 0;
if (coords && coords.length > 0) {
total += Math.abs(ringArea(coords[0]));
for (var i = 1; i < coords.length; i++) {
total -= Math.abs(ringArea(coords[i]));
}
}
return total;
}
/**
* @private
* Calculate the approximate area of the polygon were it projected onto the earth.
* Note that this area will be positive if ring is oriented clockwise, otherwise it will be negative.
*
* Reference:
* Robert. G. Chamberlain and William H. Duquette, "Some Algorithms for Polygons on a Sphere",
* JPL Publication 07-03, Jet Propulsion
* Laboratory, Pasadena, CA, June 2007 https://trs.jpl.nasa.gov/handle/2014/40409
*
* @param {Array<Array<number>>} coords Ring Coordinates
* @returns {number} The approximate signed geodesic area of the polygon in square meters.
*/
function ringArea(coords) {
var p1;
var p2;
var p3;
var lowerIndex;
var middleIndex;
var upperIndex;
var i;
var total = 0;
var coordsLength = coords.length;
if (coordsLength > 2) {
for (i = 0; i < coordsLength; i++) {
if (i === coordsLength - 2) {
// i = N-2
lowerIndex = coordsLength - 2;
middleIndex = coordsLength - 1;
upperIndex = 0;
}
else if (i === coordsLength - 1) {
// i = N-1
lowerIndex = coordsLength - 1;
middleIndex = 0;
upperIndex = 1;
}
else {
// i = 0 to N-3
lowerIndex = i;
middleIndex = i + 1;
upperIndex = i + 2;
}
p1 = coords[lowerIndex];
p2 = coords[middleIndex];
p3 = coords[upperIndex];
total += (rad(p3[0]) - rad(p1[0])) * Math.sin(rad(p2[1]));
}
total = (total * RADIUS * RADIUS) / 2;
}
return total;
}
function rad(num) {
return (num * Math.PI) / 180;
}

64
frontend/node_modules/@turf/area/package.json generated vendored Normal file
View File

@@ -0,0 +1,64 @@
{
"name": "@turf/area",
"version": "6.5.0",
"description": "turf area 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",
"area",
"polygon",
"multipolygon"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/meta": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/bbox-clip/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.

68
frontend/node_modules/@turf/bbox-clip/README.md generated vendored Normal file
View File

@@ -0,0 +1,68 @@
# @turf/bbox-clip
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## bboxClip
Takes a [Feature][1] and a bbox and clips the feature to the bbox using [lineclip][2].
May result in degenerate edges when clipping Polygons.
**Parameters**
- `feature` **[Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>** feature to clip to the bbox
- `bbox` **[BBox][8]** extent in [minX, minY, maxX, maxY] order
**Examples**
```javascript
var bbox = [0, 0, 10, 10];
var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
var clipped = turf.bboxClip(poly, bbox);
//addToMap
var addToMap = [bbox, poly, clipped]
```
Returns **[Feature][3]&lt;([LineString][4] \| [MultiLineString][5] \| [Polygon][6] \| [MultiPolygon][7])>** clipped Feature
[1]: https://tools.ietf.org/html/rfc7946#section-3.2
[2]: https://github.com/mapbox/lineclip
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5
[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7
[8]: https://tools.ietf.org/html/rfc7946#section-5
<!-- 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/bbox-clip
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

68
frontend/node_modules/@turf/bbox-clip/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,68 @@
import { lineString, multiLineString, multiPolygon, polygon, } from "@turf/helpers";
import { getGeom } from "@turf/invariant";
import { lineclip, polygonclip } from "./lib/lineclip.js";
/**
* Takes a {@link Feature} and a bbox and clips the feature to the bbox using
* [lineclip](https://github.com/mapbox/lineclip).
* May result in degenerate edges when clipping Polygons.
*
* @name bboxClip
* @param {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} feature feature to clip to the bbox
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} clipped Feature
* @example
* var bbox = [0, 0, 10, 10];
* var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
*
* var clipped = turf.bboxClip(poly, bbox);
*
* //addToMap
* var addToMap = [bbox, poly, clipped]
*/
export default function bboxClip(feature, bbox) {
var geom = getGeom(feature);
var type = geom.type;
var properties = feature.type === "Feature" ? feature.properties : {};
var coords = geom.coordinates;
switch (type) {
case "LineString":
case "MultiLineString": {
var lines_1 = [];
if (type === "LineString") {
coords = [coords];
}
coords.forEach(function (line) {
lineclip(line, bbox, lines_1);
});
if (lines_1.length === 1) {
return lineString(lines_1[0], properties);
}
return multiLineString(lines_1, properties);
}
case "Polygon":
return polygon(clipPolygon(coords, bbox), properties);
case "MultiPolygon":
return multiPolygon(coords.map(function (poly) {
return clipPolygon(poly, bbox);
}), properties);
default:
throw new Error("geometry " + type + " not supported");
}
}
function clipPolygon(rings, bbox) {
var outRings = [];
for (var _i = 0, rings_1 = rings; _i < rings_1.length; _i++) {
var ring = rings_1[_i];
var clipped = polygonclip(ring, bbox);
if (clipped.length > 0) {
if (clipped[0][0] !== clipped[clipped.length - 1][0] ||
clipped[0][1] !== clipped[clipped.length - 1][1]) {
clipped.push(clipped[0]);
}
if (clipped.length >= 4) {
outRings.push(clipped);
}
}
}
return outRings;
}

107
frontend/node_modules/@turf/bbox-clip/dist/es/lib/lineclip.js generated vendored Executable file
View File

@@ -0,0 +1,107 @@
// Cohen-Sutherland line clipping algorithm, adapted to efficiently
// handle polylines rather than just segments
export function lineclip(points, bbox, result) {
var len = points.length, codeA = bitCode(points[0], bbox), part = [], i, codeB, lastCode;
var a;
var b;
if (!result)
result = [];
for (i = 1; i < len; i++) {
a = points[i - 1];
b = points[i];
codeB = lastCode = bitCode(b, bbox);
while (true) {
if (!(codeA | codeB)) {
// accept
part.push(a);
if (codeB !== lastCode) {
// segment went outside
part.push(b);
if (i < len - 1) {
// start a new line
result.push(part);
part = [];
}
}
else if (i === len - 1) {
part.push(b);
}
break;
}
else if (codeA & codeB) {
// trivial reject
break;
}
else if (codeA) {
// a outside, intersect with clip edge
a = intersect(a, b, codeA, bbox);
codeA = bitCode(a, bbox);
}
else {
// b outside
b = intersect(a, b, codeB, bbox);
codeB = bitCode(b, bbox);
}
}
codeA = lastCode;
}
if (part.length)
result.push(part);
return result;
}
// Sutherland-Hodgeman polygon clipping algorithm
export function polygonclip(points, bbox) {
var result, edge, prev, prevInside, i, p, inside;
// clip against each side of the clip rectangle
for (edge = 1; edge <= 8; edge *= 2) {
result = [];
prev = points[points.length - 1];
prevInside = !(bitCode(prev, bbox) & edge);
for (i = 0; i < points.length; i++) {
p = points[i];
inside = !(bitCode(p, bbox) & edge);
// if segment goes through the clip window, add an intersection
if (inside !== prevInside)
result.push(intersect(prev, p, edge, bbox));
if (inside)
result.push(p); // add a point if it's inside
prev = p;
prevInside = inside;
}
points = result;
if (!points.length)
break;
}
return result;
}
// intersect a segment against one of the 4 lines that make up the bbox
function intersect(a, b, edge, bbox) {
return edge & 8
? [a[0] + ((b[0] - a[0]) * (bbox[3] - a[1])) / (b[1] - a[1]), bbox[3]] // top
: edge & 4
? [a[0] + ((b[0] - a[0]) * (bbox[1] - a[1])) / (b[1] - a[1]), bbox[1]] // bottom
: edge & 2
? [bbox[2], a[1] + ((b[1] - a[1]) * (bbox[2] - a[0])) / (b[0] - a[0])] // right
: edge & 1
? [bbox[0], a[1] + ((b[1] - a[1]) * (bbox[0] - a[0])) / (b[0] - a[0])] // left
: null;
}
// bit code reflects the point position relative to the bbox:
// left mid right
// top 1001 1000 1010
// mid 0001 0000 0010
// bottom 0101 0100 0110
function bitCode(p, bbox) {
var code = 0;
if (p[0] < bbox[0])
code |= 1;
// left
else if (p[0] > bbox[2])
code |= 2; // right
if (p[1] < bbox[1])
code |= 4;
// bottom
else if (p[1] > bbox[3])
code |= 8; // top
return code;
}

View File

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

20
frontend/node_modules/@turf/bbox-clip/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,20 @@
import { BBox, Feature, LineString, MultiLineString, MultiPolygon, Polygon, Properties } from "@turf/helpers";
/**
* Takes a {@link Feature} and a bbox and clips the feature to the bbox using
* [lineclip](https://github.com/mapbox/lineclip).
* May result in degenerate edges when clipping Polygons.
*
* @name bboxClip
* @param {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} feature feature to clip to the bbox
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} clipped Feature
* @example
* var bbox = [0, 0, 10, 10];
* var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
*
* var clipped = turf.bboxClip(poly, bbox);
*
* //addToMap
* var addToMap = [bbox, poly, clipped]
*/
export default function bboxClip<G extends Polygon | MultiPolygon | LineString | MultiLineString, P = Properties>(feature: Feature<G, P> | G, bbox: BBox): Feature<LineString, {}> | Feature<MultiLineString, {}> | Feature<Polygon, {}> | Feature<MultiPolygon, {}>;

71
frontend/node_modules/@turf/bbox-clip/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
var lineclip_1 = require("./lib/lineclip");
/**
* Takes a {@link Feature} and a bbox and clips the feature to the bbox using
* [lineclip](https://github.com/mapbox/lineclip).
* May result in degenerate edges when clipping Polygons.
*
* @name bboxClip
* @param {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} feature feature to clip to the bbox
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @returns {Feature<LineString|MultiLineString|Polygon|MultiPolygon>} clipped Feature
* @example
* var bbox = [0, 0, 10, 10];
* var poly = turf.polygon([[[2, 2], [8, 4], [12, 8], [3, 7], [2, 2]]]);
*
* var clipped = turf.bboxClip(poly, bbox);
*
* //addToMap
* var addToMap = [bbox, poly, clipped]
*/
function bboxClip(feature, bbox) {
var geom = invariant_1.getGeom(feature);
var type = geom.type;
var properties = feature.type === "Feature" ? feature.properties : {};
var coords = geom.coordinates;
switch (type) {
case "LineString":
case "MultiLineString": {
var lines_1 = [];
if (type === "LineString") {
coords = [coords];
}
coords.forEach(function (line) {
lineclip_1.lineclip(line, bbox, lines_1);
});
if (lines_1.length === 1) {
return helpers_1.lineString(lines_1[0], properties);
}
return helpers_1.multiLineString(lines_1, properties);
}
case "Polygon":
return helpers_1.polygon(clipPolygon(coords, bbox), properties);
case "MultiPolygon":
return helpers_1.multiPolygon(coords.map(function (poly) {
return clipPolygon(poly, bbox);
}), properties);
default:
throw new Error("geometry " + type + " not supported");
}
}
exports.default = bboxClip;
function clipPolygon(rings, bbox) {
var outRings = [];
for (var _i = 0, rings_1 = rings; _i < rings_1.length; _i++) {
var ring = rings_1[_i];
var clipped = lineclip_1.polygonclip(ring, bbox);
if (clipped.length > 0) {
if (clipped[0][0] !== clipped[clipped.length - 1][0] ||
clipped[0][1] !== clipped[clipped.length - 1][1]) {
clipped.push(clipped[0]);
}
if (clipped.length >= 4) {
outRings.push(clipped);
}
}
}
return outRings;
}

View File

@@ -0,0 +1,3 @@
import { BBox } from "@turf/helpers";
export declare function lineclip(points: number[][], bbox: BBox, result?: number[][][]): number[][][];
export declare function polygonclip(points: number[][], bbox: BBox): number[][];

111
frontend/node_modules/@turf/bbox-clip/dist/js/lib/lineclip.js generated vendored Executable file
View File

@@ -0,0 +1,111 @@
"use strict";
// Cohen-Sutherland line clipping algorithm, adapted to efficiently
// handle polylines rather than just segments
Object.defineProperty(exports, "__esModule", { value: true });
function lineclip(points, bbox, result) {
var len = points.length, codeA = bitCode(points[0], bbox), part = [], i, codeB, lastCode;
var a;
var b;
if (!result)
result = [];
for (i = 1; i < len; i++) {
a = points[i - 1];
b = points[i];
codeB = lastCode = bitCode(b, bbox);
while (true) {
if (!(codeA | codeB)) {
// accept
part.push(a);
if (codeB !== lastCode) {
// segment went outside
part.push(b);
if (i < len - 1) {
// start a new line
result.push(part);
part = [];
}
}
else if (i === len - 1) {
part.push(b);
}
break;
}
else if (codeA & codeB) {
// trivial reject
break;
}
else if (codeA) {
// a outside, intersect with clip edge
a = intersect(a, b, codeA, bbox);
codeA = bitCode(a, bbox);
}
else {
// b outside
b = intersect(a, b, codeB, bbox);
codeB = bitCode(b, bbox);
}
}
codeA = lastCode;
}
if (part.length)
result.push(part);
return result;
}
exports.lineclip = lineclip;
// Sutherland-Hodgeman polygon clipping algorithm
function polygonclip(points, bbox) {
var result, edge, prev, prevInside, i, p, inside;
// clip against each side of the clip rectangle
for (edge = 1; edge <= 8; edge *= 2) {
result = [];
prev = points[points.length - 1];
prevInside = !(bitCode(prev, bbox) & edge);
for (i = 0; i < points.length; i++) {
p = points[i];
inside = !(bitCode(p, bbox) & edge);
// if segment goes through the clip window, add an intersection
if (inside !== prevInside)
result.push(intersect(prev, p, edge, bbox));
if (inside)
result.push(p); // add a point if it's inside
prev = p;
prevInside = inside;
}
points = result;
if (!points.length)
break;
}
return result;
}
exports.polygonclip = polygonclip;
// intersect a segment against one of the 4 lines that make up the bbox
function intersect(a, b, edge, bbox) {
return edge & 8
? [a[0] + ((b[0] - a[0]) * (bbox[3] - a[1])) / (b[1] - a[1]), bbox[3]] // top
: edge & 4
? [a[0] + ((b[0] - a[0]) * (bbox[1] - a[1])) / (b[1] - a[1]), bbox[1]] // bottom
: edge & 2
? [bbox[2], a[1] + ((b[1] - a[1]) * (bbox[2] - a[0])) / (b[0] - a[0])] // right
: edge & 1
? [bbox[0], a[1] + ((b[1] - a[1]) * (bbox[0] - a[0])) / (b[0] - a[0])] // left
: null;
}
// bit code reflects the point position relative to the bbox:
// left mid right
// top 1001 1000 1010
// mid 0001 0000 0010
// bottom 0101 0100 0110
function bitCode(p, bbox) {
var code = 0;
if (p[0] < bbox[0])
code |= 1;
// left
else if (p[0] > bbox[2])
code |= 2; // right
if (p[1] < bbox[1])
code |= 4;
// bottom
else if (p[1] > bbox[3])
code |= 8; // top
return code;
}

71
frontend/node_modules/@turf/bbox-clip/package.json generated vendored Normal file
View File

@@ -0,0 +1,71 @@
{
"name": "@turf/bbox-clip",
"version": "6.5.0",
"description": "turf bbox-clip module",
"author": "Turf Authors",
"contributors": [
"Tim Channell <@tcql>",
"Vladimir Agafonkin <@mourner>",
"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",
"gis",
"bbox",
"clip"
],
"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/bbox": "^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"
}

20
frontend/node_modules/@turf/bbox-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.

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

@@ -0,0 +1,66 @@
# @turf/bbox-polygon
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## bboxPolygon
Takes a bbox and returns an equivalent [polygon][1].
**Parameters**
- `bbox` **[BBox][2]** extent in [minX, minY, maxX, maxY] order
- `options` **[Object][3]** Optional parameters (optional, default `{}`)
- `options.properties` **Properties** Translate properties to Polygon (optional, default `{}`)
- `options.id` **([string][4] \| [number][5])** Translate Id to Polygon (optional, default `{}`)
**Examples**
```javascript
var bbox = [0, 0, 10, 10];
var poly = turf.bboxPolygon(bbox);
//addToMap
var addToMap = [poly]
```
Returns **[Feature][6]&lt;[Polygon][7]>** a Polygon representation of the bounding box
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.6
[2]: https://tools.ietf.org/html/rfc7946#section-5
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[6]: https://tools.ietf.org/html/rfc7946#section-3.2
[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6
<!-- 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/bbox-polygon
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

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

@@ -0,0 +1,36 @@
import { polygon } from "@turf/helpers";
/**
* Takes a bbox and returns an equivalent {@link Polygon|polygon}.
*
* @name bboxPolygon
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @param {Object} [options={}] Optional parameters
* @param {Properties} [options.properties={}] Translate properties to Polygon
* @param {string|number} [options.id={}] Translate Id to Polygon
* @returns {Feature<Polygon>} a Polygon representation of the bounding box
* @example
* var bbox = [0, 0, 10, 10];
*
* var poly = turf.bboxPolygon(bbox);
*
* //addToMap
* var addToMap = [poly]
*/
export default function bboxPolygon(bbox, options) {
if (options === void 0) { options = {}; }
// Convert BBox positions to Numbers
// No performance loss for including Number()
// https://github.com/Turfjs/turf/issues/1119
var west = Number(bbox[0]);
var south = Number(bbox[1]);
var east = Number(bbox[2]);
var north = Number(bbox[3]);
if (bbox.length === 6) {
throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
}
var lowLeft = [west, south];
var topLeft = [west, north];
var topRight = [east, north];
var lowRight = [east, south];
return polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options.properties, { bbox: bbox, id: options.id });
}

View File

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

22
frontend/node_modules/@turf/bbox-polygon/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,22 @@
import { BBox, Feature, Id, Polygon, Properties } from "@turf/helpers";
/**
* Takes a bbox and returns an equivalent {@link Polygon|polygon}.
*
* @name bboxPolygon
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @param {Object} [options={}] Optional parameters
* @param {Properties} [options.properties={}] Translate properties to Polygon
* @param {string|number} [options.id={}] Translate Id to Polygon
* @returns {Feature<Polygon>} a Polygon representation of the bounding box
* @example
* var bbox = [0, 0, 10, 10];
*
* var poly = turf.bboxPolygon(bbox);
*
* //addToMap
* var addToMap = [poly]
*/
export default function bboxPolygon<P = Properties>(bbox: BBox, options?: {
properties?: P;
id?: Id;
}): Feature<Polygon, P>;

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

@@ -0,0 +1,39 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
/**
* Takes a bbox and returns an equivalent {@link Polygon|polygon}.
*
* @name bboxPolygon
* @param {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @param {Object} [options={}] Optional parameters
* @param {Properties} [options.properties={}] Translate properties to Polygon
* @param {string|number} [options.id={}] Translate Id to Polygon
* @returns {Feature<Polygon>} a Polygon representation of the bounding box
* @example
* var bbox = [0, 0, 10, 10];
*
* var poly = turf.bboxPolygon(bbox);
*
* //addToMap
* var addToMap = [poly]
*/
function bboxPolygon(bbox, options) {
if (options === void 0) { options = {}; }
// Convert BBox positions to Numbers
// No performance loss for including Number()
// https://github.com/Turfjs/turf/issues/1119
var west = Number(bbox[0]);
var south = Number(bbox[1]);
var east = Number(bbox[2]);
var north = Number(bbox[3]);
if (bbox.length === 6) {
throw new Error("@turf/bbox-polygon does not support BBox with 6 positions");
}
var lowLeft = [west, south];
var topLeft = [west, north];
var topRight = [east, north];
var lowRight = [east, south];
return helpers_1.polygon([[lowLeft, lowRight, topRight, topLeft, lowLeft]], options.properties, { bbox: bbox, id: options.id });
}
exports.default = bboxPolygon;

62
frontend/node_modules/@turf/bbox-polygon/package.json generated vendored Normal file
View File

@@ -0,0 +1,62 @@
{
"name": "@turf/bbox-polygon",
"version": "6.5.0",
"description": "turf bbox-polygon 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",
"gis",
"geojson",
"extent",
"bbox"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/bbox/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.

53
frontend/node_modules/@turf/bbox/README.md generated vendored Normal file
View File

@@ -0,0 +1,53 @@
# @turf/bbox
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## bbox
Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
**Parameters**
- `geojson` **[GeoJSON][1]** any GeoJSON object
**Examples**
```javascript
var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
var bbox = turf.bbox(line);
var bboxPolygon = turf.bboxPolygon(bbox);
//addToMap
var addToMap = [line, bboxPolygon]
```
Returns **[BBox][2]** bbox extent in [minX, minY, maxX, maxY] order
[1]: https://tools.ietf.org/html/rfc7946#section-3
[2]: https://tools.ietf.org/html/rfc7946#section-5
<!-- 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/bbox
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

35
frontend/node_modules/@turf/bbox/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,35 @@
import { coordEach } from "@turf/meta";
/**
* Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
*
* @name bbox
* @param {GeoJSON} geojson any GeoJSON object
* @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @example
* var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
* var bbox = turf.bbox(line);
* var bboxPolygon = turf.bboxPolygon(bbox);
*
* //addToMap
* var addToMap = [line, bboxPolygon]
*/
function bbox(geojson) {
var result = [Infinity, Infinity, -Infinity, -Infinity];
coordEach(geojson, function (coord) {
if (result[0] > coord[0]) {
result[0] = coord[0];
}
if (result[1] > coord[1]) {
result[1] = coord[1];
}
if (result[2] < coord[0]) {
result[2] = coord[0];
}
if (result[3] < coord[1]) {
result[3] = coord[1];
}
});
return result;
}
bbox["default"] = bbox;
export default bbox;

View File

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

17
frontend/node_modules/@turf/bbox/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,17 @@
import { BBox } from "@turf/helpers";
/**
* Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
*
* @name bbox
* @param {GeoJSON} geojson any GeoJSON object
* @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @example
* var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
* var bbox = turf.bbox(line);
* var bboxPolygon = turf.bboxPolygon(bbox);
*
* //addToMap
* var addToMap = [line, bboxPolygon]
*/
declare function bbox(geojson: any): BBox;
export default bbox;

37
frontend/node_modules/@turf/bbox/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,37 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var meta_1 = require("@turf/meta");
/**
* Takes a set of features, calculates the bbox of all input features, and returns a bounding box.
*
* @name bbox
* @param {GeoJSON} geojson any GeoJSON object
* @returns {BBox} bbox extent in [minX, minY, maxX, maxY] order
* @example
* var line = turf.lineString([[-74, 40], [-78, 42], [-82, 35]]);
* var bbox = turf.bbox(line);
* var bboxPolygon = turf.bboxPolygon(bbox);
*
* //addToMap
* var addToMap = [line, bboxPolygon]
*/
function bbox(geojson) {
var result = [Infinity, Infinity, -Infinity, -Infinity];
meta_1.coordEach(geojson, function (coord) {
if (result[0] > coord[0]) {
result[0] = coord[0];
}
if (result[1] > coord[1]) {
result[1] = coord[1];
}
if (result[2] < coord[0]) {
result[2] = coord[0];
}
if (result[3] < coord[1]) {
result[3] = coord[1];
}
});
return result;
}
bbox["default"] = bbox;
exports.default = bbox;

64
frontend/node_modules/@turf/bbox/package.json generated vendored Normal file
View File

@@ -0,0 +1,64 @@
{
"name": "@turf/bbox",
"version": "6.5.0",
"description": "turf bbox 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",
"extent",
"bbox",
"polygon",
"featurecollection",
"geojson"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/meta": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/bearing/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/bearing/README.md generated vendored Normal file
View File

@@ -0,0 +1,67 @@
# @turf/bearing
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## bearing
Takes two [points][1] and finds the geographic bearing between them,
i.e. the angle measured in degrees from the north line (0 degrees)
**Parameters**
- `start` **[Coord][2]** starting Point
- `end` **[Coord][2]** ending Point
- `options` **[Object][3]** Optional parameters (optional, default `{}`)
- `options.final` **[boolean][4]** calculates the final bearing if true (optional, default `false`)
**Examples**
```javascript
var point1 = turf.point([-75.343, 39.984]);
var point2 = turf.point([-75.534, 39.123]);
var bearing = turf.bearing(point1, point2);
//addToMap
var addToMap = [point1, point2]
point1.properties['marker-color'] = '#f00'
point2.properties['marker-color'] = '#0f0'
point1.properties.bearing = bearing
```
Returns **[number][5]** bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)
[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/Object
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
<!-- 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/bearing
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

57
frontend/node_modules/@turf/bearing/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,57 @@
import { degreesToRadians, radiansToDegrees } from "@turf/helpers";
import { getCoord } from "@turf/invariant";
// http://en.wikipedia.org/wiki/Haversine_formula
// http://www.movable-type.co.uk/scripts/latlong.html
/**
* Takes two {@link Point|points} and finds the geographic bearing between them,
* i.e. the angle measured in degrees from the north line (0 degrees)
*
* @name bearing
* @param {Coord} start starting Point
* @param {Coord} end ending Point
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.final=false] calculates the final bearing if true
* @returns {number} bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)
* @example
* var point1 = turf.point([-75.343, 39.984]);
* var point2 = turf.point([-75.534, 39.123]);
*
* var bearing = turf.bearing(point1, point2);
*
* //addToMap
* var addToMap = [point1, point2]
* point1.properties['marker-color'] = '#f00'
* point2.properties['marker-color'] = '#0f0'
* point1.properties.bearing = bearing
*/
export default function bearing(start, end, options) {
if (options === void 0) { options = {}; }
// Reverse calculation
if (options.final === true) {
return calculateFinalBearing(start, end);
}
var coordinates1 = getCoord(start);
var coordinates2 = getCoord(end);
var lon1 = degreesToRadians(coordinates1[0]);
var lon2 = degreesToRadians(coordinates2[0]);
var lat1 = degreesToRadians(coordinates1[1]);
var lat2 = degreesToRadians(coordinates2[1]);
var a = Math.sin(lon2 - lon1) * Math.cos(lat2);
var b = Math.cos(lat1) * Math.sin(lat2) -
Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1);
return radiansToDegrees(Math.atan2(a, b));
}
/**
* Calculates Final Bearing
*
* @private
* @param {Coord} start starting Point
* @param {Coord} end ending Point
* @returns {number} bearing
*/
function calculateFinalBearing(start, end) {
// Swap start & end
var bear = bearing(end, start);
bear = (bear + 180) % 360;
return bear;
}

View File

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

26
frontend/node_modules/@turf/bearing/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,26 @@
import { Coord } from "@turf/helpers";
/**
* Takes two {@link Point|points} and finds the geographic bearing between them,
* i.e. the angle measured in degrees from the north line (0 degrees)
*
* @name bearing
* @param {Coord} start starting Point
* @param {Coord} end ending Point
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.final=false] calculates the final bearing if true
* @returns {number} bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)
* @example
* var point1 = turf.point([-75.343, 39.984]);
* var point2 = turf.point([-75.534, 39.123]);
*
* var bearing = turf.bearing(point1, point2);
*
* //addToMap
* var addToMap = [point1, point2]
* point1.properties['marker-color'] = '#f00'
* point2.properties['marker-color'] = '#0f0'
* point1.properties.bearing = bearing
*/
export default function bearing(start: Coord, end: Coord, options?: {
final?: boolean;
}): number;

60
frontend/node_modules/@turf/bearing/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,60 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
// http://en.wikipedia.org/wiki/Haversine_formula
// http://www.movable-type.co.uk/scripts/latlong.html
/**
* Takes two {@link Point|points} and finds the geographic bearing between them,
* i.e. the angle measured in degrees from the north line (0 degrees)
*
* @name bearing
* @param {Coord} start starting Point
* @param {Coord} end ending Point
* @param {Object} [options={}] Optional parameters
* @param {boolean} [options.final=false] calculates the final bearing if true
* @returns {number} bearing in decimal degrees, between -180 and 180 degrees (positive clockwise)
* @example
* var point1 = turf.point([-75.343, 39.984]);
* var point2 = turf.point([-75.534, 39.123]);
*
* var bearing = turf.bearing(point1, point2);
*
* //addToMap
* var addToMap = [point1, point2]
* point1.properties['marker-color'] = '#f00'
* point2.properties['marker-color'] = '#0f0'
* point1.properties.bearing = bearing
*/
function bearing(start, end, options) {
if (options === void 0) { options = {}; }
// Reverse calculation
if (options.final === true) {
return calculateFinalBearing(start, end);
}
var coordinates1 = invariant_1.getCoord(start);
var coordinates2 = invariant_1.getCoord(end);
var lon1 = helpers_1.degreesToRadians(coordinates1[0]);
var lon2 = helpers_1.degreesToRadians(coordinates2[0]);
var lat1 = helpers_1.degreesToRadians(coordinates1[1]);
var lat2 = helpers_1.degreesToRadians(coordinates2[1]);
var a = Math.sin(lon2 - lon1) * Math.cos(lat2);
var b = Math.cos(lat1) * Math.sin(lat2) -
Math.sin(lat1) * Math.cos(lat2) * Math.cos(lon2 - lon1);
return helpers_1.radiansToDegrees(Math.atan2(a, b));
}
exports.default = bearing;
/**
* Calculates Final Bearing
*
* @private
* @param {Coord} start starting Point
* @param {Coord} end ending Point
* @returns {number} bearing
*/
function calculateFinalBearing(start, end) {
// Swap start & end
var bear = bearing(end, start);
bear = (bear + 180) % 360;
return bear;
}

62
frontend/node_modules/@turf/bearing/package.json generated vendored Normal file
View File

@@ -0,0 +1,62 @@
{
"name": "@turf/bearing",
"version": "6.5.0",
"description": "turf bearing 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",
"bearing"
],
"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/destination": "^6.5.0",
"@types/tape": "*",
"benchmark": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*",
"write-json-file": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/bezier-spline/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.

79
frontend/node_modules/@turf/bezier-spline/README.md generated vendored Normal file
View File

@@ -0,0 +1,79 @@
# @turf/bezier-spline
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## bezierSpline
Takes a [line][1] and returns a curved version
by applying a [Bezier spline][2]
algorithm.
The bezier spline implementation is by [Leszek Rybicki][3].
**Parameters**
- `line` **[Feature][4]&lt;[LineString][5]>** input LineString
- `options` **[Object][6]** Optional parameters (optional, default `{}`)
- `options.properties` **[Object][6]** Translate properties to output (optional, default `{}`)
- `options.resolution` **[number][7]** time in milliseconds between points (optional, default `10000`)
- `options.sharpness` **[number][7]** a measure of how curvy the path should be between splines (optional, default `0.85`)
**Examples**
```javascript
var line = turf.lineString([
[-76.091308, 18.427501],
[-76.695556, 18.729501],
[-76.552734, 19.40443],
[-74.61914, 19.134789],
[-73.652343, 20.07657],
[-73.157958, 20.210656]
]);
var curved = turf.bezierSpline(line);
//addToMap
var addToMap = [line, curved]
curved.properties = { stroke: '#0F0' };
```
Returns **[Feature][4]&lt;[LineString][5]>** curved line
[1]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[2]: http://en.wikipedia.org/wiki/B%C3%A9zier_spline
[3]: http://leszek.rybicki.cc/
[4]: https://tools.ietf.org/html/rfc7946#section-3.2
[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object
[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
<!-- 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/bezier-spline
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

60
frontend/node_modules/@turf/bezier-spline/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,60 @@
import { lineString } from "@turf/helpers";
import { getGeom } from "@turf/invariant";
import Spline from "./lib/spline.js";
/**
* Takes a {@link LineString|line} and returns a curved version
* by applying a [Bezier spline](http://en.wikipedia.org/wiki/B%C3%A9zier_spline)
* algorithm.
*
* The bezier spline implementation is by [Leszek Rybicki](http://leszek.rybicki.cc/).
*
* @name bezierSpline
* @param {Feature<LineString>} line input LineString
* @param {Object} [options={}] Optional parameters
* @param {Object} [options.properties={}] Translate properties to output
* @param {number} [options.resolution=10000] time in milliseconds between points
* @param {number} [options.sharpness=0.85] a measure of how curvy the path should be between splines
* @returns {Feature<LineString>} curved line
* @example
* var line = turf.lineString([
* [-76.091308, 18.427501],
* [-76.695556, 18.729501],
* [-76.552734, 19.40443],
* [-74.61914, 19.134789],
* [-73.652343, 20.07657],
* [-73.157958, 20.210656]
* ]);
*
* var curved = turf.bezierSpline(line);
*
* //addToMap
* var addToMap = [line, curved]
* curved.properties = { stroke: '#0F0' };
*/
function bezier(line, options) {
if (options === void 0) { options = {}; }
// Optional params
var resolution = options.resolution || 10000;
var sharpness = options.sharpness || 0.85;
var coords = [];
var points = getGeom(line).coordinates.map(function (pt) {
return { x: pt[0], y: pt[1] };
});
var spline = new Spline({
duration: resolution,
points: points,
sharpness: sharpness,
});
var pushCoord = function (time) {
var pos = spline.pos(time);
if (Math.floor(time / 100) % 2 === 0) {
coords.push([pos.x, pos.y]);
}
};
for (var i = 0; i < spline.duration; i += 10) {
pushCoord(i);
}
pushCoord(spline.duration);
return lineString(coords, options.properties);
}
export default bezier;

View File

@@ -0,0 +1,158 @@
/**
* BezierSpline
* https://github.com/leszekr/bezier-spline-js
*
* @private
* @copyright
* Copyright (c) 2013 Leszek Rybicki
*
* 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.
*/
var Spline = /** @class */ (function () {
function Spline(options) {
this.points = options.points || [];
this.duration = options.duration || 10000;
this.sharpness = options.sharpness || 0.85;
this.centers = [];
this.controls = [];
this.stepLength = options.stepLength || 60;
this.length = this.points.length;
this.delay = 0;
// this is to ensure compatibility with the 2d version
for (var i = 0; i < this.length; i++) {
this.points[i].z = this.points[i].z || 0;
}
for (var i = 0; i < this.length - 1; i++) {
var p1 = this.points[i];
var p2 = this.points[i + 1];
this.centers.push({
x: (p1.x + p2.x) / 2,
y: (p1.y + p2.y) / 2,
z: (p1.z + p2.z) / 2,
});
}
this.controls.push([this.points[0], this.points[0]]);
for (var i = 0; i < this.centers.length - 1; i++) {
var dx = this.points[i + 1].x - (this.centers[i].x + this.centers[i + 1].x) / 2;
var dy = this.points[i + 1].y - (this.centers[i].y + this.centers[i + 1].y) / 2;
var dz = this.points[i + 1].z - (this.centers[i].y + this.centers[i + 1].z) / 2;
this.controls.push([
{
x: (1.0 - this.sharpness) * this.points[i + 1].x +
this.sharpness * (this.centers[i].x + dx),
y: (1.0 - this.sharpness) * this.points[i + 1].y +
this.sharpness * (this.centers[i].y + dy),
z: (1.0 - this.sharpness) * this.points[i + 1].z +
this.sharpness * (this.centers[i].z + dz),
},
{
x: (1.0 - this.sharpness) * this.points[i + 1].x +
this.sharpness * (this.centers[i + 1].x + dx),
y: (1.0 - this.sharpness) * this.points[i + 1].y +
this.sharpness * (this.centers[i + 1].y + dy),
z: (1.0 - this.sharpness) * this.points[i + 1].z +
this.sharpness * (this.centers[i + 1].z + dz),
},
]);
}
this.controls.push([
this.points[this.length - 1],
this.points[this.length - 1],
]);
this.steps = this.cacheSteps(this.stepLength);
return this;
}
/**
* Caches an array of equidistant (more or less) points on the curve.
*/
Spline.prototype.cacheSteps = function (mindist) {
var steps = [];
var laststep = this.pos(0);
steps.push(0);
for (var t = 0; t < this.duration; t += 10) {
var step = this.pos(t);
var dist = Math.sqrt((step.x - laststep.x) * (step.x - laststep.x) +
(step.y - laststep.y) * (step.y - laststep.y) +
(step.z - laststep.z) * (step.z - laststep.z));
if (dist > mindist) {
steps.push(t);
laststep = step;
}
}
return steps;
};
/**
* returns angle and speed in the given point in the curve
*/
Spline.prototype.vector = function (t) {
var p1 = this.pos(t + 10);
var p2 = this.pos(t - 10);
return {
angle: (180 * Math.atan2(p1.y - p2.y, p1.x - p2.x)) / 3.14,
speed: Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) +
(p2.y - p1.y) * (p2.y - p1.y) +
(p2.z - p1.z) * (p2.z - p1.z)),
};
};
/**
* Gets the position of the point, given time.
*
* WARNING: The speed is not constant. The time it takes between control points is constant.
*
* For constant speed, use Spline.steps[i];
*/
Spline.prototype.pos = function (time) {
var t = time - this.delay;
if (t < 0) {
t = 0;
}
if (t > this.duration) {
t = this.duration - 1;
}
// t = t-this.delay;
var t2 = t / this.duration;
if (t2 >= 1) {
return this.points[this.length - 1];
}
var n = Math.floor((this.points.length - 1) * t2);
var t1 = (this.length - 1) * t2 - n;
return bezier(t1, this.points[n], this.controls[n][1], this.controls[n + 1][0], this.points[n + 1]);
};
return Spline;
}());
export default Spline;
function bezier(t, p1, c1, c2, p2) {
var b = B(t);
var pos = {
x: p2.x * b[0] + c2.x * b[1] + c1.x * b[2] + p1.x * b[3],
y: p2.y * b[0] + c2.y * b[1] + c1.y * b[2] + p1.y * b[3],
z: p2.z * b[0] + c2.z * b[1] + c1.z * b[2] + p1.z * b[3],
};
return pos;
}
function B(t) {
var t2 = t * t;
var t3 = t2 * t;
return [
t3,
3 * t2 * (1 - t),
3 * t * (1 - t) * (1 - t),
(1 - t) * (1 - t) * (1 - t),
];
}

View File

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

37
frontend/node_modules/@turf/bezier-spline/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,37 @@
import { Feature, LineString, Properties } from "@turf/helpers";
/**
* Takes a {@link LineString|line} and returns a curved version
* by applying a [Bezier spline](http://en.wikipedia.org/wiki/B%C3%A9zier_spline)
* algorithm.
*
* The bezier spline implementation is by [Leszek Rybicki](http://leszek.rybicki.cc/).
*
* @name bezierSpline
* @param {Feature<LineString>} line input LineString
* @param {Object} [options={}] Optional parameters
* @param {Object} [options.properties={}] Translate properties to output
* @param {number} [options.resolution=10000] time in milliseconds between points
* @param {number} [options.sharpness=0.85] a measure of how curvy the path should be between splines
* @returns {Feature<LineString>} curved line
* @example
* var line = turf.lineString([
* [-76.091308, 18.427501],
* [-76.695556, 18.729501],
* [-76.552734, 19.40443],
* [-74.61914, 19.134789],
* [-73.652343, 20.07657],
* [-73.157958, 20.210656]
* ]);
*
* var curved = turf.bezierSpline(line);
*
* //addToMap
* var addToMap = [line, curved]
* curved.properties = { stroke: '#0F0' };
*/
declare function bezier<P = Properties>(line: Feature<LineString> | LineString, options?: {
properties?: P;
resolution?: number;
sharpness?: number;
}): Feature<LineString, P>;
export default bezier;

65
frontend/node_modules/@turf/bezier-spline/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,65 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("@turf/helpers");
var invariant_1 = require("@turf/invariant");
var spline_1 = __importDefault(require("./lib/spline"));
/**
* Takes a {@link LineString|line} and returns a curved version
* by applying a [Bezier spline](http://en.wikipedia.org/wiki/B%C3%A9zier_spline)
* algorithm.
*
* The bezier spline implementation is by [Leszek Rybicki](http://leszek.rybicki.cc/).
*
* @name bezierSpline
* @param {Feature<LineString>} line input LineString
* @param {Object} [options={}] Optional parameters
* @param {Object} [options.properties={}] Translate properties to output
* @param {number} [options.resolution=10000] time in milliseconds between points
* @param {number} [options.sharpness=0.85] a measure of how curvy the path should be between splines
* @returns {Feature<LineString>} curved line
* @example
* var line = turf.lineString([
* [-76.091308, 18.427501],
* [-76.695556, 18.729501],
* [-76.552734, 19.40443],
* [-74.61914, 19.134789],
* [-73.652343, 20.07657],
* [-73.157958, 20.210656]
* ]);
*
* var curved = turf.bezierSpline(line);
*
* //addToMap
* var addToMap = [line, curved]
* curved.properties = { stroke: '#0F0' };
*/
function bezier(line, options) {
if (options === void 0) { options = {}; }
// Optional params
var resolution = options.resolution || 10000;
var sharpness = options.sharpness || 0.85;
var coords = [];
var points = invariant_1.getGeom(line).coordinates.map(function (pt) {
return { x: pt[0], y: pt[1] };
});
var spline = new spline_1.default({
duration: resolution,
points: points,
sharpness: sharpness,
});
var pushCoord = function (time) {
var pos = spline.pos(time);
if (Math.floor(time / 100) % 2 === 0) {
coords.push([pos.x, pos.y]);
}
};
for (var i = 0; i < spline.duration; i += 10) {
pushCoord(i);
}
pushCoord(spline.duration);
return helpers_1.lineString(coords, options.properties);
}
exports.default = bezier;

View File

@@ -0,0 +1,62 @@
export interface Point {
x: number;
y: number;
z: number;
}
/**
* BezierSpline
* https://github.com/leszekr/bezier-spline-js
*
* @private
* @copyright
* Copyright (c) 2013 Leszek Rybicki
*
* 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.
*/
export default class Spline {
duration: number;
points: Point[];
sharpness: number;
centers: Point[];
controls: Array<[Point, Point]>;
stepLength: number;
length: number;
delay: number;
steps: number[];
constructor(options?: any);
/**
* Caches an array of equidistant (more or less) points on the curve.
*/
cacheSteps(mindist: number): number[];
/**
* returns angle and speed in the given point in the curve
*/
vector(t: number): {
angle: number;
speed: number;
};
/**
* Gets the position of the point, given time.
*
* WARNING: The speed is not constant. The time it takes between control points is constant.
*
* For constant speed, use Spline.steps[i];
*/
pos(time: number): Point;
}

View File

@@ -0,0 +1,160 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* BezierSpline
* https://github.com/leszekr/bezier-spline-js
*
* @private
* @copyright
* Copyright (c) 2013 Leszek Rybicki
*
* 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.
*/
var Spline = /** @class */ (function () {
function Spline(options) {
this.points = options.points || [];
this.duration = options.duration || 10000;
this.sharpness = options.sharpness || 0.85;
this.centers = [];
this.controls = [];
this.stepLength = options.stepLength || 60;
this.length = this.points.length;
this.delay = 0;
// this is to ensure compatibility with the 2d version
for (var i = 0; i < this.length; i++) {
this.points[i].z = this.points[i].z || 0;
}
for (var i = 0; i < this.length - 1; i++) {
var p1 = this.points[i];
var p2 = this.points[i + 1];
this.centers.push({
x: (p1.x + p2.x) / 2,
y: (p1.y + p2.y) / 2,
z: (p1.z + p2.z) / 2,
});
}
this.controls.push([this.points[0], this.points[0]]);
for (var i = 0; i < this.centers.length - 1; i++) {
var dx = this.points[i + 1].x - (this.centers[i].x + this.centers[i + 1].x) / 2;
var dy = this.points[i + 1].y - (this.centers[i].y + this.centers[i + 1].y) / 2;
var dz = this.points[i + 1].z - (this.centers[i].y + this.centers[i + 1].z) / 2;
this.controls.push([
{
x: (1.0 - this.sharpness) * this.points[i + 1].x +
this.sharpness * (this.centers[i].x + dx),
y: (1.0 - this.sharpness) * this.points[i + 1].y +
this.sharpness * (this.centers[i].y + dy),
z: (1.0 - this.sharpness) * this.points[i + 1].z +
this.sharpness * (this.centers[i].z + dz),
},
{
x: (1.0 - this.sharpness) * this.points[i + 1].x +
this.sharpness * (this.centers[i + 1].x + dx),
y: (1.0 - this.sharpness) * this.points[i + 1].y +
this.sharpness * (this.centers[i + 1].y + dy),
z: (1.0 - this.sharpness) * this.points[i + 1].z +
this.sharpness * (this.centers[i + 1].z + dz),
},
]);
}
this.controls.push([
this.points[this.length - 1],
this.points[this.length - 1],
]);
this.steps = this.cacheSteps(this.stepLength);
return this;
}
/**
* Caches an array of equidistant (more or less) points on the curve.
*/
Spline.prototype.cacheSteps = function (mindist) {
var steps = [];
var laststep = this.pos(0);
steps.push(0);
for (var t = 0; t < this.duration; t += 10) {
var step = this.pos(t);
var dist = Math.sqrt((step.x - laststep.x) * (step.x - laststep.x) +
(step.y - laststep.y) * (step.y - laststep.y) +
(step.z - laststep.z) * (step.z - laststep.z));
if (dist > mindist) {
steps.push(t);
laststep = step;
}
}
return steps;
};
/**
* returns angle and speed in the given point in the curve
*/
Spline.prototype.vector = function (t) {
var p1 = this.pos(t + 10);
var p2 = this.pos(t - 10);
return {
angle: (180 * Math.atan2(p1.y - p2.y, p1.x - p2.x)) / 3.14,
speed: Math.sqrt((p2.x - p1.x) * (p2.x - p1.x) +
(p2.y - p1.y) * (p2.y - p1.y) +
(p2.z - p1.z) * (p2.z - p1.z)),
};
};
/**
* Gets the position of the point, given time.
*
* WARNING: The speed is not constant. The time it takes between control points is constant.
*
* For constant speed, use Spline.steps[i];
*/
Spline.prototype.pos = function (time) {
var t = time - this.delay;
if (t < 0) {
t = 0;
}
if (t > this.duration) {
t = this.duration - 1;
}
// t = t-this.delay;
var t2 = t / this.duration;
if (t2 >= 1) {
return this.points[this.length - 1];
}
var n = Math.floor((this.points.length - 1) * t2);
var t1 = (this.length - 1) * t2 - n;
return bezier(t1, this.points[n], this.controls[n][1], this.controls[n + 1][0], this.points[n + 1]);
};
return Spline;
}());
exports.default = Spline;
function bezier(t, p1, c1, c2, p2) {
var b = B(t);
var pos = {
x: p2.x * b[0] + c2.x * b[1] + c1.x * b[2] + p1.x * b[3],
y: p2.y * b[0] + c2.y * b[1] + c1.y * b[2] + p1.y * b[3],
z: p2.z * b[0] + c2.z * b[1] + c1.z * b[2] + p1.z * b[3],
};
return pos;
}
function B(t) {
var t2 = t * t;
var t3 = t2 * t;
return [
t3,
3 * t2 * (1 - t),
3 * t * (1 - t) * (1 - t),
(1 - t) * (1 - t) * (1 - t),
];
}

65
frontend/node_modules/@turf/bezier-spline/package.json generated vendored Normal file
View File

@@ -0,0 +1,65 @@
{
"name": "@turf/bezier-spline",
"version": "6.5.0",
"description": "turf bezier-spline 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",
"geometry",
"bezier",
"curve",
"linestring"
],
"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": {
"@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"
}

20
frontend/node_modules/@turf/boolean-clockwise/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.

60
frontend/node_modules/@turf/boolean-clockwise/README.md generated vendored Executable file
View File

@@ -0,0 +1,60 @@
# @turf/boolean-clockwise
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanClockwise
Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
**Parameters**
- `line` **([Feature][1]&lt;[LineString][2]> | [LineString][2] \| [Array][3]&lt;[Array][3]&lt;[number][4]>>)** to be evaluated
**Examples**
```javascript
var clockwiseRing = turf.lineString([[0,0],[1,1],[1,0],[0,0]]);
var counterClockwiseRing = turf.lineString([[0,0],[1,0],[1,1],[0,0]]);
turf.booleanClockwise(clockwiseRing)
//=true
turf.booleanClockwise(counterClockwiseRing)
//=false
```
Returns **[boolean][5]** true/false
[1]: https://tools.ietf.org/html/rfc7946#section-3.2
[2]: https://tools.ietf.org/html/rfc7946#section-3.1.4
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number
[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- 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/boolean-clockwise
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

View File

@@ -0,0 +1,30 @@
import { getCoords } from "@turf/invariant";
/**
* Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
*
* @name booleanClockwise
* @param {Feature<LineString>|LineString|Array<Array<number>>} line to be evaluated
* @returns {boolean} true/false
* @example
* var clockwiseRing = turf.lineString([[0,0],[1,1],[1,0],[0,0]]);
* var counterClockwiseRing = turf.lineString([[0,0],[1,0],[1,1],[0,0]]);
*
* turf.booleanClockwise(clockwiseRing)
* //=true
* turf.booleanClockwise(counterClockwiseRing)
* //=false
*/
export default function booleanClockwise(line) {
var ring = getCoords(line);
var sum = 0;
var i = 1;
var prev;
var cur;
while (i < ring.length) {
prev = cur || ring[0];
cur = ring[i];
sum += (cur[0] - prev[0]) * (cur[1] + prev[1]);
i++;
}
return sum > 0;
}

View File

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

View File

@@ -0,0 +1,17 @@
import { Feature, LineString, Position } from "@turf/helpers";
/**
* Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
*
* @name booleanClockwise
* @param {Feature<LineString>|LineString|Array<Array<number>>} line to be evaluated
* @returns {boolean} true/false
* @example
* var clockwiseRing = turf.lineString([[0,0],[1,1],[1,0],[0,0]]);
* var counterClockwiseRing = turf.lineString([[0,0],[1,0],[1,1],[0,0]]);
*
* turf.booleanClockwise(clockwiseRing)
* //=true
* turf.booleanClockwise(counterClockwiseRing)
* //=false
*/
export default function booleanClockwise(line: Feature<LineString> | LineString | Position[]): boolean;

View File

@@ -0,0 +1,33 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var invariant_1 = require("@turf/invariant");
/**
* Takes a ring and return true or false whether or not the ring is clockwise or counter-clockwise.
*
* @name booleanClockwise
* @param {Feature<LineString>|LineString|Array<Array<number>>} line to be evaluated
* @returns {boolean} true/false
* @example
* var clockwiseRing = turf.lineString([[0,0],[1,1],[1,0],[0,0]]);
* var counterClockwiseRing = turf.lineString([[0,0],[1,0],[1,1],[0,0]]);
*
* turf.booleanClockwise(clockwiseRing)
* //=true
* turf.booleanClockwise(counterClockwiseRing)
* //=false
*/
function booleanClockwise(line) {
var ring = invariant_1.getCoords(line);
var sum = 0;
var i = 1;
var prev;
var cur;
while (i < ring.length) {
prev = cur || ring[0];
cur = ring[i];
sum += (cur[0] - prev[0]) * (cur[1] + prev[1]);
i++;
}
return sum > 0;
}
exports.default = booleanClockwise;

69
frontend/node_modules/@turf/boolean-clockwise/package.json generated vendored Executable file
View File

@@ -0,0 +1,69 @@
{
"name": "@turf/boolean-clockwise",
"version": "6.5.0",
"description": "turf boolean-clockwise module",
"author": "Turf Authors",
"contributors": [
"Morgan Herlocker <@morganherlocker>",
"Rowan Winsemius <@rowanwins>",
"Denis Carriere <@DenisCarriere>",
"Stefano Borghi <@stebogit>"
],
"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",
"clockwise",
"boolean"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/boolean-contains/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.

63
frontend/node_modules/@turf/boolean-contains/README.md generated vendored Normal file
View File

@@ -0,0 +1,63 @@
# @turf/boolean-contains
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanContains
Boolean-contains returns True if the second geometry is completely contained by the first geometry.
The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
must not intersect the exterior of the primary (geometry a).
Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
**Parameters**
- `feature1` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
- `feature2` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
**Examples**
```javascript
var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
var point = turf.point([1, 2]);
turf.booleanContains(line, point);
//=true
```
Returns **[boolean][3]** true/false
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- 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/boolean-contains
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![esri-contains](diagrams/esri-contains.gif)

225
frontend/node_modules/@turf/boolean-contains/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,225 @@
import calcBbox from "@turf/bbox";
import booleanPointInPolygon from "@turf/boolean-point-in-polygon";
import isPointOnLine from "@turf/boolean-point-on-line";
import { getGeom } from "@turf/invariant";
/**
* Boolean-contains returns True if the second geometry is completely contained by the first geometry.
* The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
* must not intersect the exterior of the primary (geometry a).
* Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
*
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* var point = turf.point([1, 2]);
*
* turf.booleanContains(line, point);
* //=true
*/
export default function booleanContains(feature1, feature2) {
var geom1 = getGeom(feature1);
var geom2 = getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
var coords1 = geom1.coordinates;
var coords2 = geom2.coordinates;
switch (type1) {
case "Point":
switch (type2) {
case "Point":
return compareCoords(coords1, coords2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "MultiPoint":
switch (type2) {
case "Point":
return isPointInMultiPoint(geom1, geom2);
case "MultiPoint":
return isMultiPointInMultiPoint(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "Point":
return isPointOnLine(geom2, geom1, { ignoreEndVertices: true });
case "LineString":
return isLineOnLine(geom1, geom2);
case "MultiPoint":
return isMultiPointOnLine(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "Point":
return booleanPointInPolygon(geom2, geom1, { ignoreBoundary: true });
case "LineString":
return isLineInPoly(geom1, geom2);
case "Polygon":
return isPolyInPoly(geom1, geom2);
case "MultiPoint":
return isMultiPointInPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
export function isPointInMultiPoint(multiPoint, pt) {
var i;
var output = false;
for (i = 0; i < multiPoint.coordinates.length; i++) {
if (compareCoords(multiPoint.coordinates[i], pt.coordinates)) {
output = true;
break;
}
}
return output;
}
export function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
for (var _i = 0, _a = multiPoint2.coordinates; _i < _a.length; _i++) {
var coord2 = _a[_i];
var matchFound = false;
for (var _b = 0, _c = multiPoint1.coordinates; _b < _c.length; _b++) {
var coord1 = _c[_b];
if (compareCoords(coord2, coord1)) {
matchFound = true;
break;
}
}
if (!matchFound) {
return false;
}
}
return true;
}
export function isMultiPointOnLine(lineString, multiPoint) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (isPointOnLine(coord, lineString, { ignoreEndVertices: true })) {
haveFoundInteriorPoint = true;
}
if (!isPointOnLine(coord, lineString)) {
return false;
}
}
if (haveFoundInteriorPoint) {
return true;
}
return false;
}
export function isMultiPointInPoly(polygon, multiPoint) {
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (!booleanPointInPolygon(coord, polygon, { ignoreBoundary: true })) {
return false;
}
}
return true;
}
export function isLineOnLine(lineString1, lineString2) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = lineString2.coordinates; _i < _a.length; _i++) {
var coords = _a[_i];
if (isPointOnLine({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: true,
})) {
haveFoundInteriorPoint = true;
}
if (!isPointOnLine({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: false,
})) {
return false;
}
}
return haveFoundInteriorPoint;
}
export function isLineInPoly(polygon, linestring) {
var output = false;
var i = 0;
var polyBbox = calcBbox(polygon);
var lineBbox = calcBbox(linestring);
if (!doBBoxOverlap(polyBbox, lineBbox)) {
return false;
}
for (i; i < linestring.coordinates.length - 1; i++) {
var midPoint = getMidpoint(linestring.coordinates[i], linestring.coordinates[i + 1]);
if (booleanPointInPolygon({ type: "Point", coordinates: midPoint }, polygon, {
ignoreBoundary: true,
})) {
output = true;
break;
}
}
return output;
}
/**
* Is Polygon2 in Polygon1
* Only takes into account outer rings
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
export function isPolyInPoly(feature1, feature2) {
// Handle Nulls
if (feature1.type === "Feature" && feature1.geometry === null) {
return false;
}
if (feature2.type === "Feature" && feature2.geometry === null) {
return false;
}
var poly1Bbox = calcBbox(feature1);
var poly2Bbox = calcBbox(feature2);
if (!doBBoxOverlap(poly1Bbox, poly2Bbox)) {
return false;
}
var coords = getGeom(feature2).coordinates;
for (var _i = 0, coords_1 = coords; _i < coords_1.length; _i++) {
var ring = coords_1[_i];
for (var _a = 0, ring_1 = ring; _a < ring_1.length; _a++) {
var coord = ring_1[_a];
if (!booleanPointInPolygon(coord, feature1)) {
return false;
}
}
}
return true;
}
export function doBBoxOverlap(bbox1, bbox2) {
if (bbox1[0] > bbox2[0]) {
return false;
}
if (bbox1[2] < bbox2[2]) {
return false;
}
if (bbox1[1] > bbox2[1]) {
return false;
}
if (bbox1[3] < bbox2[3]) {
return false;
}
return true;
}
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
export function compareCoords(pair1, pair2) {
return pair1[0] === pair2[0] && pair1[1] === pair2[1];
}
export function getMidpoint(pair1, pair2) {
return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
}

View File

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

View File

@@ -0,0 +1,46 @@
import { BBox, Feature, Geometry, LineString, MultiPoint, Point, Polygon } from "@turf/helpers";
/**
* Boolean-contains returns True if the second geometry is completely contained by the first geometry.
* The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
* must not intersect the exterior of the primary (geometry a).
* Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
*
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* var point = turf.point([1, 2]);
*
* turf.booleanContains(line, point);
* //=true
*/
export default function booleanContains(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
export declare function isPointInMultiPoint(multiPoint: MultiPoint, pt: Point): boolean;
export declare function isMultiPointInMultiPoint(multiPoint1: MultiPoint, multiPoint2: MultiPoint): boolean;
export declare function isMultiPointOnLine(lineString: LineString, multiPoint: MultiPoint): boolean;
export declare function isMultiPointInPoly(polygon: Polygon, multiPoint: MultiPoint): boolean;
export declare function isLineOnLine(lineString1: LineString, lineString2: LineString): boolean;
export declare function isLineInPoly(polygon: Polygon, linestring: LineString): boolean;
/**
* Is Polygon2 in Polygon1
* Only takes into account outer rings
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
export declare function isPolyInPoly(feature1: Feature<Polygon> | Polygon, feature2: Feature<Polygon> | Polygon): boolean;
export declare function doBBoxOverlap(bbox1: BBox, bbox2: BBox): boolean;
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
export declare function compareCoords(pair1: number[], pair2: number[]): boolean;
export declare function getMidpoint(pair1: number[], pair2: number[]): number[];

241
frontend/node_modules/@turf/boolean-contains/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,241 @@
"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 boolean_point_in_polygon_1 = __importDefault(require("@turf/boolean-point-in-polygon"));
var boolean_point_on_line_1 = __importDefault(require("@turf/boolean-point-on-line"));
var invariant_1 = require("@turf/invariant");
/**
* Boolean-contains returns True if the second geometry is completely contained by the first geometry.
* The interiors of both geometries must intersect and, the interior and boundary of the secondary (geometry b)
* must not intersect the exterior of the primary (geometry a).
* Boolean-contains returns the exact opposite result of the `@turf/boolean-within`.
*
* @name booleanContains
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
* var point = turf.point([1, 2]);
*
* turf.booleanContains(line, point);
* //=true
*/
function booleanContains(feature1, feature2) {
var geom1 = invariant_1.getGeom(feature1);
var geom2 = invariant_1.getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
var coords1 = geom1.coordinates;
var coords2 = geom2.coordinates;
switch (type1) {
case "Point":
switch (type2) {
case "Point":
return compareCoords(coords1, coords2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "MultiPoint":
switch (type2) {
case "Point":
return isPointInMultiPoint(geom1, geom2);
case "MultiPoint":
return isMultiPointInMultiPoint(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "Point":
return boolean_point_on_line_1.default(geom2, geom1, { ignoreEndVertices: true });
case "LineString":
return isLineOnLine(geom1, geom2);
case "MultiPoint":
return isMultiPointOnLine(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "Point":
return boolean_point_in_polygon_1.default(geom2, geom1, { ignoreBoundary: true });
case "LineString":
return isLineInPoly(geom1, geom2);
case "Polygon":
return isPolyInPoly(geom1, geom2);
case "MultiPoint":
return isMultiPointInPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
exports.default = booleanContains;
function isPointInMultiPoint(multiPoint, pt) {
var i;
var output = false;
for (i = 0; i < multiPoint.coordinates.length; i++) {
if (compareCoords(multiPoint.coordinates[i], pt.coordinates)) {
output = true;
break;
}
}
return output;
}
exports.isPointInMultiPoint = isPointInMultiPoint;
function isMultiPointInMultiPoint(multiPoint1, multiPoint2) {
for (var _i = 0, _a = multiPoint2.coordinates; _i < _a.length; _i++) {
var coord2 = _a[_i];
var matchFound = false;
for (var _b = 0, _c = multiPoint1.coordinates; _b < _c.length; _b++) {
var coord1 = _c[_b];
if (compareCoords(coord2, coord1)) {
matchFound = true;
break;
}
}
if (!matchFound) {
return false;
}
}
return true;
}
exports.isMultiPointInMultiPoint = isMultiPointInMultiPoint;
function isMultiPointOnLine(lineString, multiPoint) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (boolean_point_on_line_1.default(coord, lineString, { ignoreEndVertices: true })) {
haveFoundInteriorPoint = true;
}
if (!boolean_point_on_line_1.default(coord, lineString)) {
return false;
}
}
if (haveFoundInteriorPoint) {
return true;
}
return false;
}
exports.isMultiPointOnLine = isMultiPointOnLine;
function isMultiPointInPoly(polygon, multiPoint) {
for (var _i = 0, _a = multiPoint.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (!boolean_point_in_polygon_1.default(coord, polygon, { ignoreBoundary: true })) {
return false;
}
}
return true;
}
exports.isMultiPointInPoly = isMultiPointInPoly;
function isLineOnLine(lineString1, lineString2) {
var haveFoundInteriorPoint = false;
for (var _i = 0, _a = lineString2.coordinates; _i < _a.length; _i++) {
var coords = _a[_i];
if (boolean_point_on_line_1.default({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: true,
})) {
haveFoundInteriorPoint = true;
}
if (!boolean_point_on_line_1.default({ type: "Point", coordinates: coords }, lineString1, {
ignoreEndVertices: false,
})) {
return false;
}
}
return haveFoundInteriorPoint;
}
exports.isLineOnLine = isLineOnLine;
function isLineInPoly(polygon, linestring) {
var output = false;
var i = 0;
var polyBbox = bbox_1.default(polygon);
var lineBbox = bbox_1.default(linestring);
if (!doBBoxOverlap(polyBbox, lineBbox)) {
return false;
}
for (i; i < linestring.coordinates.length - 1; i++) {
var midPoint = getMidpoint(linestring.coordinates[i], linestring.coordinates[i + 1]);
if (boolean_point_in_polygon_1.default({ type: "Point", coordinates: midPoint }, polygon, {
ignoreBoundary: true,
})) {
output = true;
break;
}
}
return output;
}
exports.isLineInPoly = isLineInPoly;
/**
* Is Polygon2 in Polygon1
* Only takes into account outer rings
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1, feature2) {
// Handle Nulls
if (feature1.type === "Feature" && feature1.geometry === null) {
return false;
}
if (feature2.type === "Feature" && feature2.geometry === null) {
return false;
}
var poly1Bbox = bbox_1.default(feature1);
var poly2Bbox = bbox_1.default(feature2);
if (!doBBoxOverlap(poly1Bbox, poly2Bbox)) {
return false;
}
var coords = invariant_1.getGeom(feature2).coordinates;
for (var _i = 0, coords_1 = coords; _i < coords_1.length; _i++) {
var ring = coords_1[_i];
for (var _a = 0, ring_1 = ring; _a < ring_1.length; _a++) {
var coord = ring_1[_a];
if (!boolean_point_in_polygon_1.default(coord, feature1)) {
return false;
}
}
}
return true;
}
exports.isPolyInPoly = isPolyInPoly;
function doBBoxOverlap(bbox1, bbox2) {
if (bbox1[0] > bbox2[0]) {
return false;
}
if (bbox1[2] < bbox2[2]) {
return false;
}
if (bbox1[1] > bbox2[1]) {
return false;
}
if (bbox1[3] < bbox2[3]) {
return false;
}
return true;
}
exports.doBBoxOverlap = doBBoxOverlap;
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
function compareCoords(pair1, pair2) {
return pair1[0] === pair2[0] && pair1[1] === pair2[1];
}
exports.compareCoords = compareCoords;
function getMidpoint(pair1, pair2) {
return [(pair1[0] + pair2[0]) / 2, (pair1[1] + pair2[1]) / 2];
}
exports.getMidpoint = getMidpoint;

View File

@@ -0,0 +1,73 @@
{
"name": "@turf/boolean-contains",
"version": "6.5.0",
"description": "turf boolean-contains 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",
"contains",
"boolean",
"de-9im"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"boolean-jsts": "*",
"boolean-shapely": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/bbox": "^6.5.0",
"@turf/boolean-point-in-polygon": "^6.5.0",
"@turf/boolean-point-on-line": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/boolean-crosses/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.

64
frontend/node_modules/@turf/boolean-crosses/README.md generated vendored Normal file
View File

@@ -0,0 +1,64 @@
# @turf/boolean-crosses
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanCrosses
Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
the maximum dimension of the two source geometries and the intersection set is interior to
both source geometries.
Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
**Parameters**
- `feature1` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
- `feature2` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
**Examples**
```javascript
var line1 = turf.lineString([[-2, 2], [4, 2]]);
var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
var cross = turf.booleanCrosses(line1, line2);
//=true
```
Returns **[boolean][3]** true/false
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- 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/boolean-crosses
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![esri-crosses](diagrams/esri-crosses.gif)

166
frontend/node_modules/@turf/boolean-crosses/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,166 @@
import lineIntersect from "@turf/line-intersect";
import { polygonToLine } from "@turf/polygon-to-line";
import booleanPointInPolygon from "@turf/boolean-point-in-polygon";
import { getGeom } from "@turf/invariant";
import { point, } from "@turf/helpers";
/**
* Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
* the maximum dimension of the two source geometries and the intersection set is interior to
* both source geometries.
*
* Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
*
* @name booleanCrosses
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line1 = turf.lineString([[-2, 2], [4, 2]]);
* var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* var cross = turf.booleanCrosses(line1, line2);
* //=true
*/
function booleanCrosses(feature1, feature2) {
var geom1 = getGeom(feature1);
var geom2 = getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
switch (type1) {
case "MultiPoint":
switch (type2) {
case "LineString":
return doMultiPointAndLineStringCross(geom1, geom2);
case "Polygon":
return doesMultiPointCrossPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "MultiPoint": // An inverse operation
return doMultiPointAndLineStringCross(geom2, geom1);
case "LineString":
return doLineStringsCross(geom1, geom2);
case "Polygon":
return doLineStringAndPolygonCross(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "MultiPoint": // An inverse operation
return doesMultiPointCrossPoly(geom2, geom1);
case "LineString": // An inverse operation
return doLineStringAndPolygonCross(geom2, geom1);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
function doMultiPointAndLineStringCross(multiPoint, lineString) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
var i = 0;
while (i < pointLength && !foundIntPoint && !foundExtPoint) {
for (var i2 = 0; i2 < lineString.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString.coordinates[i2], lineString.coordinates[i2 + 1], multiPoint.coordinates[i], incEndVertices)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
i++;
}
return foundIntPoint && foundExtPoint;
}
function doLineStringsCross(lineString1, lineString2) {
var doLinesIntersect = lineIntersect(lineString1, lineString2);
if (doLinesIntersect.features.length > 0) {
for (var i = 0; i < lineString1.coordinates.length - 1; i++) {
for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString2.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString1.coordinates[i], lineString1.coordinates[i + 1], lineString2.coordinates[i2], incEndVertices)) {
return true;
}
}
}
}
return false;
}
function doLineStringAndPolygonCross(lineString, polygon) {
var line = polygonToLine(polygon);
var doLinesIntersect = lineIntersect(lineString, line);
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function doesMultiPointCrossPoly(multiPoint, polygon) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
for (var i = 0; i < pointLength && (!foundIntPoint || !foundExtPoint); i++) {
if (booleanPointInPolygon(point(multiPoint.coordinates[i]), polygon)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
return foundExtPoint && foundIntPoint;
}
/**
* Is a point on a line segment
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {number[]} lineSegmentStart coord pair of start of line
* @param {number[]} lineSegmentEnd coord pair of end of line
* @param {number[]} pt coord pair of point to check
* @param {boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt, incEnd) {
var dxc = pt[0] - lineSegmentStart[0];
var dyc = pt[1] - lineSegmentStart[1];
var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0) {
return false;
}
if (incEnd) {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0]
: lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1]
: lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];
}
else {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] < pt[0] && pt[0] < lineSegmentEnd[0]
: lineSegmentEnd[0] < pt[0] && pt[0] < lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] < pt[1] && pt[1] < lineSegmentEnd[1]
: lineSegmentEnd[1] < pt[1] && pt[1] < lineSegmentStart[1];
}
}
export default booleanCrosses;

View File

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

View File

@@ -0,0 +1,21 @@
import { Feature, Geometry } from "@turf/helpers";
/**
* Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
* the maximum dimension of the two source geometries and the intersection set is interior to
* both source geometries.
*
* Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
*
* @name booleanCrosses
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line1 = turf.lineString([[-2, 2], [4, 2]]);
* var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* var cross = turf.booleanCrosses(line1, line2);
* //=true
*/
declare function booleanCrosses(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
export default booleanCrosses;

171
frontend/node_modules/@turf/boolean-crosses/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,171 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var line_intersect_1 = __importDefault(require("@turf/line-intersect"));
var polygon_to_line_1 = require("@turf/polygon-to-line");
var boolean_point_in_polygon_1 = __importDefault(require("@turf/boolean-point-in-polygon"));
var invariant_1 = require("@turf/invariant");
var helpers_1 = require("@turf/helpers");
/**
* Boolean-Crosses returns True if the intersection results in a geometry whose dimension is one less than
* the maximum dimension of the two source geometries and the intersection set is interior to
* both source geometries.
*
* Boolean-Crosses returns t (TRUE) for only multipoint/polygon, multipoint/linestring, linestring/linestring, linestring/polygon, and linestring/multipolygon comparisons.
*
* @name booleanCrosses
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var line1 = turf.lineString([[-2, 2], [4, 2]]);
* var line2 = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* var cross = turf.booleanCrosses(line1, line2);
* //=true
*/
function booleanCrosses(feature1, feature2) {
var geom1 = invariant_1.getGeom(feature1);
var geom2 = invariant_1.getGeom(feature2);
var type1 = geom1.type;
var type2 = geom2.type;
switch (type1) {
case "MultiPoint":
switch (type2) {
case "LineString":
return doMultiPointAndLineStringCross(geom1, geom2);
case "Polygon":
return doesMultiPointCrossPoly(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "LineString":
switch (type2) {
case "MultiPoint": // An inverse operation
return doMultiPointAndLineStringCross(geom2, geom1);
case "LineString":
return doLineStringsCross(geom1, geom2);
case "Polygon":
return doLineStringAndPolygonCross(geom1, geom2);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
case "Polygon":
switch (type2) {
case "MultiPoint": // An inverse operation
return doesMultiPointCrossPoly(geom2, geom1);
case "LineString": // An inverse operation
return doLineStringAndPolygonCross(geom2, geom1);
default:
throw new Error("feature2 " + type2 + " geometry not supported");
}
default:
throw new Error("feature1 " + type1 + " geometry not supported");
}
}
function doMultiPointAndLineStringCross(multiPoint, lineString) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
var i = 0;
while (i < pointLength && !foundIntPoint && !foundExtPoint) {
for (var i2 = 0; i2 < lineString.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString.coordinates[i2], lineString.coordinates[i2 + 1], multiPoint.coordinates[i], incEndVertices)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
i++;
}
return foundIntPoint && foundExtPoint;
}
function doLineStringsCross(lineString1, lineString2) {
var doLinesIntersect = line_intersect_1.default(lineString1, lineString2);
if (doLinesIntersect.features.length > 0) {
for (var i = 0; i < lineString1.coordinates.length - 1; i++) {
for (var i2 = 0; i2 < lineString2.coordinates.length - 1; i2++) {
var incEndVertices = true;
if (i2 === 0 || i2 === lineString2.coordinates.length - 2) {
incEndVertices = false;
}
if (isPointOnLineSegment(lineString1.coordinates[i], lineString1.coordinates[i + 1], lineString2.coordinates[i2], incEndVertices)) {
return true;
}
}
}
}
return false;
}
function doLineStringAndPolygonCross(lineString, polygon) {
var line = polygon_to_line_1.polygonToLine(polygon);
var doLinesIntersect = line_intersect_1.default(lineString, line);
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function doesMultiPointCrossPoly(multiPoint, polygon) {
var foundIntPoint = false;
var foundExtPoint = false;
var pointLength = multiPoint.coordinates.length;
for (var i = 0; i < pointLength && (!foundIntPoint || !foundExtPoint); i++) {
if (boolean_point_in_polygon_1.default(helpers_1.point(multiPoint.coordinates[i]), polygon)) {
foundIntPoint = true;
}
else {
foundExtPoint = true;
}
}
return foundExtPoint && foundIntPoint;
}
/**
* Is a point on a line segment
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {number[]} lineSegmentStart coord pair of start of line
* @param {number[]} lineSegmentEnd coord pair of end of line
* @param {number[]} pt coord pair of point to check
* @param {boolean} incEnd whether the point is allowed to fall on the line ends
* @returns {boolean} true/false
*/
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt, incEnd) {
var dxc = pt[0] - lineSegmentStart[0];
var dyc = pt[1] - lineSegmentStart[1];
var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0) {
return false;
}
if (incEnd) {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0]
: lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1]
: lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];
}
else {
if (Math.abs(dxl) >= Math.abs(dyl)) {
return dxl > 0
? lineSegmentStart[0] < pt[0] && pt[0] < lineSegmentEnd[0]
: lineSegmentEnd[0] < pt[0] && pt[0] < lineSegmentStart[0];
}
return dyl > 0
? lineSegmentStart[1] < pt[1] && pt[1] < lineSegmentEnd[1]
: lineSegmentEnd[1] < pt[1] && pt[1] < lineSegmentStart[1];
}
}
exports.default = booleanCrosses;

View File

@@ -0,0 +1,72 @@
{
"name": "@turf/boolean-crosses",
"version": "6.5.0",
"description": "turf boolean-crosses 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",
"equal",
"boolean",
"de-9im"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"boolean-shapely": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/boolean-point-in-polygon": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"@turf/line-intersect": "^6.5.0",
"@turf/polygon-to-line": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/boolean-disjoint/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.

60
frontend/node_modules/@turf/boolean-disjoint/README.md generated vendored Normal file
View File

@@ -0,0 +1,60 @@
# @turf/boolean-disjoint
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanDisjoint
Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.
**Parameters**
- `feature1` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
- `feature2` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
**Examples**
```javascript
var point = turf.point([2, 2]);
var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
turf.booleanDisjoint(line, point);
//=true
```
Returns **[boolean][3]** true/false
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- 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/boolean-disjoint
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![esri-disjoint](diagrams/esri-disjoint.gif)

168
frontend/node_modules/@turf/boolean-disjoint/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,168 @@
import booleanPointInPolygon from "@turf/boolean-point-in-polygon";
import lineIntersect from "@turf/line-intersect";
import { flattenEach } from "@turf/meta";
import polygonToLine from "@turf/polygon-to-line";
/**
* Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.
*
* @name booleanDisjoint
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var point = turf.point([2, 2]);
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* turf.booleanDisjoint(line, point);
* //=true
*/
function booleanDisjoint(feature1, feature2) {
var bool = true;
flattenEach(feature1, function (flatten1) {
flattenEach(feature2, function (flatten2) {
if (bool === false) {
return false;
}
bool = disjoint(flatten1.geometry, flatten2.geometry);
});
});
return bool;
}
/**
* Disjoint operation for simple Geometries (Point/LineString/Polygon)
*
* @private
* @param {Geometry<any>} geom1 GeoJSON Geometry
* @param {Geometry<any>} geom2 GeoJSON Geometry
* @returns {boolean} true/false
*/
function disjoint(geom1, geom2) {
switch (geom1.type) {
case "Point":
switch (geom2.type) {
case "Point":
return !compareCoords(geom1.coordinates, geom2.coordinates);
case "LineString":
return !isPointOnLine(geom2, geom1);
case "Polygon":
return !booleanPointInPolygon(geom1, geom2);
}
/* istanbul ignore next */
break;
case "LineString":
switch (geom2.type) {
case "Point":
return !isPointOnLine(geom1, geom2);
case "LineString":
return !isLineOnLine(geom1, geom2);
case "Polygon":
return !isLineInPoly(geom2, geom1);
}
/* istanbul ignore next */
break;
case "Polygon":
switch (geom2.type) {
case "Point":
return !booleanPointInPolygon(geom2, geom1);
case "LineString":
return !isLineInPoly(geom1, geom2);
case "Polygon":
return !isPolyInPoly(geom2, geom1);
}
}
return false;
}
// http://stackoverflow.com/a/11908158/1979085
function isPointOnLine(lineString, pt) {
for (var i = 0; i < lineString.coordinates.length - 1; i++) {
if (isPointOnLineSegment(lineString.coordinates[i], lineString.coordinates[i + 1], pt.coordinates)) {
return true;
}
}
return false;
}
function isLineOnLine(lineString1, lineString2) {
var doLinesIntersect = lineIntersect(lineString1, lineString2);
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function isLineInPoly(polygon, lineString) {
for (var _i = 0, _a = lineString.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (booleanPointInPolygon(coord, polygon)) {
return true;
}
}
var doLinesIntersect = lineIntersect(lineString, polygonToLine(polygon));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
/**
* Is Polygon (geom1) in Polygon (geom2)
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1, feature2) {
for (var _i = 0, _a = feature1.coordinates[0]; _i < _a.length; _i++) {
var coord1 = _a[_i];
if (booleanPointInPolygon(coord1, feature2)) {
return true;
}
}
for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {
var coord2 = _c[_b];
if (booleanPointInPolygon(coord2, feature1)) {
return true;
}
}
var doLinesIntersect = lineIntersect(polygonToLine(feature1), polygonToLine(feature2));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt) {
var dxc = pt[0] - lineSegmentStart[0];
var dyc = pt[1] - lineSegmentStart[1];
var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0) {
return false;
}
if (Math.abs(dxl) >= Math.abs(dyl)) {
if (dxl > 0) {
return lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0];
}
else {
return lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];
}
}
else if (dyl > 0) {
return lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1];
}
else {
return lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];
}
}
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
function compareCoords(pair1, pair2) {
return pair1[0] === pair2[0] && pair1[1] === pair2[1];
}
export default booleanDisjoint;

View File

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

View File

@@ -0,0 +1,17 @@
import { Feature, Geometry } from "@turf/helpers";
/**
* Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.
*
* @name booleanDisjoint
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var point = turf.point([2, 2]);
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* turf.booleanDisjoint(line, point);
* //=true
*/
declare function booleanDisjoint(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
export default booleanDisjoint;

173
frontend/node_modules/@turf/boolean-disjoint/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,173 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var boolean_point_in_polygon_1 = __importDefault(require("@turf/boolean-point-in-polygon"));
var line_intersect_1 = __importDefault(require("@turf/line-intersect"));
var meta_1 = require("@turf/meta");
var polygon_to_line_1 = __importDefault(require("@turf/polygon-to-line"));
/**
* Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an empty set.
*
* @name booleanDisjoint
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var point = turf.point([2, 2]);
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* turf.booleanDisjoint(line, point);
* //=true
*/
function booleanDisjoint(feature1, feature2) {
var bool = true;
meta_1.flattenEach(feature1, function (flatten1) {
meta_1.flattenEach(feature2, function (flatten2) {
if (bool === false) {
return false;
}
bool = disjoint(flatten1.geometry, flatten2.geometry);
});
});
return bool;
}
/**
* Disjoint operation for simple Geometries (Point/LineString/Polygon)
*
* @private
* @param {Geometry<any>} geom1 GeoJSON Geometry
* @param {Geometry<any>} geom2 GeoJSON Geometry
* @returns {boolean} true/false
*/
function disjoint(geom1, geom2) {
switch (geom1.type) {
case "Point":
switch (geom2.type) {
case "Point":
return !compareCoords(geom1.coordinates, geom2.coordinates);
case "LineString":
return !isPointOnLine(geom2, geom1);
case "Polygon":
return !boolean_point_in_polygon_1.default(geom1, geom2);
}
/* istanbul ignore next */
break;
case "LineString":
switch (geom2.type) {
case "Point":
return !isPointOnLine(geom1, geom2);
case "LineString":
return !isLineOnLine(geom1, geom2);
case "Polygon":
return !isLineInPoly(geom2, geom1);
}
/* istanbul ignore next */
break;
case "Polygon":
switch (geom2.type) {
case "Point":
return !boolean_point_in_polygon_1.default(geom2, geom1);
case "LineString":
return !isLineInPoly(geom1, geom2);
case "Polygon":
return !isPolyInPoly(geom2, geom1);
}
}
return false;
}
// http://stackoverflow.com/a/11908158/1979085
function isPointOnLine(lineString, pt) {
for (var i = 0; i < lineString.coordinates.length - 1; i++) {
if (isPointOnLineSegment(lineString.coordinates[i], lineString.coordinates[i + 1], pt.coordinates)) {
return true;
}
}
return false;
}
function isLineOnLine(lineString1, lineString2) {
var doLinesIntersect = line_intersect_1.default(lineString1, lineString2);
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function isLineInPoly(polygon, lineString) {
for (var _i = 0, _a = lineString.coordinates; _i < _a.length; _i++) {
var coord = _a[_i];
if (boolean_point_in_polygon_1.default(coord, polygon)) {
return true;
}
}
var doLinesIntersect = line_intersect_1.default(lineString, polygon_to_line_1.default(polygon));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
/**
* Is Polygon (geom1) in Polygon (geom2)
* Only takes into account outer rings
* See http://stackoverflow.com/a/4833823/1979085
*
* @private
* @param {Geometry|Feature<Polygon>} feature1 Polygon1
* @param {Geometry|Feature<Polygon>} feature2 Polygon2
* @returns {boolean} true/false
*/
function isPolyInPoly(feature1, feature2) {
for (var _i = 0, _a = feature1.coordinates[0]; _i < _a.length; _i++) {
var coord1 = _a[_i];
if (boolean_point_in_polygon_1.default(coord1, feature2)) {
return true;
}
}
for (var _b = 0, _c = feature2.coordinates[0]; _b < _c.length; _b++) {
var coord2 = _c[_b];
if (boolean_point_in_polygon_1.default(coord2, feature1)) {
return true;
}
}
var doLinesIntersect = line_intersect_1.default(polygon_to_line_1.default(feature1), polygon_to_line_1.default(feature2));
if (doLinesIntersect.features.length > 0) {
return true;
}
return false;
}
function isPointOnLineSegment(lineSegmentStart, lineSegmentEnd, pt) {
var dxc = pt[0] - lineSegmentStart[0];
var dyc = pt[1] - lineSegmentStart[1];
var dxl = lineSegmentEnd[0] - lineSegmentStart[0];
var dyl = lineSegmentEnd[1] - lineSegmentStart[1];
var cross = dxc * dyl - dyc * dxl;
if (cross !== 0) {
return false;
}
if (Math.abs(dxl) >= Math.abs(dyl)) {
if (dxl > 0) {
return lineSegmentStart[0] <= pt[0] && pt[0] <= lineSegmentEnd[0];
}
else {
return lineSegmentEnd[0] <= pt[0] && pt[0] <= lineSegmentStart[0];
}
}
else if (dyl > 0) {
return lineSegmentStart[1] <= pt[1] && pt[1] <= lineSegmentEnd[1];
}
else {
return lineSegmentEnd[1] <= pt[1] && pt[1] <= lineSegmentStart[1];
}
}
/**
* compareCoords
*
* @private
* @param {Position} pair1 point [x,y]
* @param {Position} pair2 point [x,y]
* @returns {boolean} true/false if coord pairs match
*/
function compareCoords(pair1, pair2) {
return pair1[0] === pair2[0] && pair1[1] === pair2[1];
}
exports.default = booleanDisjoint;

View File

@@ -0,0 +1,71 @@
{
"name": "@turf/boolean-disjoint",
"version": "6.5.0",
"description": "turf boolean-disjoint 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",
"disjoint",
"boolean",
"de-9im"
],
"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": {
"@types/tape": "*",
"benchmark": "*",
"boolean-shapely": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/boolean-point-in-polygon": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/line-intersect": "^6.5.0",
"@turf/meta": "^6.5.0",
"@turf/polygon-to-line": "^6.5.0"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/boolean-equal/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.

66
frontend/node_modules/@turf/boolean-equal/README.md generated vendored Normal file
View File

@@ -0,0 +1,66 @@
# @turf/boolean-equal
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanEqual
Determine whether two geometries of the same type have identical X,Y coordinate values.
See [https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/spatial-relationships.htm][1]
**Parameters**
- `feature1` **([Geometry][2] \| [Feature][3])** GeoJSON input
- `feature2` **([Geometry][2] \| [Feature][3])** GeoJSON input
**Examples**
```javascript
var pt1 = turf.point([0, 0]);
var pt2 = turf.point([0, 0]);
var pt3 = turf.point([1, 1]);
turf.booleanEqual(pt1, pt2);
//= true
turf.booleanEqual(pt2, pt3);
//= false
```
Returns **[boolean][4]** true if the objects are equal, false otherwise
[1]: https://desktop.arcgis.com/en/arcmap/latest/manage-data/using-sql-with-gdbs/spatial-relationships.htm
[2]: https://tools.ietf.org/html/rfc7946#section-3.1
[3]: https://tools.ietf.org/html/rfc7946#section-3.2
[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- 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/boolean-equal
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```
### Diagrams
![esri-equals](diagrams/esri-equals.gif)

30
frontend/node_modules/@turf/boolean-equal/dist/es/index.js generated vendored Executable file
View File

@@ -0,0 +1,30 @@
import GeojsonEquality from "geojson-equality";
import cleanCoords from "@turf/clean-coords";
import { getGeom } from "@turf/invariant";
/**
* Determine whether two geometries of the same type have identical X,Y coordinate values.
* See http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm
*
* @name booleanEqual
* @param {Geometry|Feature} feature1 GeoJSON input
* @param {Geometry|Feature} feature2 GeoJSON input
* @returns {boolean} true if the objects are equal, false otherwise
* @example
* var pt1 = turf.point([0, 0]);
* var pt2 = turf.point([0, 0]);
* var pt3 = turf.point([1, 1]);
*
* turf.booleanEqual(pt1, pt2);
* //= true
* turf.booleanEqual(pt2, pt3);
* //= false
*/
function booleanEqual(feature1, feature2) {
var type1 = getGeom(feature1).type;
var type2 = getGeom(feature2).type;
if (type1 !== type2)
return false;
var equality = new GeojsonEquality({ precision: 6 });
return equality.compare(cleanCoords(feature1), cleanCoords(feature2));
}
export default booleanEqual;

View File

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

21
frontend/node_modules/@turf/boolean-equal/dist/js/index.d.ts generated vendored Executable file
View File

@@ -0,0 +1,21 @@
import { Feature, Geometry } from "@turf/helpers";
/**
* Determine whether two geometries of the same type have identical X,Y coordinate values.
* See http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm
*
* @name booleanEqual
* @param {Geometry|Feature} feature1 GeoJSON input
* @param {Geometry|Feature} feature2 GeoJSON input
* @returns {boolean} true if the objects are equal, false otherwise
* @example
* var pt1 = turf.point([0, 0]);
* var pt2 = turf.point([0, 0]);
* var pt3 = turf.point([1, 1]);
*
* turf.booleanEqual(pt1, pt2);
* //= true
* turf.booleanEqual(pt2, pt3);
* //= false
*/
declare function booleanEqual(feature1: Feature<any> | Geometry, feature2: Feature<any> | Geometry): boolean;
export default booleanEqual;

35
frontend/node_modules/@turf/boolean-equal/dist/js/index.js generated vendored Executable file
View File

@@ -0,0 +1,35 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var geojson_equality_1 = __importDefault(require("geojson-equality"));
var clean_coords_1 = __importDefault(require("@turf/clean-coords"));
var invariant_1 = require("@turf/invariant");
/**
* Determine whether two geometries of the same type have identical X,Y coordinate values.
* See http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm
*
* @name booleanEqual
* @param {Geometry|Feature} feature1 GeoJSON input
* @param {Geometry|Feature} feature2 GeoJSON input
* @returns {boolean} true if the objects are equal, false otherwise
* @example
* var pt1 = turf.point([0, 0]);
* var pt2 = turf.point([0, 0]);
* var pt3 = turf.point([1, 1]);
*
* turf.booleanEqual(pt1, pt2);
* //= true
* turf.booleanEqual(pt2, pt3);
* //= false
*/
function booleanEqual(feature1, feature2) {
var type1 = invariant_1.getGeom(feature1).type;
var type2 = invariant_1.getGeom(feature2).type;
if (type1 !== type2)
return false;
var equality = new geojson_equality_1.default({ precision: 6 });
return equality.compare(clean_coords_1.default(feature1), clean_coords_1.default(feature2));
}
exports.default = booleanEqual;

75
frontend/node_modules/@turf/boolean-equal/package.json generated vendored Normal file
View File

@@ -0,0 +1,75 @@
{
"name": "@turf/boolean-equal",
"version": "6.5.0",
"description": "turf boolean-equal module",
"author": "Turf Authors",
"contributors": [
"Tom MacWright <@tmcw>",
"Tim Channell <@tcql>",
"Stefano Borghi <@stebogit>"
],
"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",
"boolean",
"de-9im",
"equal",
"boolean-equal"
],
"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": {
"@types/geojson-equality": "^0.2.0",
"@types/tape": "*",
"benchmark": "*",
"boolean-shapely": "*",
"glob": "*",
"load-json-file": "*",
"npm-run-all": "*",
"tape": "*",
"ts-node": "*",
"tslint": "*",
"typescript": "*"
},
"dependencies": {
"@turf/clean-coords": "^6.5.0",
"@turf/helpers": "^6.5.0",
"@turf/invariant": "^6.5.0",
"geojson-equality": "0.1.6"
},
"gitHead": "5375941072b90d489389db22b43bfe809d5e451e"
}

20
frontend/node_modules/@turf/boolean-intersects/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,55 @@
# @turf/boolean-intersects
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->
## booleanIntersects
Boolean-intersects returns (TRUE) two geometries intersect.
**Parameters**
- `feature1` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
- `feature2` **([Geometry][1] \| [Feature][2]&lt;any>)** GeoJSON Feature or Geometry
**Examples**
```javascript
var point = turf.point([2, 2]);
var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
turf.booleanIntersects(line, point);
//=true
```
Returns **[boolean][3]** true/false
[1]: https://tools.ietf.org/html/rfc7946#section-3.1
[2]: https://tools.ietf.org/html/rfc7946#section-3.2
[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean
<!-- 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/boolean-intersects
```
Or install the Turf module that includes it as a function:
```sh
$ npm install @turf/turf
```

View File

@@ -0,0 +1,28 @@
import booleanDisjoint from "@turf/boolean-disjoint";
import { flattenEach } from "@turf/meta";
/**
* Boolean-intersects returns (TRUE) two geometries intersect.
*
* @name booleanIntersects
* @param {Geometry|Feature<any>} feature1 GeoJSON Feature or Geometry
* @param {Geometry|Feature<any>} feature2 GeoJSON Feature or Geometry
* @returns {boolean} true/false
* @example
* var point = turf.point([2, 2]);
* var line = turf.lineString([[1, 1], [1, 2], [1, 3], [1, 4]]);
*
* turf.booleanIntersects(line, point);
* //=true
*/
export default function booleanIntersects(feature1, feature2) {
var bool = false;
flattenEach(feature1, function (flatten1) {
flattenEach(feature2, function (flatten2) {
if (bool === true) {
return true;
}
bool = !booleanDisjoint(flatten1.geometry, flatten2.geometry);
});
});
return bool;
}

Some files were not shown because too many files have changed in this diff Show More