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

11
frontend/node_modules/polygon-clipping/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,11 @@
The MIT License (MIT)
Copyright (c) 2018 Mike Fogel <mike@fogel.ca> - covers everything not specially attributed to others below.
Copyright (c) 2016 Alexander Milevski <info@w8r.name> - covers all portions originally part of github:w8r/martinez, from which this project was forked on Febuary 2, 2018.
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.

102
frontend/node_modules/polygon-clipping/README.md generated vendored Normal file
View File

@@ -0,0 +1,102 @@
# polygon-clipping
Apply boolean Polygon clipping operations (`intersection`, `union`, `difference`, `xor`) to your Polygons & MultiPolygons.
[![CI](https://github.com/mfogel/polygon-clipping/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/mfogel/polygon-clipping/actions) [![codecov](https://codecov.io/gh/mfogel/polygon-clipping/branch/main/graph/badge.svg?token=is93inDQiJ)](https://codecov.io/gh/mfogel/polygon-clipping) [![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT) [![npm](https://img.shields.io/npm/v/polygon-clipping.svg)](https://www.npmjs.com/package/polygon-clipping)
## Quickstart
<!-- prettier-ignore-start -->
```javascript
const polygonClipping = require('polygon-clipping')
const poly1 = [[[0,0],[2,0],[0,2],[0,0]]]
const poly2 = [[[-1,0],[1,0],[0,1],[-1,0]]]
polygonClipping.union (poly1, poly2 /* , poly3, ... */)
polygonClipping.intersection(poly1, poly2 /* , poly3, ... */)
polygonClipping.xor (poly1, poly2 /* , poly3, ... */)
polygonClipping.difference (poly1, poly2 /* , poly3, ... */)
```
<!-- prettier-ignore-end -->
## API
```javascript
/* All functions take one or more [multi]polygon(s) as input */
polygonClipping.union (<geom>, ...<geoms>)
polygonClipping.intersection(<geom>, ...<geoms>)
polygonClipping.xor (<geom>, ...<geoms>)
/* The clipGeoms will be subtracted from the subjectGeom */
polygonClipping.difference(<subjectGeom>, ...<clipGeoms>)
```
### Input
Each positional argument (`<geom>`) may be either a Polygon or a MultiPolygon. The [GeoJSON spec](https://tools.ietf.org/html/rfc7946#section-3.1) is followed, with the following notes/modifications:
- MultiPolygons may contain touching or overlapping Polygons.
- rings are not required to be self-closing.
- rings may contain repeated points, which are ignored.
- rings may be self-touching and/or self-crossing. Self-crossing rings will be interpreted using the [non-zero rule](https://en.wikipedia.org/wiki/Nonzero-rule).
- winding order of rings does not matter.
- inner rings may extend outside their outer ring. The portion of inner rings outside their outer ring is dropped.
- inner rings may touch or overlap each other.
### Output
For non-empty results, output will always be a MultiPolygon containing one or more non-overlapping, non-edge-sharing Polygons. The [GeoJSON spec](https://tools.ietf.org/html/rfc7946#section-3.1) is followed, with the following notes/modifications:
- outer rings will be wound counter-clockwise, and inner rings clockwise.
- inner rings will not extend outside their outer ring.
- rings will not overlap, nor share an edge with each other.
- rings will be self-closing.
- rings will not contain repeated points.
- rings will not contain superfluous points (intermediate points along a straight line).
- rings will not be self-touching nor self-crossing.
- rings _may_ touch each other, but _may not_ cross each other.
In the event that the result of the operation is the empty set, output will be a MultiPolygon with no Polygons: `[]`.
## Correctness
Run: `npm test`
The tests are broken up into unit tests and end-to-end tests. The end-to-end tests are organized as GeoJSON files, to make them easy to visualize thanks to [GitHub's helpful rendering of GeoJSON files](https://help.github.com/articles/mapping-geojson-files-on-github/). Browse those tests [here](test/end-to-end).
## Performance
The Martinez-Rueda-Feito polygon clipping algorithm is used to compute the result in `O((n+k)*log(n))` time, where `n` is the total number of edges in all polygons involved and `k` is the number of intersections between edges.
## Settings
Global settings are set via environment variables.
- **POLYGON_CLIPPING_MAX_QUEUE_SIZE** and **POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS**: Aims to prevent infinite loops - usually caused by floating-point math round-off errors. Defaults are 1,000,000.
## Changelog
This project adheres to [Semantic Versioning](https://semver.org/).
<!-- prettier-ignore-end -->
The full changelog is available at [CHANGELOG.md](https://github.com/mfogel/polygon-clipping/blob/master/CHANGELOG.md).
## Authors
- [Mike Fogel](https://github.com/mfogel)
- [Alexander Milevski](https://github.com/w8r)
- [Vladimir Ovsyannikov](https://github.com/sh1ng)
## Sponsors
- [Alantgeo](https://www.alantgeo.com.au/)
- [EasyTerritory](https://www.easyterritory.com/)
Please contact [Mike Fogel](https://github.com/mfogel) if you or your company is interested in sponsoring work on specific bug fixes or feature requests.
## Based on
- [A new algorithm for computing Boolean operations on polygons](paper.pdf) by Francisco Martinez, Antonio Jesus Rueda, Francisco Ramon Feito (2009)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,14 @@
declare module "polygon-clipping" {
export type Pair = [number, number]
export type Ring = Pair[]
export type Polygon = Ring[]
export type MultiPolygon = Polygon[]
type Geom = Polygon | MultiPolygon
export function intersection(geom: Geom, ...geoms: Geom[]): MultiPolygon
export function xor(geom: Geom, ...geoms: Geom[]): MultiPolygon
export function union(geom: Geom, ...geoms: Geom[]): MultiPolygon
export function difference(
subjectGeom: Geom,
...clipGeoms: Geom[]
): MultiPolygon
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

79
frontend/node_modules/polygon-clipping/package.json generated vendored Normal file
View File

@@ -0,0 +1,79 @@
{
"name": "polygon-clipping",
"version": "0.15.7",
"description": "Apply boolean Polygon clipping operations (intersection, union, difference, xor) to your Polygons & MultiPolygons.",
"main": "dist/polygon-clipping.cjs.js",
"module": "dist/polygon-clipping.esm.js",
"browser": "dist/polygon-clipping.umd.js",
"types": "dist/polygon-clipping.d.ts",
"scripts": {
"build": "rollup -c && cp src/polygon-clipping.d.ts dist/polygon-clipping.d.ts",
"docs:dev": "vite docs",
"docs:build": "vite build docs",
"docs:eslint": "cd docs && eslint --ext .js --ext .vue *config.js src/",
"lint": "npm-run-all -s lint:eslint docs:eslint lint:prettier",
"lint:eslint": "eslint .eslintrc.cjs *.config.js bench/ src/ test/",
"lint:prettier": "prettier --check ./* ./.eslintrc.cjs ./.github",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",
"bench": "cd bench && npm install && node bench.js",
"prepublishOnly": "npm-run-all --serial lint test build docs:build bench"
},
"files": [
"dist"
],
"browserslist": [
"> 0.25% or not dead"
],
"jest": {
"collectCoverage": true,
"testEnvironment": "node"
},
"keywords": [
"polygon",
"clipping",
"boolean",
"intersection",
"union",
"difference",
"xor",
"geometry",
"martinez"
],
"repository": "github:mfogel/polygon-clipping",
"author": "Mike Fogel <mike@fogel.ca>",
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.6",
"@babel/preset-env": "^7.23.6",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^21.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^13.3.0",
"@turf/difference": "^5.1.5",
"@turf/intersect": "^5.1.6",
"@turf/meta": "^6.5.0",
"@turf/union": "^5.1.5",
"@vitejs/plugin-vue": "^3.2.0",
"babel-jest": "^27.5.1",
"benchmark": "^2.1.4",
"eslint": "^8.56.0",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-vue": "^8.7.1",
"jest": "^27.5.1",
"leaflet": "^1.9.4",
"load-json-file": "^6.2.0",
"martinez-polygon-clipping": "^0.7.3",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"rollup": "^2.79.1",
"rollup-plugin-terser": "^7.0.2",
"vite": "^3.2.7",
"vue": "^3.3.12"
},
"dependencies": {
"robust-predicates": "^3.0.2",
"splaytree": "^3.1.0"
}
}