New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

three-geojson-geometry

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

three-geojson-geometry - npm Package Compare versions

Comparing version 1.1.7 to 1.1.8

29

dist/three-geojson-geometry.common.js

@@ -19,2 +19,21 @@ 'use strict';

function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {

@@ -32,2 +51,5 @@ if (typeof superClass !== "function" && superClass !== null) {

});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);

@@ -37,3 +59,3 @@ }

function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);

@@ -45,7 +67,6 @@ };

function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);

@@ -444,3 +465,3 @@ }

return GeoJsonGeometry;
return _createClass(GeoJsonGeometry);
}(THREE.BufferGeometry); //

@@ -447,0 +468,0 @@

138

dist/three-geojson-geometry.js

@@ -1,2 +0,2 @@

// Version 1.1.7 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
// Version 1.1.8 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
(function (global, factory) {

@@ -14,2 +14,21 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('three')) :

function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {

@@ -27,2 +46,5 @@ if (typeof superClass !== "function" && superClass !== null) {

});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);

@@ -32,3 +54,3 @@ }

function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);

@@ -40,7 +62,6 @@ };

function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);

@@ -215,6 +236,6 @@ }

var earcut$2 = {exports: {}};
var earcut$1 = {exports: {}};
earcut$2.exports = earcut;
earcut$2.exports.default = earcut;
earcut$1.exports = earcut;
earcut$1.exports.default = earcut;

@@ -252,6 +273,6 @@ function earcut(data, holeIndices, dim) {

invSize = Math.max(maxX - minX, maxY - minY);
invSize = invSize !== 0 ? 1 / invSize : 0;
invSize = invSize !== 0 ? 32767 / invSize : 0;
}
earcutLinked(outerNode, triangles, dim, minX, minY, invSize);
earcutLinked(outerNode, triangles, dim, minX, minY, invSize, 0);

@@ -320,5 +341,5 @@ return triangles;

// cut off the triangle
triangles.push(prev.i / dim);
triangles.push(ear.i / dim);
triangles.push(next.i / dim);
triangles.push(prev.i / dim | 0);
triangles.push(ear.i / dim | 0);
triangles.push(next.i / dim | 0);

@@ -366,6 +387,14 @@ removeNode(ear);

// now make sure we don't have other points inside the potential ear
var p = ear.next.next;
var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
while (p !== ear.prev) {
if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
// triangle bbox; min & max are calculated like this for speed
var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
var p = c.next;
while (p !== a) {
if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 &&
pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) &&
area(p.prev, p, p.next) >= 0) return false;

@@ -385,11 +414,13 @@ p = p.next;

var ax = a.x, bx = b.x, cx = c.x, ay = a.y, by = b.y, cy = c.y;
// triangle bbox; min & max are calculated like this for speed
var minTX = a.x < b.x ? (a.x < c.x ? a.x : c.x) : (b.x < c.x ? b.x : c.x),
minTY = a.y < b.y ? (a.y < c.y ? a.y : c.y) : (b.y < c.y ? b.y : c.y),
maxTX = a.x > b.x ? (a.x > c.x ? a.x : c.x) : (b.x > c.x ? b.x : c.x),
maxTY = a.y > b.y ? (a.y > c.y ? a.y : c.y) : (b.y > c.y ? b.y : c.y);
var x0 = ax < bx ? (ax < cx ? ax : cx) : (bx < cx ? bx : cx),
y0 = ay < by ? (ay < cy ? ay : cy) : (by < cy ? by : cy),
x1 = ax > bx ? (ax > cx ? ax : cx) : (bx > cx ? bx : cx),
y1 = ay > by ? (ay > cy ? ay : cy) : (by > cy ? by : cy);
// z-order range for the current triangle bbox;
var minZ = zOrder(minTX, minTY, minX, minY, invSize),
maxZ = zOrder(maxTX, maxTY, minX, minY, invSize);
var minZ = zOrder(x0, y0, minX, minY, invSize),
maxZ = zOrder(x1, y1, minX, minY, invSize);

@@ -401,10 +432,8 @@ var p = ear.prevZ,

while (p && p.z >= minZ && n && n.z <= maxZ) {
if (p !== ear.prev && p !== ear.next &&
pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
area(p.prev, p, p.next) >= 0) return false;
if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
p = p.prevZ;
if (n !== ear.prev && n !== ear.next &&
pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
area(n.prev, n, n.next) >= 0) return false;
if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
n = n.nextZ;

@@ -415,5 +444,4 @@ }

while (p && p.z >= minZ) {
if (p !== ear.prev && p !== ear.next &&
pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) &&
area(p.prev, p, p.next) >= 0) return false;
if (p.x >= x0 && p.x <= x1 && p.y >= y0 && p.y <= y1 && p !== a && p !== c &&
pointInTriangle(ax, ay, bx, by, cx, cy, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false;
p = p.prevZ;

@@ -424,5 +452,4 @@ }

while (n && n.z <= maxZ) {
if (n !== ear.prev && n !== ear.next &&
pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, n.x, n.y) &&
area(n.prev, n, n.next) >= 0) return false;
if (n.x >= x0 && n.x <= x1 && n.y >= y0 && n.y <= y1 && n !== a && n !== c &&
pointInTriangle(ax, ay, bx, by, cx, cy, n.x, n.y) && area(n.prev, n, n.next) >= 0) return false;
n = n.nextZ;

@@ -443,5 +470,5 @@ }

triangles.push(a.i / dim);
triangles.push(p.i / dim);
triangles.push(b.i / dim);
triangles.push(a.i / dim | 0);
triangles.push(p.i / dim | 0);
triangles.push(b.i / dim | 0);

@@ -476,4 +503,4 @@ // remove two nodes involved

// run earcut on each half
earcutLinked(a, triangles, dim, minX, minY, invSize);
earcutLinked(c, triangles, dim, minX, minY, invSize);
earcutLinked(a, triangles, dim, minX, minY, invSize, 0);
earcutLinked(c, triangles, dim, minX, minY, invSize, 0);
return;

@@ -505,3 +532,2 @@ }

outerNode = eliminateHole(queue[i], outerNode);
outerNode = filterPoints(outerNode, outerNode.next);
}

@@ -526,7 +552,4 @@

// filter collinear points around the cuts
var filteredBridge = filterPoints(bridge, bridge.next);
filterPoints(bridgeReverse, bridgeReverse.next);
// Check if input node was removed by the filtering
return outerNode === bridge ? filteredBridge : outerNode;
return filterPoints(bridge, bridge.next);
}

@@ -549,7 +572,4 @@

qx = x;
if (x === hx) {
if (hy === p.y) return p;
if (hy === p.next.y) return p.next;
}
m = p.x < p.next.x ? p : p.next;
if (x === hx) return m; // hole touches outer segment; pick leftmost endpoint
}

@@ -562,4 +582,2 @@ }

if (hx === qx) return m; // hole touches outer segment; pick leftmost endpoint
// look for points inside the triangle of hole point, segment intersection and endpoint;

@@ -605,3 +623,3 @@ // if there are no points found, we have a valid connection;

do {
if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, invSize);
if (p.z === 0) p.z = zOrder(p.x, p.y, minX, minY, invSize);
p.prevZ = p.prev;

@@ -674,4 +692,4 @@ p.nextZ = p.next;

// coords are transformed into non-negative 15-bit integer range
x = 32767 * (x - minX) * invSize;
y = 32767 * (y - minY) * invSize;
x = (x - minX) * invSize | 0;
y = (y - minY) * invSize | 0;

@@ -705,5 +723,5 @@ x = (x | (x << 8)) & 0x00FF00FF;

function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {
return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&
(ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&
(bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;
return (cx - px) * (ay - py) >= (ax - px) * (cy - py) &&
(ax - px) * (by - py) >= (bx - px) * (ay - py) &&
(bx - px) * (cy - py) >= (cx - px) * (by - py);
}

@@ -851,3 +869,3 @@

// z-order curve value
this.z = null;
this.z = 0;

@@ -918,4 +936,2 @@ // previous and next nodes in z-order

var earcut$1 = earcut$2.exports;
// https://github.com/python/cpython/blob/a74eea238f5baba15797e2e8b570d153bc8690a7/Modules/mathmodule.c#L1423

@@ -1265,3 +1281,3 @@ class Adder {

var _earcut$flatten = earcut$1.flatten([coords3d]),
var _earcut$flatten = earcut$1.exports.flatten([coords3d]),
vertices = _earcut$flatten.vertices;

@@ -1309,3 +1325,3 @@

var _earcut$flatten2 = earcut$1.flatten(coords3d),
var _earcut$flatten2 = earcut$1.exports.flatten(coords3d),
vertices = _earcut$flatten2.vertices,

@@ -1374,3 +1390,3 @@ holes = _earcut$flatten2.holes;

return GeoJsonGeometry;
return _createClass(GeoJsonGeometry);
}(THREE.BufferGeometry); //

@@ -1377,0 +1393,0 @@

@@ -1,2 +0,2 @@

// Version 1.1.7 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).THREE=t.THREE||{},t.THREE)}(this,(function(t,n){"use strict";function e(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function r(t){return r=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},r(t)}function i(t,n){return i=Object.setPrototypeOf||function(t,n){return t.__proto__=n,t},i(t,n)}function o(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function u(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,i=r(t);if(n){var u=r(this).constructor;e=Reflect.construct(i,arguments,u)}else e=i.apply(this,arguments);return o(this,e)}}function f(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var r,i,o=[],u=!0,f=!1;try{for(e=e.call(t);!(u=(r=e.next()).done)&&(o.push(r.value),!n||o.length!==n);u=!0);}catch(t){f=!0,i=t}finally{try{u||null==e.return||e.return()}finally{if(f)throw i}}return o}(t,n)||a(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function a(t,n){if(t){if("string"==typeof t)return c(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?c(t,n):void 0}}function c(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var l={exports:{}};function x(t,n,e){e=e||2;var r,i,o,u,f,a,c,l=n&&n.length,x=l?n[0]*e:t.length,h=s(t,0,x,e,!0),p=[];if(!h||h.next===h.prev)return p;if(l&&(h=function(t,n,e,r){var i,o,u,f=[];for(i=0,o=n.length;i<o;i++)(u=s(t,n[i]*r,i<o-1?n[i+1]*r:t.length,r,!1))===u.next&&(u.steiner=!0),f.push(E(u));for(f.sort(b),i=0;i<f.length;i++)e=v(e=m(f[i],e),e.next);return e}(t,n,h,e)),t.length>80*e){r=o=t[0],i=u=t[1];for(var d=e;d<x;d+=e)(f=t[d])<r&&(r=f),(a=t[d+1])<i&&(i=a),f>o&&(o=f),a>u&&(u=a);c=0!==(c=Math.max(o-r,u-i))?1/c:0}return y(h,p,e,r,i,c),p}function s(t,n,e,r,i){var o,u;if(i===B(t,n,e,r)>0)for(o=n;o<e;o+=r)u=G(o,t[o],t[o+1],u);else for(o=e-r;o>=n;o-=r)u=G(o,t[o],t[o+1],u);return u&&_(u,u.next)&&(I(u),u=u.next),u}function v(t,n){if(!t)return t;n||(n=t);var e,r=t;do{if(e=!1,r.steiner||!_(r,r.next)&&0!==S(r.prev,r,r.next))r=r.next;else{if(I(r),(r=n=r.prev)===r.next)break;e=!0}}while(e||r!==n);return n}function y(t,n,e,r,i,o,u){if(t){!u&&o&&function(t,n,e,r){var i=t;do{null===i.z&&(i.z=M(i.x,i.y,n,e,r)),i.prevZ=i.prev,i.nextZ=i.next,i=i.next}while(i!==t);i.prevZ.nextZ=null,i.prevZ=null,function(t){var n,e,r,i,o,u,f,a,c=1;do{for(e=t,t=null,o=null,u=0;e;){for(u++,r=e,f=0,n=0;n<c&&(f++,r=r.nextZ);n++);for(a=c;f>0||a>0&&r;)0!==f&&(0===a||!r||e.z<=r.z)?(i=e,e=e.nextZ,f--):(i=r,r=r.nextZ,a--),o?o.nextZ=i:t=i,i.prevZ=o,o=i;e=r}o.nextZ=null,c*=2}while(u>1)}(i)}(t,r,i,o);for(var f,a,c=t;t.prev!==t.next;)if(f=t.prev,a=t.next,o?p(t,r,i,o):h(t))n.push(f.i/e),n.push(t.i/e),n.push(a.i/e),I(t),t=a.next,c=a.next;else if((t=a)===c){u?1===u?y(t=d(v(t),n,e),n,e,r,i,o,2):2===u&&g(t,n,e,r,i,o):y(v(t),n,e,r,i,o,1);break}}}function h(t){var n=t.prev,e=t,r=t.next;if(S(n,e,r)>=0)return!1;for(var i=t.next.next;i!==t.prev;){if(Z(n.x,n.y,e.x,e.y,r.x,r.y,i.x,i.y)&&S(i.prev,i,i.next)>=0)return!1;i=i.next}return!0}function p(t,n,e,r){var i=t.prev,o=t,u=t.next;if(S(i,o,u)>=0)return!1;for(var f=i.x<o.x?i.x<u.x?i.x:u.x:o.x<u.x?o.x:u.x,a=i.y<o.y?i.y<u.y?i.y:u.y:o.y<u.y?o.y:u.y,c=i.x>o.x?i.x>u.x?i.x:u.x:o.x>u.x?o.x:u.x,l=i.y>o.y?i.y>u.y?i.y:u.y:o.y>u.y?o.y:u.y,x=M(f,a,n,e,r),s=M(c,l,n,e,r),v=t.prevZ,y=t.nextZ;v&&v.z>=x&&y&&y.z<=s;){if(v!==t.prev&&v!==t.next&&Z(i.x,i.y,o.x,o.y,u.x,u.y,v.x,v.y)&&S(v.prev,v,v.next)>=0)return!1;if(v=v.prevZ,y!==t.prev&&y!==t.next&&Z(i.x,i.y,o.x,o.y,u.x,u.y,y.x,y.y)&&S(y.prev,y,y.next)>=0)return!1;y=y.nextZ}for(;v&&v.z>=x;){if(v!==t.prev&&v!==t.next&&Z(i.x,i.y,o.x,o.y,u.x,u.y,v.x,v.y)&&S(v.prev,v,v.next)>=0)return!1;v=v.prevZ}for(;y&&y.z<=s;){if(y!==t.prev&&y!==t.next&&Z(i.x,i.y,o.x,o.y,u.x,u.y,y.x,y.y)&&S(y.prev,y,y.next)>=0)return!1;y=y.nextZ}return!0}function d(t,n,e){var r=t;do{var i=r.prev,o=r.next.next;!_(i,o)&&O(i,r,r.next,o)&&T(i,o)&&T(o,i)&&(n.push(i.i/e),n.push(r.i/e),n.push(o.i/e),I(r),I(r.next),r=t=o),r=r.next}while(r!==t);return v(r)}function g(t,n,e,r,i,o){var u=t;do{for(var f=u.next.next;f!==u.prev;){if(u.i!==f.i&&P(u,f)){var a=R(u,f);return u=v(u,u.next),a=v(a,a.next),y(u,n,e,r,i,o),void y(a,n,e,r,i,o)}f=f.next}u=u.next}while(u!==t)}function b(t,n){return t.x-n.x}function m(t,n){var e=function(t,n){var e,r=n,i=t.x,o=t.y,u=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var f=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(f<=i&&f>u){if(u=f,f===i){if(o===r.y)return r;if(o===r.next.y)return r.next}e=r.x<r.next.x?r:r.next}}r=r.next}while(r!==n);if(!e)return null;if(i===u)return e;var a,c=e,l=e.x,x=e.y,s=1/0;r=e;do{i>=r.x&&r.x>=l&&i!==r.x&&Z(o<x?i:u,o,l,x,o<x?u:i,o,r.x,r.y)&&(a=Math.abs(o-r.y)/(i-r.x),T(r,t)&&(a<s||a===s&&(r.x>e.x||r.x===e.x&&w(e,r)))&&(e=r,s=a)),r=r.next}while(r!==c);return e}(t,n);if(!e)return n;var r=R(e,t),i=v(e,e.next);return v(r,r.next),n===e?i:n}function w(t,n){return S(t.prev,t,n.prev)<0&&S(n.next,t,t.next)<0}function M(t,n,e,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-e)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-r)*i)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function E(t){var n=t,e=t;do{(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next}while(n!==t);return e}function Z(t,n,e,r,i,o,u,f){return(i-u)*(n-f)-(t-u)*(o-f)>=0&&(t-u)*(r-f)-(e-u)*(n-f)>=0&&(e-u)*(o-f)-(i-u)*(r-f)>=0}function P(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&O(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}(t,n)&&(T(t,n)&&T(n,t)&&function(t,n){var e=t,r=!1,i=(t.x+n.x)/2,o=(t.y+n.y)/2;do{e.y>o!=e.next.y>o&&e.next.y!==e.y&&i<(e.next.x-e.x)*(o-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next}while(e!==t);return r}(t,n)&&(S(t.prev,t,n.prev)||S(t,n.prev,n))||_(t,n)&&S(t.prev,t,t.next)>0&&S(n.prev,n,n.next)>0)}function S(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function _(t,n){return t.x===n.x&&t.y===n.y}function O(t,n,e,r){var i=j(S(t,n,e)),o=j(S(t,n,r)),u=j(S(e,r,t)),f=j(S(e,r,n));return i!==o&&u!==f||(!(0!==i||!A(t,e,n))||(!(0!==o||!A(t,r,n))||(!(0!==u||!A(e,t,r))||!(0!==f||!A(e,n,r)))))}function A(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function j(t){return t>0?1:t<0?-1:0}function T(t,n){return S(t.prev,t,t.next)<0?S(t,n,t.next)>=0&&S(t,t.prev,n)>=0:S(t,n,t.prev)<0||S(t,t.next,n)<0}function R(t,n){var e=new z(t.i,t.x,t.y),r=new z(n.i,n.x,n.y),i=t.next,o=n.prev;return t.next=n,n.prev=t,e.next=i,i.prev=e,r.next=e,e.prev=r,o.next=r,r.prev=o,r}function G(t,n,e,r){var i=new z(t,n,e);return r?(i.next=r.next,i.prev=r,r.next.prev=i,r.next=i):(i.prev=i,i.next=i),i}function I(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function z(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}function B(t,n,e,r){for(var i=0,o=n,u=e-r;o<e;o+=r)i+=(t[u]-t[o])*(t[o+1]+t[u+1]),u=o;return i}l.exports=x,l.exports.default=x,x.deviation=function(t,n,e,r){var i=n&&n.length,o=i?n[0]*e:t.length,u=Math.abs(B(t,0,o,e));if(i)for(var f=0,a=n.length;f<a;f++){var c=n[f]*e,l=f<a-1?n[f+1]*e:t.length;u-=Math.abs(B(t,c,l,e))}var x=0;for(f=0;f<r.length;f+=3){var s=r[f]*e,v=r[f+1]*e,y=r[f+2]*e;x+=Math.abs((t[s]-t[y])*(t[v+1]-t[s+1])-(t[s]-t[v])*(t[y+1]-t[s+1]))}return 0===u&&0===x?0:Math.abs((x-u)/u)},x.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},r=0,i=0;i<t.length;i++){for(var o=0;o<t[i].length;o++)for(var u=0;u<n;u++)e.vertices.push(t[i][o][u]);i>0&&(r+=t[i-1].length,e.holes.push(r))}return e};var F=l.exports;class H{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let e=0;for(let r=0;r<this._n&&r<32;r++){const i=n[r],o=t+i,u=Math.abs(t)<Math.abs(i)?t-(o-i):i-(o-t);u&&(n[e++]=u),t=o}return n[e]=t,this._n=e+1,this}valueOf(){const t=this._partials;let n,e,r,i=this._n,o=0;if(i>0){for(o=t[--i];i>0&&(n=o,e=t[--i],o=n+e,r=e-(o-n),!r););i>0&&(r<0&&t[i-1]<0||r>0&&t[i-1]>0)&&(e=2*r,n=o+e,e==n-o&&(o=n))}return o}}var L=Math.PI,C=L/2,J=180/L,k=L/180,q=Math.abs,D=Math.atan2,U=Math.cos,$=Math.sin,K=Math.sqrt;function N(t){return(t=$(t/2))*t}function Q(){}function V(t,n){t&&et.hasOwnProperty(t.type)&&et[t.type](t,n)}var W,X,Y,tt,nt={Feature:function(t,n){V(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,i=e.length;++r<i;)V(e[r].geometry,n)}},et={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){rt(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)rt(e[r],n,0)},Polygon:function(t,n){it(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,i=e.length;++r<i;)it(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,i=e.length;++r<i;)V(e[r],n)}};function rt(t,n,e){var r,i=-1,o=t.length-e;for(n.lineStart();++i<o;)r=t[i],n.point(r[0],r[1],r[2]);n.lineEnd()}function it(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)rt(t[e],n,1);n.polygonEnd()}var ot={sphere:Q,point:Q,lineStart:function(){ot.point=ft,ot.lineEnd=ut},lineEnd:Q,polygonStart:Q,polygonEnd:Q};function ut(){ot.point=ot.lineEnd=Q}function ft(t,n){X=t*=k,Y=$(n*=k),tt=U(n),ot.point=at}function at(t,n){t*=k;var e=$(n*=k),r=U(n),i=q(t-X),o=U(i),u=r*$(i),f=tt*e-Y*r*o,a=Y*e+tt*r*o;W.add(D(K(u*u+f*f),a)),X=t,Y=e,tt=r}function ct(t){return W=new H,function(t,n){t&&nt.hasOwnProperty(t.type)?nt[t.type](t,n):V(t,n)}(t,ot),+W}var lt=[null,null],xt={type:"LineString",coordinates:lt};function st(t,n){return lt[0]=t,lt[1]=n,ct(xt)}function vt(t,n){var e,r=t[0]*k,i=t[1]*k,o=n[0]*k,u=n[1]*k,f=U(i),a=$(i),c=U(u),l=$(u),x=f*U(r),s=f*$(r),v=c*U(o),y=c*$(o),h=2*((e=K(N(u-i)+f*c*N(o-r)))>1?C:e<-1?-C:Math.asin(e)),p=$(h),d=h?function(t){var n=$(t*=h)/p,e=$(h-t)/p,r=e*x+n*v,i=e*s+n*y,o=e*a+n*l;return[D(i,r)*J,D(o,K(r*r+i*i))*J]}:function(){return[r*J,i*J]};return d.distance=h,d}var yt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],r=null;return t.forEach((function(t){if(r){var i=180*st(t,r)/Math.PI;if(i>n)for(var o=vt(r,t),u=1/Math.ceil(i/n),f=u;f<1;)e.push(o(f)),f+=u}e.push(r=t)})),e},ht="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:n.BufferGeometry,Float32BufferAttribute:n.Float32BufferAttribute},pt=(new ht.BufferGeometry).setAttribute?"setAttribute":"addAttribute",dt=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),n&&i(t,n)}(r,t);var n=u(r);function r(t){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;e(this,r),(i=n.call(this)).type="GeoJsonGeometry",i.parameters={geoJson:t,radius:o,resolution:u};var a=({Point:s,MultiPoint:v,LineString:y,MultiLineString:h,Polygon:p,MultiPolygon:d}[t.type]||function(){return[]})(t.coordinates,o),c=[],l=[],x=0;function s(t,n){return[{vertices:mt(t[1],t[0],n),indices:[]}]}function v(t,n){var e={vertices:[],indices:[]};return t.map((function(t){return s(t,n)})).forEach((function(t){var n=f(t,1)[0];gt(e,n)})),[e]}function y(t,n){for(var e=yt(t,u).map((function(t){var e=f(t,2),r=e[0];return mt(e[1],r,n)})),r=F.flatten([e]).vertices,i=Math.round(r.length/3),o=[],a=1;a<i;a++)o.push(a-1,a);return[{vertices:r,indices:o}]}function h(t,n){var e={vertices:[],indices:[]};return t.map((function(t){return y(t,n)})).forEach((function(t){var n=f(t,1)[0];gt(e,n)})),[e]}function p(t,n){for(var e=t.map((function(t){return yt(t,u).map((function(t){var e=f(t,2),r=e[0];return mt(e[1],r,n)}))})),r=F.flatten(e),i=r.vertices,o=r.holes,a=o[0]||1/0,c=i.slice(0,3*a),l=i.slice(3*a),x=new Set(o),s=Math.round(i.length/3),v=[],y=[],h=1;h<s;h++)x.has(h)||(h<a?v.push(h-1,h):y.push(h-1-a,h-a));var p=[{indices:v,vertices:c}];return o.length&&p.push({indices:y,vertices:l}),p}function d(t,n){var e={vertices:[],indices:[]},r={vertices:[],indices:[]};t.map((function(t){return p(t,n)})).forEach((function(t){var n=f(t,2),i=n[0],o=n[1];gt(e,i),o&&gt(r,o)}));var i=[e];return r.vertices.length&&i.push(r),i}return a.forEach((function(t){var n=c.length;gt({indices:c,vertices:l},t),i.addGroup(n,c.length-n,x++)})),c.length&&i.setIndex(c),l.length&&i[pt]("position",new ht.Float32BufferAttribute(l,3)),i}return r}(ht.BufferGeometry);function gt(t,n){var e=Math.round(t.vertices.length/3);bt(t.vertices,n.vertices),bt(t.indices,n.indices.map((function(t){return t+e})))}function bt(t,n){var e,r=function(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=a(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,i=function(){};return{s:i,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,u=!0,f=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return u=t.done,t},e:function(t){f=!0,o=t},f:function(){try{u||null==e.return||e.return()}finally{if(f)throw o}}}}(n);try{for(r.s();!(e=r.n()).done;){var i=e.value;t.push(i)}}catch(t){r.e(t)}finally{r.f()}}function mt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,i=(90-n)*Math.PI/180;return[e*Math.sin(r)*Math.cos(i),e*Math.cos(r),e*Math.sin(r)*Math.sin(i)]}t.GeoJsonGeometry=dt,Object.defineProperty(t,"__esModule",{value:!0})}));
// Version 1.1.8 three-geojson-geometry - https://github.com/vasturiano/three-geojson-geometry
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("three")):"function"==typeof define&&define.amd?define(["exports","three"],n):n((t="undefined"!=typeof globalThis?globalThis:t||self).THREE=t.THREE||{},t.THREE)}(this,(function(t,n){"use strict";function e(t,n){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}function r(t,n){for(var e=0;e<n.length;e++){var r=n[e];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},o(t)}function i(t,n){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,n){return t.__proto__=n,t},i(t,n)}function u(t,n){if(n&&("object"==typeof n||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function a(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var e,r=o(t);if(n){var i=o(this).constructor;e=Reflect.construct(r,arguments,i)}else e=r.apply(this,arguments);return u(this,e)}}function f(t,n){return function(t){if(Array.isArray(t))return t}(t)||function(t,n){var e=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==e)return;var r,o,i=[],u=!0,a=!1;try{for(e=e.call(t);!(u=(r=e.next()).done)&&(i.push(r.value),!n||i.length!==n);u=!0);}catch(t){a=!0,o=t}finally{try{u||null==e.return||e.return()}finally{if(a)throw o}}return i}(t,n)||c(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(t,n){if(t){if("string"==typeof t)return l(t,n);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?l(t,n):void 0}}function l(t,n){(null==n||n>t.length)&&(n=t.length);for(var e=0,r=new Array(n);e<n;e++)r[e]=t[e];return r}var s={exports:{}};function v(t,n,e){e=e||2;var r,o,i,u,a,f,c,l=n&&n.length,s=l?n[0]*e:t.length,v=x(t,0,s,e,!0),p=[];if(!v||v.next===v.prev)return p;if(l&&(v=function(t,n,e,r){var o,i,u,a=[];for(o=0,i=n.length;o<i;o++)(u=x(t,n[o]*r,o<i-1?n[o+1]*r:t.length,r,!1))===u.next&&(u.steiner=!0),a.push(Z(u));for(a.sort(m),o=0;o<a.length;o++)e=w(a[o],e);return e}(t,n,v,e)),t.length>80*e){r=i=t[0],o=u=t[1];for(var y=e;y<s;y+=e)(a=t[y])<r&&(r=a),(f=t[y+1])<o&&(o=f),a>i&&(i=a),f>u&&(u=f);c=0!==(c=Math.max(i-r,u-o))?32767/c:0}return h(v,p,e,r,o,c,0),p}function x(t,n,e,r,o){var i,u;if(o===F(t,n,e,r)>0)for(i=n;i<e;i+=r)u=I(i,t[i],t[i+1],u);else for(i=e-r;i>=n;i-=r)u=I(i,t[i],t[i+1],u);return u&&j(u,u.next)&&(z(u),u=u.next),u}function p(t,n){if(!t)return t;n||(n=t);var e,r=t;do{if(e=!1,r.steiner||!j(r,r.next)&&0!==S(r.prev,r,r.next))r=r.next;else{if(z(r),(r=n=r.prev)===r.next)break;e=!0}}while(e||r!==n);return n}function h(t,n,e,r,o,i,u){if(t){!u&&i&&function(t,n,e,r){var o=t;do{0===o.z&&(o.z=E(o.x,o.y,n,e,r)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next}while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,function(t){var n,e,r,o,i,u,a,f,c=1;do{for(e=t,t=null,i=null,u=0;e;){for(u++,r=e,a=0,n=0;n<c&&(a++,r=r.nextZ);n++);for(f=c;a>0||f>0&&r;)0!==a&&(0===f||!r||e.z<=r.z)?(o=e,e=e.nextZ,a--):(o=r,r=r.nextZ,f--),i?i.nextZ=o:t=o,o.prevZ=i,i=o;e=r}i.nextZ=null,c*=2}while(u>1)}(o)}(t,r,o,i);for(var a,f,c=t;t.prev!==t.next;)if(a=t.prev,f=t.next,i?d(t,r,o,i):y(t))n.push(a.i/e|0),n.push(t.i/e|0),n.push(f.i/e|0),z(t),t=f.next,c=f.next;else if((t=f)===c){u?1===u?h(t=g(p(t),n,e),n,e,r,o,i,2):2===u&&b(t,n,e,r,o,i):h(p(t),n,e,r,o,i,1);break}}}function y(t){var n=t.prev,e=t,r=t.next;if(S(n,e,r)>=0)return!1;for(var o=n.x,i=e.x,u=r.x,a=n.y,f=e.y,c=r.y,l=o<i?o<u?o:u:i<u?i:u,s=a<f?a<c?a:c:f<c?f:c,v=o>i?o>u?o:u:i>u?i:u,x=a>f?a>c?a:c:f>c?f:c,p=r.next;p!==n;){if(p.x>=l&&p.x<=v&&p.y>=s&&p.y<=x&&P(o,a,i,f,u,c,p.x,p.y)&&S(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function d(t,n,e,r){var o=t.prev,i=t,u=t.next;if(S(o,i,u)>=0)return!1;for(var a=o.x,f=i.x,c=u.x,l=o.y,s=i.y,v=u.y,x=a<f?a<c?a:c:f<c?f:c,p=l<s?l<v?l:v:s<v?s:v,h=a>f?a>c?a:c:f>c?f:c,y=l>s?l>v?l:v:s>v?s:v,d=E(x,p,n,e,r),g=E(h,y,n,e,r),b=t.prevZ,m=t.nextZ;b&&b.z>=d&&m&&m.z<=g;){if(b.x>=x&&b.x<=h&&b.y>=p&&b.y<=y&&b!==o&&b!==u&&P(a,l,f,s,c,v,b.x,b.y)&&S(b.prev,b,b.next)>=0)return!1;if(b=b.prevZ,m.x>=x&&m.x<=h&&m.y>=p&&m.y<=y&&m!==o&&m!==u&&P(a,l,f,s,c,v,m.x,m.y)&&S(m.prev,m,m.next)>=0)return!1;m=m.nextZ}for(;b&&b.z>=d;){if(b.x>=x&&b.x<=h&&b.y>=p&&b.y<=y&&b!==o&&b!==u&&P(a,l,f,s,c,v,b.x,b.y)&&S(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;m&&m.z<=g;){if(m.x>=x&&m.x<=h&&m.y>=p&&m.y<=y&&m!==o&&m!==u&&P(a,l,f,s,c,v,m.x,m.y)&&S(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function g(t,n,e){var r=t;do{var o=r.prev,i=r.next.next;!j(o,i)&&_(o,r,r.next,i)&&R(o,i)&&R(i,o)&&(n.push(o.i/e|0),n.push(r.i/e|0),n.push(i.i/e|0),z(r),z(r.next),r=t=i),r=r.next}while(r!==t);return p(r)}function b(t,n,e,r,o,i){var u=t;do{for(var a=u.next.next;a!==u.prev;){if(u.i!==a.i&&O(u,a)){var f=G(u,a);return u=p(u,u.next),f=p(f,f.next),h(u,n,e,r,o,i,0),void h(f,n,e,r,o,i,0)}a=a.next}u=u.next}while(u!==t)}function m(t,n){return t.x-n.x}function w(t,n){var e=function(t,n){var e,r=n,o=t.x,i=t.y,u=-1/0;do{if(i<=r.y&&i>=r.next.y&&r.next.y!==r.y){var a=r.x+(i-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=o&&a>u&&(u=a,e=r.x<r.next.x?r:r.next,a===o))return e}r=r.next}while(r!==n);if(!e)return null;var f,c=e,l=e.x,s=e.y,v=1/0;r=e;do{o>=r.x&&r.x>=l&&o!==r.x&&P(i<s?o:u,i,l,s,i<s?u:o,i,r.x,r.y)&&(f=Math.abs(i-r.y)/(o-r.x),R(r,t)&&(f<v||f===v&&(r.x>e.x||r.x===e.x&&M(e,r)))&&(e=r,v=f)),r=r.next}while(r!==c);return e}(t,n);if(!e)return n;var r=G(e,t);return p(r,r.next),p(e,e.next)}function M(t,n){return S(t.prev,t,n.prev)<0&&S(n.next,t,t.next)<0}function E(t,n,e,r,o){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=(t-e)*o|0)|t<<8))|t<<4))|t<<2))|t<<1))|(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=(n-r)*o|0)|n<<8))|n<<4))|n<<2))|n<<1))<<1}function Z(t){var n=t,e=t;do{(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next}while(n!==t);return e}function P(t,n,e,r,o,i,u,a){return(o-u)*(n-a)>=(t-u)*(i-a)&&(t-u)*(r-a)>=(e-u)*(n-a)&&(e-u)*(i-a)>=(o-u)*(r-a)}function O(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!function(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&_(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}(t,n)&&(R(t,n)&&R(n,t)&&function(t,n){var e=t,r=!1,o=(t.x+n.x)/2,i=(t.y+n.y)/2;do{e.y>i!=e.next.y>i&&e.next.y!==e.y&&o<(e.next.x-e.x)*(i-e.y)/(e.next.y-e.y)+e.x&&(r=!r),e=e.next}while(e!==t);return r}(t,n)&&(S(t.prev,t,n.prev)||S(t,n.prev,n))||j(t,n)&&S(t.prev,t,t.next)>0&&S(n.prev,n,n.next)>0)}function S(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function j(t,n){return t.x===n.x&&t.y===n.y}function _(t,n,e,r){var o=T(S(t,n,e)),i=T(S(t,n,r)),u=T(S(e,r,t)),a=T(S(e,r,n));return o!==i&&u!==a||(!(0!==o||!A(t,e,n))||(!(0!==i||!A(t,r,n))||(!(0!==u||!A(e,t,r))||!(0!==a||!A(e,n,r)))))}function A(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function T(t){return t>0?1:t<0?-1:0}function R(t,n){return S(t.prev,t,t.next)<0?S(t,n,t.next)>=0&&S(t,t.prev,n)>=0:S(t,n,t.prev)<0||S(t,t.next,n)<0}function G(t,n){var e=new B(t.i,t.x,t.y),r=new B(n.i,n.x,n.y),o=t.next,i=n.prev;return t.next=n,n.prev=t,e.next=o,o.prev=e,r.next=e,e.prev=r,i.next=r,r.prev=i,r}function I(t,n,e,r){var o=new B(t,n,e);return r?(o.next=r.next,o.prev=r,r.next.prev=o,r.next=o):(o.prev=o,o.next=o),o}function z(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function B(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}function F(t,n,e,r){for(var o=0,i=n,u=e-r;i<e;i+=r)o+=(t[u]-t[i])*(t[i+1]+t[u+1]),u=i;return o}s.exports=v,s.exports.default=v,v.deviation=function(t,n,e,r){var o=n&&n.length,i=o?n[0]*e:t.length,u=Math.abs(F(t,0,i,e));if(o)for(var a=0,f=n.length;a<f;a++){var c=n[a]*e,l=a<f-1?n[a+1]*e:t.length;u-=Math.abs(F(t,c,l,e))}var s=0;for(a=0;a<r.length;a+=3){var v=r[a]*e,x=r[a+1]*e,p=r[a+2]*e;s+=Math.abs((t[v]-t[p])*(t[x+1]-t[v+1])-(t[v]-t[x])*(t[p+1]-t[v+1]))}return 0===u&&0===s?0:Math.abs((s-u)/u)},v.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},r=0,o=0;o<t.length;o++){for(var i=0;i<t[o].length;i++)for(var u=0;u<n;u++)e.vertices.push(t[o][i][u]);o>0&&(r+=t[o-1].length,e.holes.push(r))}return e};class H{constructor(){this._partials=new Float64Array(32),this._n=0}add(t){const n=this._partials;let e=0;for(let r=0;r<this._n&&r<32;r++){const o=n[r],i=t+o,u=Math.abs(t)<Math.abs(o)?t-(i-o):o-(i-t);u&&(n[e++]=u),t=i}return n[e]=t,this._n=e+1,this}valueOf(){const t=this._partials;let n,e,r,o=this._n,i=0;if(o>0){for(i=t[--o];o>0&&(n=i,e=t[--o],i=n+e,r=e-(i-n),!r););o>0&&(r<0&&t[o-1]<0||r>0&&t[o-1]>0)&&(e=2*r,n=i+e,e==n-i&&(i=n))}return i}}var L=Math.PI,C=L/2,k=180/L,J=L/180,q=Math.abs,D=Math.atan2,U=Math.cos,$=Math.sin,K=Math.sqrt;function N(t){return(t=$(t/2))*t}function Q(){}function V(t,n){t&&et.hasOwnProperty(t.type)&&et[t.type](t,n)}var W,X,Y,tt,nt={Feature:function(t,n){V(t.geometry,n)},FeatureCollection:function(t,n){for(var e=t.features,r=-1,o=e.length;++r<o;)V(e[r].geometry,n)}},et={Sphere:function(t,n){n.sphere()},Point:function(t,n){t=t.coordinates,n.point(t[0],t[1],t[2])},MultiPoint:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)t=e[r],n.point(t[0],t[1],t[2])},LineString:function(t,n){rt(t.coordinates,n,0)},MultiLineString:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)rt(e[r],n,0)},Polygon:function(t,n){ot(t.coordinates,n)},MultiPolygon:function(t,n){for(var e=t.coordinates,r=-1,o=e.length;++r<o;)ot(e[r],n)},GeometryCollection:function(t,n){for(var e=t.geometries,r=-1,o=e.length;++r<o;)V(e[r],n)}};function rt(t,n,e){var r,o=-1,i=t.length-e;for(n.lineStart();++o<i;)r=t[o],n.point(r[0],r[1],r[2]);n.lineEnd()}function ot(t,n){var e=-1,r=t.length;for(n.polygonStart();++e<r;)rt(t[e],n,1);n.polygonEnd()}var it={sphere:Q,point:Q,lineStart:function(){it.point=at,it.lineEnd=ut},lineEnd:Q,polygonStart:Q,polygonEnd:Q};function ut(){it.point=it.lineEnd=Q}function at(t,n){X=t*=J,Y=$(n*=J),tt=U(n),it.point=ft}function ft(t,n){t*=J;var e=$(n*=J),r=U(n),o=q(t-X),i=U(o),u=r*$(o),a=tt*e-Y*r*i,f=Y*e+tt*r*i;W.add(D(K(u*u+a*a),f)),X=t,Y=e,tt=r}function ct(t){return W=new H,function(t,n){t&&nt.hasOwnProperty(t.type)?nt[t.type](t,n):V(t,n)}(t,it),+W}var lt=[null,null],st={type:"LineString",coordinates:lt};function vt(t,n){return lt[0]=t,lt[1]=n,ct(st)}function xt(t,n){var e,r=t[0]*J,o=t[1]*J,i=n[0]*J,u=n[1]*J,a=U(o),f=$(o),c=U(u),l=$(u),s=a*U(r),v=a*$(r),x=c*U(i),p=c*$(i),h=2*((e=K(N(u-o)+a*c*N(i-r)))>1?C:e<-1?-C:Math.asin(e)),y=$(h),d=h?function(t){var n=$(t*=h)/y,e=$(h-t)/y,r=e*s+n*x,o=e*v+n*p,i=e*f+n*l;return[D(o,r)*k,D(i,K(r*r+o*o))*k]}:function(){return[r*k,o*k]};return d.distance=h,d}var pt=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,e=[],r=null;return t.forEach((function(t){if(r){var o=180*vt(t,r)/Math.PI;if(o>n)for(var i=xt(r,t),u=1/Math.ceil(o/n),a=u;a<1;)e.push(i(a)),a+=u}e.push(r=t)})),e},ht="undefined"!=typeof window&&window.THREE?window.THREE:{BufferGeometry:n.BufferGeometry,Float32BufferAttribute:n.Float32BufferAttribute},yt=(new ht.BufferGeometry).setAttribute?"setAttribute":"addAttribute",dt=function(t){!function(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(n&&n.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),n&&i(t,n)}(l,t);var n,o,u,c=a(l);function l(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;e(this,l),(n=c.call(this)).type="GeoJsonGeometry",n.parameters={geoJson:t,radius:r,resolution:o};var i=({Point:x,MultiPoint:p,LineString:h,MultiLineString:y,Polygon:d,MultiPolygon:g}[t.type]||function(){return[]})(t.coordinates,r),u=[],a=[],v=0;function x(t,n){return[{vertices:mt(t[1],t[0],n),indices:[]}]}function p(t,n){var e={vertices:[],indices:[]};return t.map((function(t){return x(t,n)})).forEach((function(t){var n=f(t,1)[0];gt(e,n)})),[e]}function h(t,n){for(var e=pt(t,o).map((function(t){var e=f(t,2),r=e[0];return mt(e[1],r,n)})),r=s.exports.flatten([e]).vertices,i=Math.round(r.length/3),u=[],a=1;a<i;a++)u.push(a-1,a);return[{vertices:r,indices:u}]}function y(t,n){var e={vertices:[],indices:[]};return t.map((function(t){return h(t,n)})).forEach((function(t){var n=f(t,1)[0];gt(e,n)})),[e]}function d(t,n){for(var e=t.map((function(t){return pt(t,o).map((function(t){var e=f(t,2),r=e[0];return mt(e[1],r,n)}))})),r=s.exports.flatten(e),i=r.vertices,u=r.holes,a=u[0]||1/0,c=i.slice(0,3*a),l=i.slice(3*a),v=new Set(u),x=Math.round(i.length/3),p=[],h=[],y=1;y<x;y++)v.has(y)||(y<a?p.push(y-1,y):h.push(y-1-a,y-a));var d=[{indices:p,vertices:c}];return u.length&&d.push({indices:h,vertices:l}),d}function g(t,n){var e={vertices:[],indices:[]},r={vertices:[],indices:[]};t.map((function(t){return d(t,n)})).forEach((function(t){var n=f(t,2),o=n[0],i=n[1];gt(e,o),i&&gt(r,i)}));var o=[e];return r.vertices.length&&o.push(r),o}return i.forEach((function(t){var e=u.length;gt({indices:u,vertices:a},t),n.addGroup(e,u.length-e,v++)})),u.length&&n.setIndex(u),a.length&&n[yt]("position",new ht.Float32BufferAttribute(a,3)),n}return n=l,o&&r(n.prototype,o),u&&r(n,u),Object.defineProperty(n,"prototype",{writable:!1}),n}(ht.BufferGeometry);function gt(t,n){var e=Math.round(t.vertices.length/3);bt(t.vertices,n.vertices),bt(t.indices,n.indices.map((function(t){return t+e})))}function bt(t,n){var e,r=function(t,n){var e="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=c(t))||n&&t&&"number"==typeof t.length){e&&(t=e);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,u=!0,a=!1;return{s:function(){e=e.call(t)},n:function(){var t=e.next();return u=t.done,t},e:function(t){a=!0,i=t},f:function(){try{u||null==e.return||e.return()}finally{if(a)throw i}}}}(n);try{for(r.s();!(e=r.n()).done;){var o=e.value;t.push(o)}}catch(t){r.e(t)}finally{r.f()}}function mt(t,n){var e=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=(90-t)*Math.PI/180,o=(90-n)*Math.PI/180;return[e*Math.sin(r)*Math.cos(o),e*Math.cos(r),e*Math.sin(r)*Math.sin(o)]}t.GeoJsonGeometry=dt,Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -11,2 +11,21 @@ import { BufferGeometry, Float32BufferAttribute } from 'three';

function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inherits(subClass, superClass) {

@@ -24,2 +43,5 @@ if (typeof superClass !== "function" && superClass !== null) {

});
Object.defineProperty(subClass, "prototype", {
writable: false
});
if (superClass) _setPrototypeOf(subClass, superClass);

@@ -29,3 +51,3 @@ }

function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);

@@ -37,7 +59,6 @@ };

function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);

@@ -436,3 +457,3 @@ }

return GeoJsonGeometry;
return _createClass(GeoJsonGeometry);
}(THREE.BufferGeometry); //

@@ -439,0 +460,0 @@

{
"name": "three-geojson-geometry",
"version": "1.1.7",
"version": "1.1.8",
"description": "ThreeJS geometry for stroking GeoJSON objects on a sphere",

@@ -48,16 +48,16 @@ "unpkg": "dist/three-geojson-geometry.min.js",

"devDependencies": {
"@babel/core": "^7.16.0",
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-proposal-object-rest-spread": "^7.16.0",
"@babel/preset-env": "^7.16.0",
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^21.0.1",
"@rollup/plugin-node-resolve": "^13.0.6",
"@babel/core": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
"@babel/preset-env": "^7.19.1",
"@rollup/plugin-babel": "^5.3.1",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
"@types/three": ">=0.72.0",
"rimraf": "^3.0.2",
"rollup": "^2.59.0",
"rollup-plugin-dts": "^4.0.1",
"rollup": "^2.79.1",
"rollup-plugin-dts": "^4.2.2",
"rollup-plugin-terser": "^7.0.2",
"typescript": "^4.4.4"
"typescript": "^4.8.3"
}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc