diff --git a/demo/js/bundle.js b/demo/js/bundle.js index 1894479..9ed5e45 100644 --- a/demo/js/bundle.js +++ b/demo/js/bundle.js @@ -762,7 +762,12 @@ } // check if the line segment belongs to the Boolean operation - event.inResult = inResult(event, operation); + var isInResult = inResult(event, operation); + if (isInResult) { + event.resultTransition = determineResultTransition(event, operation); + } else { + event.resultTransition = 0; + } } @@ -795,6 +800,30 @@ } /* eslint-enable indent */ + + function determineResultTransition(event, operation) { + var thisIn = !event.inOut; + var thatIn = !event.otherInOut; + + var isIn; + switch (operation) { + case INTERSECTION: + isIn = thisIn && thatIn; break; + case UNION: + isIn = thisIn || thatIn; break; + case XOR: + isIn = thisIn ^ thatIn; break; + case DIFFERENCE: + if (event.isSubject) { + isIn = thisIn && !thatIn; + } else { + isIn = thatIn && !thisIn; + } + break; + } + return isIn ? +1 : -1; + } + var SweepEvent = function SweepEvent (point, left, otherEvent, isSubject, edgeType) { /** @@ -846,22 +875,28 @@ this.prevInResult = null; /** - * Does event belong to result? - * @type {Boolean} + * Type of result transition (0 = not in result, +1 = out-in, -1, in-out) + * @type {Number} */ - this.inResult = false; - + this.resultTransition = 0; // connection step /** - * @type {Boolean} + * @type {Number} + */ + this.otherPos = -1; + + /** + * @type {Number} */ - this.resultInOut = false; + this.outputContourId = -1; - this.isExteriorRing = true; + this.isExteriorRing = true; // TODO: Looks unused, remove? }; + var prototypeAccessors$1 = { inResult: { configurable: true } }; + /** * @param{Array.}p @@ -894,19 +929,31 @@ }; + /** + * Does event belong to result? + * @return {Boolean} + */ + prototypeAccessors$1.inResult.get = function () { + return this.resultTransition !== 0; + }; + + SweepEvent.prototype.clone = function clone () { var copy = new SweepEvent( this.point, this.left, this.otherEvent, this.isSubject, this.type); - copy.inResult = this.inResult; - copy.prevInResult = this.prevInResult; + copy.contourId = this.contourId; + copy.resultTransition = this.resultTransition; + copy.prevInResult = this.prevInResult; copy.isExteriorRing = this.isExteriorRing; - copy.inOut = this.inOut; - copy.otherInOut = this.otherInOut; + copy.inOut = this.inOut; + copy.otherInOut = this.otherInOut; return copy; }; + Object.defineProperties( SweepEvent.prototype, prototypeAccessors$1 ); + function equals(p1, p2) { if (p1[0] === p2[0]) { if (p1[1] === p2[1]) { @@ -1263,7 +1310,6 @@ /* eslint-disable no-console */ if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that, a collapsed segment?', se); } /* eslint-enable no-console */ @@ -1653,6 +1699,17 @@ return sortedEvents; } + var Contour = function Contour() { + this.points = []; + this.holeIds = []; + this.holeOf = null; + this.depth = null; + }; + + Contour.prototype.isExterior = function isExterior () { + return this.holeOf == null; + }; + /** * @param {Array.} sortedEvents * @return {Array.} @@ -1685,7 +1742,7 @@ for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; - event.pos = i; + event.otherPos = i; } // imagine, the right event is found in the beginning of the queue, @@ -1693,9 +1750,9 @@ for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; if (!event.left) { - tmp = event.pos; - event.pos = event.otherEvent.pos; - event.otherEvent.pos = tmp; + tmp = event.otherPos; + event.otherPos = event.otherEvent.otherPos; + event.otherEvent.otherPos = tmp; } } @@ -1709,18 +1766,15 @@ * @param {Object>} processed * @return {Number} */ - function nextPos(pos, resultEvents, processed, origIndex) { - var p, p1; - var newPos = pos + 1; + function nextPos(pos, resultEvents, processed, origPos) { + var newPos = pos + 1, + p = resultEvents[pos].point, + p1; var length = resultEvents.length; - p = resultEvents[pos].point; - if (newPos < length) { p1 = resultEvents[newPos].point; } - - // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { return newPos; @@ -1732,80 +1786,110 @@ newPos = pos - 1; - while (processed[newPos] && newPos >= origIndex) { + while (processed[newPos] && newPos > origPos) { newPos--; } + return newPos; } + function initializeContourFromContext(event, contours, contourId) { + var contour = new Contour(); + if (event.prevInResult != null) { + var prevInResult = event.prevInResult; + // Note that it is valid to query the "previous in result" for its output contour id, + // because we must have already processed it (i.e., assigned an output contour id) + // in an earlier iteration, otherwise it wouldn't be possible that it is "previous in + // result". + var lowerContourId = prevInResult.outputContourId; + var lowerResultTransition = prevInResult.resultTransition; + if (lowerResultTransition > 0) { + // We are inside. Now we have to check if the thing below us is another hole or + // an exterior contour. + var lowerContour = contours[lowerContourId]; + if (lowerContour.holeOf != null) { + // The lower contour is a hole => Connect the new contour as a hole to its parent, + // and use same depth. + var parentContourId = lowerContour.holeOf; + contours[parentContourId].holeIds.push(contourId); + contour.holeOf = parentContourId; + contour.depth = contours[lowerContourId].depth; + } else { + // The lower contour is an exterior contour => Connect the new contour as a hole, + // and increment depth. + contours[lowerContourId].holeIds.push(contourId); + contour.holeOf = lowerContourId; + contour.depth = contours[lowerContourId].depth + 1; + } + } else { + // We are outside => this contour is an exterior contour of same depth. + contour.holeOf = null; + contour.depth = contours[lowerContourId].depth; + } + } else { + // There is no lower/previous contour => this contour is an exterior contour of depth 0. + contour.holeOf = null; + contour.depth = 0; + } + return contour; + } + /** * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ - function connectEdges(sortedEvents, operation) { + function connectEdges(sortedEvents) { var i, len; var resultEvents = orderEvents(sortedEvents); // "false"-filled array var processed = {}; - var result = []; - var event; + var contours = []; - for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) { continue; } - var contour = [[]]; - - if (!resultEvents[i].isExteriorRing) { - if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length === 0) { - result.push(contour); - } else if (result.length === 0) { - result.push([[contour]]); - } else { - result[result.length - 1].push(contour[0]); - } - } else if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) { - result[result.length - 1].push(contour[0]); - } else { - result.push(contour); + var loop = function ( ) { + + if (processed[i]) { + return; } - var ringId = result.length - 1; + var contourId = contours.length; + var contour = initializeContourFromContext(resultEvents[i], contours, contourId); + + // Helper function that combines marking an event as processed with assigning its output contour ID + var markAsProcessed = function (pos) { + processed[pos] = true; + resultEvents[pos].outputContourId = contourId; + }; + var pos = i; + var origPos = i; var initial = resultEvents[i].point; - contour[0].push(initial); + contour.points.push(initial); - while (pos >= i) { - event = resultEvents[pos]; - processed[pos] = true; + /* eslint no-constant-condition: "off" */ + while (true) { + markAsProcessed(pos); - if (event.left) { - event.resultInOut = false; - event.contourId = ringId; - } else { - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } + pos = resultEvents[pos].otherPos; - pos = event.pos; - processed[pos] = true; - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed, i); + markAsProcessed(pos); + contour.points.push(resultEvents[pos].point); + + pos = nextPos(pos, resultEvents, processed, origPos); + + if (pos == origPos) { + break; + } } - pos = pos === -1 ? i : pos; + contours.push(contour); + }; - event = resultEvents[pos]; - processed[pos] = processed[event.pos] = true; - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } + for (i = 0, len = resultEvents.length; i < len; i++) loop( ); - // Handle if the result is a polygon (eg not multipoly) - // Commented it again, let's see what do we mean by that - // if (result.length === 1) result = result[0]; - return result; + return contours; } var tinyqueue = TinyQueue; @@ -2018,7 +2102,7 @@ var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - //console.time('fill queue'); + // console.time('fill queue'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation); //console.timeEnd('fill queue'); @@ -2026,14 +2110,31 @@ if (trivial) { return trivial === EMPTY ? null : trivial; } - //console.time('subdivide edges'); + // console.time('subdivide edges'); var sortedEvents = subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation); //console.timeEnd('subdivide edges'); - //console.time('connect vertices'); - var result = connectEdges(sortedEvents, operation); + // console.time('connect vertices'); + var contours = connectEdges(sortedEvents); //console.timeEnd('connect vertices'); - return result; + + // Convert contours to polygons + var polygons = []; + for (var i = 0; i < contours.length; i++) { + var contour = contours[i]; + if (contour.isExterior()) { + // The exterior ring goes first + var rings = [contour.points]; + // Followed by holes if any + for (var j = 0; j < contour.holeIds.length; j++) { + var holeId = contour.holeIds[j]; + rings.push(contours[holeId].points); + } + polygons.push(rings); + } + } + + return polygons; } function union (subject, clipping) { @@ -2044,7 +2145,7 @@ return boolean(subject, clipping, DIFFERENCE); } - function xor (subject, clipping){ + function xor (subject, clipping) { return boolean(subject, clipping, XOR); } @@ -2223,7 +2324,7 @@ //if (op === OPERATIONS.UNION) result = result[0]; console.log('result', result); - // console.log(JSON.stringify(result)) + console.log(JSON.stringify(result)); results.clearLayers(); if (result !== null) { diff --git a/dist/martinez.min.js b/dist/martinez.min.js index 0b61d78..0a451fe 100644 --- a/dist/martinez.min.js +++ b/dist/martinez.min.js @@ -6,4 +6,4 @@ * @license MIT * @preserve */ -(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.martinez={}))})(this,function(t){"use strict";function i(t,e){return t>e?1:t0){r=r.left}else{return r}}return null};y.prototype.contains=function t(e){var r=this._root;var i=this._compare;while(r){var n=i(e,r.key);if(n===0){return true}else if(n<0){r=r.left}else{r=r.right}}return false};y.prototype.remove=function t(e){var r=this.find(e);if(!r){return false}this.splay(r);if(!r.left){this.replace(r,r.right)}else if(!r.right){this.replace(r,r.left)}else{var i=this.minNode(r.right);if(i.parent!==r){this.replace(i,i.right);i.right=r.right;i.right.parent=i}this.replace(r,i);i.left=r.left;i.left.parent=i}this._size--;return true};y.prototype.removeNode=function t(e){if(!e){return false}this.splay(e);if(!e.left){this.replace(e,e.right)}else if(!e.right){this.replace(e,e.left)}else{var r=this.minNode(e.right);if(r.parent!==e){this.replace(r,r.right);r.right=e.right;r.right.parent=r}this.replace(e,r);r.left=e.left;r.left.parent=r}this._size--;return true};y.prototype.erase=function t(e){var r=this.find(e);if(!r){return}this.splay(r);var i=r.left;var n=r.right;var o=null;if(i){i.parent=null;o=this.maxNode(i);this.splay(o);this._root=o}if(n){if(i){o.right=n}else{this._root=n}n.parent=o}this._size--};y.prototype.pop=function t(){var e=this._root,r=null;if(e){while(e.left){e=e.left}r={key:e.key,data:e.data};this.remove(e.key)}return r};y.prototype.next=function t(e){var r=e;if(r){if(r.right){r=r.right;while(r&&r.left){r=r.left}}else{r=e.parent;while(r&&r.right===e){e=r;r=r.parent}}}return r};y.prototype.prev=function t(e){var r=e;if(r){if(r.left){r=r.left;while(r&&r.right){r=r.right}}else{r=e.parent;while(r&&r.left===e){e=r;r=r.parent}}}return r};y.prototype.forEach=function t(e){var r=this._root;var i=[],n=false,o=0;while(!n){if(r){i.push(r);r=r.left}else{if(i.length>0){r=i.pop();e(r,o++);r=r.right}else{n=true}}}return this};y.prototype.range=function t(e,r,i,n){var o=[];var f=this._compare;var l=this._root,a;while(o.length!==0||l){if(l){o.push(l);l=l.left}else{l=o.pop();a=f(l.key,r);if(a>0){break}else if(f(l.key,e)>=0){if(i.call(n,l)){return this}}l=l.right}}return this};y.prototype.keys=function t(){var e=this._root;var r=[],i=[],n=false;while(!n){if(e){r.push(e);e=e.left}else{if(r.length>0){e=r.pop();i.push(e.key);e=e.right}else{n=true}}}return i};y.prototype.values=function t(){var e=this._root;var r=[],i=[],n=false;while(!n){if(e){r.push(e);e=e.left}else{if(r.length>0){e=r.pop();i.push(e.data);e=e.right}else{n=true}}}return i};y.prototype.at=function t(e){var r=this._root;var i=[],n=false,o=0;while(!n){if(r){i.push(r);r=r.left}else{if(i.length>0){r=i.pop();if(o===e){return r}o++;r=r.right}else{n=true}}}return null};y.prototype.load=function t(e,r,i){if(e===void 0)e=[];if(r===void 0)r=[];if(i===void 0)i=false;if(this._size!==0){throw new Error("bulk-load: tree is not empty")}var n=e.length;if(i){u(e,r,0,n-1,this._compare)}this._root=s(null,e,r,0,n);this._size=n;return this};y.prototype.min=function t(){var e=this.minNode(this._root);if(e){return e.key}else{return null}};y.prototype.max=function t(){var e=this.maxNode(this._root);if(e){return e.key}else{return null}};y.prototype.isEmpty=function t(){return this._root===null};e.size.get=function(){return this._size};y.createTree=function t(e,r,i,n,o){return new y(i,o).load(e,r,n)};Object.defineProperties(y.prototype,e);function s(t,e,r,i,n){var o=n-i;if(o>0){var f=i+Math.floor(o/2);var l=e[f];var a=r[f];var u={key:l,data:a,parent:t};u.left=s(u,e,r,i,f);u.right=s(u,e,r,f+1,n);return u}return null}function u(t,e,r,i,n){if(r>=i){return}var o=t[r+i>>1];var f=r-1;var l=i+1;while(true){do{f++}while(n(t[f],o)<0);do{l--}while(n(t[l],o)>0);if(f>=l){break}var a=t[f];t[f]=t[l];t[l]=a;a=e[f];e[f]=e[l];e[l]=a}u(t,e,r,l,n);u(t,e,l+1,i,n)}var f=0;var a=1;var h=2;var p=3;var d=0;var l=1;var E=2;var v=3;function w(t,e,r){if(e===null){t.inOut=false;t.otherInOut=true}else{if(t.isSubject===e.isSubject){t.inOut=!e.inOut;t.otherInOut=e.otherInOut}else{t.inOut=!e.otherInOut;t.otherInOut=e.isVertical()?!e.inOut:e.inOut}if(e){t.prevInResult=!n(e,r)||e.isVertical()?e.prevInResult:e}}t.inResult=n(t,r)}function n(t,e){switch(t.type){case f:switch(e){case d:return!t.otherInOut;case l:return t.otherInOut;case E:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case v:return true}break;case h:return e===d||e===l;case p:return e===E;case a:return false}return false}var c=function t(e,r,i,n,o){this.left=r;this.point=e;this.otherEvent=i;this.isSubject=n;this.type=o||f;this.inOut=false;this.otherInOut=false;this.prevInResult=null;this.inResult=false;this.resultInOut=false;this.isExteriorRing=true};c.prototype.isBelow=function t(e){var r=this.point,i=this.otherEvent.point;return this.left?(r[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(r[1]-e[1])>0:(i[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(i[1]-e[1])>0};c.prototype.isAbove=function t(e){return!this.isBelow(e)};c.prototype.isVertical=function t(){return this.point[0]===this.otherEvent.point[0]};c.prototype.clone=function t(){var e=new c(this.point,this.left,this.otherEvent,this.isSubject,this.type);e.inResult=this.inResult;e.prevInResult=this.prevInResult;e.isExteriorRing=this.isExteriorRing;e.inOut=this.inOut;e.otherInOut=this.otherInOut;return e};function g(t,e){if(t[0]===e[0]){if(t[1]===e[1]){return true}else{return false}}return false}var r=11102230246251565e-32;var B=134217729;var A=(3+8*r)*r;function D(t,e,r,i,n){var o,f,l,a;var u=e[0];var s=i[0];var h=0;var p=0;if(s>u===s>-u){o=u;u=e[++h]}else{o=s;s=i[++p]}var v=0;if(hu===s>-u){f=u+o;l=o-(f-u);u=e[++h]}else{f=s+o;l=o-(f-s);s=i[++p]}o=f;if(l!==0){n[v++]=l}while(hu===s>-u){f=o+u;a=f-o;l=o-(f-a)+(u-a);u=e[++h]}else{f=o+s;a=f-o;l=o-(f-a)+(s-a);s=i[++p]}o=f;if(l!==0){n[v++]=l}}}while(h=N||-S>=N){return S}h=t-O;l=t-(O+h)+(h-n);h=r-R;u=r-(R+h)+(h-n);h=e-j;a=e-(j+h)+(h-o);h=i-x;s=i-(x+h)+(h-o);if(l===0&&a===0&&u===0&&s===0){return S}N=V*f+A*Math.abs(S);S+=O*s+x*l-(j*u+R*a);if(S>=N||-S>=N){return S}_=l*x;p=B*l;v=p-(p-l);c=l-v;p=B*x;g=p-(p-x);y=x-g;I=c*y-(_-v*g-c*g-v*y);m=a*R;p=B*a;v=p-(p-a);c=a-v;p=B*R;g=p-(p-R);y=R-g;b=c*y-(m-v*g-c*g-v*y);d=I-b;h=I-d;q[0]=I-(d+h)+(h-b);E=_+d;h=E-_;w=_-(E-h)+(d-h);d=w-m;h=w-d;q[1]=w-(d+h)+(h-m);k=E+d;h=k-E;q[2]=E-(k-h)+(d-h);q[3]=k;var z=D(4,C,4,q,P);_=O*s;p=B*O;v=p-(p-O);c=O-v;p=B*s;g=p-(p-s);y=s-g;I=c*y-(_-v*g-c*g-v*y);m=j*u;p=B*j;v=p-(p-j);c=j-v;p=B*u;g=p-(p-u);y=u-g;b=c*y-(m-v*g-c*g-v*y);d=I-b;h=I-d;q[0]=I-(d+h)+(h-b);E=_+d;h=E-_;w=_-(E-h)+(d-h);d=w-m;h=w-d;q[1]=w-(d+h)+(h-m);k=E+d;h=k-E;q[2]=E-(k-h)+(d-h);q[3]=k;var M=D(z,P,4,q,U);_=l*s;p=B*l;v=p-(p-l);c=l-v;p=B*s;g=p-(p-s);y=s-g;I=c*y-(_-v*g-c*g-v*y);m=a*u;p=B*a;v=p-(p-a);c=a-v;p=B*u;g=p-(p-u);y=u-g;b=c*y-(m-v*g-c*g-v*y);d=I-b;h=I-d;q[0]=I-(d+h)+(h-b);E=_+d;h=E-_;w=_-(E-h)+(d-h);d=w-m;h=w-d;q[1]=w-(d+h)+(h-m);k=E+d;h=k-E;q[2]=E-(k-h)+(d-h);q[3]=k;var L=D(M,U,4,q,X);return X[L-1]}function m(t,e,r,i,n,o){var f=(e-o)*(r-n);var l=(t-n)*(i-o);var a=f-l;if(f===0||l===0||f>0!==l>0){return a}var u=Math.abs(f+l);if(Math.abs(a)>=_*u){return a}return-I(t,e,r,i,n,o,u)}function b(t,e,r){var i=m(t[0],t[1],e[0],e[1],r[0],r[1]);if(i>0){return-1}if(i<0){return 1}return 0}function k(t,e){var r=t.point;var i=e.point;if(r[0]>i[0]){return 1}if(r[0]i[1]?1:-1}return O(t,e,r)}function O(t,e,r,i){if(t.left!==e.left){return t.left?1:-1}if(b(r,t.otherEvent.point,e.otherEvent.point)!==0){return!t.isBelow(e.otherEvent.point)?1:-1}return!t.isSubject&&e.isSubject?1:-1}function R(t,e,r){var i=new c(e,false,t,t.isSubject);var n=new c(e,true,t.otherEvent,t.isSubject);if(g(t.point,t.otherEvent.point)){console.warn("what is that, a collapsed segment?",t)}i.contourId=n.contourId=t.contourId;if(k(n,t.otherEvent)>0){t.otherEvent.left=true;n.left=false}t.otherEvent.otherEvent=n;t.otherEvent=i;r.push(n);r.push(i);return r}function j(t,e){return t[0]*e[1]-t[1]*e[0]}function x(t,e){return t[0]*e[0]+t[1]*e[1]}function S(t,e,r,i,n){var o=[e[0]-t[0],e[1]-t[1]];var f=[i[0]-r[0],i[1]-r[1]];function l(t,e,r){return[t[0]+e*r[0],t[1]+e*r[1]]}var a=[r[0]-t[0],r[1]-t[1]];var u=j(o,f);var s=u*u;var h=x(o,o);if(s>0){var p=j(a,f)/u;if(p<0||p>1){return null}var v=j(a,o)/u;if(v<0||v>1){return null}if(p===0||p===1){return n?null:[l(t,p,o)]}if(v===0||v===1){return n?null:[l(r,v,f)]}return[l(t,p,o)]}u=j(a,o);s=u*u;if(s>0){return null}var c=x(o,a)/h;var g=c+x(o,f)/h;var y=Math.min(c,g);var d=Math.max(c,g);if(y<=1&&d>=0){if(y===1){return n?null:[l(t,y>0?y:0,o)]}if(d===0){return n?null:[l(t,d<1?d:1,o)]}if(n&&y===0&&d===1){return null}return[l(t,y>0?y:0,o),l(t,d<1?d:1,o)]}return null}function N(t,e,r){var i=S(t.point,t.otherEvent.point,e.point,e.otherEvent.point);var n=i?i.length:0;if(n===0){return 0}if(n===1&&(g(t.point,e.point)||g(t.otherEvent.point,e.otherEvent.point))){return 0}if(n===2&&t.isSubject===e.isSubject){return 0}if(n===1){if(!g(t.point,i[0])&&!g(t.otherEvent.point,i[0])){R(t,i[0],r)}if(!g(e.point,i[0])&&!g(e.otherEvent.point,i[0])){R(e,i[0],r)}return 1}var o=[];var f=false;var l=false;if(g(t.point,e.point)){f=true}else if(k(t,e)===1){o.push(e,t)}else{o.push(t,e)}if(g(t.otherEvent.point,e.otherEvent.point)){l=true}else if(k(t.otherEvent,e.otherEvent)===1){o.push(e.otherEvent,t.otherEvent)}else{o.push(t.otherEvent,e.otherEvent)}if(f&&l||f){e.type=a;t.type=e.inOut===t.inOut?h:p;if(f&&!l){R(o[1].otherEvent,o[0].point,r)}return 2}if(l){R(o[0],o[1].point,r);return 3}if(o[0]!==o[3].otherEvent){R(o[0],o[1].point,r);R(o[1],o[2].point,r);return 3}R(o[0],o[1].point,r);R(o[3].otherEvent,o[2].point,r);return 3}function z(t,e){if(t===e){return 0}if(b(t.point,t.otherEvent.point,e.point)!==0||b(t.point,t.otherEvent.point,e.otherEvent.point)!==0){if(g(t.point,e.point)){return t.isBelow(e.otherEvent.point)?-1:1}if(t.point[0]===e.point[0]){return t.point[1]e.contourId?1:-1}}}else{return t.isSubject?-1:1}return k(t,e)===1?1:-1}function M(t,e,r,i,n,o){var f=new y(z);var l=[];var a=Math.min(i[2],n[2]);var u,s,h;while(t.length!==0){var p=t.pop();l.push(p);if(o===d&&p.point[0]>a||o===E&&p.point[0]>i[2]){break}if(p.left){s=u=f.insert(p);h=f.minNode();if(u!==h){u=f.prev(u)}else{u=null}s=f.next(s);var v=u?u.key:null;var c=void 0;w(p,v,o);if(s){if(N(p,s.key,t)===2){w(p,v,o);w(p,s.key,o)}}if(u){if(N(u.key,p,t)===2){var g=u;if(g!==h){g=f.prev(g)}else{g=null}c=g?g.key:null;w(v,c,o);w(p,v,o)}}}else{p=p.otherEvent;s=u=f.find(p);if(u&&s){if(u!==h){u=f.prev(u)}else{u=null}s=f.next(s);f.remove(p);if(s&&u){N(u.key,s.key,t)}}}}return l}function L(t){var e,r,i,n;var o=[];for(r=0,i=t.length;r=i){f--}return f}function H(t,e){var r,i;var n=L(t);var o={};var f=[];var l;for(r=0,i=n.length;r1){f[f.length-1].push(a[0])}else{f.push(a)}var u=f.length-1;var s=r;var h=n[r].point;a[0].push(h);while(s>=r){l=n[s];o[s]=true;if(l.left){l.resultInOut=false;l.contourId=u}else{l.otherEvent.resultInOut=true;l.otherEvent.contourId=u}s=l.pos;o[s]=true;a[0].push(n[s].point);s=G(s,n,o,r)}s=s===-1?r:s;l=n[s];o[s]=o[l.pos]=true;l.otherEvent.resultInOut=true;l.otherEvent.contourId=u}return f}var J=Q;var K=Q;function Q(t,e){if(!(this instanceof Q)){return new Q(t,e)}this.data=t||[];this.length=this.data.length;this.compare=e||W;if(this.length>0){for(var r=(this.length>>1)-1;r>=0;r--){this._down(r)}}}function W(t,e){return te?1:0}Q.prototype={push:function(t){this.data.push(t);this.length++;this._up(this.length-1)},pop:function(){if(this.length===0){return undefined}var t=this.data[0];this.length--;if(this.length>0){this.data[0]=this.data[this.length];this._down(0)}this.data.pop();return t},peek:function(){return this.data[0]},_up:function(t){var e=this.data;var r=this.compare;var i=e[t];while(t>0){var n=t-1>>1;var o=e[n];if(r(i,o)>=0){break}e[t]=o;t=n}e[t]=i},_down:function(t){var e=this.data;var r=this.compare;var i=this.length>>1;var n=e[t];while(t=0){break}e[t]=l;t=o}e[t]=n}};J.default=K;var Y=Math.max;var Z=Math.min;var $=0;function tt(t,e,r,i,n,o){var f,l,a,u,s,h;for(f=0,l=t.length-1;f0){h.left=true}else{s.left=true}var p=a[0],v=a[1];n[0]=Z(n[0],p);n[1]=Z(n[1],v);n[2]=Y(n[2],p);n[3]=Y(n[3],v);i.push(s);i.push(h)}}function et(t,e,r,i,n){var o=new J(null,k);var f,l,a,u,s,h;for(a=0,u=t.length;ai[2]||i[0]>r[2]||r[1]>i[3]||i[1]>r[3]){if(n===d){o=rt}else if(n===E){o=t}else if(n===l||n===v){o=t.concat(e)}}return o}function ot(t,e,r){if(typeof t[0][0][0]==="number"){t=[t]}if(typeof e[0][0][0]==="number"){e=[e]}var i=it(t,e,r);if(i){return i===rt?null:i}var n=[Infinity,Infinity,-Infinity,-Infinity];var o=[Infinity,Infinity,-Infinity,-Infinity];var f=et(t,e,n,o,r);i=nt(t,e,n,o,r);if(i){return i===rt?null:i}var l=M(f,t,e,n,o,r);var a=H(l,r);return a}function ft(t,e){return ot(t,e,l)}function lt(t,e){return ot(t,e,E)}function at(t,e){return ot(t,e,v)}function ut(t,e){return ot(t,e,d)}var st={UNION:l,DIFFERENCE:E,INTERSECTION:d,XOR:v};t.diff=lt;t.intersection=ut;t.operations=st;t.union=ft;t.xor=at;Object.defineProperty(t,"__esModule",{value:true})}); \ No newline at end of file +(function(t,e){typeof exports==="object"&&typeof module!=="undefined"?e(exports):typeof define==="function"&&define.amd?define(["exports"],e):(t=t||self,e(t.martinez={}))})(this,function(t){"use strict";function i(t,e){return t>e?1:t0){r=r.left}else{return r}}return null};d.prototype.contains=function t(e){var r=this._root;var i=this._compare;while(r){var n=i(e,r.key);if(n===0){return true}else if(n<0){r=r.left}else{r=r.right}}return false};d.prototype.remove=function t(e){var r=this.find(e);if(!r){return false}this.splay(r);if(!r.left){this.replace(r,r.right)}else if(!r.right){this.replace(r,r.left)}else{var i=this.minNode(r.right);if(i.parent!==r){this.replace(i,i.right);i.right=r.right;i.right.parent=i}this.replace(r,i);i.left=r.left;i.left.parent=i}this._size--;return true};d.prototype.removeNode=function t(e){if(!e){return false}this.splay(e);if(!e.left){this.replace(e,e.right)}else if(!e.right){this.replace(e,e.left)}else{var r=this.minNode(e.right);if(r.parent!==e){this.replace(r,r.right);r.right=e.right;r.right.parent=r}this.replace(e,r);r.left=e.left;r.left.parent=r}this._size--;return true};d.prototype.erase=function t(e){var r=this.find(e);if(!r){return}this.splay(r);var i=r.left;var n=r.right;var o=null;if(i){i.parent=null;o=this.maxNode(i);this.splay(o);this._root=o}if(n){if(i){o.right=n}else{this._root=n}n.parent=o}this._size--};d.prototype.pop=function t(){var e=this._root,r=null;if(e){while(e.left){e=e.left}r={key:e.key,data:e.data};this.remove(e.key)}return r};d.prototype.next=function t(e){var r=e;if(r){if(r.right){r=r.right;while(r&&r.left){r=r.left}}else{r=e.parent;while(r&&r.right===e){e=r;r=r.parent}}}return r};d.prototype.prev=function t(e){var r=e;if(r){if(r.left){r=r.left;while(r&&r.right){r=r.right}}else{r=e.parent;while(r&&r.left===e){e=r;r=r.parent}}}return r};d.prototype.forEach=function t(e){var r=this._root;var i=[],n=false,o=0;while(!n){if(r){i.push(r);r=r.left}else{if(i.length>0){r=i.pop();e(r,o++);r=r.right}else{n=true}}}return this};d.prototype.range=function t(e,r,i,n){var o=[];var f=this._compare;var a=this._root,l;while(o.length!==0||a){if(a){o.push(a);a=a.left}else{a=o.pop();l=f(a.key,r);if(l>0){break}else if(f(a.key,e)>=0){if(i.call(n,a)){return this}}a=a.right}}return this};d.prototype.keys=function t(){var e=this._root;var r=[],i=[],n=false;while(!n){if(e){r.push(e);e=e.left}else{if(r.length>0){e=r.pop();i.push(e.key);e=e.right}else{n=true}}}return i};d.prototype.values=function t(){var e=this._root;var r=[],i=[],n=false;while(!n){if(e){r.push(e);e=e.left}else{if(r.length>0){e=r.pop();i.push(e.data);e=e.right}else{n=true}}}return i};d.prototype.at=function t(e){var r=this._root;var i=[],n=false,o=0;while(!n){if(r){i.push(r);r=r.left}else{if(i.length>0){r=i.pop();if(o===e){return r}o++;r=r.right}else{n=true}}}return null};d.prototype.load=function t(e,r,i){if(e===void 0)e=[];if(r===void 0)r=[];if(i===void 0)i=false;if(this._size!==0){throw new Error("bulk-load: tree is not empty")}var n=e.length;if(i){u(e,r,0,n-1,this._compare)}this._root=s(null,e,r,0,n);this._size=n;return this};d.prototype.min=function t(){var e=this.minNode(this._root);if(e){return e.key}else{return null}};d.prototype.max=function t(){var e=this.maxNode(this._root);if(e){return e.key}else{return null}};d.prototype.isEmpty=function t(){return this._root===null};e.size.get=function(){return this._size};d.createTree=function t(e,r,i,n,o){return new d(i,o).load(e,r,n)};Object.defineProperties(d.prototype,e);function s(t,e,r,i,n){var o=n-i;if(o>0){var f=i+Math.floor(o/2);var a=e[f];var l=r[f];var u={key:a,data:l,parent:t};u.left=s(u,e,r,i,f);u.right=s(u,e,r,f+1,n);return u}return null}function u(t,e,r,i,n){if(r>=i){return}var o=t[r+i>>1];var f=r-1;var a=i+1;while(true){do{f++}while(n(t[f],o)<0);do{a--}while(n(t[a],o)>0);if(f>=a){break}var l=t[f];t[f]=t[a];t[a]=l;l=e[f];e[f]=e[a];e[a]=l}u(t,e,r,a,n);u(t,e,a+1,i,n)}var f=0;var l=1;var h=2;var p=3;var y=0;var a=1;var w=2;var v=3;function E(t,e,r){if(e===null){t.inOut=false;t.otherInOut=true}else{if(t.isSubject===e.isSubject){t.inOut=!e.inOut;t.otherInOut=e.otherInOut}else{t.inOut=!e.otherInOut;t.otherInOut=e.isVertical()?!e.inOut:e.inOut}if(e){t.prevInResult=!n(e,r)||e.isVertical()?e.prevInResult:e}}var i=n(t,r);if(i){t.resultTransition=o(t,r)}else{t.resultTransition=0}}function n(t,e){switch(t.type){case f:switch(e){case y:return!t.otherInOut;case a:return t.otherInOut;case w:return t.isSubject&&t.otherInOut||!t.isSubject&&!t.otherInOut;case v:return true}break;case h:return e===y||e===a;case p:return e===w;case l:return false}return false}function o(t,e){var r=!t.inOut;var i=!t.otherInOut;var n;switch(e){case y:n=r&&i;break;case a:n=r||i;break;case v:n=r^i;break;case w:if(t.isSubject){n=r&&!i}else{n=i&&!r}break}return n?+1:-1}var c=function t(e,r,i,n,o){this.left=r;this.point=e;this.otherEvent=i;this.isSubject=n;this.type=o||f;this.inOut=false;this.otherInOut=false;this.prevInResult=null;this.resultTransition=0;this.otherPos=-1;this.outputContourId=-1;this.isExteriorRing=true};var r={inResult:{configurable:true}};c.prototype.isBelow=function t(e){var r=this.point,i=this.otherEvent.point;return this.left?(r[0]-e[0])*(i[1]-e[1])-(i[0]-e[0])*(r[1]-e[1])>0:(i[0]-e[0])*(r[1]-e[1])-(r[0]-e[0])*(i[1]-e[1])>0};c.prototype.isAbove=function t(e){return!this.isBelow(e)};c.prototype.isVertical=function t(){return this.point[0]===this.otherEvent.point[0]};r.inResult.get=function(){return this.resultTransition!==0};c.prototype.clone=function t(){var e=new c(this.point,this.left,this.otherEvent,this.isSubject,this.type);e.contourId=this.contourId;e.resultTransition=this.resultTransition;e.prevInResult=this.prevInResult;e.isExteriorRing=this.isExteriorRing;e.inOut=this.inOut;e.otherInOut=this.otherInOut;return e};Object.defineProperties(c.prototype,r);function g(t,e){if(t[0]===e[0]){if(t[1]===e[1]){return true}else{return false}}return false}var I=11102230246251565e-32;var T=134217729;var L=(3+8*I)*I;function B(t,e,r,i,n){var o,f,a,l;var u=e[0];var s=i[0];var h=0;var p=0;if(s>u===s>-u){o=u;u=e[++h]}else{o=s;s=i[++p]}var v=0;if(hu===s>-u){f=u+o;a=o-(f-u);u=e[++h]}else{f=s+o;a=o-(f-s);s=i[++p]}o=f;if(a!==0){n[v++]=a}while(hu===s>-u){f=o+u;l=f-o;a=o-(f-l)+(u-l);u=e[++h]}else{f=o+s;l=f-o;a=o-(f-l)+(s-l);s=i[++p]}o=f;if(a!==0){n[v++]=a}}}while(h=N||-S>=N){return S}h=t-m;a=t-(m+h)+(h-n);h=r-R;u=r-(R+h)+(h-n);h=e-j;l=e-(j+h)+(h-o);h=i-x;s=i-(x+h)+(h-o);if(a===0&&l===0&&u===0&&s===0){return S}N=D*f+L*Math.abs(S);S+=m*s+x*a-(j*u+R*l);if(S>=N||-S>=N){return S}I=a*x;p=T*a;v=p-(p-a);c=a-v;p=T*x;g=p-(p-x);d=x-g;_=c*d-(I-v*g-c*g-v*d);b=l*R;p=T*l;v=p-(p-l);c=l-v;p=T*R;g=p-(p-R);d=R-g;O=c*d-(b-v*g-c*g-v*d);y=_-O;h=_-y;q[0]=_-(y+h)+(h-O);w=I+y;h=w-I;E=I-(w-h)+(y-h);y=E-b;h=E-y;q[1]=E-(y+h)+(h-b);k=w+y;h=k-w;q[2]=w-(k-h)+(y-h);q[3]=k;var z=B(4,F,4,q,V);I=m*s;p=T*m;v=p-(p-m);c=m-v;p=T*s;g=p-(p-s);d=s-g;_=c*d-(I-v*g-c*g-v*d);b=j*u;p=T*j;v=p-(p-j);c=j-v;p=T*u;g=p-(p-u);d=u-g;O=c*d-(b-v*g-c*g-v*d);y=_-O;h=_-y;q[0]=_-(y+h)+(h-O);w=I+y;h=w-I;E=I-(w-h)+(y-h);y=E-b;h=E-y;q[1]=E-(y+h)+(h-b);k=w+y;h=k-w;q[2]=w-(k-h)+(y-h);q[3]=k;var M=B(z,V,4,q,U);I=a*s;p=T*a;v=p-(p-a);c=a-v;p=T*s;g=p-(p-s);d=s-g;_=c*d-(I-v*g-c*g-v*d);b=l*u;p=T*l;v=p-(p-l);c=l-v;p=T*u;g=p-(p-u);d=u-g;O=c*d-(b-v*g-c*g-v*d);y=_-O;h=_-y;q[0]=_-(y+h)+(h-O);w=I+y;h=w-I;E=I-(w-h)+(y-h);y=E-b;h=E-y;q[1]=E-(y+h)+(h-b);k=w+y;h=k-w;q[2]=w-(k-h)+(y-h);q[3]=k;var P=B(M,U,4,q,X);return X[P-1]}function k(t,e,r,i,n,o){var f=(e-o)*(r-n);var a=(t-n)*(i-o);var l=f-a;if(f===0||a===0||f>0!==a>0){return l}var u=Math.abs(f+a);if(Math.abs(l)>=b*u){return l}return-O(t,e,r,i,n,o,u)}function m(t,e,r){var i=k(t[0],t[1],e[0],e[1],r[0],r[1]);if(i>0){return-1}if(i<0){return 1}return 0}function R(t,e){var r=t.point;var i=e.point;if(r[0]>i[0]){return 1}if(r[0]i[1]?1:-1}return j(t,e,r)}function j(t,e,r,i){if(t.left!==e.left){return t.left?1:-1}if(m(r,t.otherEvent.point,e.otherEvent.point)!==0){return!t.isBelow(e.otherEvent.point)?1:-1}return!t.isSubject&&e.isSubject?1:-1}function x(t,e,r){var i=new c(e,false,t,t.isSubject);var n=new c(e,true,t.otherEvent,t.isSubject);if(g(t.point,t.otherEvent.point)){console.warn("what is that, a collapsed segment?",t)}i.contourId=n.contourId=t.contourId;if(R(n,t.otherEvent)>0){t.otherEvent.left=true;n.left=false}t.otherEvent.otherEvent=n;t.otherEvent=i;r.push(n);r.push(i);return r}function S(t,e){return t[0]*e[1]-t[1]*e[0]}function N(t,e){return t[0]*e[0]+t[1]*e[1]}function z(t,e,r,i,n){var o=[e[0]-t[0],e[1]-t[1]];var f=[i[0]-r[0],i[1]-r[1]];function a(t,e,r){return[t[0]+e*r[0],t[1]+e*r[1]]}var l=[r[0]-t[0],r[1]-t[1]];var u=S(o,f);var s=u*u;var h=N(o,o);if(s>0){var p=S(l,f)/u;if(p<0||p>1){return null}var v=S(l,o)/u;if(v<0||v>1){return null}if(p===0||p===1){return n?null:[a(t,p,o)]}if(v===0||v===1){return n?null:[a(r,v,f)]}return[a(t,p,o)]}u=S(l,o);s=u*u;if(s>0){return null}var c=N(o,l)/h;var g=c+N(o,f)/h;var d=Math.min(c,g);var y=Math.max(c,g);if(d<=1&&y>=0){if(d===1){return n?null:[a(t,d>0?d:0,o)]}if(y===0){return n?null:[a(t,y<1?y:1,o)]}if(n&&d===0&&y===1){return null}return[a(t,d>0?d:0,o),a(t,y<1?y:1,o)]}return null}function M(t,e,r){var i=z(t.point,t.otherEvent.point,e.point,e.otherEvent.point);var n=i?i.length:0;if(n===0){return 0}if(n===1&&(g(t.point,e.point)||g(t.otherEvent.point,e.otherEvent.point))){return 0}if(n===2&&t.isSubject===e.isSubject){return 0}if(n===1){if(!g(t.point,i[0])&&!g(t.otherEvent.point,i[0])){x(t,i[0],r)}if(!g(e.point,i[0])&&!g(e.otherEvent.point,i[0])){x(e,i[0],r)}return 1}var o=[];var f=false;var a=false;if(g(t.point,e.point)){f=true}else if(R(t,e)===1){o.push(e,t)}else{o.push(t,e)}if(g(t.otherEvent.point,e.otherEvent.point)){a=true}else if(R(t.otherEvent,e.otherEvent)===1){o.push(e.otherEvent,t.otherEvent)}else{o.push(t.otherEvent,e.otherEvent)}if(f&&a||f){e.type=l;t.type=e.inOut===t.inOut?h:p;if(f&&!a){x(o[1].otherEvent,o[0].point,r)}return 2}if(a){x(o[0],o[1].point,r);return 3}if(o[0]!==o[3].otherEvent){x(o[0],o[1].point,r);x(o[1],o[2].point,r);return 3}x(o[0],o[1].point,r);x(o[3].otherEvent,o[2].point,r);return 3}function P(t,e){if(t===e){return 0}if(m(t.point,t.otherEvent.point,e.point)!==0||m(t.point,t.otherEvent.point,e.otherEvent.point)!==0){if(g(t.point,e.point)){return t.isBelow(e.otherEvent.point)?-1:1}if(t.point[0]===e.point[0]){return t.point[1]e.contourId?1:-1}}}else{return t.isSubject?-1:1}return R(t,e)===1?1:-1}function G(t,e,r,i,n,o){var f=new d(P);var a=[];var l=Math.min(i[2],n[2]);var u,s,h;while(t.length!==0){var p=t.pop();a.push(p);if(o===y&&p.point[0]>l||o===w&&p.point[0]>i[2]){break}if(p.left){s=u=f.insert(p);h=f.minNode();if(u!==h){u=f.prev(u)}else{u=null}s=f.next(s);var v=u?u.key:null;var c=void 0;E(p,v,o);if(s){if(M(p,s.key,t)===2){E(p,v,o);E(p,s.key,o)}}if(u){if(M(u.key,p,t)===2){var g=u;if(g!==h){g=f.prev(g)}else{g=null}c=g?g.key:null;E(v,c,o);E(p,v,o)}}}else{p=p.otherEvent;s=u=f.find(p);if(u&&s){if(u!==h){u=f.prev(u)}else{u=null}s=f.next(s);f.remove(p);if(s&&u){M(u.key,s.key,t)}}}}return a}var H=function t(){this.points=[];this.holeIds=[];this.holeOf=null;this.depth=null};H.prototype.isExterior=function t(){return this.holeOf==null};function J(t){var e,r,i,n;var o=[];for(r=0,i=t.length;ri){n--}return n}function Q(t,e,r){var i=new H;if(t.prevInResult!=null){var n=t.prevInResult;var o=n.outputContourId;var f=n.resultTransition;if(f>0){var a=e[o];if(a.holeOf!=null){var l=a.holeOf;e[l].holeIds.push(r);i.holeOf=l;i.depth=e[o].depth}else{e[o].holeIds.push(r);i.holeOf=o;i.depth=e[o].depth+1}}else{i.holeOf=null;i.depth=e[o].depth}}else{i.holeOf=null;i.depth=0}return i}function W(t){var f,e;var a=J(t);var l={};var u=[];var r=function(){if(l[f]){return}var e=u.length;var t=Q(a[f],u,e);var r=function(t){l[t]=true;a[t].outputContourId=e};var i=f;var n=f;var o=a[f].point;t.points.push(o);while(true){r(i);i=a[i].otherPos;r(i);t.points.push(a[i].point);i=K(i,a,l,n);if(i==n){break}}u.push(t)};for(f=0,e=a.length;f0){for(var r=(this.length>>1)-1;r>=0;r--){this._down(r)}}}function tt(t,e){return te?1:0}$.prototype={push:function(t){this.data.push(t);this.length++;this._up(this.length-1)},pop:function(){if(this.length===0){return undefined}var t=this.data[0];this.length--;if(this.length>0){this.data[0]=this.data[this.length];this._down(0)}this.data.pop();return t},peek:function(){return this.data[0]},_up:function(t){var e=this.data;var r=this.compare;var i=e[t];while(t>0){var n=t-1>>1;var o=e[n];if(r(i,o)>=0){break}e[t]=o;t=n}e[t]=i},_down:function(t){var e=this.data;var r=this.compare;var i=this.length>>1;var n=e[t];while(t=0){break}e[t]=a;t=o}e[t]=n}};Y.default=Z;var et=Math.max;var rt=Math.min;var it=0;function nt(t,e,r,i,n,o){var f,a,l,u,s,h;for(f=0,a=t.length-1;f0){h.left=true}else{s.left=true}var p=l[0],v=l[1];n[0]=rt(n[0],p);n[1]=rt(n[1],v);n[2]=et(n[2],p);n[3]=et(n[3],v);i.push(s);i.push(h)}}function ot(t,e,r,i,n){var o=new Y(null,R);var f,a,l,u,s,h;for(l=0,u=t.length;li[2]||i[0]>r[2]||r[1]>i[3]||i[1]>r[3]){if(n===y){o=ft}else if(n===w){o=t}else if(n===a||n===v){o=t.concat(e)}}return o}function ut(t,e,r){if(typeof t[0][0][0]==="number"){t=[t]}if(typeof e[0][0][0]==="number"){e=[e]}var i=at(t,e,r);if(i){return i===ft?null:i}var n=[Infinity,Infinity,-Infinity,-Infinity];var o=[Infinity,Infinity,-Infinity,-Infinity];var f=ot(t,e,n,o,r);i=lt(t,e,n,o,r);if(i){return i===ft?null:i}var a=G(f,t,e,n,o,r);var l=W(a);var u=[];for(var s=0;s}p @@ -805,19 +840,31 @@ }; + /** + * Does event belong to result? + * @return {Boolean} + */ + prototypeAccessors$1.inResult.get = function () { + return this.resultTransition !== 0; + }; + + SweepEvent.prototype.clone = function clone () { var copy = new SweepEvent( this.point, this.left, this.otherEvent, this.isSubject, this.type); - copy.inResult = this.inResult; - copy.prevInResult = this.prevInResult; + copy.contourId = this.contourId; + copy.resultTransition = this.resultTransition; + copy.prevInResult = this.prevInResult; copy.isExteriorRing = this.isExteriorRing; - copy.inOut = this.inOut; - copy.otherInOut = this.otherInOut; + copy.inOut = this.inOut; + copy.otherInOut = this.otherInOut; return copy; }; + Object.defineProperties( SweepEvent.prototype, prototypeAccessors$1 ); + function equals(p1, p2) { if (p1[0] === p2[0]) { if (p1[1] === p2[1]) { @@ -1174,7 +1221,6 @@ /* eslint-disable no-console */ if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that, a collapsed segment?', se); } /* eslint-enable no-console */ @@ -1564,6 +1610,17 @@ return sortedEvents; } + var Contour = function Contour() { + this.points = []; + this.holeIds = []; + this.holeOf = null; + this.depth = null; + }; + + Contour.prototype.isExterior = function isExterior () { + return this.holeOf == null; + }; + /** * @param {Array.} sortedEvents * @return {Array.} @@ -1596,7 +1653,7 @@ for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; - event.pos = i; + event.otherPos = i; } // imagine, the right event is found in the beginning of the queue, @@ -1604,9 +1661,9 @@ for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; if (!event.left) { - tmp = event.pos; - event.pos = event.otherEvent.pos; - event.otherEvent.pos = tmp; + tmp = event.otherPos; + event.otherPos = event.otherEvent.otherPos; + event.otherEvent.otherPos = tmp; } } @@ -1620,18 +1677,15 @@ * @param {Object>} processed * @return {Number} */ - function nextPos(pos, resultEvents, processed, origIndex) { - var p, p1; - var newPos = pos + 1; + function nextPos(pos, resultEvents, processed, origPos) { + var newPos = pos + 1, + p = resultEvents[pos].point, + p1; var length = resultEvents.length; - p = resultEvents[pos].point; - if (newPos < length) { p1 = resultEvents[newPos].point; } - - // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { return newPos; @@ -1643,80 +1697,110 @@ newPos = pos - 1; - while (processed[newPos] && newPos >= origIndex) { + while (processed[newPos] && newPos > origPos) { newPos--; } + return newPos; } + function initializeContourFromContext(event, contours, contourId) { + var contour = new Contour(); + if (event.prevInResult != null) { + var prevInResult = event.prevInResult; + // Note that it is valid to query the "previous in result" for its output contour id, + // because we must have already processed it (i.e., assigned an output contour id) + // in an earlier iteration, otherwise it wouldn't be possible that it is "previous in + // result". + var lowerContourId = prevInResult.outputContourId; + var lowerResultTransition = prevInResult.resultTransition; + if (lowerResultTransition > 0) { + // We are inside. Now we have to check if the thing below us is another hole or + // an exterior contour. + var lowerContour = contours[lowerContourId]; + if (lowerContour.holeOf != null) { + // The lower contour is a hole => Connect the new contour as a hole to its parent, + // and use same depth. + var parentContourId = lowerContour.holeOf; + contours[parentContourId].holeIds.push(contourId); + contour.holeOf = parentContourId; + contour.depth = contours[lowerContourId].depth; + } else { + // The lower contour is an exterior contour => Connect the new contour as a hole, + // and increment depth. + contours[lowerContourId].holeIds.push(contourId); + contour.holeOf = lowerContourId; + contour.depth = contours[lowerContourId].depth + 1; + } + } else { + // We are outside => this contour is an exterior contour of same depth. + contour.holeOf = null; + contour.depth = contours[lowerContourId].depth; + } + } else { + // There is no lower/previous contour => this contour is an exterior contour of depth 0. + contour.holeOf = null; + contour.depth = 0; + } + return contour; + } + /** * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ - function connectEdges(sortedEvents, operation) { + function connectEdges(sortedEvents) { var i, len; var resultEvents = orderEvents(sortedEvents); // "false"-filled array var processed = {}; - var result = []; - var event; + var contours = []; - for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) { continue; } - var contour = [[]]; - - if (!resultEvents[i].isExteriorRing) { - if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length === 0) { - result.push(contour); - } else if (result.length === 0) { - result.push([[contour]]); - } else { - result[result.length - 1].push(contour[0]); - } - } else if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) { - result[result.length - 1].push(contour[0]); - } else { - result.push(contour); + var loop = function ( ) { + + if (processed[i]) { + return; } - var ringId = result.length - 1; + var contourId = contours.length; + var contour = initializeContourFromContext(resultEvents[i], contours, contourId); + + // Helper function that combines marking an event as processed with assigning its output contour ID + var markAsProcessed = function (pos) { + processed[pos] = true; + resultEvents[pos].outputContourId = contourId; + }; + var pos = i; + var origPos = i; var initial = resultEvents[i].point; - contour[0].push(initial); + contour.points.push(initial); - while (pos >= i) { - event = resultEvents[pos]; - processed[pos] = true; + /* eslint no-constant-condition: "off" */ + while (true) { + markAsProcessed(pos); - if (event.left) { - event.resultInOut = false; - event.contourId = ringId; - } else { - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } + pos = resultEvents[pos].otherPos; - pos = event.pos; - processed[pos] = true; - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed, i); + markAsProcessed(pos); + contour.points.push(resultEvents[pos].point); + + pos = nextPos(pos, resultEvents, processed, origPos); + + if (pos == origPos) { + break; + } } - pos = pos === -1 ? i : pos; + contours.push(contour); + }; - event = resultEvents[pos]; - processed[pos] = processed[event.pos] = true; - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } + for (i = 0, len = resultEvents.length; i < len; i++) loop( ); - // Handle if the result is a polygon (eg not multipoly) - // Commented it again, let's see what do we mean by that - // if (result.length === 1) result = result[0]; - return result; + return contours; } var tinyqueue = TinyQueue; @@ -1929,7 +2013,7 @@ var sbbox = [Infinity, Infinity, -Infinity, -Infinity]; var cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - //console.time('fill queue'); + // console.time('fill queue'); var eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation); //console.timeEnd('fill queue'); @@ -1937,14 +2021,31 @@ if (trivial) { return trivial === EMPTY ? null : trivial; } - //console.time('subdivide edges'); + // console.time('subdivide edges'); var sortedEvents = subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation); //console.timeEnd('subdivide edges'); - //console.time('connect vertices'); - var result = connectEdges(sortedEvents, operation); + // console.time('connect vertices'); + var contours = connectEdges(sortedEvents); //console.timeEnd('connect vertices'); - return result; + + // Convert contours to polygons + var polygons = []; + for (var i = 0; i < contours.length; i++) { + var contour = contours[i]; + if (contour.isExterior()) { + // The exterior ring goes first + var rings = [contour.points]; + // Followed by holes if any + for (var j = 0; j < contour.holeIds.length; j++) { + var holeId = contour.holeIds[j]; + rings.push(contours[holeId].points); + } + polygons.push(rings); + } + } + + return polygons; } function union (subject, clipping) { @@ -1955,7 +2056,7 @@ return boolean(subject, clipping, DIFFERENCE); } - function xor (subject, clipping){ + function xor (subject, clipping) { return boolean(subject, clipping, XOR); } diff --git a/dist/martinez.umd.js.map b/dist/martinez.umd.js.map index 716773c..f841bfb 100644 --- a/dist/martinez.umd.js.map +++ b/dist/martinez.umd.js.map @@ -1 +1 @@ -{"version":3,"file":"martinez.umd.js","sources":["../node_modules/splaytree/index.js","../src/edge_type.js","../src/operation.js","../src/compute_fields.js","../src/sweep_event.js","../src/equals.js","../node_modules/robust-predicates/esm/util.js","../node_modules/robust-predicates/esm/orient2d.js","../src/signed_area.js","../src/compare_events.js","../src/divide_segment.js","../src/segment_intersection.js","../src/possible_intersection.js","../src/compare_segments.js","../src/subdivide_segments.js","../src/connect_edges.js","../node_modules/tinyqueue/index.js","../src/fill_queue.js","../src/index.js","../index.js"],"sourcesContent":["function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }\n\nexport default class SplayTree {\n\n constructor(compare = DEFAULT_COMPARE, noDuplicates = false) {\n this._compare = compare;\n this._root = null;\n this._size = 0;\n this._noDuplicates = !!noDuplicates;\n }\n\n\n rotateLeft(x) {\n var y = x.right;\n if (y) {\n x.right = y.left;\n if (y.left) y.left.parent = x;\n y.parent = x.parent;\n }\n\n if (!x.parent) this._root = y;\n else if (x === x.parent.left) x.parent.left = y;\n else x.parent.right = y;\n if (y) y.left = x;\n x.parent = y;\n }\n\n\n rotateRight(x) {\n var y = x.left;\n if (y) {\n x.left = y.right;\n if (y.right) y.right.parent = x;\n y.parent = x.parent;\n }\n\n if (!x.parent) this._root = y;\n else if(x === x.parent.left) x.parent.left = y;\n else x.parent.right = y;\n if (y) y.right = x;\n x.parent = y;\n }\n\n\n _splay(x) {\n while (x.parent) {\n var p = x.parent;\n if (!p.parent) {\n if (p.left === x) this.rotateRight(p);\n else this.rotateLeft(p);\n } else if (p.left === x && p.parent.left === p) {\n this.rotateRight(p.parent);\n this.rotateRight(p);\n } else if (p.right === x && p.parent.right === p) {\n this.rotateLeft(p.parent);\n this.rotateLeft(p);\n } else if (p.left === x && p.parent.right === p) {\n this.rotateRight(p);\n this.rotateLeft(p);\n } else {\n this.rotateLeft(p);\n this.rotateRight(p);\n }\n }\n }\n\n\n splay(x) {\n var p, gp, ggp, l, r;\n\n while (x.parent) {\n p = x.parent;\n gp = p.parent;\n\n if (gp && gp.parent) {\n ggp = gp.parent;\n if (ggp.left === gp) ggp.left = x;\n else ggp.right = x;\n x.parent = ggp;\n } else {\n x.parent = null;\n this._root = x;\n }\n\n l = x.left; r = x.right;\n\n if (x === p.left) { // left\n if (gp) {\n if (gp.left === p) {\n /* zig-zig */\n if (p.right) {\n gp.left = p.right;\n gp.left.parent = gp;\n } else gp.left = null;\n\n p.right = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (l) {\n gp.right = l;\n l.parent = gp;\n } else gp.right = null;\n\n x.left = gp;\n gp.parent = x;\n }\n }\n if (r) {\n p.left = r;\n r.parent = p;\n } else p.left = null;\n\n x.right = p;\n p.parent = x;\n } else { // right\n if (gp) {\n if (gp.right === p) {\n /* zig-zig */\n if (p.left) {\n gp.right = p.left;\n gp.right.parent = gp;\n } else gp.right = null;\n\n p.left = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (r) {\n gp.left = r;\n r.parent = gp;\n } else gp.left = null;\n\n x.right = gp;\n gp.parent = x;\n }\n }\n if (l) {\n p.right = l;\n l.parent = p;\n } else p.right = null;\n\n x.left = p;\n p.parent = x;\n }\n }\n }\n\n\n replace(u, v) {\n if (!u.parent) this._root = v;\n else if (u === u.parent.left) u.parent.left = v;\n else u.parent.right = v;\n if (v) v.parent = u.parent;\n }\n\n\n minNode(u = this._root) {\n if (u) while (u.left) u = u.left;\n return u;\n }\n\n\n maxNode(u = this._root) {\n if (u) while (u.right) u = u.right;\n return u;\n }\n\n\n insert(key, data) {\n var z = this._root;\n var p = null;\n var comp = this._compare;\n var cmp;\n\n if (this._noDuplicates) {\n while (z) {\n p = z;\n cmp = comp(z.key, key);\n if (cmp === 0) return;\n else if (comp(z.key, key) < 0) z = z.right;\n else z = z.left;\n }\n } else {\n while (z) {\n p = z;\n if (comp(z.key, key) < 0) z = z.right;\n else z = z.left;\n }\n }\n\n z = { key, data, left: null, right: null, parent: p };\n\n if (!p) this._root = z;\n else if (comp(p.key, z.key) < 0) p.right = z;\n else p.left = z;\n\n this.splay(z);\n this._size++;\n return z;\n }\n\n\n find (key) {\n var z = this._root;\n var comp = this._compare;\n while (z) {\n var cmp = comp(z.key, key);\n if (cmp < 0) z = z.right;\n else if (cmp > 0) z = z.left;\n else return z;\n }\n return null;\n }\n\n /**\n * Whether the tree contains a node with the given key\n * @param {Key} key\n * @return {boolean} true/false\n */\n contains (key) {\n var node = this._root;\n var comparator = this._compare;\n while (node) {\n var cmp = comparator(key, node.key);\n if (cmp === 0) return true;\n else if (cmp < 0) node = node.left;\n else node = node.right;\n }\n\n return false;\n }\n\n\n remove (key) {\n var z = this.find(key);\n\n if (!z) return false;\n\n this.splay(z);\n\n if (!z.left) this.replace(z, z.right);\n else if (!z.right) this.replace(z, z.left);\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n }\n\n\n removeNode(z) {\n if (!z) return false;\n\n this.splay(z);\n\n if (!z.left) this.replace(z, z.right);\n else if (!z.right) this.replace(z, z.left);\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n }\n\n\n erase (key) {\n var z = this.find(key);\n if (!z) return;\n\n this.splay(z);\n\n var s = z.left;\n var t = z.right;\n\n var sMax = null;\n if (s) {\n s.parent = null;\n sMax = this.maxNode(s);\n this.splay(sMax);\n this._root = sMax;\n }\n if (t) {\n if (s) sMax.right = t;\n else this._root = t;\n t.parent = sMax;\n }\n\n this._size--;\n }\n\n /**\n * Removes and returns the node with smallest key\n * @return {?Node}\n */\n pop () {\n var node = this._root, returnValue = null;\n if (node) {\n while (node.left) node = node.left;\n returnValue = { key: node.key, data: node.data };\n this.remove(node.key);\n }\n return returnValue;\n }\n\n\n /* eslint-disable class-methods-use-this */\n\n /**\n * Successor node\n * @param {Node} node\n * @return {?Node}\n */\n next (node) {\n var successor = node;\n if (successor) {\n if (successor.right) {\n successor = successor.right;\n while (successor && successor.left) successor = successor.left;\n } else {\n successor = node.parent;\n while (successor && successor.right === node) {\n node = successor; successor = successor.parent;\n }\n }\n }\n return successor;\n }\n\n\n /**\n * Predecessor node\n * @param {Node} node\n * @return {?Node}\n */\n prev (node) {\n var predecessor = node;\n if (predecessor) {\n if (predecessor.left) {\n predecessor = predecessor.left;\n while (predecessor && predecessor.right) predecessor = predecessor.right;\n } else {\n predecessor = node.parent;\n while (predecessor && predecessor.left === node) {\n node = predecessor;\n predecessor = predecessor.parent;\n }\n }\n }\n return predecessor;\n }\n /* eslint-enable class-methods-use-this */\n\n\n /**\n * @param {forEachCallback} callback\n * @return {SplayTree}\n */\n forEach(callback) {\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n // Reach the left most Node of the current Node\n if (current) {\n // Place pointer to a tree node on the stack\n // before traversing the node's left subtree\n s.push(current);\n current = current.left;\n } else {\n // BackTrack from the empty subtree and visit the Node\n // at the top of the stack; however, if the stack is\n // empty you are done\n if (s.length > 0) {\n current = s.pop();\n callback(current, i++);\n\n // We have visited the node and its left\n // subtree. Now, it's right subtree's turn\n current = current.right;\n } else done = true;\n }\n }\n return this;\n }\n\n\n /**\n * Walk key range from `low` to `high`. Stops if `fn` returns a value.\n * @param {Key} low\n * @param {Key} high\n * @param {Function} fn\n * @param {*?} ctx\n * @return {SplayTree}\n */\n range(low, high, fn, ctx) {\n const Q = [];\n const compare = this._compare;\n let node = this._root, cmp;\n\n while (Q.length !== 0 || node) {\n if (node) {\n Q.push(node);\n node = node.left;\n } else {\n node = Q.pop();\n cmp = compare(node.key, high);\n if (cmp > 0) {\n break;\n } else if (compare(node.key, low) >= 0) {\n if (fn.call(ctx, node)) return this; // stop if smth is returned\n }\n node = node.right;\n }\n }\n return this;\n }\n\n /**\n * Returns all keys in order\n * @return {Array}\n */\n keys () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.key);\n current = current.right;\n } else done = true;\n }\n }\n return r;\n }\n\n\n /**\n * Returns `data` fields of all nodes in order.\n * @return {Array}\n */\n values () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.data);\n current = current.right;\n } else done = true;\n }\n }\n return r;\n }\n\n\n /**\n * Returns node at given index\n * @param {number} index\n * @return {?Node}\n */\n at (index) {\n // removed after a consideration, more misleading than useful\n // index = index % this.size;\n // if (index < 0) index = this.size - index;\n\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n if (i === index) return current;\n i++;\n current = current.right;\n } else done = true;\n }\n }\n return null;\n }\n\n /**\n * Bulk-load items. Both array have to be same size\n * @param {Array} keys\n * @param {Array} [values]\n * @param {Boolean} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @return {AVLTree}\n */\n load(keys = [], values = [], presort = false) {\n if (this._size !== 0) throw new Error('bulk-load: tree is not empty');\n const size = keys.length;\n if (presort) sort(keys, values, 0, size - 1, this._compare);\n this._root = loadRecursive(null, keys, values, 0, size);\n this._size = size;\n return this;\n }\n\n\n min() {\n var node = this.minNode(this._root);\n if (node) return node.key;\n else return null;\n }\n\n\n max() {\n var node = this.maxNode(this._root);\n if (node) return node.key;\n else return null;\n }\n\n isEmpty() { return this._root === null; }\n get size() { return this._size; }\n\n\n /**\n * Create a tree and load it with items\n * @param {Array} keys\n * @param {Array?} [values]\n\n * @param {Function?} [comparator]\n * @param {Boolean?} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @param {Boolean?} [noDuplicates=false] Allow duplicates\n * @return {SplayTree}\n */\n static createTree(keys, values, comparator, presort, noDuplicates) {\n return new SplayTree(comparator, noDuplicates).load(keys, values, presort);\n }\n}\n\n\nfunction loadRecursive (parent, keys, values, start, end) {\n const size = end - start;\n if (size > 0) {\n const middle = start + Math.floor(size / 2);\n const key = keys[middle];\n const data = values[middle];\n const node = { key, data, parent };\n node.left = loadRecursive(node, keys, values, start, middle);\n node.right = loadRecursive(node, keys, values, middle + 1, end);\n return node;\n }\n return null;\n}\n\n\nfunction sort(keys, values, left, right, compare) {\n if (left >= right) return;\n\n const pivot = keys[(left + right) >> 1];\n let i = left - 1;\n let j = right + 1;\n\n while (true) {\n do i++; while (compare(keys[i], pivot) < 0);\n do j--; while (compare(keys[j], pivot) > 0);\n if (i >= j) break;\n\n let tmp = keys[i];\n keys[i] = keys[j];\n keys[j] = tmp;\n\n tmp = values[i];\n values[i] = values[j];\n values[j] = tmp;\n }\n\n sort(keys, values, left, j, compare);\n sort(keys, values, j + 1, right, compare);\n}\n","export const NORMAL = 0;\nexport const NON_CONTRIBUTING = 1;\nexport const SAME_TRANSITION = 2;\nexport const DIFFERENT_TRANSITION = 3;\n","export const INTERSECTION = 0;\nexport const UNION = 1;\nexport const DIFFERENCE = 2;\nexport const XOR = 3;\n","import {\n NORMAL,\n SAME_TRANSITION,\n DIFFERENT_TRANSITION,\n NON_CONTRIBUTING\n} from './edge_type';\nimport {\n INTERSECTION,\n UNION,\n DIFFERENCE,\n XOR\n} from './operation';\n\n/**\n * @param {SweepEvent} event\n * @param {SweepEvent} prev\n * @param {Operation} operation\n */\nexport default function computeFields (event, prev, operation) {\n // compute inOut and otherInOut fields\n if (prev === null) {\n event.inOut = false;\n event.otherInOut = true;\n\n // previous line segment in sweepline belongs to the same polygon\n } else {\n if (event.isSubject === prev.isSubject) {\n event.inOut = !prev.inOut;\n event.otherInOut = prev.otherInOut;\n\n // previous line segment in sweepline belongs to the clipping polygon\n } else {\n event.inOut = !prev.otherInOut;\n event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut;\n }\n\n // compute prevInResult field\n if (prev) {\n event.prevInResult = (!inResult(prev, operation) || prev.isVertical())\n ? prev.prevInResult : prev;\n }\n }\n\n // check if the line segment belongs to the Boolean operation\n event.inResult = inResult(event, operation);\n}\n\n\n/* eslint-disable indent */\nfunction inResult(event, operation) {\n switch (event.type) {\n case NORMAL:\n switch (operation) {\n case INTERSECTION:\n return !event.otherInOut;\n case UNION:\n return event.otherInOut;\n case DIFFERENCE:\n // return (event.isSubject && !event.otherInOut) ||\n // (!event.isSubject && event.otherInOut);\n return (event.isSubject && event.otherInOut) ||\n (!event.isSubject && !event.otherInOut);\n case XOR:\n return true;\n }\n break;\n case SAME_TRANSITION:\n return operation === INTERSECTION || operation === UNION;\n case DIFFERENT_TRANSITION:\n return operation === DIFFERENCE;\n case NON_CONTRIBUTING:\n return false;\n }\n return false;\n}\n/* eslint-enable indent */\n","import { NORMAL } from './edge_type';\n\n\nexport default class SweepEvent {\n\n\n /**\n * Sweepline event\n *\n * @class {SweepEvent}\n * @param {Array.} point\n * @param {Boolean} left\n * @param {SweepEvent=} otherEvent\n * @param {Boolean} isSubject\n * @param {Number} edgeType\n */\n constructor (point, left, otherEvent, isSubject, edgeType) {\n\n /**\n * Is left endpoint?\n * @type {Boolean}\n */\n this.left = left;\n\n /**\n * @type {Array.}\n */\n this.point = point;\n\n /**\n * Other edge reference\n * @type {SweepEvent}\n */\n this.otherEvent = otherEvent;\n\n /**\n * Belongs to source or clipping polygon\n * @type {Boolean}\n */\n this.isSubject = isSubject;\n\n /**\n * Edge contribution type\n * @type {Number}\n */\n this.type = edgeType || NORMAL;\n\n\n /**\n * In-out transition for the sweepline crossing polygon\n * @type {Boolean}\n */\n this.inOut = false;\n\n\n /**\n * @type {Boolean}\n */\n this.otherInOut = false;\n\n /**\n * Previous event in result?\n * @type {SweepEvent}\n */\n this.prevInResult = null;\n\n /**\n * Does event belong to result?\n * @type {Boolean}\n */\n this.inResult = false;\n\n\n // connection step\n\n /**\n * @type {Boolean}\n */\n this.resultInOut = false;\n\n this.isExteriorRing = true;\n }\n\n\n /**\n * @param {Array.} p\n * @return {Boolean}\n */\n isBelow (p) {\n const p0 = this.point, p1 = this.otherEvent.point;\n return this.left\n ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0\n // signedArea(this.point, this.otherEvent.point, p) > 0 :\n : (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0;\n //signedArea(this.otherEvent.point, this.point, p) > 0;\n }\n\n\n /**\n * @param {Array.} p\n * @return {Boolean}\n */\n isAbove (p) {\n return !this.isBelow(p);\n }\n\n\n /**\n * @return {Boolean}\n */\n isVertical () {\n return this.point[0] === this.otherEvent.point[0];\n }\n\n\n clone () {\n const copy = new SweepEvent(\n this.point, this.left, this.otherEvent, this.isSubject, this.type);\n\n copy.inResult = this.inResult;\n copy.prevInResult = this.prevInResult;\n copy.isExteriorRing = this.isExteriorRing;\n copy.inOut = this.inOut;\n copy.otherInOut = this.otherInOut;\n\n return copy;\n }\n}\n","export default function equals(p1, p2) {\n if (p1[0] === p2[0]) {\n if (p1[1] === p2[1]) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}\n\n// const EPSILON = 1e-9;\n// const abs = Math.abs;\n// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164\n// Precision problem.\n//\n// module.exports = function equals(p1, p2) {\n// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON;\n// };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","import {orient2d} from 'robust-predicates';\n\n/**\n * Signed area of the triangle (p0, p1, p2)\n * @param {Array.} p0\n * @param {Array.} p1\n * @param {Array.} p2\n * @return {Number}\n */\nexport default function signedArea(p0, p1, p2) {\n const res = orient2d(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);\n if (res > 0) return -1;\n if (res < 0) return 1;\n return 0;\n}\n","import signedArea from './signed_area';\n\n/**\n * @param {SweepEvent} e1\n * @param {SweepEvent} e2\n * @return {Number}\n */\nexport default function compareEvents(e1, e2) {\n const p1 = e1.point;\n const p2 = e2.point;\n\n // Different x-coordinate\n if (p1[0] > p2[0]) return 1;\n if (p1[0] < p2[0]) return -1;\n\n // Different points, but same x-coordinate\n // Event with lower y-coordinate is processed first\n if (p1[1] !== p2[1]) return p1[1] > p2[1] ? 1 : -1;\n\n return specialCases(e1, e2, p1, p2);\n}\n\n\n/* eslint-disable no-unused-vars */\nfunction specialCases(e1, e2, p1, p2) {\n // Same coordinates, but one is a left endpoint and the other is\n // a right endpoint. The right endpoint is processed first\n if (e1.left !== e2.left)\n return e1.left ? 1 : -1;\n\n // const p2 = e1.otherEvent.point, p3 = e2.otherEvent.point;\n // const sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1])\n // Same coordinates, both events\n // are left endpoints or right endpoints.\n // not collinear\n if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) {\n // the event associate to the bottom segment is processed first\n return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1;\n }\n\n return (!e1.isSubject && e2.isSubject) ? 1 : -1;\n}\n/* eslint-enable no-unused-vars */\n","import SweepEvent from './sweep_event';\nimport equals from './equals';\nimport compareEvents from './compare_events';\n\n/**\n * @param {SweepEvent} se\n * @param {Array.} p\n * @param {Queue} queue\n * @return {Queue}\n */\nexport default function divideSegment(se, p, queue) {\n const r = new SweepEvent(p, false, se, se.isSubject);\n const l = new SweepEvent(p, true, se.otherEvent, se.isSubject);\n\n /* eslint-disable no-console */\n if (equals(se.point, se.otherEvent.point)) {\n\n console.warn('what is that, a collapsed segment?', se);\n }\n /* eslint-enable no-console */\n\n r.contourId = l.contourId = se.contourId;\n\n // avoid a rounding error. The left event would be processed after the right event\n if (compareEvents(l, se.otherEvent) > 0) {\n se.otherEvent.left = true;\n l.left = false;\n }\n\n // avoid a rounding error. The left event would be processed after the right event\n // if (compareEvents(se, r) > 0) {}\n\n se.otherEvent.otherEvent = l;\n se.otherEvent = r;\n\n queue.push(l);\n queue.push(r);\n\n return queue;\n}\n","//const EPS = 1e-9;\n\n/**\n * Finds the magnitude of the cross product of two vectors (if we pretend\n * they're in three dimensions)\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The magnitude of the cross product\n */\nfunction crossProduct(a, b) {\n return (a[0] * b[1]) - (a[1] * b[0]);\n}\n\n/**\n * Finds the dot product of two vectors.\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The dot product\n */\nfunction dotProduct(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]);\n}\n\n/**\n * Finds the intersection (if any) between two line segments a and b, given the\n * line segments' end points a1, a2 and b1, b2.\n *\n * This algorithm is based on Schneider and Eberly.\n * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf\n * Page 244.\n *\n * @param {Array.} a1 point of first line\n * @param {Array.} a2 point of first line\n * @param {Array.} b1 point of second line\n * @param {Array.} b2 point of second line\n * @param {Boolean=} noEndpointTouch whether to skip single touchpoints\n * (meaning connected segments) as\n * intersections\n * @returns {Array.>|Null} If the lines intersect, the point of\n * intersection. If they overlap, the two end points of the overlapping segment.\n * Otherwise, null.\n */\nexport default function (a1, a2, b1, b2, noEndpointTouch) {\n // The algorithm expects our lines in the form P + sd, where P is a point,\n // s is on the interval [0, 1], and d is a vector.\n // We are passed two points. P can be the first point of each pair. The\n // vector, then, could be thought of as the distance (in x and y components)\n // from the first point to the second point.\n // So first, let's make our vectors:\n const va = [a2[0] - a1[0], a2[1] - a1[1]];\n const vb = [b2[0] - b1[0], b2[1] - b1[1]];\n // We also define a function to convert back to regular point form:\n\n /* eslint-disable arrow-body-style */\n\n function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }\n\n /* eslint-enable arrow-body-style */\n\n // The rest is pretty much a straight port of the algorithm.\n const e = [b1[0] - a1[0], b1[1] - a1[1]];\n let kross = crossProduct(va, vb);\n let sqrKross = kross * kross;\n const sqrLenA = dotProduct(va, va);\n //const sqrLenB = dotProduct(vb, vb);\n\n // Check for line intersection. This works because of the properties of the\n // cross product -- specifically, two vectors are parallel if and only if the\n // cross product is the 0 vector. The full calculation involves relative error\n // to account for possible very small line segments. See Schneider & Eberly\n // for details.\n if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) {\n // If they're not parallel, then (because these are line segments) they\n // still might not actually intersect. This code checks that the\n // intersection point of the lines is actually on both line segments.\n const s = crossProduct(e, vb) / kross;\n if (s < 0 || s > 1) {\n // not on line segment a\n return null;\n }\n const t = crossProduct(e, va) / kross;\n if (t < 0 || t > 1) {\n // not on line segment b\n return null;\n }\n if (s === 0 || s === 1) {\n // on an endpoint of line segment a\n return noEndpointTouch ? null : [toPoint(a1, s, va)];\n }\n if (t === 0 || t === 1) {\n // on an endpoint of line segment b\n return noEndpointTouch ? null : [toPoint(b1, t, vb)];\n }\n return [toPoint(a1, s, va)];\n }\n\n // If we've reached this point, then the lines are either parallel or the\n // same, but the segments could overlap partially or fully, or not at all.\n // So we need to find the overlap, if any. To do that, we can use e, which is\n // the (vector) difference between the two initial points. If this is parallel\n // with the line itself, then the two lines are the same line, and there will\n // be overlap.\n //const sqrLenE = dotProduct(e, e);\n kross = crossProduct(e, va);\n sqrKross = kross * kross;\n\n if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) {\n // Lines are just parallel, not the same. No overlap.\n return null;\n }\n\n const sa = dotProduct(va, e) / sqrLenA;\n const sb = sa + dotProduct(va, vb) / sqrLenA;\n const smin = Math.min(sa, sb);\n const smax = Math.max(sa, sb);\n\n // this is, essentially, the FindIntersection acting on floats from\n // Schneider & Eberly, just inlined into this function.\n if (smin <= 1 && smax >= 0) {\n\n // overlap on an end point\n if (smin === 1) {\n return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)];\n }\n\n if (smax === 0) {\n return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)];\n }\n\n if (noEndpointTouch && smin === 0 && smax === 1) return null;\n\n // There's overlap on a segment -- two points of intersection. Return both.\n return [\n toPoint(a1, smin > 0 ? smin : 0, va),\n toPoint(a1, smax < 1 ? smax : 1, va)\n ];\n }\n\n return null;\n}\n","import divideSegment from './divide_segment';\nimport intersection from './segment_intersection';\nimport equals from './equals';\nimport compareEvents from './compare_events';\nimport {\n NON_CONTRIBUTING,\n SAME_TRANSITION,\n DIFFERENT_TRANSITION\n} from './edge_type';\n\n/**\n * @param {SweepEvent} se1\n * @param {SweepEvent} se2\n * @param {Queue} queue\n * @return {Number}\n */\nexport default function possibleIntersection (se1, se2, queue) {\n // that disallows self-intersecting polygons,\n // did cost us half a day, so I'll leave it\n // out of respect\n // if (se1.isSubject === se2.isSubject) return;\n const inter = intersection(\n se1.point, se1.otherEvent.point,\n se2.point, se2.otherEvent.point\n );\n\n const nintersections = inter ? inter.length : 0;\n if (nintersections === 0) return 0; // no intersection\n\n // the line segments intersect at an endpoint of both line segments\n if ((nintersections === 1) &&\n (equals(se1.point, se2.point) ||\n equals(se1.otherEvent.point, se2.otherEvent.point))) {\n return 0;\n }\n\n if (nintersections === 2 && se1.isSubject === se2.isSubject) {\n // if(se1.contourId === se2.contourId){\n // console.warn('Edges of the same polygon overlap',\n // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point);\n // }\n //throw new Error('Edges of the same polygon overlap');\n return 0;\n }\n\n // The line segments associated to se1 and se2 intersect\n if (nintersections === 1) {\n\n // if the intersection point is not an endpoint of se1\n if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) {\n divideSegment(se1, inter[0], queue);\n }\n\n // if the intersection point is not an endpoint of se2\n if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) {\n divideSegment(se2, inter[0], queue);\n }\n return 1;\n }\n\n // The line segments associated to se1 and se2 overlap\n const events = [];\n let leftCoincide = false;\n let rightCoincide = false;\n\n if (equals(se1.point, se2.point)) {\n leftCoincide = true; // linked\n } else if (compareEvents(se1, se2) === 1) {\n events.push(se2, se1);\n } else {\n events.push(se1, se2);\n }\n\n if (equals(se1.otherEvent.point, se2.otherEvent.point)) {\n rightCoincide = true;\n } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) {\n events.push(se2.otherEvent, se1.otherEvent);\n } else {\n events.push(se1.otherEvent, se2.otherEvent);\n }\n\n if ((leftCoincide && rightCoincide) || leftCoincide) {\n // both line segments are equal or share the left endpoint\n se2.type = NON_CONTRIBUTING;\n se1.type = (se2.inOut === se1.inOut)\n ? SAME_TRANSITION : DIFFERENT_TRANSITION;\n\n if (leftCoincide && !rightCoincide) {\n // honestly no idea, but changing events selection from [2, 1]\n // to [0, 1] fixes the overlapping self-intersecting polygons issue\n divideSegment(events[1].otherEvent, events[0].point, queue);\n }\n return 2;\n }\n\n // the line segments share the right endpoint\n if (rightCoincide) {\n divideSegment(events[0], events[1].point, queue);\n return 3;\n }\n\n // no line segment includes totally the other one\n if (events[0] !== events[3].otherEvent) {\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[1], events[2].point, queue);\n return 3;\n }\n\n // one line segment includes the other one\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[3].otherEvent, events[2].point, queue);\n\n return 3;\n}\n","import signedArea from './signed_area';\nimport compareEvents from './compare_events';\nimport equals from './equals';\n\n\n/**\n * @param {SweepEvent} le1\n * @param {SweepEvent} le2\n * @return {Number}\n */\nexport default function compareSegments(le1, le2) {\n if (le1 === le2) return 0;\n\n // Segments are not collinear\n if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 ||\n signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) {\n\n // If they share their left endpoint use the right endpoint to sort\n if (equals(le1.point, le2.point)) return le1.isBelow(le2.otherEvent.point) ? -1 : 1;\n\n // Different left endpoint: use the left endpoint to sort\n if (le1.point[0] === le2.point[0]) return le1.point[1] < le2.point[1] ? -1 : 1;\n\n // has the line segment associated to e1 been inserted\n // into S after the line segment associated to e2 ?\n if (compareEvents(le1, le2) === 1) return le2.isAbove(le1.point) ? -1 : 1;\n\n // The line segment associated to e2 has been inserted\n // into S after the line segment associated to e1\n return le1.isBelow(le2.point) ? -1 : 1;\n }\n\n if (le1.isSubject === le2.isSubject) { // same polygon\n let p1 = le1.point, p2 = le2.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) {\n p1 = le1.otherEvent.point; p2 = le2.otherEvent.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]) return 0;\n else return le1.contourId > le2.contourId ? 1 : -1;\n }\n } else { // Segments are collinear, but belong to separate polygons\n return le1.isSubject ? -1 : 1;\n }\n\n return compareEvents(le1, le2) === 1 ? 1 : -1;\n}\n","import Tree from 'splaytree';\nimport computeFields from './compute_fields';\nimport possibleIntersection from './possible_intersection';\nimport compareSegments from './compare_segments';\nimport {\n INTERSECTION,\n DIFFERENCE\n} from './operation';\n\n\nexport default function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n const sweepLine = new Tree(compareSegments);\n const sortedEvents = [];\n\n const rightbound = Math.min(sbbox[2], cbbox[2]);\n\n let prev, next, begin;\n\n while (eventQueue.length !== 0) {\n let event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n next = prev = sweepLine.insert(event);\n begin = sweepLine.minNode();\n\n if (prev !== begin) prev = sweepLine.prev(prev);\n else prev = null;\n\n next = sweepLine.next(next);\n\n const prevEvent = prev ? prev.key : null;\n let prevprevEvent;\n computeFields(event, prevEvent, operation);\n if (next) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n let prevprev = prev;\n if (prevprev !== begin) prevprev = sweepLine.prev(prevprev);\n else prevprev = null;\n\n prevprevEvent = prevprev ? prevprev.key : null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = prev = sweepLine.find(event);\n\n if (prev && next) {\n\n if (prev !== begin) prev = sweepLine.prev(prev);\n else prev = null;\n\n next = sweepLine.next(next);\n sweepLine.remove(event);\n\n if (next && prev) {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}\n","import compareEvents from './compare_events';\nimport { DIFFERENCE } from './operation';\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.}\n */\nfunction orderEvents(sortedEvents) {\n let event, i, len, tmp;\n const resultEvents = [];\n for (i = 0, len = sortedEvents.length; i < len; i++) {\n event = sortedEvents[i];\n if ((event.left && event.inResult) ||\n (!event.left && event.otherEvent.inResult)) {\n resultEvents.push(event);\n }\n }\n // Due to overlapping edges the resultEvents array can be not wholly sorted\n let sorted = false;\n while (!sorted) {\n sorted = true;\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if ((i + 1) < len &&\n compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) {\n tmp = resultEvents[i];\n resultEvents[i] = resultEvents[i + 1];\n resultEvents[i + 1] = tmp;\n sorted = false;\n }\n }\n }\n\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n event.pos = i;\n }\n\n // imagine, the right event is found in the beginning of the queue,\n // when his left counterpart is not marked yet\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n if (!event.left) {\n tmp = event.pos;\n event.pos = event.otherEvent.pos;\n event.otherEvent.pos = tmp;\n }\n }\n\n return resultEvents;\n}\n\n\n/**\n * @param {Number} pos\n * @param {Array.} resultEvents\n * @param {Object>} processed\n * @return {Number}\n */\nfunction nextPos(pos, resultEvents, processed, origIndex) {\n let p, p1;\n let newPos = pos + 1;\n const length = resultEvents.length;\n\n p = resultEvents[pos].point;\n\n if (newPos < length)\n p1 = resultEvents[newPos].point;\n\n\n // while in range and not the current one by value\n while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) {\n if (!processed[newPos]) {\n return newPos;\n } else {\n newPos++;\n }\n p1 = resultEvents[newPos].point;\n }\n\n newPos = pos - 1;\n\n while (processed[newPos] && newPos >= origIndex) {\n newPos--;\n }\n return newPos;\n}\n\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.<*>} polygons\n */\nexport default function connectEdges(sortedEvents, operation) {\n let i, len;\n const resultEvents = orderEvents(sortedEvents);\n\n // \"false\"-filled array\n const processed = {};\n const result = [];\n let event;\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if (processed[i]) continue;\n const contour = [[]];\n\n if (!resultEvents[i].isExteriorRing) {\n if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length === 0) {\n result.push(contour);\n } else if (result.length === 0) {\n result.push([[contour]]);\n } else {\n result[result.length - 1].push(contour[0]);\n }\n } else if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) {\n result[result.length - 1].push(contour[0]);\n } else {\n result.push(contour);\n }\n\n const ringId = result.length - 1;\n let pos = i;\n\n const initial = resultEvents[i].point;\n contour[0].push(initial);\n\n while (pos >= i) {\n event = resultEvents[pos];\n processed[pos] = true;\n\n if (event.left) {\n event.resultInOut = false;\n event.contourId = ringId;\n } else {\n event.otherEvent.resultInOut = true;\n event.otherEvent.contourId = ringId;\n }\n\n pos = event.pos;\n processed[pos] = true;\n contour[0].push(resultEvents[pos].point);\n pos = nextPos(pos, resultEvents, processed, i);\n }\n\n pos = pos === -1 ? i : pos;\n\n event = resultEvents[pos];\n processed[pos] = processed[event.pos] = true;\n event.otherEvent.resultInOut = true;\n event.otherEvent.contourId = ringId;\n }\n\n // Handle if the result is a polygon (eg not multipoly)\n // Commented it again, let's see what do we mean by that\n // if (result.length === 1) result = result[0];\n return result;\n}\n","'use strict';\n\nmodule.exports = TinyQueue;\nmodule.exports.default = TinyQueue;\n\nfunction TinyQueue(data, compare) {\n if (!(this instanceof TinyQueue)) return new TinyQueue(data, compare);\n\n this.data = data || [];\n this.length = this.data.length;\n this.compare = compare || defaultCompare;\n\n if (this.length > 0) {\n for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nTinyQueue.prototype = {\n\n push: function (item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n },\n\n pop: function () {\n if (this.length === 0) return undefined;\n\n var top = this.data[0];\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = this.data[this.length];\n this._down(0);\n }\n this.data.pop();\n\n return top;\n },\n\n peek: function () {\n return this.data[0];\n },\n\n _up: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var item = data[pos];\n\n while (pos > 0) {\n var parent = (pos - 1) >> 1;\n var current = data[parent];\n if (compare(item, current) >= 0) break;\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n },\n\n _down: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var halfLength = this.length >> 1;\n var item = data[pos];\n\n while (pos < halfLength) {\n var left = (pos << 1) + 1;\n var right = left + 1;\n var best = data[left];\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) break;\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n};\n","import Queue from 'tinyqueue';\nimport SweepEvent from './sweep_event';\nimport compareEvents from './compare_events';\nimport { DIFFERENCE } from './operation';\n\nconst max = Math.max;\nconst min = Math.min;\n\nlet contourId = 0;\n\n\nfunction processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) {\n let i, len, s1, s2, e1, e2;\n for (i = 0, len = contourOrHole.length - 1; i < len; i++) {\n s1 = contourOrHole[i];\n s2 = contourOrHole[i + 1];\n e1 = new SweepEvent(s1, false, undefined, isSubject);\n e2 = new SweepEvent(s2, false, e1, isSubject);\n e1.otherEvent = e2;\n\n if (s1[0] === s2[0] && s1[1] === s2[1]) {\n continue; // skip collapsed edges, or it breaks\n }\n\n e1.contourId = e2.contourId = depth;\n if (!isExteriorRing) {\n e1.isExteriorRing = false;\n e2.isExteriorRing = false;\n }\n if (compareEvents(e1, e2) > 0) {\n e2.left = true;\n } else {\n e1.left = true;\n }\n\n const x = s1[0], y = s1[1];\n bbox[0] = min(bbox[0], x);\n bbox[1] = min(bbox[1], y);\n bbox[2] = max(bbox[2], x);\n bbox[3] = max(bbox[3], y);\n\n // Pushing it so the queue is sorted from left to right,\n // with object on the left having the highest priority.\n Q.push(e1);\n Q.push(e2);\n }\n}\n\n\nexport default function fillQueue(subject, clipping, sbbox, cbbox, operation) {\n const eventQueue = new Queue(null, compareEvents);\n let polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk;\n\n for (i = 0, ii = subject.length; i < ii; i++) {\n polygonSet = subject[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (isExteriorRing) contourId++;\n processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing);\n }\n }\n\n for (i = 0, ii = clipping.length; i < ii; i++) {\n polygonSet = clipping[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (operation === DIFFERENCE) isExteriorRing = false;\n if (isExteriorRing) contourId++;\n processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing);\n }\n }\n\n return eventQueue;\n}\n","import subdivideSegments from './subdivide_segments';\nimport connectEdges from './connect_edges';\nimport fillQueue from './fill_queue';\nimport {\n INTERSECTION,\n DIFFERENCE,\n UNION,\n XOR\n} from './operation';\n\nconst EMPTY = [];\n\n\nfunction trivialOperation(subject, clipping, operation) {\n let result = null;\n if (subject.length * clipping.length === 0) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = (subject.length === 0) ? clipping : subject;\n }\n }\n return result;\n}\n\n\nfunction compareBBoxes(subject, clipping, sbbox, cbbox, operation) {\n let result = null;\n if (sbbox[0] > cbbox[2] ||\n cbbox[0] > sbbox[2] ||\n sbbox[1] > cbbox[3] ||\n cbbox[1] > sbbox[3]) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = subject.concat(clipping);\n }\n }\n return result;\n}\n\n\nexport default function boolean(subject, clipping, operation) {\n if (typeof subject[0][0][0] === 'number') {\n subject = [subject];\n }\n if (typeof clipping[0][0][0] === 'number') {\n clipping = [clipping];\n }\n let trivial = trivialOperation(subject, clipping, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n const sbbox = [Infinity, Infinity, -Infinity, -Infinity];\n const cbbox = [Infinity, Infinity, -Infinity, -Infinity];\n\n //console.time('fill queue');\n const eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('fill queue');\n\n trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n //console.time('subdivide edges');\n const sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('subdivide edges');\n\n //console.time('connect vertices');\n const result = connectEdges(sortedEvents, operation);\n //console.timeEnd('connect vertices');\n return result;\n}\n","import boolean from './src/';\nimport {\n INTERSECTION,\n DIFFERENCE,\n UNION,\n XOR\n} from './src/operation';\n\nexport function union (subject, clipping) {\n return boolean(subject, clipping, UNION);\n}\n\nexport function diff (subject, clipping) {\n return boolean(subject, clipping, DIFFERENCE);\n}\n\nexport function xor (subject, clipping){\n return boolean(subject, clipping, XOR);\n}\n\nexport function intersection (subject, clipping) {\n return boolean(subject, clipping, INTERSECTION);\n}\n\n/**\n * @enum {Number}\n */\nexport const operations = { UNION, DIFFERENCE, INTERSECTION, XOR };\n"],"names":["const","let","Tree","Queue","subdivideSeg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AE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;EACjG;AACA;EACA;EACA,EAAEJ,IAAM,MAAM,GAAG,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;EACvD;EACA,EAAE,OAAO,MAAM,CAAC;EAChB,CAAC;;ECtEM,SAAS,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE;EAC1C,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;EAC3C,CAAC;AACD;AACA,EAAO,SAAS,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE;EACzC,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;EAChD,CAAC;AACD;AACA,EAAO,SAAS,GAAG,EAAE,OAAO,EAAE,QAAQ,CAAC;EACvC,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;EACzC,CAAC;AACD;AACA,EAAO,SAASK,cAAY,EAAE,OAAO,EAAE,QAAQ,EAAE;EACjD,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;EAClD,CAAC;AACD;EACA;EACA;EACA;AACA,AAAY,MAAC,UAAU,GAAG,SAAE,KAAK,cAAE,UAAU,gBAAE,YAAY,OAAE,GAAG,EAAE;;;;;;;;;;;;;;;;"} \ No newline at end of file +{"version":3,"file":"martinez.umd.js","sources":["../node_modules/splaytree/index.js","../src/edge_type.js","../src/operation.js","../src/compute_fields.js","../src/sweep_event.js","../src/equals.js","../node_modules/robust-predicates/esm/util.js","../node_modules/robust-predicates/esm/orient2d.js","../src/signed_area.js","../src/compare_events.js","../src/divide_segment.js","../src/segment_intersection.js","../src/possible_intersection.js","../src/compare_segments.js","../src/subdivide_segments.js","../src/contour.js","../src/connect_edges.js","../node_modules/tinyqueue/index.js","../src/fill_queue.js","../src/index.js","../index.js"],"sourcesContent":["function DEFAULT_COMPARE (a, b) { return a > b ? 1 : a < b ? -1 : 0; }\n\nexport default class SplayTree {\n\n constructor(compare = DEFAULT_COMPARE, noDuplicates = false) {\n this._compare = compare;\n this._root = null;\n this._size = 0;\n this._noDuplicates = !!noDuplicates;\n }\n\n\n rotateLeft(x) {\n var y = x.right;\n if (y) {\n x.right = y.left;\n if (y.left) y.left.parent = x;\n y.parent = x.parent;\n }\n\n if (!x.parent) this._root = y;\n else if (x === x.parent.left) x.parent.left = y;\n else x.parent.right = y;\n if (y) y.left = x;\n x.parent = y;\n }\n\n\n rotateRight(x) {\n var y = x.left;\n if (y) {\n x.left = y.right;\n if (y.right) y.right.parent = x;\n y.parent = x.parent;\n }\n\n if (!x.parent) this._root = y;\n else if(x === x.parent.left) x.parent.left = y;\n else x.parent.right = y;\n if (y) y.right = x;\n x.parent = y;\n }\n\n\n _splay(x) {\n while (x.parent) {\n var p = x.parent;\n if (!p.parent) {\n if (p.left === x) this.rotateRight(p);\n else this.rotateLeft(p);\n } else if (p.left === x && p.parent.left === p) {\n this.rotateRight(p.parent);\n this.rotateRight(p);\n } else if (p.right === x && p.parent.right === p) {\n this.rotateLeft(p.parent);\n this.rotateLeft(p);\n } else if (p.left === x && p.parent.right === p) {\n this.rotateRight(p);\n this.rotateLeft(p);\n } else {\n this.rotateLeft(p);\n this.rotateRight(p);\n }\n }\n }\n\n\n splay(x) {\n var p, gp, ggp, l, r;\n\n while (x.parent) {\n p = x.parent;\n gp = p.parent;\n\n if (gp && gp.parent) {\n ggp = gp.parent;\n if (ggp.left === gp) ggp.left = x;\n else ggp.right = x;\n x.parent = ggp;\n } else {\n x.parent = null;\n this._root = x;\n }\n\n l = x.left; r = x.right;\n\n if (x === p.left) { // left\n if (gp) {\n if (gp.left === p) {\n /* zig-zig */\n if (p.right) {\n gp.left = p.right;\n gp.left.parent = gp;\n } else gp.left = null;\n\n p.right = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (l) {\n gp.right = l;\n l.parent = gp;\n } else gp.right = null;\n\n x.left = gp;\n gp.parent = x;\n }\n }\n if (r) {\n p.left = r;\n r.parent = p;\n } else p.left = null;\n\n x.right = p;\n p.parent = x;\n } else { // right\n if (gp) {\n if (gp.right === p) {\n /* zig-zig */\n if (p.left) {\n gp.right = p.left;\n gp.right.parent = gp;\n } else gp.right = null;\n\n p.left = gp;\n gp.parent = p;\n } else {\n /* zig-zag */\n if (r) {\n gp.left = r;\n r.parent = gp;\n } else gp.left = null;\n\n x.right = gp;\n gp.parent = x;\n }\n }\n if (l) {\n p.right = l;\n l.parent = p;\n } else p.right = null;\n\n x.left = p;\n p.parent = x;\n }\n }\n }\n\n\n replace(u, v) {\n if (!u.parent) this._root = v;\n else if (u === u.parent.left) u.parent.left = v;\n else u.parent.right = v;\n if (v) v.parent = u.parent;\n }\n\n\n minNode(u = this._root) {\n if (u) while (u.left) u = u.left;\n return u;\n }\n\n\n maxNode(u = this._root) {\n if (u) while (u.right) u = u.right;\n return u;\n }\n\n\n insert(key, data) {\n var z = this._root;\n var p = null;\n var comp = this._compare;\n var cmp;\n\n if (this._noDuplicates) {\n while (z) {\n p = z;\n cmp = comp(z.key, key);\n if (cmp === 0) return;\n else if (comp(z.key, key) < 0) z = z.right;\n else z = z.left;\n }\n } else {\n while (z) {\n p = z;\n if (comp(z.key, key) < 0) z = z.right;\n else z = z.left;\n }\n }\n\n z = { key, data, left: null, right: null, parent: p };\n\n if (!p) this._root = z;\n else if (comp(p.key, z.key) < 0) p.right = z;\n else p.left = z;\n\n this.splay(z);\n this._size++;\n return z;\n }\n\n\n find (key) {\n var z = this._root;\n var comp = this._compare;\n while (z) {\n var cmp = comp(z.key, key);\n if (cmp < 0) z = z.right;\n else if (cmp > 0) z = z.left;\n else return z;\n }\n return null;\n }\n\n /**\n * Whether the tree contains a node with the given key\n * @param {Key} key\n * @return {boolean} true/false\n */\n contains (key) {\n var node = this._root;\n var comparator = this._compare;\n while (node) {\n var cmp = comparator(key, node.key);\n if (cmp === 0) return true;\n else if (cmp < 0) node = node.left;\n else node = node.right;\n }\n\n return false;\n }\n\n\n remove (key) {\n var z = this.find(key);\n\n if (!z) return false;\n\n this.splay(z);\n\n if (!z.left) this.replace(z, z.right);\n else if (!z.right) this.replace(z, z.left);\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n }\n\n\n removeNode(z) {\n if (!z) return false;\n\n this.splay(z);\n\n if (!z.left) this.replace(z, z.right);\n else if (!z.right) this.replace(z, z.left);\n else {\n var y = this.minNode(z.right);\n if (y.parent !== z) {\n this.replace(y, y.right);\n y.right = z.right;\n y.right.parent = y;\n }\n this.replace(z, y);\n y.left = z.left;\n y.left.parent = y;\n }\n\n this._size--;\n return true;\n }\n\n\n erase (key) {\n var z = this.find(key);\n if (!z) return;\n\n this.splay(z);\n\n var s = z.left;\n var t = z.right;\n\n var sMax = null;\n if (s) {\n s.parent = null;\n sMax = this.maxNode(s);\n this.splay(sMax);\n this._root = sMax;\n }\n if (t) {\n if (s) sMax.right = t;\n else this._root = t;\n t.parent = sMax;\n }\n\n this._size--;\n }\n\n /**\n * Removes and returns the node with smallest key\n * @return {?Node}\n */\n pop () {\n var node = this._root, returnValue = null;\n if (node) {\n while (node.left) node = node.left;\n returnValue = { key: node.key, data: node.data };\n this.remove(node.key);\n }\n return returnValue;\n }\n\n\n /* eslint-disable class-methods-use-this */\n\n /**\n * Successor node\n * @param {Node} node\n * @return {?Node}\n */\n next (node) {\n var successor = node;\n if (successor) {\n if (successor.right) {\n successor = successor.right;\n while (successor && successor.left) successor = successor.left;\n } else {\n successor = node.parent;\n while (successor && successor.right === node) {\n node = successor; successor = successor.parent;\n }\n }\n }\n return successor;\n }\n\n\n /**\n * Predecessor node\n * @param {Node} node\n * @return {?Node}\n */\n prev (node) {\n var predecessor = node;\n if (predecessor) {\n if (predecessor.left) {\n predecessor = predecessor.left;\n while (predecessor && predecessor.right) predecessor = predecessor.right;\n } else {\n predecessor = node.parent;\n while (predecessor && predecessor.left === node) {\n node = predecessor;\n predecessor = predecessor.parent;\n }\n }\n }\n return predecessor;\n }\n /* eslint-enable class-methods-use-this */\n\n\n /**\n * @param {forEachCallback} callback\n * @return {SplayTree}\n */\n forEach(callback) {\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n // Reach the left most Node of the current Node\n if (current) {\n // Place pointer to a tree node on the stack\n // before traversing the node's left subtree\n s.push(current);\n current = current.left;\n } else {\n // BackTrack from the empty subtree and visit the Node\n // at the top of the stack; however, if the stack is\n // empty you are done\n if (s.length > 0) {\n current = s.pop();\n callback(current, i++);\n\n // We have visited the node and its left\n // subtree. Now, it's right subtree's turn\n current = current.right;\n } else done = true;\n }\n }\n return this;\n }\n\n\n /**\n * Walk key range from `low` to `high`. Stops if `fn` returns a value.\n * @param {Key} low\n * @param {Key} high\n * @param {Function} fn\n * @param {*?} ctx\n * @return {SplayTree}\n */\n range(low, high, fn, ctx) {\n const Q = [];\n const compare = this._compare;\n let node = this._root, cmp;\n\n while (Q.length !== 0 || node) {\n if (node) {\n Q.push(node);\n node = node.left;\n } else {\n node = Q.pop();\n cmp = compare(node.key, high);\n if (cmp > 0) {\n break;\n } else if (compare(node.key, low) >= 0) {\n if (fn.call(ctx, node)) return this; // stop if smth is returned\n }\n node = node.right;\n }\n }\n return this;\n }\n\n /**\n * Returns all keys in order\n * @return {Array}\n */\n keys () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.key);\n current = current.right;\n } else done = true;\n }\n }\n return r;\n }\n\n\n /**\n * Returns `data` fields of all nodes in order.\n * @return {Array}\n */\n values () {\n var current = this._root;\n var s = [], r = [], done = false;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n r.push(current.data);\n current = current.right;\n } else done = true;\n }\n }\n return r;\n }\n\n\n /**\n * Returns node at given index\n * @param {number} index\n * @return {?Node}\n */\n at (index) {\n // removed after a consideration, more misleading than useful\n // index = index % this.size;\n // if (index < 0) index = this.size - index;\n\n var current = this._root;\n var s = [], done = false, i = 0;\n\n while (!done) {\n if (current) {\n s.push(current);\n current = current.left;\n } else {\n if (s.length > 0) {\n current = s.pop();\n if (i === index) return current;\n i++;\n current = current.right;\n } else done = true;\n }\n }\n return null;\n }\n\n /**\n * Bulk-load items. Both array have to be same size\n * @param {Array} keys\n * @param {Array} [values]\n * @param {Boolean} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @return {AVLTree}\n */\n load(keys = [], values = [], presort = false) {\n if (this._size !== 0) throw new Error('bulk-load: tree is not empty');\n const size = keys.length;\n if (presort) sort(keys, values, 0, size - 1, this._compare);\n this._root = loadRecursive(null, keys, values, 0, size);\n this._size = size;\n return this;\n }\n\n\n min() {\n var node = this.minNode(this._root);\n if (node) return node.key;\n else return null;\n }\n\n\n max() {\n var node = this.maxNode(this._root);\n if (node) return node.key;\n else return null;\n }\n\n isEmpty() { return this._root === null; }\n get size() { return this._size; }\n\n\n /**\n * Create a tree and load it with items\n * @param {Array} keys\n * @param {Array?} [values]\n\n * @param {Function?} [comparator]\n * @param {Boolean?} [presort=false] Pre-sort keys and values, using\n * tree's comparator. Sorting is done\n * in-place\n * @param {Boolean?} [noDuplicates=false] Allow duplicates\n * @return {SplayTree}\n */\n static createTree(keys, values, comparator, presort, noDuplicates) {\n return new SplayTree(comparator, noDuplicates).load(keys, values, presort);\n }\n}\n\n\nfunction loadRecursive (parent, keys, values, start, end) {\n const size = end - start;\n if (size > 0) {\n const middle = start + Math.floor(size / 2);\n const key = keys[middle];\n const data = values[middle];\n const node = { key, data, parent };\n node.left = loadRecursive(node, keys, values, start, middle);\n node.right = loadRecursive(node, keys, values, middle + 1, end);\n return node;\n }\n return null;\n}\n\n\nfunction sort(keys, values, left, right, compare) {\n if (left >= right) return;\n\n const pivot = keys[(left + right) >> 1];\n let i = left - 1;\n let j = right + 1;\n\n while (true) {\n do i++; while (compare(keys[i], pivot) < 0);\n do j--; while (compare(keys[j], pivot) > 0);\n if (i >= j) break;\n\n let tmp = keys[i];\n keys[i] = keys[j];\n keys[j] = tmp;\n\n tmp = values[i];\n values[i] = values[j];\n values[j] = tmp;\n }\n\n sort(keys, values, left, j, compare);\n sort(keys, values, j + 1, right, compare);\n}\n","export const NORMAL = 0;\nexport const NON_CONTRIBUTING = 1;\nexport const SAME_TRANSITION = 2;\nexport const DIFFERENT_TRANSITION = 3;\n","export const INTERSECTION = 0;\nexport const UNION = 1;\nexport const DIFFERENCE = 2;\nexport const XOR = 3;\n","import {\n NORMAL,\n SAME_TRANSITION,\n DIFFERENT_TRANSITION,\n NON_CONTRIBUTING\n} from './edge_type';\nimport {\n INTERSECTION,\n UNION,\n DIFFERENCE,\n XOR\n} from './operation';\n\n/**\n * @param {SweepEvent} event\n * @param {SweepEvent} prev\n * @param {Operation} operation\n */\nexport default function computeFields (event, prev, operation) {\n // compute inOut and otherInOut fields\n if (prev === null) {\n event.inOut = false;\n event.otherInOut = true;\n\n // previous line segment in sweepline belongs to the same polygon\n } else {\n if (event.isSubject === prev.isSubject) {\n event.inOut = !prev.inOut;\n event.otherInOut = prev.otherInOut;\n\n // previous line segment in sweepline belongs to the clipping polygon\n } else {\n event.inOut = !prev.otherInOut;\n event.otherInOut = prev.isVertical() ? !prev.inOut : prev.inOut;\n }\n\n // compute prevInResult field\n if (prev) {\n event.prevInResult = (!inResult(prev, operation) || prev.isVertical())\n ? prev.prevInResult : prev;\n }\n }\n\n // check if the line segment belongs to the Boolean operation\n let isInResult = inResult(event, operation);\n if (isInResult) {\n event.resultTransition = determineResultTransition(event, operation);\n } else {\n event.resultTransition = 0;\n }\n}\n\n\n/* eslint-disable indent */\nfunction inResult(event, operation) {\n switch (event.type) {\n case NORMAL:\n switch (operation) {\n case INTERSECTION:\n return !event.otherInOut;\n case UNION:\n return event.otherInOut;\n case DIFFERENCE:\n // return (event.isSubject && !event.otherInOut) ||\n // (!event.isSubject && event.otherInOut);\n return (event.isSubject && event.otherInOut) ||\n (!event.isSubject && !event.otherInOut);\n case XOR:\n return true;\n }\n break;\n case SAME_TRANSITION:\n return operation === INTERSECTION || operation === UNION;\n case DIFFERENT_TRANSITION:\n return operation === DIFFERENCE;\n case NON_CONTRIBUTING:\n return false;\n }\n return false;\n}\n/* eslint-enable indent */\n\n\nfunction determineResultTransition(event, operation) {\n let thisIn = !event.inOut;\n let thatIn = !event.otherInOut;\n\n let isIn;\n switch (operation) {\n case INTERSECTION:\n isIn = thisIn && thatIn; break;\n case UNION:\n isIn = thisIn || thatIn; break;\n case XOR:\n isIn = thisIn ^ thatIn; break;\n case DIFFERENCE:\n if (event.isSubject) {\n isIn = thisIn && !thatIn;\n } else {\n isIn = thatIn && !thisIn;\n }\n break;\n }\n return isIn ? +1 : -1;\n}\n","import { NORMAL } from './edge_type';\n\n\nexport default class SweepEvent {\n\n\n /**\n * Sweepline event\n *\n * @class {SweepEvent}\n * @param {Array.} point\n * @param {Boolean} left\n * @param {SweepEvent=} otherEvent\n * @param {Boolean} isSubject\n * @param {Number} edgeType\n */\n constructor (point, left, otherEvent, isSubject, edgeType) {\n\n /**\n * Is left endpoint?\n * @type {Boolean}\n */\n this.left = left;\n\n /**\n * @type {Array.}\n */\n this.point = point;\n\n /**\n * Other edge reference\n * @type {SweepEvent}\n */\n this.otherEvent = otherEvent;\n\n /**\n * Belongs to source or clipping polygon\n * @type {Boolean}\n */\n this.isSubject = isSubject;\n\n /**\n * Edge contribution type\n * @type {Number}\n */\n this.type = edgeType || NORMAL;\n\n\n /**\n * In-out transition for the sweepline crossing polygon\n * @type {Boolean}\n */\n this.inOut = false;\n\n\n /**\n * @type {Boolean}\n */\n this.otherInOut = false;\n\n /**\n * Previous event in result?\n * @type {SweepEvent}\n */\n this.prevInResult = null;\n\n /**\n * Type of result transition (0 = not in result, +1 = out-in, -1, in-out)\n * @type {Number}\n */\n this.resultTransition = 0;\n\n // connection step\n\n /**\n * @type {Number}\n */\n this.otherPos = -1;\n\n /**\n * @type {Number}\n */\n this.outputContourId = -1;\n\n this.isExteriorRing = true; // TODO: Looks unused, remove?\n }\n\n\n /**\n * @param {Array.} p\n * @return {Boolean}\n */\n isBelow (p) {\n const p0 = this.point, p1 = this.otherEvent.point;\n return this.left\n ? (p0[0] - p[0]) * (p1[1] - p[1]) - (p1[0] - p[0]) * (p0[1] - p[1]) > 0\n // signedArea(this.point, this.otherEvent.point, p) > 0 :\n : (p1[0] - p[0]) * (p0[1] - p[1]) - (p0[0] - p[0]) * (p1[1] - p[1]) > 0;\n //signedArea(this.otherEvent.point, this.point, p) > 0;\n }\n\n\n /**\n * @param {Array.} p\n * @return {Boolean}\n */\n isAbove (p) {\n return !this.isBelow(p);\n }\n\n\n /**\n * @return {Boolean}\n */\n isVertical () {\n return this.point[0] === this.otherEvent.point[0];\n }\n\n\n /**\n * Does event belong to result?\n * @return {Boolean}\n */\n get inResult() {\n return this.resultTransition !== 0;\n }\n\n\n clone () {\n const copy = new SweepEvent(\n this.point, this.left, this.otherEvent, this.isSubject, this.type);\n\n copy.contourId = this.contourId;\n copy.resultTransition = this.resultTransition;\n copy.prevInResult = this.prevInResult;\n copy.isExteriorRing = this.isExteriorRing;\n copy.inOut = this.inOut;\n copy.otherInOut = this.otherInOut;\n\n return copy;\n }\n}\n","export default function equals(p1, p2) {\n if (p1[0] === p2[0]) {\n if (p1[1] === p2[1]) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}\n\n// const EPSILON = 1e-9;\n// const abs = Math.abs;\n// TODO https://github.com/w8r/martinez/issues/6#issuecomment-262847164\n// Precision problem.\n//\n// module.exports = function equals(p1, p2) {\n// return abs(p1[0] - p2[0]) <= EPSILON && abs(p1[1] - p2[1]) <= EPSILON;\n// };\n","export const epsilon = 1.1102230246251565e-16;\nexport const splitter = 134217729;\nexport const resulterrbound = (3 + 8 * epsilon) * epsilon;\n\n// fast_expansion_sum_zeroelim routine from oritinal code\nexport function sum(elen, e, flen, f, h) {\n let Q, Qnew, hh, bvirt;\n let enow = e[0];\n let fnow = f[0];\n let eindex = 0;\n let findex = 0;\n if ((fnow > enow) === (fnow > -enow)) {\n Q = enow;\n enow = e[++eindex];\n } else {\n Q = fnow;\n fnow = f[++findex];\n }\n let hindex = 0;\n if (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = enow + Q;\n hh = Q - (Qnew - enow);\n enow = e[++eindex];\n } else {\n Qnew = fnow + Q;\n hh = Q - (Qnew - fnow);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n while (eindex < elen && findex < flen) {\n if ((fnow > enow) === (fnow > -enow)) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n } else {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n }\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n }\n while (eindex < elen) {\n Qnew = Q + enow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (enow - bvirt);\n enow = e[++eindex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n while (findex < flen) {\n Qnew = Q + fnow;\n bvirt = Qnew - Q;\n hh = Q - (Qnew - bvirt) + (fnow - bvirt);\n fnow = f[++findex];\n Q = Qnew;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function sum_three(alen, a, blen, b, clen, c, tmp, out) {\n return sum(sum(alen, a, blen, b, tmp), tmp, clen, c, out);\n}\n\n// scale_expansion_zeroelim routine from oritinal code\nexport function scale(elen, e, b, h) {\n let Q, sum, hh, product1, product0;\n let bvirt, c, ahi, alo, bhi, blo;\n\n c = splitter * b;\n bhi = c - (c - b);\n blo = b - bhi;\n let enow = e[0];\n Q = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n hh = alo * blo - (Q - ahi * bhi - alo * bhi - ahi * blo);\n let hindex = 0;\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n for (let i = 1; i < elen; i++) {\n enow = e[i];\n product1 = enow * b;\n c = splitter * enow;\n ahi = c - (c - enow);\n alo = enow - ahi;\n product0 = alo * blo - (product1 - ahi * bhi - alo * bhi - ahi * blo);\n sum = Q + product0;\n bvirt = sum - Q;\n hh = Q - (sum - bvirt) + (product0 - bvirt);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n Q = product1 + sum;\n hh = sum - (Q - product1);\n if (hh !== 0) {\n h[hindex++] = hh;\n }\n }\n if (Q !== 0 || hindex === 0) {\n h[hindex++] = Q;\n }\n return hindex;\n}\n\nexport function negate(elen, e) {\n for (let i = 0; i < elen; i++) e[i] = -e[i];\n return elen;\n}\n\nexport function estimate(elen, e) {\n let Q = e[0];\n for (let i = 1; i < elen; i++) Q += e[i];\n return Q;\n}\n\nexport function vec(n) {\n return new Float64Array(n);\n}\n","import {epsilon, splitter, resulterrbound, estimate, vec, sum} from './util.js';\n\nconst ccwerrboundA = (3 + 16 * epsilon) * epsilon;\nconst ccwerrboundB = (2 + 12 * epsilon) * epsilon;\nconst ccwerrboundC = (9 + 64 * epsilon) * epsilon * epsilon;\n\nconst B = vec(4);\nconst C1 = vec(8);\nconst C2 = vec(12);\nconst D = vec(16);\nconst u = vec(4);\n\nfunction orient2dadapt(ax, ay, bx, by, cx, cy, detsum) {\n let acxtail, acytail, bcxtail, bcytail;\n let bvirt, c, ahi, alo, bhi, blo, _i, _j, _0, s1, s0, t1, t0, u3;\n\n const acx = ax - cx;\n const bcx = bx - cx;\n const acy = ay - cy;\n const bcy = by - cy;\n\n s1 = acx * bcy;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcx;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n B[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n B[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n B[2] = _j - (u3 - bvirt) + (_i - bvirt);\n B[3] = u3;\n\n let det = estimate(4, B);\n let errbound = ccwerrboundB * detsum;\n if (det >= errbound || -det >= errbound) {\n return det;\n }\n\n bvirt = ax - acx;\n acxtail = ax - (acx + bvirt) + (bvirt - cx);\n bvirt = bx - bcx;\n bcxtail = bx - (bcx + bvirt) + (bvirt - cx);\n bvirt = ay - acy;\n acytail = ay - (acy + bvirt) + (bvirt - cy);\n bvirt = by - bcy;\n bcytail = by - (bcy + bvirt) + (bvirt - cy);\n\n if (acxtail === 0 && acytail === 0 && bcxtail === 0 && bcytail === 0) {\n return det;\n }\n\n errbound = ccwerrboundC * detsum + resulterrbound * Math.abs(det);\n det += (acx * bcytail + bcy * acxtail) - (acy * bcxtail + bcx * acytail);\n if (det >= errbound || -det >= errbound) return det;\n\n s1 = acxtail * bcy;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcy;\n bhi = c - (c - bcy);\n blo = bcy - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcx;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcx;\n bhi = c - (c - bcx);\n blo = bcx - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C1len = sum(4, B, 4, u, C1);\n\n s1 = acx * bcytail;\n c = splitter * acx;\n ahi = c - (c - acx);\n alo = acx - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acy * bcxtail;\n c = splitter * acy;\n ahi = c - (c - acy);\n alo = acy - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const C2len = sum(C1len, C1, 4, u, C2);\n\n s1 = acxtail * bcytail;\n c = splitter * acxtail;\n ahi = c - (c - acxtail);\n alo = acxtail - ahi;\n c = splitter * bcytail;\n bhi = c - (c - bcytail);\n blo = bcytail - bhi;\n s0 = alo * blo - (s1 - ahi * bhi - alo * bhi - ahi * blo);\n t1 = acytail * bcxtail;\n c = splitter * acytail;\n ahi = c - (c - acytail);\n alo = acytail - ahi;\n c = splitter * bcxtail;\n bhi = c - (c - bcxtail);\n blo = bcxtail - bhi;\n t0 = alo * blo - (t1 - ahi * bhi - alo * bhi - ahi * blo);\n _i = s0 - t0;\n bvirt = s0 - _i;\n u[0] = s0 - (_i + bvirt) + (bvirt - t0);\n _j = s1 + _i;\n bvirt = _j - s1;\n _0 = s1 - (_j - bvirt) + (_i - bvirt);\n _i = _0 - t1;\n bvirt = _0 - _i;\n u[1] = _0 - (_i + bvirt) + (bvirt - t1);\n u3 = _j + _i;\n bvirt = u3 - _j;\n u[2] = _j - (u3 - bvirt) + (_i - bvirt);\n u[3] = u3;\n const Dlen = sum(C2len, C2, 4, u, D);\n\n return D[Dlen - 1];\n}\n\nexport function orient2d(ax, ay, bx, by, cx, cy) {\n const detleft = (ay - cy) * (bx - cx);\n const detright = (ax - cx) * (by - cy);\n const det = detleft - detright;\n\n if (detleft === 0 || detright === 0 || (detleft > 0) !== (detright > 0)) return det;\n\n const detsum = Math.abs(detleft + detright);\n if (Math.abs(det) >= ccwerrboundA * detsum) return det;\n\n return -orient2dadapt(ax, ay, bx, by, cx, cy, detsum);\n}\n\nexport function orient2dfast(ax, ay, bx, by, cx, cy) {\n return (ay - cy) * (bx - cx) - (ax - cx) * (by - cy);\n}\n","import {orient2d} from 'robust-predicates';\n\n/**\n * Signed area of the triangle (p0, p1, p2)\n * @param {Array.} p0\n * @param {Array.} p1\n * @param {Array.} p2\n * @return {Number}\n */\nexport default function signedArea(p0, p1, p2) {\n const res = orient2d(p0[0], p0[1], p1[0], p1[1], p2[0], p2[1]);\n if (res > 0) return -1;\n if (res < 0) return 1;\n return 0;\n}\n","import signedArea from './signed_area';\n\n/**\n * @param {SweepEvent} e1\n * @param {SweepEvent} e2\n * @return {Number}\n */\nexport default function compareEvents(e1, e2) {\n const p1 = e1.point;\n const p2 = e2.point;\n\n // Different x-coordinate\n if (p1[0] > p2[0]) return 1;\n if (p1[0] < p2[0]) return -1;\n\n // Different points, but same x-coordinate\n // Event with lower y-coordinate is processed first\n if (p1[1] !== p2[1]) return p1[1] > p2[1] ? 1 : -1;\n\n return specialCases(e1, e2, p1, p2);\n}\n\n\n/* eslint-disable no-unused-vars */\nfunction specialCases(e1, e2, p1, p2) {\n // Same coordinates, but one is a left endpoint and the other is\n // a right endpoint. The right endpoint is processed first\n if (e1.left !== e2.left)\n return e1.left ? 1 : -1;\n\n // const p2 = e1.otherEvent.point, p3 = e2.otherEvent.point;\n // const sa = (p1[0] - p3[0]) * (p2[1] - p3[1]) - (p2[0] - p3[0]) * (p1[1] - p3[1])\n // Same coordinates, both events\n // are left endpoints or right endpoints.\n // not collinear\n if (signedArea(p1, e1.otherEvent.point, e2.otherEvent.point) !== 0) {\n // the event associate to the bottom segment is processed first\n return (!e1.isBelow(e2.otherEvent.point)) ? 1 : -1;\n }\n\n return (!e1.isSubject && e2.isSubject) ? 1 : -1;\n}\n/* eslint-enable no-unused-vars */\n","import SweepEvent from './sweep_event';\nimport equals from './equals';\nimport compareEvents from './compare_events';\n\n/**\n * @param {SweepEvent} se\n * @param {Array.} p\n * @param {Queue} queue\n * @return {Queue}\n */\nexport default function divideSegment(se, p, queue) {\n const r = new SweepEvent(p, false, se, se.isSubject);\n const l = new SweepEvent(p, true, se.otherEvent, se.isSubject);\n\n /* eslint-disable no-console */\n if (equals(se.point, se.otherEvent.point)) {\n console.warn('what is that, a collapsed segment?', se);\n }\n /* eslint-enable no-console */\n\n r.contourId = l.contourId = se.contourId;\n\n // avoid a rounding error. The left event would be processed after the right event\n if (compareEvents(l, se.otherEvent) > 0) {\n se.otherEvent.left = true;\n l.left = false;\n }\n\n // avoid a rounding error. The left event would be processed after the right event\n // if (compareEvents(se, r) > 0) {}\n\n se.otherEvent.otherEvent = l;\n se.otherEvent = r;\n\n queue.push(l);\n queue.push(r);\n\n return queue;\n}\n","//const EPS = 1e-9;\n\n/**\n * Finds the magnitude of the cross product of two vectors (if we pretend\n * they're in three dimensions)\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The magnitude of the cross product\n */\nfunction crossProduct(a, b) {\n return (a[0] * b[1]) - (a[1] * b[0]);\n}\n\n/**\n * Finds the dot product of two vectors.\n *\n * @param {Object} a First vector\n * @param {Object} b Second vector\n * @private\n * @returns {Number} The dot product\n */\nfunction dotProduct(a, b) {\n return (a[0] * b[0]) + (a[1] * b[1]);\n}\n\n/**\n * Finds the intersection (if any) between two line segments a and b, given the\n * line segments' end points a1, a2 and b1, b2.\n *\n * This algorithm is based on Schneider and Eberly.\n * http://www.cimec.org.ar/~ncalvo/Schneider_Eberly.pdf\n * Page 244.\n *\n * @param {Array.} a1 point of first line\n * @param {Array.} a2 point of first line\n * @param {Array.} b1 point of second line\n * @param {Array.} b2 point of second line\n * @param {Boolean=} noEndpointTouch whether to skip single touchpoints\n * (meaning connected segments) as\n * intersections\n * @returns {Array.>|Null} If the lines intersect, the point of\n * intersection. If they overlap, the two end points of the overlapping segment.\n * Otherwise, null.\n */\nexport default function (a1, a2, b1, b2, noEndpointTouch) {\n // The algorithm expects our lines in the form P + sd, where P is a point,\n // s is on the interval [0, 1], and d is a vector.\n // We are passed two points. P can be the first point of each pair. The\n // vector, then, could be thought of as the distance (in x and y components)\n // from the first point to the second point.\n // So first, let's make our vectors:\n const va = [a2[0] - a1[0], a2[1] - a1[1]];\n const vb = [b2[0] - b1[0], b2[1] - b1[1]];\n // We also define a function to convert back to regular point form:\n\n /* eslint-disable arrow-body-style */\n\n function toPoint(p, s, d) {\n return [\n p[0] + s * d[0],\n p[1] + s * d[1]\n ];\n }\n\n /* eslint-enable arrow-body-style */\n\n // The rest is pretty much a straight port of the algorithm.\n const e = [b1[0] - a1[0], b1[1] - a1[1]];\n let kross = crossProduct(va, vb);\n let sqrKross = kross * kross;\n const sqrLenA = dotProduct(va, va);\n //const sqrLenB = dotProduct(vb, vb);\n\n // Check for line intersection. This works because of the properties of the\n // cross product -- specifically, two vectors are parallel if and only if the\n // cross product is the 0 vector. The full calculation involves relative error\n // to account for possible very small line segments. See Schneider & Eberly\n // for details.\n if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) {\n // If they're not parallel, then (because these are line segments) they\n // still might not actually intersect. This code checks that the\n // intersection point of the lines is actually on both line segments.\n const s = crossProduct(e, vb) / kross;\n if (s < 0 || s > 1) {\n // not on line segment a\n return null;\n }\n const t = crossProduct(e, va) / kross;\n if (t < 0 || t > 1) {\n // not on line segment b\n return null;\n }\n if (s === 0 || s === 1) {\n // on an endpoint of line segment a\n return noEndpointTouch ? null : [toPoint(a1, s, va)];\n }\n if (t === 0 || t === 1) {\n // on an endpoint of line segment b\n return noEndpointTouch ? null : [toPoint(b1, t, vb)];\n }\n return [toPoint(a1, s, va)];\n }\n\n // If we've reached this point, then the lines are either parallel or the\n // same, but the segments could overlap partially or fully, or not at all.\n // So we need to find the overlap, if any. To do that, we can use e, which is\n // the (vector) difference between the two initial points. If this is parallel\n // with the line itself, then the two lines are the same line, and there will\n // be overlap.\n //const sqrLenE = dotProduct(e, e);\n kross = crossProduct(e, va);\n sqrKross = kross * kross;\n\n if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) {\n // Lines are just parallel, not the same. No overlap.\n return null;\n }\n\n const sa = dotProduct(va, e) / sqrLenA;\n const sb = sa + dotProduct(va, vb) / sqrLenA;\n const smin = Math.min(sa, sb);\n const smax = Math.max(sa, sb);\n\n // this is, essentially, the FindIntersection acting on floats from\n // Schneider & Eberly, just inlined into this function.\n if (smin <= 1 && smax >= 0) {\n\n // overlap on an end point\n if (smin === 1) {\n return noEndpointTouch ? null : [toPoint(a1, smin > 0 ? smin : 0, va)];\n }\n\n if (smax === 0) {\n return noEndpointTouch ? null : [toPoint(a1, smax < 1 ? smax : 1, va)];\n }\n\n if (noEndpointTouch && smin === 0 && smax === 1) return null;\n\n // There's overlap on a segment -- two points of intersection. Return both.\n return [\n toPoint(a1, smin > 0 ? smin : 0, va),\n toPoint(a1, smax < 1 ? smax : 1, va)\n ];\n }\n\n return null;\n}\n","import divideSegment from './divide_segment';\nimport intersection from './segment_intersection';\nimport equals from './equals';\nimport compareEvents from './compare_events';\nimport {\n NON_CONTRIBUTING,\n SAME_TRANSITION,\n DIFFERENT_TRANSITION\n} from './edge_type';\n\n/**\n * @param {SweepEvent} se1\n * @param {SweepEvent} se2\n * @param {Queue} queue\n * @return {Number}\n */\nexport default function possibleIntersection (se1, se2, queue) {\n // that disallows self-intersecting polygons,\n // did cost us half a day, so I'll leave it\n // out of respect\n // if (se1.isSubject === se2.isSubject) return;\n const inter = intersection(\n se1.point, se1.otherEvent.point,\n se2.point, se2.otherEvent.point\n );\n\n const nintersections = inter ? inter.length : 0;\n if (nintersections === 0) return 0; // no intersection\n\n // the line segments intersect at an endpoint of both line segments\n if ((nintersections === 1) &&\n (equals(se1.point, se2.point) ||\n equals(se1.otherEvent.point, se2.otherEvent.point))) {\n return 0;\n }\n\n if (nintersections === 2 && se1.isSubject === se2.isSubject) {\n // if(se1.contourId === se2.contourId){\n // console.warn('Edges of the same polygon overlap',\n // se1.point, se1.otherEvent.point, se2.point, se2.otherEvent.point);\n // }\n //throw new Error('Edges of the same polygon overlap');\n return 0;\n }\n\n // The line segments associated to se1 and se2 intersect\n if (nintersections === 1) {\n\n // if the intersection point is not an endpoint of se1\n if (!equals(se1.point, inter[0]) && !equals(se1.otherEvent.point, inter[0])) {\n divideSegment(se1, inter[0], queue);\n }\n\n // if the intersection point is not an endpoint of se2\n if (!equals(se2.point, inter[0]) && !equals(se2.otherEvent.point, inter[0])) {\n divideSegment(se2, inter[0], queue);\n }\n return 1;\n }\n\n // The line segments associated to se1 and se2 overlap\n const events = [];\n let leftCoincide = false;\n let rightCoincide = false;\n\n if (equals(se1.point, se2.point)) {\n leftCoincide = true; // linked\n } else if (compareEvents(se1, se2) === 1) {\n events.push(se2, se1);\n } else {\n events.push(se1, se2);\n }\n\n if (equals(se1.otherEvent.point, se2.otherEvent.point)) {\n rightCoincide = true;\n } else if (compareEvents(se1.otherEvent, se2.otherEvent) === 1) {\n events.push(se2.otherEvent, se1.otherEvent);\n } else {\n events.push(se1.otherEvent, se2.otherEvent);\n }\n\n if ((leftCoincide && rightCoincide) || leftCoincide) {\n // both line segments are equal or share the left endpoint\n se2.type = NON_CONTRIBUTING;\n se1.type = (se2.inOut === se1.inOut)\n ? SAME_TRANSITION : DIFFERENT_TRANSITION;\n\n if (leftCoincide && !rightCoincide) {\n // honestly no idea, but changing events selection from [2, 1]\n // to [0, 1] fixes the overlapping self-intersecting polygons issue\n divideSegment(events[1].otherEvent, events[0].point, queue);\n }\n return 2;\n }\n\n // the line segments share the right endpoint\n if (rightCoincide) {\n divideSegment(events[0], events[1].point, queue);\n return 3;\n }\n\n // no line segment includes totally the other one\n if (events[0] !== events[3].otherEvent) {\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[1], events[2].point, queue);\n return 3;\n }\n\n // one line segment includes the other one\n divideSegment(events[0], events[1].point, queue);\n divideSegment(events[3].otherEvent, events[2].point, queue);\n\n return 3;\n}\n","import signedArea from './signed_area';\nimport compareEvents from './compare_events';\nimport equals from './equals';\n\n\n/**\n * @param {SweepEvent} le1\n * @param {SweepEvent} le2\n * @return {Number}\n */\nexport default function compareSegments(le1, le2) {\n if (le1 === le2) return 0;\n\n // Segments are not collinear\n if (signedArea(le1.point, le1.otherEvent.point, le2.point) !== 0 ||\n signedArea(le1.point, le1.otherEvent.point, le2.otherEvent.point) !== 0) {\n\n // If they share their left endpoint use the right endpoint to sort\n if (equals(le1.point, le2.point)) return le1.isBelow(le2.otherEvent.point) ? -1 : 1;\n\n // Different left endpoint: use the left endpoint to sort\n if (le1.point[0] === le2.point[0]) return le1.point[1] < le2.point[1] ? -1 : 1;\n\n // has the line segment associated to e1 been inserted\n // into S after the line segment associated to e2 ?\n if (compareEvents(le1, le2) === 1) return le2.isAbove(le1.point) ? -1 : 1;\n\n // The line segment associated to e2 has been inserted\n // into S after the line segment associated to e1\n return le1.isBelow(le2.point) ? -1 : 1;\n }\n\n if (le1.isSubject === le2.isSubject) { // same polygon\n let p1 = le1.point, p2 = le2.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]/*equals(le1.point, le2.point)*/) {\n p1 = le1.otherEvent.point; p2 = le2.otherEvent.point;\n if (p1[0] === p2[0] && p1[1] === p2[1]) return 0;\n else return le1.contourId > le2.contourId ? 1 : -1;\n }\n } else { // Segments are collinear, but belong to separate polygons\n return le1.isSubject ? -1 : 1;\n }\n\n return compareEvents(le1, le2) === 1 ? 1 : -1;\n}\n","import Tree from 'splaytree';\nimport computeFields from './compute_fields';\nimport possibleIntersection from './possible_intersection';\nimport compareSegments from './compare_segments';\nimport {\n INTERSECTION,\n DIFFERENCE\n} from './operation';\n\n\nexport default function subdivide(eventQueue, subject, clipping, sbbox, cbbox, operation) {\n const sweepLine = new Tree(compareSegments);\n const sortedEvents = [];\n\n const rightbound = Math.min(sbbox[2], cbbox[2]);\n\n let prev, next, begin;\n\n while (eventQueue.length !== 0) {\n let event = eventQueue.pop();\n sortedEvents.push(event);\n\n // optimization by bboxes for intersection and difference goes here\n if ((operation === INTERSECTION && event.point[0] > rightbound) ||\n (operation === DIFFERENCE && event.point[0] > sbbox[2])) {\n break;\n }\n\n if (event.left) {\n next = prev = sweepLine.insert(event);\n begin = sweepLine.minNode();\n\n if (prev !== begin) prev = sweepLine.prev(prev);\n else prev = null;\n\n next = sweepLine.next(next);\n\n const prevEvent = prev ? prev.key : null;\n let prevprevEvent;\n computeFields(event, prevEvent, operation);\n if (next) {\n if (possibleIntersection(event, next.key, eventQueue) === 2) {\n computeFields(event, prevEvent, operation);\n computeFields(event, next.key, operation);\n }\n }\n\n if (prev) {\n if (possibleIntersection(prev.key, event, eventQueue) === 2) {\n let prevprev = prev;\n if (prevprev !== begin) prevprev = sweepLine.prev(prevprev);\n else prevprev = null;\n\n prevprevEvent = prevprev ? prevprev.key : null;\n computeFields(prevEvent, prevprevEvent, operation);\n computeFields(event, prevEvent, operation);\n }\n }\n } else {\n event = event.otherEvent;\n next = prev = sweepLine.find(event);\n\n if (prev && next) {\n\n if (prev !== begin) prev = sweepLine.prev(prev);\n else prev = null;\n\n next = sweepLine.next(next);\n sweepLine.remove(event);\n\n if (next && prev) {\n possibleIntersection(prev.key, next.key, eventQueue);\n }\n }\n }\n }\n return sortedEvents;\n}\n","export default class Contour {\n\n /**\n * Contour\n *\n * @class {Contour}\n */\n constructor() {\n this.points = [];\n this.holeIds = [];\n this.holeOf = null;\n this.depth = null;\n }\n\n isExterior() {\n return this.holeOf == null;\n }\n\n}\n","import compareEvents from './compare_events';\nimport Contour from './contour';\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.}\n */\nfunction orderEvents(sortedEvents) {\n let event, i, len, tmp;\n const resultEvents = [];\n for (i = 0, len = sortedEvents.length; i < len; i++) {\n event = sortedEvents[i];\n if ((event.left && event.inResult) ||\n (!event.left && event.otherEvent.inResult)) {\n resultEvents.push(event);\n }\n }\n // Due to overlapping edges the resultEvents array can be not wholly sorted\n let sorted = false;\n while (!sorted) {\n sorted = true;\n for (i = 0, len = resultEvents.length; i < len; i++) {\n if ((i + 1) < len &&\n compareEvents(resultEvents[i], resultEvents[i + 1]) === 1) {\n tmp = resultEvents[i];\n resultEvents[i] = resultEvents[i + 1];\n resultEvents[i + 1] = tmp;\n sorted = false;\n }\n }\n }\n\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n event.otherPos = i;\n }\n\n // imagine, the right event is found in the beginning of the queue,\n // when his left counterpart is not marked yet\n for (i = 0, len = resultEvents.length; i < len; i++) {\n event = resultEvents[i];\n if (!event.left) {\n tmp = event.otherPos;\n event.otherPos = event.otherEvent.otherPos;\n event.otherEvent.otherPos = tmp;\n }\n }\n\n return resultEvents;\n}\n\n\n/**\n * @param {Number} pos\n * @param {Array.} resultEvents\n * @param {Object>} processed\n * @return {Number}\n */\nfunction nextPos(pos, resultEvents, processed, origPos) {\n let newPos = pos + 1,\n p = resultEvents[pos].point,\n p1;\n const length = resultEvents.length;\n\n if (newPos < length)\n p1 = resultEvents[newPos].point;\n\n while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) {\n if (!processed[newPos]) {\n return newPos;\n } else {\n newPos++;\n }\n p1 = resultEvents[newPos].point;\n }\n\n newPos = pos - 1;\n\n while (processed[newPos] && newPos > origPos) {\n newPos--;\n }\n\n return newPos;\n}\n\n\nfunction initializeContourFromContext(event, contours, contourId) {\n const contour = new Contour();\n if (event.prevInResult != null) {\n const prevInResult = event.prevInResult;\n // Note that it is valid to query the \"previous in result\" for its output contour id,\n // because we must have already processed it (i.e., assigned an output contour id)\n // in an earlier iteration, otherwise it wouldn't be possible that it is \"previous in\n // result\".\n const lowerContourId = prevInResult.outputContourId;\n const lowerResultTransition = prevInResult.resultTransition;\n if (lowerResultTransition > 0) {\n // We are inside. Now we have to check if the thing below us is another hole or\n // an exterior contour.\n const lowerContour = contours[lowerContourId];\n if (lowerContour.holeOf != null) {\n // The lower contour is a hole => Connect the new contour as a hole to its parent,\n // and use same depth.\n const parentContourId = lowerContour.holeOf;\n contours[parentContourId].holeIds.push(contourId);\n contour.holeOf = parentContourId;\n contour.depth = contours[lowerContourId].depth;\n } else {\n // The lower contour is an exterior contour => Connect the new contour as a hole,\n // and increment depth.\n contours[lowerContourId].holeIds.push(contourId);\n contour.holeOf = lowerContourId;\n contour.depth = contours[lowerContourId].depth + 1;\n }\n } else {\n // We are outside => this contour is an exterior contour of same depth.\n contour.holeOf = null;\n contour.depth = contours[lowerContourId].depth;\n }\n } else {\n // There is no lower/previous contour => this contour is an exterior contour of depth 0.\n contour.holeOf = null;\n contour.depth = 0;\n }\n return contour;\n}\n\n/**\n * @param {Array.} sortedEvents\n * @return {Array.<*>} polygons\n */\nexport default function connectEdges(sortedEvents) {\n let i, len;\n const resultEvents = orderEvents(sortedEvents);\n\n // \"false\"-filled array\n const processed = {};\n const contours = [];\n\n for (i = 0, len = resultEvents.length; i < len; i++) {\n\n if (processed[i]) {\n continue;\n }\n\n const contourId = contours.length;\n const contour = initializeContourFromContext(resultEvents[i], contours, contourId);\n\n // Helper function that combines marking an event as processed with assigning its output contour ID\n const markAsProcessed = (pos) => {\n processed[pos] = true;\n resultEvents[pos].outputContourId = contourId;\n };\n\n let pos = i;\n let origPos = i;\n\n const initial = resultEvents[i].point;\n contour.points.push(initial);\n\n /* eslint no-constant-condition: \"off\" */\n while (true) {\n markAsProcessed(pos);\n\n pos = resultEvents[pos].otherPos;\n\n markAsProcessed(pos);\n contour.points.push(resultEvents[pos].point);\n\n pos = nextPos(pos, resultEvents, processed, origPos);\n\n if (pos == origPos) {\n break;\n }\n }\n\n contours.push(contour);\n }\n\n return contours;\n}\n","'use strict';\n\nmodule.exports = TinyQueue;\nmodule.exports.default = TinyQueue;\n\nfunction TinyQueue(data, compare) {\n if (!(this instanceof TinyQueue)) return new TinyQueue(data, compare);\n\n this.data = data || [];\n this.length = this.data.length;\n this.compare = compare || defaultCompare;\n\n if (this.length > 0) {\n for (var i = (this.length >> 1) - 1; i >= 0; i--) this._down(i);\n }\n}\n\nfunction defaultCompare(a, b) {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nTinyQueue.prototype = {\n\n push: function (item) {\n this.data.push(item);\n this.length++;\n this._up(this.length - 1);\n },\n\n pop: function () {\n if (this.length === 0) return undefined;\n\n var top = this.data[0];\n this.length--;\n\n if (this.length > 0) {\n this.data[0] = this.data[this.length];\n this._down(0);\n }\n this.data.pop();\n\n return top;\n },\n\n peek: function () {\n return this.data[0];\n },\n\n _up: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var item = data[pos];\n\n while (pos > 0) {\n var parent = (pos - 1) >> 1;\n var current = data[parent];\n if (compare(item, current) >= 0) break;\n data[pos] = current;\n pos = parent;\n }\n\n data[pos] = item;\n },\n\n _down: function (pos) {\n var data = this.data;\n var compare = this.compare;\n var halfLength = this.length >> 1;\n var item = data[pos];\n\n while (pos < halfLength) {\n var left = (pos << 1) + 1;\n var right = left + 1;\n var best = data[left];\n\n if (right < this.length && compare(data[right], best) < 0) {\n left = right;\n best = data[right];\n }\n if (compare(best, item) >= 0) break;\n\n data[pos] = best;\n pos = left;\n }\n\n data[pos] = item;\n }\n};\n","import Queue from 'tinyqueue';\nimport SweepEvent from './sweep_event';\nimport compareEvents from './compare_events';\nimport { DIFFERENCE } from './operation';\n\nconst max = Math.max;\nconst min = Math.min;\n\nlet contourId = 0;\n\n\nfunction processPolygon(contourOrHole, isSubject, depth, Q, bbox, isExteriorRing) {\n let i, len, s1, s2, e1, e2;\n for (i = 0, len = contourOrHole.length - 1; i < len; i++) {\n s1 = contourOrHole[i];\n s2 = contourOrHole[i + 1];\n e1 = new SweepEvent(s1, false, undefined, isSubject);\n e2 = new SweepEvent(s2, false, e1, isSubject);\n e1.otherEvent = e2;\n\n if (s1[0] === s2[0] && s1[1] === s2[1]) {\n continue; // skip collapsed edges, or it breaks\n }\n\n e1.contourId = e2.contourId = depth;\n if (!isExteriorRing) {\n e1.isExteriorRing = false;\n e2.isExteriorRing = false;\n }\n if (compareEvents(e1, e2) > 0) {\n e2.left = true;\n } else {\n e1.left = true;\n }\n\n const x = s1[0], y = s1[1];\n bbox[0] = min(bbox[0], x);\n bbox[1] = min(bbox[1], y);\n bbox[2] = max(bbox[2], x);\n bbox[3] = max(bbox[3], y);\n\n // Pushing it so the queue is sorted from left to right,\n // with object on the left having the highest priority.\n Q.push(e1);\n Q.push(e2);\n }\n}\n\n\nexport default function fillQueue(subject, clipping, sbbox, cbbox, operation) {\n const eventQueue = new Queue(null, compareEvents);\n let polygonSet, isExteriorRing, i, ii, j, jj; //, k, kk;\n\n for (i = 0, ii = subject.length; i < ii; i++) {\n polygonSet = subject[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (isExteriorRing) contourId++;\n processPolygon(polygonSet[j], true, contourId, eventQueue, sbbox, isExteriorRing);\n }\n }\n\n for (i = 0, ii = clipping.length; i < ii; i++) {\n polygonSet = clipping[i];\n for (j = 0, jj = polygonSet.length; j < jj; j++) {\n isExteriorRing = j === 0;\n if (operation === DIFFERENCE) isExteriorRing = false;\n if (isExteriorRing) contourId++;\n processPolygon(polygonSet[j], false, contourId, eventQueue, cbbox, isExteriorRing);\n }\n }\n\n return eventQueue;\n}\n","import subdivideSegments from './subdivide_segments';\nimport connectEdges from './connect_edges';\nimport fillQueue from './fill_queue';\nimport {\n INTERSECTION,\n DIFFERENCE,\n UNION,\n XOR\n} from './operation';\n\nconst EMPTY = [];\n\n\nfunction trivialOperation(subject, clipping, operation) {\n let result = null;\n if (subject.length * clipping.length === 0) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = (subject.length === 0) ? clipping : subject;\n }\n }\n return result;\n}\n\n\nfunction compareBBoxes(subject, clipping, sbbox, cbbox, operation) {\n let result = null;\n if (sbbox[0] > cbbox[2] ||\n cbbox[0] > sbbox[2] ||\n sbbox[1] > cbbox[3] ||\n cbbox[1] > sbbox[3]) {\n if (operation === INTERSECTION) {\n result = EMPTY;\n } else if (operation === DIFFERENCE) {\n result = subject;\n } else if (operation === UNION ||\n operation === XOR) {\n result = subject.concat(clipping);\n }\n }\n return result;\n}\n\n\nexport default function boolean(subject, clipping, operation) {\n if (typeof subject[0][0][0] === 'number') {\n subject = [subject];\n }\n if (typeof clipping[0][0][0] === 'number') {\n clipping = [clipping];\n }\n let trivial = trivialOperation(subject, clipping, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n const sbbox = [Infinity, Infinity, -Infinity, -Infinity];\n const cbbox = [Infinity, Infinity, -Infinity, -Infinity];\n\n // console.time('fill queue');\n const eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('fill queue');\n\n trivial = compareBBoxes(subject, clipping, sbbox, cbbox, operation);\n if (trivial) {\n return trivial === EMPTY ? null : trivial;\n }\n // console.time('subdivide edges');\n const sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation);\n //console.timeEnd('subdivide edges');\n\n // console.time('connect vertices');\n const contours = connectEdges(sortedEvents, operation);\n //console.timeEnd('connect vertices');\n\n // Convert contours to polygons\n const polygons = [];\n for (let i = 0; i < contours.length; i++) {\n let contour = contours[i];\n if (contour.isExterior()) {\n // The exterior ring goes first\n let rings = [contour.points];\n // Followed by holes if any\n for (let j = 0; j < contour.holeIds.length; j++) {\n let holeId = contour.holeIds[j];\n rings.push(contours[holeId].points);\n }\n polygons.push(rings);\n }\n }\n\n return polygons;\n}\n","import boolean from './src/';\nimport {\n INTERSECTION,\n DIFFERENCE,\n UNION,\n XOR\n} from './src/operation';\n\nexport function union (subject, clipping) {\n return boolean(subject, clipping, UNION);\n}\n\nexport function diff (subject, clipping) {\n return boolean(subject, clipping, DIFFERENCE);\n}\n\nexport function xor (subject, clipping) {\n return boolean(subject, clipping, XOR);\n}\n\nexport function intersection (subject, clipping) {\n return boolean(subject, clipping, INTERSECTION);\n}\n\n/**\n * @enum {Number}\n */\nexport const operations = { UNION, DIFFERENCE, INTERSECTION, XOR };\n"],"names":["const","let","prototypeAccessors","Tree","Queue","subdivideSegments","intersection"],"mappings":";;;;;;;;;;;;;;;EAAA,SAAS,eAAe,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE;AACtE;EACe,IAAM,SAAS,GAE5B,kBAAW,CAAC,OAAyB,EAAE,YAAoB,EAAE;qCAA1C,GAAG;+CAA6B,GAAG;AAAQ;EAChE,EAAI,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;EAC5B,EAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;EACtB,E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ACzC,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;EAChD,CAAC;AACD;AACA,EAAO,SAAS,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE;EACxC,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,CAAC,CAAC;EACzC,CAAC;AACD;AACA,EAAO,SAASK,cAAY,EAAE,OAAO,EAAE,QAAQ,EAAE;EACjD,EAAE,OAAO,OAAO,CAAC,OAAO,EAAE,QAAQ,EAAE,YAAY,CAAC,CAAC;EAClD,CAAC;AACD;EACA;EACA;EACA;AACA,AAAY,MAAC,UAAU,GAAG,SAAE,KAAK,cAAE,UAAU,gBAAE,YAAY,OAAE,GAAG,EAAE;;;;;;;;;;;;;;;;"} \ No newline at end of file diff --git a/index.js b/index.js index 0812939..04441cf 100644 --- a/index.js +++ b/index.js @@ -14,7 +14,7 @@ export function diff (subject, clipping) { return boolean(subject, clipping, DIFFERENCE); } -export function xor (subject, clipping){ +export function xor (subject, clipping) { return boolean(subject, clipping, XOR); } diff --git a/src/compute_fields.js b/src/compute_fields.js index 43846f2..10d8eb9 100644 --- a/src/compute_fields.js +++ b/src/compute_fields.js @@ -42,7 +42,12 @@ export default function computeFields (event, prev, operation) { } // check if the line segment belongs to the Boolean operation - event.inResult = inResult(event, operation); + let isInResult = inResult(event, operation); + if (isInResult) { + event.resultTransition = determineResultTransition(event, operation); + } else { + event.resultTransition = 0; + } } @@ -74,3 +79,27 @@ function inResult(event, operation) { return false; } /* eslint-enable indent */ + + +function determineResultTransition(event, operation) { + let thisIn = !event.inOut; + let thatIn = !event.otherInOut; + + let isIn; + switch (operation) { + case INTERSECTION: + isIn = thisIn && thatIn; break; + case UNION: + isIn = thisIn || thatIn; break; + case XOR: + isIn = thisIn ^ thatIn; break; + case DIFFERENCE: + if (event.isSubject) { + isIn = thisIn && !thatIn; + } else { + isIn = thatIn && !thisIn; + } + break; + } + return isIn ? +1 : -1; +} diff --git a/src/connect_edges.js b/src/connect_edges.js index 92dba4c..d3b5f65 100644 --- a/src/connect_edges.js +++ b/src/connect_edges.js @@ -1,5 +1,5 @@ import compareEvents from './compare_events'; -import { DIFFERENCE } from './operation'; +import Contour from './contour'; /** * @param {Array.} sortedEvents @@ -33,7 +33,7 @@ function orderEvents(sortedEvents) { for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; - event.pos = i; + event.otherPos = i; } // imagine, the right event is found in the beginning of the queue, @@ -41,9 +41,9 @@ function orderEvents(sortedEvents) { for (i = 0, len = resultEvents.length; i < len; i++) { event = resultEvents[i]; if (!event.left) { - tmp = event.pos; - event.pos = event.otherEvent.pos; - event.otherEvent.pos = tmp; + tmp = event.otherPos; + event.otherPos = event.otherEvent.otherPos; + event.otherEvent.otherPos = tmp; } } @@ -57,18 +57,15 @@ function orderEvents(sortedEvents) { * @param {Object>} processed * @return {Number} */ -function nextPos(pos, resultEvents, processed, origIndex) { - let p, p1; - let newPos = pos + 1; +function nextPos(pos, resultEvents, processed, origPos) { + let newPos = pos + 1, + p = resultEvents[pos].point, + p1; const length = resultEvents.length; - p = resultEvents[pos].point; - if (newPos < length) p1 = resultEvents[newPos].point; - - // while in range and not the current one by value while (newPos < length && p1[0] === p[0] && p1[1] === p[1]) { if (!processed[newPos]) { return newPos; @@ -80,78 +77,106 @@ function nextPos(pos, resultEvents, processed, origIndex) { newPos = pos - 1; - while (processed[newPos] && newPos >= origIndex) { + while (processed[newPos] && newPos > origPos) { newPos--; } + return newPos; } +function initializeContourFromContext(event, contours, contourId) { + const contour = new Contour(); + if (event.prevInResult != null) { + const prevInResult = event.prevInResult; + // Note that it is valid to query the "previous in result" for its output contour id, + // because we must have already processed it (i.e., assigned an output contour id) + // in an earlier iteration, otherwise it wouldn't be possible that it is "previous in + // result". + const lowerContourId = prevInResult.outputContourId; + const lowerResultTransition = prevInResult.resultTransition; + if (lowerResultTransition > 0) { + // We are inside. Now we have to check if the thing below us is another hole or + // an exterior contour. + const lowerContour = contours[lowerContourId]; + if (lowerContour.holeOf != null) { + // The lower contour is a hole => Connect the new contour as a hole to its parent, + // and use same depth. + const parentContourId = lowerContour.holeOf; + contours[parentContourId].holeIds.push(contourId); + contour.holeOf = parentContourId; + contour.depth = contours[lowerContourId].depth; + } else { + // The lower contour is an exterior contour => Connect the new contour as a hole, + // and increment depth. + contours[lowerContourId].holeIds.push(contourId); + contour.holeOf = lowerContourId; + contour.depth = contours[lowerContourId].depth + 1; + } + } else { + // We are outside => this contour is an exterior contour of same depth. + contour.holeOf = null; + contour.depth = contours[lowerContourId].depth; + } + } else { + // There is no lower/previous contour => this contour is an exterior contour of depth 0. + contour.holeOf = null; + contour.depth = 0; + } + return contour; +} + /** * @param {Array.} sortedEvents * @return {Array.<*>} polygons */ -export default function connectEdges(sortedEvents, operation) { +export default function connectEdges(sortedEvents) { let i, len; const resultEvents = orderEvents(sortedEvents); // "false"-filled array const processed = {}; - const result = []; - let event; + const contours = []; for (i = 0, len = resultEvents.length; i < len; i++) { - if (processed[i]) continue; - const contour = [[]]; - - if (!resultEvents[i].isExteriorRing) { - if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length === 0) { - result.push(contour); - } else if (result.length === 0) { - result.push([[contour]]); - } else { - result[result.length - 1].push(contour[0]); - } - } else if (operation === DIFFERENCE && !resultEvents[i].isSubject && result.length > 1) { - result[result.length - 1].push(contour[0]); - } else { - result.push(contour); + + if (processed[i]) { + continue; } - const ringId = result.length - 1; + const contourId = contours.length; + const contour = initializeContourFromContext(resultEvents[i], contours, contourId); + + // Helper function that combines marking an event as processed with assigning its output contour ID + const markAsProcessed = (pos) => { + processed[pos] = true; + resultEvents[pos].outputContourId = contourId; + }; + let pos = i; + let origPos = i; const initial = resultEvents[i].point; - contour[0].push(initial); + contour.points.push(initial); - while (pos >= i) { - event = resultEvents[pos]; - processed[pos] = true; + /* eslint no-constant-condition: "off" */ + while (true) { + markAsProcessed(pos); - if (event.left) { - event.resultInOut = false; - event.contourId = ringId; - } else { - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; - } + pos = resultEvents[pos].otherPos; - pos = event.pos; - processed[pos] = true; - contour[0].push(resultEvents[pos].point); - pos = nextPos(pos, resultEvents, processed, i); - } + markAsProcessed(pos); + contour.points.push(resultEvents[pos].point); - pos = pos === -1 ? i : pos; + pos = nextPos(pos, resultEvents, processed, origPos); + + if (pos == origPos) { + break; + } + } - event = resultEvents[pos]; - processed[pos] = processed[event.pos] = true; - event.otherEvent.resultInOut = true; - event.otherEvent.contourId = ringId; + contours.push(contour); } - // Handle if the result is a polygon (eg not multipoly) - // Commented it again, let's see what do we mean by that - // if (result.length === 1) result = result[0]; - return result; + return contours; } diff --git a/src/contour.js b/src/contour.js new file mode 100644 index 0000000..a4c96ce --- /dev/null +++ b/src/contour.js @@ -0,0 +1,19 @@ +export default class Contour { + + /** + * Contour + * + * @class {Contour} + */ + constructor() { + this.points = []; + this.holeIds = []; + this.holeOf = null; + this.depth = null; + } + + isExterior() { + return this.holeOf == null; + } + +} diff --git a/src/divide_segment.js b/src/divide_segment.js index d53ceb9..82ffb90 100644 --- a/src/divide_segment.js +++ b/src/divide_segment.js @@ -14,7 +14,6 @@ export default function divideSegment(se, p, queue) { /* eslint-disable no-console */ if (equals(se.point, se.otherEvent.point)) { - console.warn('what is that, a collapsed segment?', se); } /* eslint-enable no-console */ diff --git a/src/index.js b/src/index.js index 2f92594..b3a3f69 100644 --- a/src/index.js +++ b/src/index.js @@ -60,7 +60,7 @@ export default function boolean(subject, clipping, operation) { const sbbox = [Infinity, Infinity, -Infinity, -Infinity]; const cbbox = [Infinity, Infinity, -Infinity, -Infinity]; - //console.time('fill queue'); + // console.time('fill queue'); const eventQueue = fillQueue(subject, clipping, sbbox, cbbox, operation); //console.timeEnd('fill queue'); @@ -68,12 +68,29 @@ export default function boolean(subject, clipping, operation) { if (trivial) { return trivial === EMPTY ? null : trivial; } - //console.time('subdivide edges'); + // console.time('subdivide edges'); const sortedEvents = subdivideSegments(eventQueue, subject, clipping, sbbox, cbbox, operation); //console.timeEnd('subdivide edges'); - //console.time('connect vertices'); - const result = connectEdges(sortedEvents, operation); + // console.time('connect vertices'); + const contours = connectEdges(sortedEvents, operation); //console.timeEnd('connect vertices'); - return result; + + // Convert contours to polygons + const polygons = []; + for (let i = 0; i < contours.length; i++) { + let contour = contours[i]; + if (contour.isExterior()) { + // The exterior ring goes first + let rings = [contour.points]; + // Followed by holes if any + for (let j = 0; j < contour.holeIds.length; j++) { + let holeId = contour.holeIds[j]; + rings.push(contours[holeId].points); + } + polygons.push(rings); + } + } + + return polygons; } diff --git a/src/sweep_event.js b/src/sweep_event.js index ad232cb..1c2e991 100644 --- a/src/sweep_event.js +++ b/src/sweep_event.js @@ -65,20 +65,24 @@ export default class SweepEvent { this.prevInResult = null; /** - * Does event belong to result? - * @type {Boolean} + * Type of result transition (0 = not in result, +1 = out-in, -1, in-out) + * @type {Number} */ - this.inResult = false; - + this.resultTransition = 0; // connection step /** - * @type {Boolean} + * @type {Number} */ - this.resultInOut = false; + this.otherPos = -1; - this.isExteriorRing = true; + /** + * @type {Number} + */ + this.outputContourId = -1; + + this.isExteriorRing = true; // TODO: Looks unused, remove? } @@ -113,15 +117,25 @@ export default class SweepEvent { } + /** + * Does event belong to result? + * @return {Boolean} + */ + get inResult() { + return this.resultTransition !== 0; + } + + clone () { const copy = new SweepEvent( this.point, this.left, this.otherEvent, this.isSubject, this.type); - copy.inResult = this.inResult; - copy.prevInResult = this.prevInResult; - copy.isExteriorRing = this.isExteriorRing; - copy.inOut = this.inOut; - copy.otherInOut = this.otherInOut; + copy.contourId = this.contourId; + copy.resultTransition = this.resultTransition; + copy.prevInResult = this.prevInResult; + copy.isExteriorRing = this.isExteriorRing; + copy.inOut = this.inOut; + copy.otherInOut = this.otherInOut; return copy; } diff --git a/test/genericTestCases/closed_loop1.geojson b/test/genericTestCases/closed_loop1.geojson new file mode 100644 index 0000000..1d2eb63 --- /dev/null +++ b/test/genericTestCases/closed_loop1.geojson @@ -0,0 +1,56 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [-1, 1], + [1, 1], + [1, -1], + [-1, -1], + [-1, -0.9], + [0.9, -0.9], + [0.9, 0.9], + [-1, 0.9], + [-1, 1] + ] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [[[-1, 1], [-0.9, 1], [-0.9, -1], [-1, -1], [-1, 1]]], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [-1, -1], + [-0.9, -1], + [1, -1], + [1, 1], + [-0.9, 1], + [-1, 1], + [-1, 0.9], + [-1, -0.9], + [-1, -1] + ], + [[-0.9, -0.9], [0.9, -0.9], [0.9, 0.9], [-0.9, 0.9], [-0.9, -0.9]] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "union"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/disjoint_boxes.geojson b/test/genericTestCases/disjoint_boxes.geojson new file mode 100644 index 0000000..cd80e06 --- /dev/null +++ b/test/genericTestCases/disjoint_boxes.geojson @@ -0,0 +1,104 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [ + [0.55, 0.55], + [0.55, 1.45], + [1.45, 1.45], + [1.45, 0.55], + [0.55, 0.55] + ] + ], + [ + [ + [1.55, 1.55], + [1.55, 2.45], + [2.45, 2.45], + [2.45, 1.55], + [1.55, 1.55] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [0.55, 1.55], + [0.55, 2.45], + [1.45, 2.45], + [1.45, 1.55], + [0.55, 1.55] + ] + ], + [ + [ + [1.55, 0.55], + [1.55, 1.45], + [2.45, 1.45], + [2.45, 0.55], + [1.55, 0.55] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [0.55, 0.55], + [1.45, 0.55], + [1.45, 1.45], + [0.55, 1.45], + [0.55, 0.55] + ] + ], + [ + [ + [0.55, 1.55], + [1.45, 1.55], + [1.45, 2.45], + [0.55, 2.45], + [0.55, 1.55] + ] + ], + [ + [ + [1.55, 0.55], + [2.45, 0.55], + [2.45, 1.45], + [1.55, 1.45], + [1.55, 0.55] + ] + ], + [ + [ + [1.55, 1.55], + [2.45, 1.55], + [2.45, 2.45], + [1.55, 2.45], + [1.55, 1.55] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "union"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/disjoint_union_nesting.geojson b/test/genericTestCases/disjoint_union_nesting.geojson index c6cd27d..cc664ae 100644 --- a/test/genericTestCases/disjoint_union_nesting.geojson +++ b/test/genericTestCases/disjoint_union_nesting.geojson @@ -50,15 +50,11 @@ "coordinates": [ [ [ - [ - [ - [4.25, 2.25], - [4.75, 2.25], - [4.75, 2.75], - [4.25, 2.75], - [4.25, 2.25] - ] - ] + [4.25, 2.25], + [4.75, 2.25], + [4.75, 2.75], + [4.25, 2.75], + [4.25, 2.25] ] ], [ @@ -91,10 +87,10 @@ }, "properties": { "operation": "union", - "comment": "This case is wrong, because the first result ring has too many levels of array nesting. Related to #47 and #61. May be fixed by #113." + "comment": "This case has invalid input (hole lies outside parent contour), but algorithm seems to handle it reasonably. Related to #47 #61 #113." }, "type": "Feature" } ], "type": "FeatureCollection" -} \ No newline at end of file +} diff --git a/test/genericTestCases/fatal2.geojson b/test/genericTestCases/fatal2.geojson index 09c5363..e7a35bd 100644 --- a/test/genericTestCases/fatal2.geojson +++ b/test/genericTestCases/fatal2.geojson @@ -1,11 +1,7 @@ { - "type": "FeatureCollection", "features": [ { - "type": "Feature", - "properties": {}, "geometry": { - "type": "Polygon", "coordinates": [ [ [-79.887128, 40.444464], @@ -21,14 +17,14 @@ [-79.887688, 40.444658], [-79.887128, 40.444464] ] - ] - } + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" }, { - "type": "Feature", - "properties": {}, "geometry": { - "type": "Polygon", "coordinates": [ [ [-79.88648, 40.44009399906854], @@ -169,14 +165,14 @@ [-79.88652999999987, 40.44039399906853], [-79.88648, 40.44009399906854] ] - ] - } + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" }, { - "type": "Feature", - "properties": {"operation": "intersection"}, "geometry": { - "type": "MultiPolygon", "coordinates": [ [ [ @@ -215,14 +211,14 @@ [-79.88711873229528, 40.44256717591859] ] ] - ] - } + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "intersection"}, + "type": "Feature" }, { - "type": "Feature", - "properties": {"operation": "union"}, "geometry": { - "type": "MultiPolygon", "coordinates": [ [ [ @@ -362,25 +358,19 @@ [-79.894336, 40.44128999906837], [-79.894344, 40.4412529990685], [-79.894363, 40.44117499906849] - ] - ], - [ + ], [ [-79.887688, 40.444657999068475], [-79.88768796122203, 40.444657857562895], [-79.88768799972165, 40.44465799897759], [-79.887688, 40.444657999068475] - ] - ], - [ + ], [ [-79.88768795318525, 40.44465798378203], [-79.88761078560448, 40.44463125072726], [-79.887639, 40.44464199906838], [-79.88768795318525, 40.44465798378203] - ] - ], - [ + ], [ [-79.88724301621599, 40.443023510093695], [-79.887235, 40.442993999068484], @@ -390,14 +380,14 @@ [-79.88724301621599, 40.443023510093695] ] ] - ] - } + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "union"}, + "type": "Feature" }, { - "type": "Feature", - "properties": {"operation": "diff"}, "geometry": { - "type": "MultiPolygon", "coordinates": [ [ [ @@ -430,8 +420,12 @@ [-79.88768799972165, 40.44465799897759] ] ] - ] - } + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "diff"}, + "type": "Feature" } - ] + ], + "type": "FeatureCollection" } \ No newline at end of file diff --git a/test/genericTestCases/issue68.geojson b/test/genericTestCases/issue68.geojson new file mode 100644 index 0000000..05d0845 --- /dev/null +++ b/test/genericTestCases/issue68.geojson @@ -0,0 +1,76 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [ + [-89.489886, 40.482217], + [-89.489714, 40.482022], + [-89.489836, 40.482146], + [-89.489886, 40.482217] + ] + ], + [ + [ + [-89.491551, 40.483208], + [-89.486778, 40.487262], + [-89.487045, 40.485142], + [-89.491551, 40.483208] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [-89.48925, 40.484891], + [-89.488996, 40.484309], + [-89.48821, 40.484919], + [-89.48925, 40.484891] + ] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [-89.491551, 40.483208], + [-89.487045, 40.485142], + [-89.486778, 40.487262], + [-89.491551, 40.483208] + ], + [ + [-89.48925, 40.484891], + [-89.488996, 40.484309], + [-89.48821, 40.484919], + [-89.48925, 40.484891] + ] + ], + [ + [ + [-89.489886, 40.482217], + [-89.489836, 40.482146], + [-89.489714, 40.482022], + [-89.489886, 40.482217] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "diff"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/issue69.geojson b/test/genericTestCases/issue69.geojson new file mode 100644 index 0000000..0cf10d0 --- /dev/null +++ b/test/genericTestCases/issue69.geojson @@ -0,0 +1,45 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [[[2, 0], [10, 10], [10, 0], [2, 0]]], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [[5, 1], [12, 1], [12, 9], [5, 9], [5, 1]], + [[6, 2], [11, 8], [6, 8], [6, 2]] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [[[2, 0], [10, 0], [10, 1], [5, 1], [5, 3.75], [2, 0]]], + [ + [ + [6, 2], + [10, 6.800000000000001], + [10, 8], + [8.399999999999999, 8], + [6, 5], + [6, 2] + ] + ], + [[[9.2, 9], [10, 9], [10, 10], [9.2, 9]]] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "diff"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/issue69_sub1.geojson b/test/genericTestCases/issue69_sub1.geojson new file mode 100644 index 0000000..6f902a2 --- /dev/null +++ b/test/genericTestCases/issue69_sub1.geojson @@ -0,0 +1,74 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [-93.52965, 42.04924], + [-93.53626, 42.04214], + [-93.53914, 42.04358], + [-93.5313, 42.04924], + [-93.52965, 42.04924] + ], + [ + [-93.53419, 42.04589], + [-93.53449, 42.04596], + [-93.53434, 42.04588], + [-93.53419, 42.04589] + ] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [-93.5388, 42.0484], + [-93.5387, 42.0476], + [-93.53824, 42.04826], + [-93.5388, 42.0484] + ] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [-93.53914, 42.04358], + [-93.53626, 42.04214], + [-93.52965, 42.04924], + [-93.5313, 42.04924], + [-93.53914, 42.04358] + ], + [ + [-93.53449, 42.04596], + [-93.53434, 42.04588], + [-93.53419, 42.04589], + [-93.53449, 42.04596] + ] + ], + [ + [ + [-93.5388, 42.0484], + [-93.5387, 42.0476], + [-93.53824, 42.04826], + [-93.5388, 42.0484] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "union"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/issue71.geojson b/test/genericTestCases/issue71.geojson new file mode 100644 index 0000000..06aa67c --- /dev/null +++ b/test/genericTestCases/issue71.geojson @@ -0,0 +1,322 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [ + [176466.88409999758, 172075.63210000098], + [176477.45099999756, 172064.3258999996], + [176488.64299999923, 172052.3500000015], + [176492.06599999964, 172051.7960000001], + [176494.7480000034, 172050.36400000006], + [176499.52199999988, 172044.5], + [176502.2899999991, 172040.47199999914], + [176504.22999999672, 172037.90989999846], + [176506.92899999768, 172036.49500000104], + [176510.40200000256, 172035.4690000005], + [176514.06099999696, 172035.5549999997], + [176517.5, 172035.92799999937], + [176520.61900000274, 172036.04809999838], + [176523.4179000035, 172035.25699999928], + [176525.67890000343, 172033.21799999848], + [176526.84399999678, 172030.48699999973], + [176527.9069999978, 172027.80700000003], + [176529.25789999962, 172024.5540000014], + [176530.82699999958, 172022.48099999875], + [176533.0380000025, 172019.88599999994], + [176535.66899999976, 172017.86400000006], + [176538.46809999645, 172017.0401000008], + [176540.9130000025, 172017.3110000007], + [176542.53100000322, 172018.54199999943], + [176542.69789999723, 172020.936999999], + [176541.90399999917, 172023.36400000006], + [176540.08100000024, 172026.56590000167], + [176537.76910000294, 172029.68400000036], + [176535.55900000036, 172032.6330000013], + [176534.12399999797, 172035.88699999824], + [176533.81899999827, 172037.94299999997], + [176534.25699999928, 172039.71400000155], + [176536.21100000292, 172041.94099999964], + [176538.72299999744, 172043.0549999997], + [176542.49899999797, 172043.49500000104], + [176545.31499999762, 172043.63210000098], + [176549.10809999704, 172044.52699999884], + [176554.72100000083, 172046.5540000014], + [176561.17599999905, 172049.35599999875], + [176568.93100000173, 172051.53500000015], + [176576.3650000021, 172052.7030000016], + [176584.3730000034, 172053.6339999996], + [176589.5850000009, 172053.1308999993], + [176593.52799999714, 172052.87700000033], + [176597.06589999795, 172052.14699999988], + [176600.2899999991, 172049.69090000167], + [176601.4830000028, 172047.7498999983], + [176603.620099999, 172046.2199999988], + [176605.28100000322, 172045.63500000164], + [176606.39599999785, 172045.94399999827], + [176607.27000000328, 172047.21609999985], + [176606.8049999997, 172049.1090000011], + [176605.90100000054, 172051.05000000075], + [176605.5549999997, 172052.79100000113], + [176606.52899999917, 172054.53700000048], + [176608.85899999738, 172055.59600000083], + [176610.97200000286, 172055.90900000185], + [176612.86100000143, 172057.33799999952], + [176614.76600000262, 172058.78299999982], + [176618.36299999803, 172060.33799999952], + [176622.89299999923, 172061.15100000054], + [176627.83100000024, 172061.45899999887], + [176633.81899999827, 172061.56810000166], + [176642.77099999785, 172060.7589999996], + [176649.54900000244, 172057.92799999937], + [176656.8377000019, 172050.72399999946], + [176658.1550000012, 172049.4219999984], + [176659.07710000128, 172050.03130000085], + [176665.00360000134, 172053.94700000063], + [176707.14899999648, 172081.79300000146], + [176684.625, 172132.8740000017], + [176810.65299999714, 172177.37090000138], + [176809.2968999967, 172212.32679999992], + [176808.82509999722, 172224.48999999836], + [176804.07569999993, 172257.0540000014], + [176804.05099999905, 172257.22300000116], + [176802.96410000324, 172258.9294999987], + [176800.75339999795, 172262.40060000122], + [176799.68860000372, 172264.07229999825], + [176798.5345999971, 172265.88430000097], + [176795.4469999969, 172270.73200000077], + [176791.96109999716, 172268.55099999905], + [176790.33100000024, 172267.53079999983], + [176768.1169999987, 172253.62900000066], + [176765.84669999778, 172261.02389999852], + [176755.33659999818, 172295.2600999996], + [176754.51299999654, 172297.94299999997], + [176763.4104000032, 172301.13910000026], + [176774.2199999988, 172305.02199999988], + [176785.4849999994, 172309.06799999997], + [176793.8220999986, 172313.06500000134], + [176795.69449999928, 172313.9626000002], + [176797.41399999708, 172314.78700000048], + [176793.84000000358, 172320.97800000012], + [176793.42700000107, 172320.82539999858], + [176792.40299999714, 172320.44700000063], + [176791.7602000013, 172320.20969999954], + [176788.245099999, 172318.91169999912], + [176780.26200000197, 172315.96400000155], + [176766.1699000001, 172310.76099999994], + [176764.81099999696, 172314.64039999992], + [176764.02199999988, 172316.89299999923], + [176767.50869999826, 172318.22590000182], + [176767.3180000037, 172318.68400000036], + [176760.51200000197, 172316.30409999937], + [176760.67769999802, 172315.78689999878], + [176761.41849999875, 172313.4765000008], + [176761.56899999827, 172313.00699999928], + [176686.63390000165, 172287.0089999996], + [176686.5320999995, 172290.43100000173], + [176685.91600000113, 172311.1559999995], + [176685.79089999944, 172315.3601000011], + [176679.06120000035, 172313.3550999984], + [176636.88910000026, 172300.79100000113], + [176636.89090000093, 172300.7666000016], + [176645.35599999875, 172189.9750000015], + [176611.0799999982, 172170.84600000083], + [176606.81599999964, 172167.8280000016], + [176580.52600000054, 172149.22190000117], + [176543.73099999875, 172119.4200000018], + [176504.67700000107, 172091.66299999878], + [176466.88409999758, 172075.63210000098] + ] + ], + [ + [ + [176687.02899999917, 172273.7030000016], + [176689.14400000125, 172202.563000001], + [176703.73369999975, 172212.30469999835], + [176714.7704000026, 172219.67399999872], + [176728.3599999994, 172228.74799999967], + [176726.54599999636, 172287.85090000182], + [176721.57140000165, 172286.0698999986], + [176687.5874999985, 172273.90300000086], + [176687.02899999917, 172273.7030000016] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [176689.14400000125, 172202.563000001], + [176647.29299999774, 172182.33700000122], + [176645.35599999875, 172189.9750000015], + [176636.89090000093, 172300.7666000016], + [176636.88910000026, 172300.79100000113], + [176679.06120000035, 172313.3550999984], + [176685.79089999944, 172315.3601000011], + [176685.91600000113, 172311.1559999995], + [176686.5320999995, 172290.43100000173], + [176686.63390000165, 172287.0089999996], + [176687.02899999917, 172273.7030000016], + [176689.14400000125, 172202.563000001] + ] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [176466.88409999758, 172075.63210000098], + [176477.45099999756, 172064.3258999996], + [176488.64299999923, 172052.3500000015], + [176492.06599999964, 172051.7960000001], + [176494.7480000034, 172050.36400000006], + [176499.52199999988, 172044.5], + [176502.2899999991, 172040.47199999914], + [176504.22999999672, 172037.90989999846], + [176506.92899999768, 172036.49500000104], + [176510.40200000256, 172035.4690000005], + [176514.06099999696, 172035.5549999997], + [176517.5, 172035.92799999937], + [176520.61900000274, 172036.04809999838], + [176523.4179000035, 172035.25699999928], + [176525.67890000343, 172033.21799999848], + [176526.84399999678, 172030.48699999973], + [176527.9069999978, 172027.80700000003], + [176529.25789999962, 172024.5540000014], + [176530.82699999958, 172022.48099999875], + [176533.0380000025, 172019.88599999994], + [176535.66899999976, 172017.86400000006], + [176538.46809999645, 172017.0401000008], + [176540.9130000025, 172017.3110000007], + [176542.53100000322, 172018.54199999943], + [176542.69789999723, 172020.936999999], + [176541.90399999917, 172023.36400000006], + [176540.08100000024, 172026.56590000167], + [176537.76910000294, 172029.68400000036], + [176535.55900000036, 172032.6330000013], + [176534.12399999797, 172035.88699999824], + [176533.81899999827, 172037.94299999997], + [176534.25699999928, 172039.71400000155], + [176536.21100000292, 172041.94099999964], + [176538.72299999744, 172043.0549999997], + [176542.49899999797, 172043.49500000104], + [176545.31499999762, 172043.63210000098], + [176549.10809999704, 172044.52699999884], + [176554.72100000083, 172046.5540000014], + [176561.17599999905, 172049.35599999875], + [176568.93100000173, 172051.53500000015], + [176576.3650000021, 172052.7030000016], + [176584.3730000034, 172053.6339999996], + [176589.5850000009, 172053.1308999993], + [176593.52799999714, 172052.87700000033], + [176597.06589999795, 172052.14699999988], + [176600.2899999991, 172049.69090000167], + [176601.4830000028, 172047.7498999983], + [176603.620099999, 172046.2199999988], + [176605.28100000322, 172045.63500000164], + [176606.39599999785, 172045.94399999827], + [176607.27000000328, 172047.21609999985], + [176606.8049999997, 172049.1090000011], + [176605.90100000054, 172051.05000000075], + [176605.5549999997, 172052.79100000113], + [176606.52899999917, 172054.53700000048], + [176608.85899999738, 172055.59600000083], + [176610.97200000286, 172055.90900000185], + [176612.86100000143, 172057.33799999952], + [176614.76600000262, 172058.78299999982], + [176618.36299999803, 172060.33799999952], + [176622.89299999923, 172061.15100000054], + [176627.83100000024, 172061.45899999887], + [176633.81899999827, 172061.56810000166], + [176642.77099999785, 172060.7589999996], + [176649.54900000244, 172057.92799999937], + [176656.8377000019, 172050.72399999946], + [176658.1550000012, 172049.4219999984], + [176659.07710000128, 172050.03130000085], + [176665.00360000134, 172053.94700000063], + [176707.14899999648, 172081.79300000146], + [176684.625, 172132.8740000017], + [176810.65299999714, 172177.37090000138], + [176809.2968999967, 172212.32679999992], + [176808.82509999722, 172224.48999999836], + [176804.07569999993, 172257.0540000014], + [176804.05099999905, 172257.22300000116], + [176802.96410000324, 172258.9294999987], + [176800.75339999795, 172262.40060000122], + [176799.68860000372, 172264.07229999825], + [176798.5345999971, 172265.88430000097], + [176795.4469999969, 172270.73200000077], + [176791.96109999716, 172268.55099999905], + [176790.33100000024, 172267.53079999983], + [176768.1169999987, 172253.62900000066], + [176765.84669999778, 172261.02389999852], + [176755.33659999818, 172295.2600999996], + [176754.51299999654, 172297.94299999997], + [176763.4104000032, 172301.13910000026], + [176774.2199999988, 172305.02199999988], + [176785.4849999994, 172309.06799999997], + [176793.8220999986, 172313.06500000134], + [176795.69449999928, 172313.9626000002], + [176797.41399999708, 172314.78700000048], + [176793.84000000358, 172320.97800000012], + [176793.42700000107, 172320.82539999858], + [176792.40299999714, 172320.44700000063], + [176791.7602000013, 172320.20969999954], + [176788.245099999, 172318.91169999912], + [176780.26200000197, 172315.96400000155], + [176766.1699000001, 172310.76099999994], + [176764.81099999696, 172314.64039999992], + [176764.02199999988, 172316.89299999923], + [176767.50869999826, 172318.22590000182], + [176767.3180000037, 172318.68400000036], + [176760.51200000197, 172316.30409999937], + [176760.67769999802, 172315.78689999878], + [176761.41849999875, 172313.4765000008], + [176761.56899999827, 172313.00699999928], + [176686.63390000165, 172287.0089999996], + [176686.5320999995, 172290.43100000173], + [176685.91600000113, 172311.1559999995], + [176685.79089999944, 172315.3601000011], + [176679.06120000035, 172313.3550999984], + [176636.88910000026, 172300.79100000113], + [176636.89090000093, 172300.7666000016], + [176645.35599999875, 172189.9750000015], + [176611.0799999982, 172170.84600000083], + [176606.81599999964, 172167.8280000016], + [176580.52600000054, 172149.22190000117], + [176543.73099999875, 172119.4200000018], + [176504.67700000107, 172091.66299999878], + [176466.88409999758, 172075.63210000098] + ], + [ + [176687.02899999917, 172273.7030000016], + [176689.14400000125, 172202.563000001], + [176703.73369999975, 172212.30469999835], + [176714.7704000026, 172219.67399999872], + [176728.3599999994, 172228.74799999967], + [176726.54599999636, 172287.85090000182], + [176721.57140000165, 172286.0698999986], + [176687.5874999985, 172273.90300000086], + [176687.02899999917, 172273.7030000016] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "union"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/issue93.geojson b/test/genericTestCases/issue93.geojson new file mode 100644 index 0000000..9a83eef --- /dev/null +++ b/test/genericTestCases/issue93.geojson @@ -0,0 +1,458 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [0.663168, 51.562679], + [0.663108, 51.56268], + [0.663071, 51.562681], + [0.662725, 51.562688], + [0.662462, 51.562694], + [0.662426, 51.562694], + [0.66229, 51.562697], + [0.662281, 51.562698], + [0.662015, 51.562703], + [0.661886, 51.562706], + [0.661877, 51.562706], + [0.661673, 51.562718], + [0.661662, 51.562718], + [0.661599, 51.562722], + [0.661588, 51.562722], + [0.661582, 51.562723], + [0.661297, 51.562738], + [0.661294, 51.562738], + [0.661227, 51.562742], + [0.661193, 51.562744], + [0.661183, 51.562745], + [0.661157, 51.562746], + [0.661154, 51.562746], + [0.661103, 51.562749], + [0.661084, 51.56275], + [0.66108, 51.56275], + [0.661066, 51.562751], + [0.660919, 51.562761], + [0.660905, 51.562762], + [0.660832, 51.562767], + [0.660819, 51.562767], + [0.660808, 51.562768], + [0.66072, 51.562774], + [0.660688, 51.562776], + [0.660515, 51.562787], + [0.660474, 51.56279], + [0.660472, 51.56279], + [0.660433, 51.562793], + [0.660328, 51.5628], + [0.660309, 51.562801], + [0.660229, 51.562806], + [0.660216, 51.562807], + [0.660202, 51.562808], + [0.660166, 51.56281], + [0.660057, 51.562817], + [0.660043, 51.562818], + [0.660004, 51.562821], + [0.659964, 51.562823], + [0.65991, 51.562827], + [0.659884, 51.562829], + [0.659828, 51.562832], + [0.65982, 51.562833], + [0.659687, 51.562842], + [0.659631, 51.562845], + [0.65962, 51.562846], + [0.6596, 51.562847], + [0.659439, 51.562858], + [0.659432, 51.562858], + [0.659404, 51.56286], + [0.659401, 51.56286], + [0.659332, 51.562866], + [0.659318, 51.562867], + [0.659099, 51.562884], + [0.659063, 51.562887], + [0.658928, 51.562897], + [0.658914, 51.562836], + [0.658875, 51.56284], + [0.658781, 51.562423], + [0.658785, 51.562424], + [0.658818, 51.562434], + [0.658822, 51.562437], + [0.65883, 51.562437], + [0.658959, 51.562447], + [0.658977, 51.562448], + [0.659115, 51.562474], + [0.659122, 51.562474], + [0.659253, 51.562473], + [0.65926, 51.562473], + [0.65933, 51.562445], + [0.65933, 51.562444], + [0.659366, 51.562206], + [0.659361, 51.562178], + [0.659361, 51.562177], + [0.659362, 51.562139], + [0.659363, 51.562096], + [0.659359, 51.562076], + [0.659362, 51.56205], + [0.659362, 51.562046], + [0.659719, 51.562096], + [0.659882, 51.562119], + [0.659901, 51.562111], + [0.659986, 51.562078], + [0.659987, 51.562078], + [0.660195, 51.561868], + [0.660205, 51.561858], + [0.660247, 51.561802], + [0.660235, 51.561795], + [0.660224, 51.561788], + [0.660205, 51.561777], + [0.660164, 51.561759], + [0.660154, 51.561754], + [0.6595, 51.561534], + [0.659493, 51.561524], + [0.659472, 51.561494], + [0.659458, 51.561494], + [0.659316, 51.561486], + [0.659312, 51.561485], + [0.659042, 51.561586], + [0.659048, 51.561595], + [0.659063, 51.561612], + [0.658941, 51.561623], + [0.65892, 51.561625], + [0.658712, 51.561643], + [0.658566, 51.561656], + [0.658503, 51.561661], + [0.658482, 51.561663], + [0.658478, 51.561663], + [0.658479, 51.561659], + [0.658501, 51.561511], + [0.658495, 51.561501], + [0.658411, 51.56138], + [0.658402, 51.561375], + [0.658329, 51.56134], + [0.658327, 51.561339], + [0.658226, 51.561314], + [0.658219, 51.561317], + [0.658151, 51.561347], + [0.658142, 51.561349], + [0.658125, 51.561354], + [0.658116, 51.561356], + [0.65809, 51.561357], + [0.65808, 51.56136], + [0.65792, 51.561396], + [0.657814, 51.561396], + [0.657812, 51.561395], + [0.65776, 51.561382], + [0.657756, 51.561381], + [0.657745, 51.561382], + [0.657519, 51.561399], + [0.657497, 51.561397], + [0.657482, 51.561395], + [0.657476, 51.561394], + [0.657469, 51.561396], + [0.657465, 51.561396], + [0.657358, 51.561405], + [0.657345, 51.561404], + [0.657261, 51.561393], + [0.657247, 51.561392], + [0.657153, 51.561389], + [0.657145, 51.561388], + [0.657134, 51.561389], + [0.657121, 51.56139], + [0.657043, 51.561396], + [0.657026, 51.5614], + [0.657015, 51.561403], + [0.657009, 51.561404], + [0.656979, 51.561405], + [0.656966, 51.561403], + [0.656908, 51.561395], + [0.656907, 51.561395], + [0.656821, 51.561396], + [0.656813, 51.561392], + [0.656799, 51.561387], + [0.656792, 51.561385], + [0.65669, 51.561288], + [0.656662, 51.561232], + [0.656628, 51.561165], + [0.656631, 51.561153], + [0.656636, 51.561131], + [0.656634, 51.561127], + [0.656611, 51.561029], + [0.656609, 51.561019], + [0.65661, 51.561012], + [0.656614, 51.560996], + [0.656611, 51.560979], + [0.656625, 51.560972], + [0.656709, 51.56093], + [0.656727, 51.560921], + [0.656765, 51.560898], + [0.656774, 51.560892], + [0.656934, 51.560858], + [0.656945, 51.560854], + [0.657112, 51.560791], + [0.657111, 51.560789], + [0.657078, 51.560736], + [0.657074, 51.560732], + [0.657071, 51.560728], + [0.656988, 51.560678], + [0.656985, 51.560677], + [0.656809, 51.560609], + [0.656812, 51.560607], + [0.657025, 51.560324], + [0.657106, 51.560324], + [0.657298, 51.560323], + [0.657502, 51.560323], + [0.657557, 51.560379], + [0.657567, 51.560389], + [0.657575, 51.560397], + [0.657603, 51.560425], + [0.657604, 51.560426], + [0.657606, 51.560429], + [0.657886, 51.560517], + [0.65789, 51.560519], + [0.658107, 51.560587], + [0.658117, 51.560591], + [0.658128, 51.560594], + [0.658138, 51.560597], + [0.658151, 51.560601], + [0.658268, 51.560639], + [0.658283, 51.560643], + [0.658312, 51.560652], + [0.658314, 51.560653], + [0.658352, 51.560664], + [0.658366, 51.560668], + [0.658381, 51.560673], + [0.658517, 51.560714], + [0.658537, 51.56072], + [0.658541, 51.560721], + [0.658547, 51.560723], + [0.658561, 51.560727], + [0.658567, 51.560729], + [0.658571, 51.56073], + [0.658577, 51.560732], + [0.658666, 51.560759], + [0.658689, 51.560766], + [0.658765, 51.560789], + [0.658875, 51.560822], + [0.658889, 51.560826], + [0.658933, 51.560839], + [0.658938, 51.560841], + [0.659014, 51.560864], + [0.659017, 51.560865], + [0.659135, 51.5609], + [0.659818, 51.56109], + [0.659823, 51.561092], + [0.65985, 51.561099], + [0.65999, 51.561138], + [0.660342, 51.561235], + [0.660367, 51.561242], + [0.660388, 51.561248], + [0.660498, 51.561278], + [0.660525, 51.561285], + [0.660614, 51.561309], + [0.66064, 51.561317], + [0.660666, 51.561324], + [0.660704, 51.561334], + [0.660725, 51.56134], + [0.660749, 51.561346], + [0.660922, 51.561394], + [0.660958, 51.561404], + [0.660976, 51.561408], + [0.660988, 51.561412], + [0.661039, 51.561426], + [0.661044, 51.561427], + [0.661054, 51.56143], + [0.661065, 51.561434], + [0.661165, 51.561467], + [0.661179, 51.561472], + [0.661186, 51.561474], + [0.661195, 51.561477], + [0.661322, 51.561519], + [0.661323, 51.56152], + [0.661429, 51.561555], + [0.661431, 51.561556], + [0.66145, 51.561562], + [0.661459, 51.561565], + [0.661494, 51.561577], + [0.661505, 51.56158], + [0.661527, 51.561588], + [0.661552, 51.561596], + [0.661579, 51.561605], + [0.661611, 51.561616], + [0.661628, 51.561622], + [0.661631, 51.561623], + [0.661662, 51.561634], + [0.661668, 51.561636], + [0.661674, 51.561639], + [0.661706, 51.56165], + [0.66171, 51.561651], + [0.661758, 51.561668], + [0.661759, 51.561669], + [0.661801, 51.561683], + [0.661812, 51.561687], + [0.6619, 51.561719], + [0.661922, 51.561726], + [0.661944, 51.561734], + [0.661956, 51.561738], + [0.66199, 51.56175], + [0.662012, 51.561758], + [0.662069, 51.561778], + [0.66209, 51.561787], + [0.662111, 51.561796], + [0.662122, 51.561801], + [0.66215, 51.561813], + [0.66217, 51.561821], + [0.66218, 51.561825], + [0.6622, 51.561834], + [0.662211, 51.561838], + [0.662224, 51.561844], + [0.662263, 51.56186], + [0.662285, 51.561869], + [0.662313, 51.561881], + [0.662383, 51.561911], + [0.662398, 51.561917], + [0.6624, 51.561918], + [0.662414, 51.561924], + [0.662536, 51.561975], + [0.662551, 51.561982], + [0.662636, 51.562018], + [0.662651, 51.562024], + [0.662688, 51.56204], + [0.662691, 51.562042], + [0.662715, 51.562052], + [0.662792, 51.562085], + [0.66294, 51.56215], + [0.663027, 51.562194], + [0.663041, 51.562201], + [0.663141, 51.562252], + [0.663154, 51.562259], + [0.663156, 51.56226], + [0.663164, 51.562271], + [0.663188, 51.562303], + [0.663212, 51.562334], + [0.663223, 51.56235], + [0.663215, 51.5624], + [0.663192, 51.562537], + [0.663191, 51.562541], + [0.663186, 51.562571], + [0.66318, 51.562612], + [0.663177, 51.562626], + [0.663173, 51.56265], + [0.663171, 51.562661], + [0.663168, 51.562679] + ] + ], + "type": "Polygon" + }, + "properties": {"fill": "green"}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [0.657899, 51.560714], + [0.657205, 51.560501], + [0.657207, 51.560361], + [0.656965, 51.56036], + [0.656962, 51.56036], + [0.656326, 51.560346], + [0.655835, 51.560344], + [0.656072, 51.560848], + [0.656487, 51.561707], + [0.658876, 51.561546], + [0.658557, 51.560993], + [0.658555, 51.56099], + [0.658553, 51.560986], + [0.658552, 51.560983], + [0.658551, 51.560979], + [0.65855, 51.560976], + [0.65855, 51.560962], + [0.658551, 51.560958], + [0.658552, 51.560955], + [0.658553, 51.560951], + [0.658606, 51.560818], + [0.658176, 51.56069], + [0.65779, 51.561168], + [0.657584, 51.561104], + [0.657899, 51.560714] + ], + [ + [0.658258, 51.560948], + [0.658465, 51.561311], + [0.658483, 51.561406], + [0.656672, 51.561528], + [0.656249, 51.560649], + [0.656424, 51.560656], + [0.656439, 51.560511], + [0.657238, 51.560525], + [0.657145, 51.560639], + [0.657562, 51.560767], + [0.657391, 51.560977], + [0.657001, 51.560858], + [0.656784, 51.561146], + [0.657306, 51.561299], + [0.657399, 51.561179], + [0.657747, 51.561287], + [0.657832, 51.561182], + [0.658022, 51.561241], + [0.658258, 51.560948] + ] + ], + "type": "Polygon" + }, + "properties": {"fill": "red"}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [0.656784, 51.561146], + [0.657001, 51.560858], + [0.657391, 51.560977], + [0.657562, 51.560767], + [0.657145, 51.560639], + [0.657238, 51.560525], + [0.6568784588933171, 51.560518700155825], + [0.656997802573544, 51.560360135547825], + [0.657207, 51.560361], + [0.657205, 51.560501], + [0.657899, 51.560714], + [0.657584, 51.561104], + [0.65779, 51.561168], + [0.658176, 51.56069], + [0.658606, 51.560818], + [0.658553, 51.560951], + [0.658552, 51.560955], + [0.658551, 51.560958], + [0.65855, 51.560962], + [0.65855, 51.560976], + [0.658551, 51.560979], + [0.658552, 51.560983], + [0.658553, 51.560986], + [0.658555, 51.56099], + [0.658557, 51.560993], + [0.658876, 51.561546], + [0.6584919499757166, 51.56157188198154], + [0.658501, 51.561511], + [0.658495, 51.561501], + [0.6584314599374823, 51.5614094720528], + [0.658483, 51.561406], + [0.658465, 51.561311], + [0.658258, 51.560948], + [0.658022, 51.561241], + [0.657832, 51.561182], + [0.657747, 51.561287], + [0.657399, 51.561179], + [0.657306, 51.561299], + [0.656784, 51.561146] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "intersection"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/issue96.geojson b/test/genericTestCases/issue96.geojson new file mode 100644 index 0000000..a820ea0 --- /dev/null +++ b/test/genericTestCases/issue96.geojson @@ -0,0 +1,2019 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [ + [-5.0844225050718475, 56.82118935427821], + [-5.0838535, 56.8211702], + [-5.0837353, 56.82118289999995], + [-5.0836972, 56.8211822], + [-5.0834868, 56.821172399999966], + [-5.083281, 56.82114969999998], + [-5.0830782, 56.82115089999998], + [-5.0829664, 56.821141], + [-5.0826849, 56.8210829], + [-5.0823903, 56.82098249999996], + [-5.0819432, 56.82075849999996], + [-5.0818217, 56.82067609999997], + [-5.0817477, 56.820652799999976], + [-5.0817043, 56.82060349999996], + [-5.0814518, 56.820471599999976], + [-5.0812101, 56.82039219999997], + [-5.0810824, 56.820378], + [-5.0809574, 56.82034929999998], + [-5.0808115, 56.8203196], + [-5.0805575, 56.82024639999997], + [-5.080352473426072, 56.82015402319541], + [-5.080064299546843, 56.819774453961585], + [-5.080066535257358, 56.81970550600799], + [-5.0801541, 56.819691299999974], + [-5.0801798, 56.819684399999964], + [-5.0801898, 56.81966709999998], + [-5.0801832, 56.81964659999996], + [-5.0801599, 56.819642699999974], + [-5.0800769, 56.819669], + [-5.080067749805464, 56.81966805001485], + [-5.080075393006905, 56.8194323368084], + [-5.080107557155173, 56.818903595785166], + [-5.080106852393738, 56.8188933833134], + [-5.080103512847632, 56.81888332896133], + [-5.080097606072239, 56.81887363611132], + [-5.079291103268355, 56.817808836909244], + [-5.079280900995247, 56.81779804666472], + [-5.078275699486228, 56.81692464756334], + [-5.07827199725973, 56.8169216051043], + [-5.077740996687888, 56.81650840556168], + [-5.077730060823799, 56.81650099371128], + [-5.077717431932552, 56.816494441157275], + [-5.076935523766095, 56.81613957407178], + [-5.076414600327056, 56.81573737941062], + [-5.076103435787177, 56.81522190806761], + [-5.076108075441466, 56.815093274083374], + [-5.076558134115263, 56.81417372888078], + [-5.076561062833359, 56.81416612288394], + [-5.076661061639212, 56.813812822789224], + [-5.076662425824648, 56.81380563237591], + [-5.076662465809871, 56.81379840317256], + [-5.076612263788466, 56.81321660323931], + [-5.076610692399389, 56.813208401885674], + [-5.076480590405791, 56.81277210022826], + [-5.076408089594414, 56.81252900030875], + [-5.07640488357897, 56.81252108447643], + [-5.076400071933539, 56.81251341716845], + [-5.076120370936136, 56.81213801744596], + [-5.076113662251077, 56.81213034512128], + [-5.075971415002954, 56.81198968778768], + [-5.0759814, 56.811969899999966], + [-5.0759015, 56.81186879999997], + [-5.0757877, 56.81171189999996], + [-5.0757683, 56.811640699999955], + [-5.0757321, 56.811575499999954], + [-5.075721, 56.811358399999975], + [-5.0757828, 56.8113047], + [-5.0758658, 56.811215], + [-5.0758906, 56.81114059999997], + [-5.0759846, 56.810983799999974], + [-5.0760084, 56.81085409999997], + [-5.076000725481171, 56.81083805328089], + [-5.076003746657344, 56.81082899359518], + [-5.0760522, 56.810788299999984], + [-5.0760649, 56.81071969999996], + [-5.07613587706682, 56.81052279588375], + [-5.076474740835754, 56.8099681792691], + [-5.0765026, 56.80993269999998], + [-5.0765628, 56.80987849999998], + [-5.0767629, 56.809711299999975], + [-5.0768278, 56.8096175], + [-5.0768813, 56.809526499999954], + [-5.0768973, 56.80946819999998], + [-5.0769328, 56.80942689999996], + [-5.076952628335087, 56.80926360225266], + [-5.076989842982081, 56.80920936020085], + [-5.0770991, 56.809109], + [-5.0771592, 56.80903659999996], + [-5.077144635936648, 56.808983740609996], + [-5.077150900745453, 56.80897460923242], + [-5.077155759194521, 56.80896588309476], + [-5.077176351361956, 56.80891825936254], + [-5.0772776, 56.80885029999998], + [-5.0773146, 56.80878189999998], + [-5.0773107, 56.808734399999985], + [-5.077281234166157, 56.80867569386844], + [-5.07733035789224, 56.80856208292662], + [-5.07733334468683, 56.80855207326558], + [-5.077333732386435, 56.8085419326344], + [-5.077331513268288, 56.808531863083815], + [-5.077269926977104, 56.8083570890335], + [-5.077267, 56.808241099999975], + [-5.077221, 56.80814679999999], + [-5.0771487, 56.80792959999997], + [-5.0770781, 56.807787899999965], + [-5.0769818, 56.80762519999995], + [-5.0769008, 56.807536399999975], + [-5.0761416, 56.8067902], + [-5.0760064, 56.806660499999964], + [-5.075947, 56.806616099999985], + [-5.0757464, 56.806487199999985], + [-5.0755538, 56.8063957], + [-5.0754592, 56.806362099999966], + [-5.075408378251169, 56.80633717067541], + [-5.075282292797596, 56.80626652880195], + [-5.075266588105093, 56.80625902775082], + [-5.07516528747315, 56.80621792788577], + [-5.075058, 56.806165299999975], + [-5.0745412, 56.805937099999966], + [-5.0744035, 56.80589559999997], + [-5.074217680509599, 56.80585431710212], + [-5.074173392494825, 56.80583849111142], + [-5.074155533130106, 56.80583314377629], + [-5.074140985640383, 56.805830283741145], + [-5.0741284, 56.8058179], + [-5.0735492, 56.8057288], + [-5.073469533955619, 56.805729559181046], + [-5.073451341717011, 56.80572683595746], + [-5.073277843074884, 56.805692476328595], + [-5.0732691, 56.805688899999986], + [-5.0732026, 56.80567709999998], + [-5.07320057173734, 56.80567717343334], + [-5.073078576512948, 56.80565301325009], + [-5.073078148002581, 56.80565292884826], + [-5.072726495704795, 56.80558404305916], + [-5.072459731350001, 56.805516622896405], + [-5.072385498378591, 56.80549295709813], + [-5.072047135153812, 56.80536725949438], + [-5.071743310874293, 56.805219178664515], + [-5.0714697, 56.805025], + [-5.0711059, 56.80472379999996], + [-5.0710573, 56.80465039999997], + [-5.0710473, 56.80460839999997], + [-5.0710152, 56.80455709999998], + [-5.0708008, 56.80427919999997], + [-5.0702227, 56.80336219999995], + [-5.0700235, 56.80311], + [-5.0698687, 56.802880199999954], + [-5.0696916, 56.802658], + [-5.0695335, 56.802547699999955], + [-5.069544, 56.802516], + [-5.0690218, 56.80197969999995], + [-5.0685784, 56.80150609999998], + [-5.0683886, 56.801349499999986], + [-5.0682417, 56.801209699999966], + [-5.067800957551483, 56.8008976852266], + [-5.067551209684683, 56.800648606926494], + [-5.067379197734261, 56.800320604183895], + [-5.0673164, 56.80016349999995], + [-5.067250297641417, 56.80007480571355], + [-5.067157858011309, 56.799898531266734], + [-5.067148412949355, 56.79988548155604], + [-5.067096863685227, 56.79983060224214], + [-5.0670653, 56.79978009999997], + [-5.0668036, 56.79939709999998], + [-5.0664568, 56.79910939999997], + [-5.066092, 56.79894779999997], + [-5.065790861693006, 56.79885686120155], + [-5.065784864950974, 56.798854429314076], + [-5.065131096379549, 56.798618961134835], + [-5.064593210510688, 56.79840916150834], + [-5.064459402855822, 56.79832497430791], + [-5.064078373324219, 56.7980851909765], + [-5.0639455, 56.79798709999998], + [-5.063921346244208, 56.79795731045964], + [-5.063714604747818, 56.79750839369863], + [-5.063689036070978, 56.79736225573366], + [-5.06369, 56.797361199999976], + [-5.0637241, 56.79731149999998], + [-5.0637619, 56.79712729999996], + [-5.0637997, 56.797042399999974], + [-5.0638299, 56.796951399999955], + [-5.063840545777511, 56.79690825365828], + [-5.063871112516328, 56.796843488764075], + [-5.0639093, 56.796789899999986], + [-5.063932, 56.79671749999997], + [-5.0639698, 56.79664289999998], + [-5.0639773, 56.79653939999994], + [-5.0639055, 56.79642969999995], + [-5.0638034, 56.79631589999997], + [-5.063623328360122, 56.79621350284332], + [-5.063330773953526, 56.79597542748944], + [-5.063328610315422, 56.79597372055465], + [-5.062912309893991, 56.79565522091085], + [-5.062900300053392, 56.79564730001357], + [-5.062886349109989, 56.79564040313278], + [-5.062870743931184, 56.795634672085676], + [-5.062794520457557, 56.795610832288475], + [-5.0627904, 56.795607899999965], + [-5.0626619, 56.79556029999998], + [-5.062596244726551, 56.79554881883488], + [-5.061970617563441, 56.795353141928594], + [-5.061829665075179, 56.79528707942135], + [-5.061732, 56.795220799999974], + [-5.0614863, 56.79509249999998], + [-5.0614006, 56.7950526], + [-5.0612103, 56.79497859999998], + [-5.0610742, 56.79491029999998], + [-5.0609117, 56.794837799999975], + [-5.0607983, 56.794790199999966], + [-5.0606547, 56.7947033], + [-5.060472294716802, 56.79458896281343], + [-5.060196366913685, 56.79437442967579], + [-5.059938431132121, 56.7941111723512], + [-5.059937003483922, 56.79410975382291], + [-5.059692603007896, 56.793873254048236], + [-5.059681302733298, 56.793864055083624], + [-5.059529699068083, 56.793759134204265], + [-5.059448529659369, 56.793631933095426], + [-5.059328739775509, 56.793414152188944], + [-5.05930995647021, 56.79331564447932], + [-5.059308, 56.79326369999996], + [-5.059212275682353, 56.79251355245305], + [-5.05921117960946, 56.79239145573188], + [-5.05928705325, 56.792069825566166], + [-5.059288125524903, 56.792061546483055], + [-5.059287450985335, 56.79205325477282], + [-5.059227849896295, 56.79173495484243], + [-5.059227245654561, 56.791732237848834], + [-5.05917034491058, 56.79151143791297], + [-5.059167808115607, 56.79150425444858], + [-5.059163953297503, 56.79149724980947], + [-5.05903715274842, 56.791303149937924], + [-5.059030289602089, 56.79129448476168], + [-5.059021414141305, 56.79128638867432], + [-5.059010679819252, 56.79127900165282], + [-5.058976409658929, 56.7912583623708], + [-5.0588789, 56.79111249999996], + [-5.0587957, 56.79109659999998], + [-5.0587182, 56.791105], + [-5.0586901, 56.79110809999995], + [-5.0585872, 56.791151099999965], + [-5.058494824635421, 56.7912096088545], + [-5.058427960873987, 56.791223494243475], + [-5.058409870339997, 56.791228145299016], + [-5.058393279672446, 56.79123425257887], + [-5.058131879813535, 56.79134725240899], + [-5.058123668828177, 56.79135111382938], + [-5.057684768895031, 56.79157541351664], + [-5.05767211168842, 56.79158286921267], + [-5.057661503491429, 56.7915912325077], + [-5.057575774094469, 56.79167023124861], + [-5.0575512, 56.79166839999998], + [-5.0574907, 56.79163729999996], + [-5.0573093, 56.79150689999995], + [-5.0572035, 56.79139919999999], + [-5.057119464767872, 56.791320843978156], + [-5.057101738752526, 56.791296905563634], + [-5.0571049, 56.79123069999997], + [-5.0570386, 56.7911325], + [-5.0569804, 56.791003799999956], + [-5.056928, 56.79093369999997], + [-5.0566955, 56.79050019999996], + [-5.0566524, 56.790447099999966], + [-5.056499422840998, 56.79038123234917], + [-5.055869115150336, 56.78997086089894], + [-5.055735418347902, 56.78979802014871], + [-5.055566635008775, 56.78957982319612], + [-5.055195338853872, 56.78902155821231], + [-5.055166872572557, 56.788808926281845], + [-5.055115571252607, 56.78842632634459], + [-5.055114826826991, 56.78842231547202], + [-5.054960852611891, 56.78777375802082], + [-5.055071842243443, 56.787217421317266], + [-5.055072457510139, 56.7872060202266], + [-5.055069778134389, 56.78719470933569], + [-5.054862376394724, 56.786657309559814], + [-5.054857806674836, 56.7866483658985], + [-5.054851173155182, 56.786639820507105], + [-5.054842586683363, 56.78663181617936], + [-5.054832190740584, 56.786624486667556], + [-5.054820159044032, 56.786617954447934], + [-5.05480669264402, 56.78661232867379], + [-5.053398922762203, 56.78609952353009], + [-5.052823869112232, 56.78586649607518], + [-5.052512373696763, 56.78574021165627], + [-5.051647183424055, 56.785227645199754], + [-5.051634428229315, 56.78503272084079], + [-5.051632644620956, 56.78502320465459], + [-5.051628573808174, 56.78501390284921], + [-5.051561130117941, 56.78489522361774], + [-5.05159325976338, 56.78480721907061], + [-5.051595675226743, 56.78479638084742], + [-5.051606774763253, 56.78466308083912], + [-5.051606435304696, 56.784653678102615], + [-5.051603861547536, 56.78464438023261], + [-5.051515360835772, 56.784423280327886], + [-5.051507645690004, 56.784410164864035], + [-5.051402645348595, 56.78427696496709], + [-5.051395135608862, 56.784268881115736], + [-5.05138582967021, 56.78426138122732], + [-5.051374875935312, 56.784254584902364], + [-5.051362449083946, 56.78424860052176], + [-5.051119149240513, 56.78414560067578], + [-5.05109760437492, 56.784138191121066], + [-5.050876504664123, 56.78407769122202], + [-5.050862689931641, 56.78407444029466], + [-5.050848287363703, 56.784072080019726], + [-5.050833486831478, 56.784070641513146], + [-5.050413287620675, 56.78404334155912], + [-5.05039789961582, 56.784042843424665], + [-5.049997820914563, 56.78404284342474], + [-5.049066248466787, 56.78401609834609], + [-5.048450112170306, 56.78391352419519], + [-5.048329843193051, 56.78330495073044], + [-5.048326684289387, 56.78329524192849], + [-5.048321133262226, 56.78328586200232], + [-5.04784693153339, 56.78263936247374], + [-5.04783890516812, 56.78263030846943], + [-5.046916303437762, 56.781751909316036], + [-5.046915413585923, 56.78175107509339], + [-5.046014212013696, 56.78091907591312], + [-5.046005070697779, 56.780911716562905], + [-5.045994340971041, 56.78090503460811], + [-5.044627235608612, 56.780153211771385], + [-5.043682004451961, 56.778802860261585], + [-5.04396962010656, 56.778227720915815], + [-5.044219946111421, 56.77772706567761], + [-5.045108976317644, 56.77697484521091], + [-5.046031634053867, 56.776249817571006], + [-5.046670416790827, 56.776303722689214], + [-5.046687645573158, 56.776304541930514], + [-5.046704920696494, 56.77630410695737], + [-5.046721940571063, 56.77630242536353], + [-5.04713354128229, 56.776246125254644], + [-5.04714907361037, 56.776243426984344], + [-5.047163875044285, 56.776239690221416], + [-5.047177716255251, 56.77623497286219], + [-5.047190382792116, 56.77622934799597], + [-5.047201678404027, 56.77622290277277], + [-5.047211428081086, 56.776215737052816], + [-5.047696727382215, 56.775808436633774], + [-5.047704857746765, 56.775800573819254], + [-5.047711125294253, 56.775792212696956], + [-5.047715430795, 56.77578348564441], + [-5.047717706083597, 56.775774530832585], + [-5.047787104344933, 56.775271830772574], + [-5.047787114515391, 56.77526104354609], + [-5.047784183356109, 56.775250377036436], + [-5.04748088102908, 56.77452237736149], + [-5.047477030932942, 56.774514982084774], + [-5.047471763214956, 56.77450785511505], + [-5.046963728019259, 56.77391389129399], + [-5.04663308896715, 56.773362698822034], + [-5.04656069293501, 56.772898667148255], + [-5.046559288425677, 56.77289265752792], + [-5.046421086958397, 56.77245005768046], + [-5.046416584587734, 56.772440030347134], + [-5.046409510775885, 56.772430460967556], + [-5.046169210152349, 56.77216246119697], + [-5.046163386553889, 56.77215665789507], + [-5.045802385969291, 56.771833158220524], + [-5.045791528573977, 56.771824826483304], + [-5.04577862362996, 56.77181742723784], + [-5.045763933462056, 56.771811110891434], + [-5.045747756683539, 56.771806005838776], + [-5.045730422126136, 56.77180221585212], + [-5.045404222665225, 56.7717453159514], + [-5.045390008014714, 56.771743310553894], + [-5.045375473807582, 56.771742191705385], + [-5.045360802840538, 56.77174197347766], + [-5.044758403989612, 56.771751573451326], + [-5.044756432897056, 56.77175161302337], + [-5.044314633738066, 56.77176231299712], + [-5.044291408362242, 56.77176402868762], + [-5.043456954175049, 56.771868116442874], + [-5.042500006201438, 56.7718013772788], + [-5.041351720463965, 56.77161039251483], + [-5.040803582341719, 56.77151721595063], + [-5.04033291988711, 56.771396404738596], + [-5.040319101159831, 56.7713933705997], + [-5.039825901960779, 56.771302570757754], + [-5.03980528103558, 56.77129977267055], + [-5.039493581610555, 56.77127197271865], + [-5.039477918654264, 56.771271102509836], + [-5.039091289181199, 56.77126246662606], + [-5.038728319759183, 56.77124557529982], + [-5.038487144386079, 56.77121760664362], + [-5.03836516464192, 56.77116833109147], + [-5.038254561705084, 56.77108395288377], + [-5.038090106639766, 56.77088952217539], + [-5.0379813477199, 56.77041267071711], + [-5.03797749388615, 56.77040218309272], + [-5.037970846881517, 56.77039212592545], + [-5.037860846546339, 56.77025782603252], + [-5.037853766822706, 56.770250379403365], + [-5.037845152823503, 56.77024343734495], + [-5.037835122271261, 56.77023709472969], + [-5.037699422267213, 56.77016079483108], + [-5.037687169496897, 56.77015472339523], + [-5.037673622463826, 56.77014954709781], + [-5.037658996647449, 56.77014534827291], + [-5.037643524686095, 56.770142193706974], + [-5.037458424996744, 56.770111593760504], + [-5.037443762860107, 56.77010966784906], + [-5.037428794632018, 56.77010868070171], + [-5.037413718971525, 56.77010864541983], + [-5.037398735963513, 56.7701095624718], + [-5.037219036290796, 56.77012636243805], + [-5.037202199010498, 56.77012857440839], + [-5.037186040835524, 56.77013198748685], + [-5.036985341104968, 56.77018298739695], + [-5.036977987192591, 56.77018518749714], + [-5.036970622003041, 56.77018737619988], + [-5.0369704722437, 56.77018743577455], + [-5.036970309853309, 56.77018748435752], + [-5.036963541827739, 56.77019019271204], + [-5.036956759916273, 56.77019289057328], + [-5.036956625599425, 56.77019296037193], + [-5.036956476146658, 56.770193020178255], + [-5.036950409812859, 56.77019619044584], + [-5.036944327217214, 56.770199351305386], + [-5.036852337238845, 56.77025384528489], + [-5.036785398322123, 56.7702934811466], + [-5.036671581136191, 56.770319522285654], + [-5.03660749054709, 56.77031971629849], + [-5.036533518855928, 56.7703141973479], + [-5.036517994584214, 56.77031355229406], + [-5.036502440666002, 56.77031392416586], + [-5.036487077249141, 56.77031530769984], + [-5.036472121785205, 56.77031768331372], + [-5.036163935479264, 56.77037775686831], + [-5.035483930506816, 56.770488778107236], + [-5.034710747629625, 56.77049426369205], + [-5.033750913309432, 56.77040348584927], + [-5.033739048668949, 56.77040266809259], + [-5.033309165228711, 56.770383941649236], + [-5.033162952842571, 56.770322661478545], + [-5.032745753120217, 56.770147961740655], + [-5.032730637805079, 56.77014249644737], + [-5.032714293848013, 56.77013822854273], + [-5.032697033851368, 56.77013523965664], + [-5.031978535117203, 56.770040239823324], + [-5.03196249566122, 56.77003869138097], + [-5.031946230156653, 56.770038248875046], + [-5.031228163485361, 56.77004327861562], + [-5.030778998533689, 56.77000844898548], + [-5.030757941203743, 56.77000775897847], + [-5.030281865714793, 56.770013270472546], + [-5.029901937432302, 56.76993583402815], + [-5.029884563621346, 56.769933026896986], + [-5.029866650398643, 56.76993156378089], + [-5.029848540852238, 56.76993147270265], + [-5.029612441300336, 56.7699392726847], + [-5.029594601448172, 56.7699405422159], + [-5.029577247224947, 56.76994314320245], + [-5.029324247622088, 56.76999154311278], + [-5.029301923585764, 56.76999715288565], + [-5.028803624124256, 56.770154952622036], + [-5.028791507973671, 56.77015929659929], + [-5.027678490918634, 56.770608413683675], + [-5.027265627452971, 56.77069587910747], + [-5.02639658883008, 56.77081187518612], + [-5.02639658883008, 56.7709597742192], + [-5.027335711621496, 56.77083442357739], + [-5.027351904492563, 56.77083164053779], + [-5.027789005148308, 56.77073904036897], + [-5.027804751357127, 56.770735026785246], + [-5.027819391499965, 56.77072990405236], + [-5.028940653207516, 56.77027745954526], + [-5.029421995867688, 56.77012502946384], + [-5.029646243784535, 56.7700821298563], + [-5.029836723650749, 56.7700758370065], + [-5.030214163036814, 56.770152766097716], + [-5.030229877075177, 56.77015536609115], + [-5.030246060194936, 56.77015686559987], + [-5.030262457853618, 56.77015724103825], + [-5.030752879298577, 56.77015156351889], + [-5.031201502254727, 56.77018635107251], + [-5.031221468462152, 56.77018705114348], + [-5.031933190378858, 56.770182065901565], + [-5.032608966092147, 56.77027141693292], + [-5.033004224230213, 56.770436928972195], + [-5.033181001663783, 56.770511019576126], + [-5.033196658842235, 56.77051665658052], + [-5.033213620757753, 56.77052100900596], + [-5.033231540212038, 56.77052398776132], + [-5.033250050406345, 56.77052553187355], + [-5.033712384895555, 56.770545672010066], + [-5.034678188393849, 56.77063701430622], + [-5.034702089947854, 56.77063805094072], + [-5.035505491482456, 56.77063235091911], + [-5.035523480570888, 56.77063153966424], + [-5.035541095250985, 56.770629376937606], + [-5.03624179641142, 56.770514976721024], + [-5.036248277889867, 56.7705138167812], + [-5.036529750067585, 56.77045895052231], + [-5.036581381235431, 56.77046280265984], + [-5.036599721346842, 56.77046345581749], + [-5.03669882153621, 56.77046315581558], + [-5.036715748407127, 56.770462500444765], + [-5.03673237853071, 56.77046064788621], + [-5.036748432281617, 56.770457629289616], + [-5.036912332517488, 56.77042012922216], + [-5.036929006428533, 56.7704155223606], + [-5.036944317078998, 56.77040965974852], + [-5.036957952971134, 56.770402660662064], + [-5.03704427305481, 56.770351548688836], + [-5.037118708128757, 56.77030745394777], + [-5.037280143687985, 56.770266431434656], + [-5.037412385366501, 56.7702540682777], + [-5.037535757987124, 56.77027446375458], + [-5.037631668828436, 56.770328391580165], + [-5.037724093737016, 56.77044123441909], + [-5.037832950561739, 56.7709185292749], + [-5.037837021472434, 56.770929436674166], + [-5.037844112196551, 56.77093986781723], + [-5.038022411682521, 56.77115066798963], + [-5.038034886202877, 56.77116237660403], + [-5.038164786073096, 56.771261476715], + [-5.038177983352675, 56.77127004488495], + [-5.038193449136521, 56.77127738036255], + [-5.038354849255184, 56.771342580461585], + [-5.038370553345114, 56.77134802587678], + [-5.038387503237015, 56.771352195697915], + [-5.038405357502683, 56.771355005930616], + [-5.038682158000016, 56.77138710598681], + [-5.038698148173042, 56.77138840016596], + [-5.039072048881555, 56.77140580019397], + [-5.039077780585226, 56.77140599747794], + [-5.03945940207112, 56.77141452150777], + [-5.039752800921299, 56.771440689259386], + [-5.040228831948191, 56.77152832838906], + [-5.040700880580803, 56.77164949544446], + [-5.040717597796708, 56.77165304259934], + [-5.041274698724455, 56.77174774276478], + [-5.041275460783456, 56.77174787090825], + [-5.042434662725824, 56.77194067124537], + [-5.042456109458064, 56.77194318404308], + [-5.043446911312539, 56.77201228416034], + [-5.043462122516216, 56.77201285337643], + [-5.043477351059239, 56.77201244732348], + [-5.043492390243135, 56.77201107151286], + [-5.044337919467774, 56.771905602370275], + [-5.044766981849441, 56.77189521083972], + [-5.045346170007636, 56.77188598079118], + [-5.04560469481365, 56.77193107604918], + [-5.045937057527528, 56.77222891414132], + [-5.046166316119592, 56.772484600893556], + [-5.046300378327033, 56.77291395379751], + [-5.046373605396361, 56.77338333280373], + [-5.04637578379235, 56.773391602993634], + [-5.046379696109799, 56.773399678406854], + [-5.046717594464963, 56.77396297875348], + [-5.046723438036395, 56.77397104428017], + [-5.047228856012808, 56.77456195271855], + [-5.047524598017353, 56.775271817360675], + [-5.047459239019699, 56.77574523446726], + [-5.047020464710445, 56.7761134858196], + [-5.046684183889066, 56.7761594833688], + [-5.045990884469436, 56.776100977412035], + [-5.045974768424556, 56.77610017307002], + [-5.045958594770481, 56.77610046677368], + [-5.045942610759093, 56.776101854033115], + [-5.0459270607432, 56.77610431364077], + [-5.045912182441098, 56.776107807995906], + [-5.045898203302536, 56.77611228367915], + [-5.045885337031666, 56.77611767226916], + [-5.045873780320099, 56.776123891388835], + [-5.045863709840021, 56.77613084596423], + [-5.044893108686666, 56.77689354514177], + [-5.044890602907807, 56.77689558782139], + [-5.043989301580958, 56.77765818704146], + [-5.043979681267374, 56.777667885738595], + [-5.043972881618455, 56.777678279201595], + [-5.043717180628941, 56.778189677734446], + [-5.043418179361967, 56.77878757623941], + [-5.043414807507304, 56.77879650323572], + [-5.043413521769236, 56.77880559276595], + [-5.043414342846467, 56.77881469851123], + [-5.043417257523199, 56.77882367389159], + [-5.043422218881773, 56.778832374425455], + [-5.044392815084058, 56.780218975398014], + [-5.044400511949996, 56.780228032989484], + [-5.044410423753367, 56.780236416688496], + [-5.04442235873728, 56.78024396430009], + [-5.045797528698641, 56.78100022467195], + [-5.046689936157024, 56.781824109337286], + [-5.047607502207719, 56.78269771914416], + [-5.048071508151786, 56.78333032394201], + [-5.04819915451194, 56.783976249284365], + [-5.04819992883291, 56.78397856053853], + [-5.048201811977156, 56.783984819805234], + [-5.048202354923839, 56.78398580212361], + [-5.048202646491, 56.78398667241579], + [-5.048204326696695, 56.783989369524555], + [-5.048206783389565, 56.783993814258835], + [-5.048208055780578, 56.78399535554302], + [-5.048208893490106, 56.783996700254974], + [-5.048211100819502, 56.78399904408648], + [-5.048213851099418, 56.78400237557916], + [-5.048216145263805, 56.78400440047995], + [-5.048217759623993, 56.784006114672046], + [-5.048770458734618, 56.78449991516997], + [-5.048779728400123, 56.78450715585577], + [-5.048790549292018, 56.78451371618296], + [-5.048802757282811, 56.78451949664642], + [-5.049360943983058, 56.78475249128862], + [-5.049757930572188, 56.78491828582567], + [-5.049771261281642, 56.78492317591164], + [-5.049785581108873, 56.7849271348274], + [-5.051172016201057, 56.78525364317051], + [-5.051440962795205, 56.78531693014778], + [-5.052328666952865, 56.78584283617055], + [-5.052346919319733, 56.78585179918145], + [-5.052668341727795, 56.78598210836673], + [-5.053246042149018, 56.786216208722024], + [-5.053251405830547, 56.78621827048006], + [-5.054617314004347, 56.786715827890596], + [-5.054809274121202, 56.787213225308285], + [-5.054698855868834, 56.78776667844323], + [-5.054698084822023, 56.78777523656595], + [-5.054699175330116, 56.787783784216], + [-5.054854698360472, 56.788438884688986], + [-5.05490572683024, 56.78881946942477], + [-5.05493552550569, 56.789042065303796], + [-5.054938095439817, 56.789051896077304], + [-5.054943110598742, 56.78906143847741], + [-5.055321809000603, 56.78963083886015], + [-5.05532428204027, 56.789634279568425], + [-5.055494381238994, 56.789854179437675], + [-5.055635780527663, 56.790036979270525], + [-5.055644742257239, 56.79004651495212], + [-5.055656191227153, 56.79005521199068], + [-5.055923320907867, 56.79022913304563], + [-5.0558842, 56.790244599999966], + [-5.056112946043207, 56.790352591605306], + [-5.056305813426518, 56.79047815994251], + [-5.056342445683901, 56.79050454202945], + [-5.0563681, 56.790524899999966], + [-5.056374880239901, 56.79052790094474], + [-5.056462391796525, 56.79059092535902], + [-5.056555818468024, 56.79078644080464], + [-5.0565517, 56.79081129999999], + [-5.0565517, 56.790933099999975], + [-5.0568262, 56.79138029999996], + [-5.05707, 56.791666799999966], + [-5.0571802, 56.791757299999944], + [-5.0573454, 56.79189079999998], + [-5.0574201, 56.79190809999997], + [-5.0574919, 56.791905699999965], + [-5.0575538, 56.791921], + [-5.057605, 56.7919124], + [-5.0576609, 56.79188429999997], + [-5.0576605, 56.791839], + [-5.057679230391617, 56.79180675249511], + [-5.057746953778136, 56.79178085635096], + [-5.057761375470753, 56.791774463977006], + [-5.05777400758786, 56.79176701793309], + [-5.057784596913017, 56.79175866747913], + [-5.057876923474196, 56.7916735891097], + [-5.058298171322838, 56.791458309935784], + [-5.05853948864883, 56.79135399135283], + [-5.058622612064148, 56.791336729338234], + [-5.0587614, 56.79135659999996], + [-5.058809171057008, 56.7913800059129], + [-5.058912929316837, 56.79153883529996], + [-5.058967605005468, 56.79175100667762], + [-5.059025395205642, 56.79205964702162], + [-5.058950345697522, 56.79237777422629], + [-5.05894926356118, 56.79238735378415], + [-5.058950782322862, 56.79255666688042], + [-5.0588983, 56.792658099999976], + [-5.0589159, 56.79287339999996], + [-5.0589992, 56.79309149999995], + [-5.0589602, 56.79331719999997], + [-5.0589764, 56.79341569999998], + [-5.0592242, 56.79374219999997], + [-5.059260276767664, 56.79377175824539], + [-5.05928981506814, 56.79381804824424], + [-5.059295380333332, 56.793825426974415], + [-5.059302403267853, 56.793832421254415], + [-5.059310797131696, 56.79383894469735], + [-5.059469797940468, 56.793948985405294], + [-5.059557295211276, 56.79403365503241], + [-5.0598665, 56.79445179999996], + [-5.0598997, 56.79449409999997], + [-5.060657347046678, 56.794982064082646], + [-5.060674416356393, 56.79499533510432], + [-5.060684305821487, 56.795002114041345], + [-5.060695613229276, 56.7950081888731], + [-5.06070223432766, 56.79501097327642], + [-5.0607133, 56.79501809999997], + [-5.0611689, 56.7952944], + [-5.0614169, 56.795423199999966], + [-5.0615187, 56.79546559999997], + [-5.0618895, 56.795571099999975], + [-5.0622467, 56.795654499999955], + [-5.0625795, 56.79571819999997], + [-5.0626968, 56.79575129999997], + [-5.0627399, 56.795777199999975], + [-5.0628913, 56.79592629999997], + [-5.063099729859053, 56.79604519269657], + [-5.063114685124376, 56.796056634476116], + [-5.06363877432231, 56.79648312784175], + [-5.063670915883596, 56.7966324980781], + [-5.0636267, 56.79670819999996], + [-5.063625, 56.796743699999965], + [-5.063630951378125, 56.79677910742796], + [-5.063573428579678, 56.7969009851488], + [-5.063572115086645, 56.7969040418793], + [-5.063502270686251, 56.797084112265715], + [-5.0634933, 56.797090899999944], + [-5.0634186, 56.79722439999996], + [-5.0633556, 56.7973084], + [-5.0633291, 56.7973747], + [-5.0633945, 56.7975], + [-5.0635941, 56.797913499999964], + [-5.06366136152693, 56.797979378080626], + [-5.063693933385671, 56.79805010439076], + [-5.063698564827959, 56.798058142523644], + [-5.063704880134638, 56.79806582770508], + [-5.063712792380572, 56.7980730541535], + [-5.063722192659599, 56.79807972240142], + [-5.064262001302243, 56.79841942838794], + [-5.0644060012506, 56.79851002850163], + [-5.064416802798192, 56.79851606660646], + [-5.064428822965484, 56.79852136621768], + [-5.064981323407518, 56.79873686654881], + [-5.06498533420564, 56.79873837027412], + [-5.065225703306525, 56.79882494500756], + [-5.0656725, 56.798996099999954], + [-5.066026605450785, 56.79915350852219], + [-5.066299682464358, 56.79936756368276], + [-5.0666183, 56.799651699999956], + [-5.0668297, 56.79999989999999], + [-5.0669763, 56.800116], + [-5.067048146780964, 56.800209062543885], + [-5.067121965496018, 56.80034982826676], + [-5.0671456, 56.80041069999998], + [-5.067215044051697, 56.80052731918506], + [-5.067303539542217, 56.80069606902236], + [-5.067308345040403, 56.80070362195112], + [-5.067314650996707, 56.800710834990156], + [-5.067338471207105, 56.800734591659555], + [-5.067367, 56.80078249999998], + [-5.0675088, 56.80091379999996], + [-5.06753839316311, 56.80093397893352], + [-5.067576050452532, 56.80097153523316], + [-5.067582617258695, 56.800977400413714], + [-5.068074768112272, 56.80137312331462], + [-5.06815, 56.801450399999986], + [-5.0684195, 56.80172729999998], + [-5.0685702, 56.801907199999974], + [-5.0687165, 56.802033], + [-5.0687712, 56.802100899999964], + [-5.0688205, 56.802203], + [-5.0688988, 56.8022595], + [-5.0689218, 56.80229939999998], + [-5.0690105, 56.802382599999966], + [-5.0691134, 56.80251939999995], + [-5.0692419, 56.80264839999998], + [-5.0693444, 56.8027733], + [-5.0694913, 56.80295239999997], + [-5.0697146, 56.803159], + [-5.0697674, 56.803223299999964], + [-5.0698463, 56.80340649999997], + [-5.0701487, 56.8037793], + [-5.070172, 56.80386319999998], + [-5.0703764, 56.80415929999998], + [-5.0704691, 56.804370099999986], + [-5.0709194, 56.80498819999998], + [-5.0710295, 56.80511219999998], + [-5.0712731, 56.80522329999996], + [-5.0714898, 56.80535079999997], + [-5.072206, 56.805612699999976], + [-5.0723789, 56.80568389999996], + [-5.0725285, 56.80572969999997], + [-5.0727688, 56.8057822], + [-5.0728901, 56.80580339999997], + [-5.0731145, 56.805822199999966], + [-5.073259548521571, 56.80584164308395], + [-5.073367323927089, 56.80586298686416], + [-5.073377319000957, 56.805864721598844], + [-5.074034166716566, 56.80596304422003], + [-5.0740621423819, 56.805970249168006], + [-5.074499243396785, 56.80612644265136], + [-5.075102414141387, 56.80637116514891], + [-5.075475256108104, 56.806580056595344], + [-5.076023513526231, 56.807038979725284], + [-5.0763621, 56.80750119999997], + [-5.0765058, 56.80767469999998], + [-5.0766237, 56.80778249999998], + [-5.0766932, 56.80792089999996], + [-5.0767824, 56.80805139999997], + [-5.0768095, 56.808125599999954], + [-5.076821, 56.8082234], + [-5.0768728, 56.8082826], + [-5.0769239, 56.80839729999997], + [-5.0769811, 56.808488099999984], + [-5.0769929, 56.8086541], + [-5.0769364, 56.80885], + [-5.076784787492785, 56.80910022534516], + [-5.076510307792257, 56.80950028567876], + [-5.0764816, 56.8095249], + [-5.076435, 56.809556], + [-5.0763439, 56.80959409999998], + [-5.076316, 56.80962689999996], + [-5.0762096, 56.80974869999997], + [-5.0761356, 56.8098744], + [-5.0760289, 56.8100072], + [-5.075949, 56.81011189999999], + [-5.0758929, 56.8102317], + [-5.0759225, 56.810345699999985], + [-5.0759056, 56.81041619999998], + [-5.0758658, 56.810457799999966], + [-5.0758008, 56.81062059999997], + [-5.0757155, 56.810697199999986], + [-5.0756864, 56.8107647], + [-5.075694456871266, 56.81095775237792], + [-5.075668679041583, 56.811035050719845], + [-5.0756196, 56.81107629999998], + [-5.0755706, 56.811058699999975], + [-5.0755304, 56.81107249999999], + [-5.0755087, 56.81103739999997], + [-5.0754988, 56.81095889999999], + [-5.0754806, 56.8109261], + [-5.0754501, 56.81091569999997], + [-5.0754043, 56.8109436], + [-5.07532, 56.8110585], + [-5.0752694, 56.811278599999945], + [-5.0752788, 56.81133409999996], + [-5.075315, 56.811343], + [-5.0753295, 56.81136439999997], + [-5.0752973, 56.81149769999998], + [-5.0752971, 56.81158709999997], + [-5.0753136, 56.81164149999997], + [-5.0756078, 56.81200929999997], + [-5.075638, 56.81205379999996], + [-5.0758445, 56.81224119999998], + [-5.075871678565633, 56.81218733950714], + [-5.075880768369225, 56.81219632773172], + [-5.076151908325035, 56.81256024045391], + [-5.076222009240063, 56.812795298729085], + [-5.076350892123785, 56.813227522070115], + [-5.076400108731193, 56.81379794799158], + [-5.076303225998736, 56.8141402304768], + [-5.075850863082588, 56.81506447055261], + [-5.075847683819908, 56.81507300046135], + [-5.075846408862165, 56.815081678637945], + [-5.075841008339635, 56.815231378636035], + [-5.075841553502018, 56.81523950016853], + [-5.075843767340653, 56.81524753599317], + [-5.075847621537082, 56.81525538331528], + [-5.076172019966671, 56.81579278364812], + [-5.076179508356363, 56.815802657042454], + [-5.076189585546753, 56.815811811612626], + [-5.07673188497837, 56.81623051207843], + [-5.076742704635766, 56.81623780370603], + [-5.076755167426731, 56.816244258261364], + [-5.077536884887427, 56.81659903967925], + [-5.078055880771903, 56.81700289941917], + [-5.079053362627056, 56.817869595557696], + [-5.079844695524088, 56.8189143755296], + [-5.079813441011627, 56.81942810405679], + [-5.079813388865646, 56.81942922227376], + [-5.079807117335942, 56.81962259217873], + [-5.0797536, 56.819685], + [-5.0797376, 56.81968989999998], + [-5.0797499, 56.8196995], + [-5.079804525098718, 56.81970251818767], + [-5.079801787616651, 56.81978692227056], + [-5.079801924145179, 56.81978839102829], + [-5.0797872, 56.819814599999965], + [-5.0797558, 56.819831499999985], + [-5.079759, 56.81984839999995], + [-5.0797905, 56.8198747], + [-5.0797174, 56.819943], + [-5.0797266, 56.820074], + [-5.0797571, 56.820147], + [-5.0798064, 56.82019129999996], + [-5.0797808, 56.820250799999954], + [-5.0797868, 56.820283099999976], + [-5.0798659, 56.82042119999995], + [-5.0798793, 56.82052419999999], + [-5.0799331, 56.82056149999995], + [-5.0801321, 56.82062939999997], + [-5.080215, 56.8206399], + [-5.0802523, 56.820675], + [-5.0804414, 56.820738199999965], + [-5.0807451, 56.82082629999996], + [-5.0807099, 56.8208462], + [-5.080595, 56.8208657], + [-5.0805053, 56.820895399999976], + [-5.0804674, 56.820922899999964], + [-5.0805194, 56.82094159999997], + [-5.0805758, 56.820904], + [-5.08066, 56.820875299999976], + [-5.0807475, 56.820862599999984], + [-5.0808018, 56.820837499999975], + [-5.0809123, 56.82086419999995], + [-5.0811938, 56.82091359999997], + [-5.0813255, 56.82092119999998], + [-5.0814572, 56.820908], + [-5.081482, 56.820911], + [-5.0815494, 56.82095249999997], + [-5.0818038, 56.82101019999997], + [-5.081880925099665, 56.821020475197784], + [-5.082081284760894, 56.8210893731434], + [-5.082117, 56.82113159999999], + [-5.0822752, 56.82120809999997], + [-5.0824719, 56.821265699999984], + [-5.0826933, 56.82130459999996], + [-5.0828028, 56.82135], + [-5.0828781, 56.821363], + [-5.0831054, 56.821366], + [-5.0832286, 56.82138759999997], + [-5.0836266, 56.82139809999997], + [-5.0836644, 56.82140519999997], + [-5.083799, 56.82140529999998], + [-5.0842168, 56.82144259999996], + [-5.0844225050718475, 56.82145112888207], + [-5.0844225050718475, 56.82118935427821] + ] + ], + [ + [ + [-5.0844225050718475, 56.832621492171256], + [-5.0843141, 56.83263489999997], + [-5.0835698, 56.83265639999997], + [-5.0834655, 56.832680299999964], + [-5.0828692, 56.83274349999998], + [-5.0828112, 56.8327434], + [-5.0827731, 56.83272469999997], + [-5.0827228, 56.83273269999997], + [-5.0826786, 56.832753599999954], + [-5.0825515, 56.83274419999995], + [-5.0823024, 56.83274579999997], + [-5.0820384, 56.832765799999976], + [-5.0819758, 56.832762], + [-5.0819236, 56.832745299999964], + [-5.0818978, 56.83275039999997], + [-5.081827, 56.8327872], + [-5.0818004, 56.832782499999944], + [-5.0817711, 56.83276529999996], + [-5.0816977, 56.83275], + [-5.0815713, 56.8327477], + [-5.0808636, 56.832691899999965], + [-5.080459, 56.832719599999955], + [-5.0803587, 56.8327417], + [-5.0802846, 56.83276839999994], + [-5.0802252, 56.83277729999996], + [-5.0801564, 56.832776199999984], + [-5.0800842, 56.8327753], + [-5.0799201, 56.832793699999954], + [-5.0795527, 56.832892699999974], + [-5.0791712883983875, 56.83302498513894], + [-5.0844225050718475, 56.83302498513894], + [-5.0844225050718475, 56.832621492171256] + ], + [ + [-5.051379858375106, 56.78514618835705], + [-5.051373401463104, 56.7850475033589], + [-5.051301226452125, 56.78492049694643], + [-5.051297340670326, 56.784911775258664], + [-5.051295466805563, 56.78490285566966], + [-5.051295634113581, 56.78489387744342], + [-5.051297839980689, 56.78488498075939], + [-5.051334580273318, 56.78478434939144], + [-5.051344437848347, 56.78466597464513], + [-5.05126234554798, 56.78446088128153], + [-5.051175779914012, 56.78435106618435], + [-5.050969364440095, 56.78426368098362], + [-5.050780086442988, 56.78421188848845], + [-5.050390179593937, 56.78418655658689], + [-5.049994399615806, 56.78418655657996], + [-5.049987563202976, 56.78418645851914], + [-5.049036661389644, 56.78415915848006], + [-5.049020918064802, 56.78415817942333], + [-5.04900550553014, 56.78415616356193], + [-5.048621418931659, 56.78409222143322], + [-5.048980727048144, 56.784413236504776], + [-5.049519442101911, 56.784638102954275], + [-5.049903636793424, 56.78479855495112], + [-5.051275200148113, 56.78512156069807], + [-5.051379858375106, 56.78514618835705] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [-5.0844225050718475, 56.76993147270265], + [-5.02639658883008, 56.76993147270265], + [-5.02639658883008, 56.83302498513894], + [-5.0844225050718475, 56.83302498513894], + [-5.0844225050718475, 56.76993147270265] + ] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [ + [-5.0844225050718475, 56.82118935427821], + [-5.0838535, 56.8211702], + [-5.0837353, 56.82118289999995], + [-5.0836972, 56.8211822], + [-5.0834868, 56.821172399999966], + [-5.083281, 56.82114969999998], + [-5.0830782, 56.82115089999998], + [-5.0829664, 56.821141], + [-5.0826849, 56.8210829], + [-5.0823903, 56.82098249999996], + [-5.0819432, 56.82075849999996], + [-5.0818217, 56.82067609999997], + [-5.0817477, 56.820652799999976], + [-5.0817043, 56.82060349999996], + [-5.0814518, 56.820471599999976], + [-5.0812101, 56.82039219999997], + [-5.0810824, 56.820378], + [-5.0809574, 56.82034929999998], + [-5.0808115, 56.8203196], + [-5.0805575, 56.82024639999997], + [-5.080352473426072, 56.82015402319541], + [-5.080064299546843, 56.819774453961585], + [-5.080066535257358, 56.81970550600799], + [-5.0801541, 56.819691299999974], + [-5.0801798, 56.819684399999964], + [-5.0801898, 56.81966709999998], + [-5.0801832, 56.81964659999996], + [-5.0801599, 56.819642699999974], + [-5.0800769, 56.819669], + [-5.080067749805464, 56.81966805001485], + [-5.080075393006905, 56.8194323368084], + [-5.080107557155173, 56.818903595785166], + [-5.080106852393738, 56.8188933833134], + [-5.080103512847632, 56.81888332896133], + [-5.080097606072239, 56.81887363611132], + [-5.079291103268355, 56.817808836909244], + [-5.079280900995247, 56.81779804666472], + [-5.078275699486228, 56.81692464756334], + [-5.07827199725973, 56.8169216051043], + [-5.077740996687888, 56.81650840556168], + [-5.077730060823799, 56.81650099371128], + [-5.077717431932552, 56.816494441157275], + [-5.076935523766095, 56.81613957407178], + [-5.076414600327056, 56.81573737941062], + [-5.076103435787177, 56.81522190806761], + [-5.076108075441466, 56.815093274083374], + [-5.076558134115263, 56.81417372888078], + [-5.076561062833359, 56.81416612288394], + [-5.076661061639212, 56.813812822789224], + [-5.076662425824648, 56.81380563237591], + [-5.076662465809871, 56.81379840317256], + [-5.076612263788466, 56.81321660323931], + [-5.076610692399389, 56.813208401885674], + [-5.076480590405791, 56.81277210022826], + [-5.076408089594414, 56.81252900030875], + [-5.07640488357897, 56.81252108447643], + [-5.076400071933539, 56.81251341716845], + [-5.076120370936136, 56.81213801744596], + [-5.076113662251077, 56.81213034512128], + [-5.075971415002954, 56.81198968778768], + [-5.0759814, 56.811969899999966], + [-5.0759015, 56.81186879999997], + [-5.0757877, 56.81171189999996], + [-5.0757683, 56.811640699999955], + [-5.0757321, 56.811575499999954], + [-5.075721, 56.811358399999975], + [-5.0757828, 56.8113047], + [-5.0758658, 56.811215], + [-5.0758906, 56.81114059999997], + [-5.0759846, 56.810983799999974], + [-5.0760084, 56.81085409999997], + [-5.076000725481171, 56.81083805328089], + [-5.076003746657344, 56.81082899359518], + [-5.0760522, 56.810788299999984], + [-5.0760649, 56.81071969999996], + [-5.07613587706682, 56.81052279588375], + [-5.076474740835754, 56.8099681792691], + [-5.0765026, 56.80993269999998], + [-5.0765628, 56.80987849999998], + [-5.0767629, 56.809711299999975], + [-5.0768278, 56.8096175], + [-5.0768813, 56.809526499999954], + [-5.0768973, 56.80946819999998], + [-5.0769328, 56.80942689999996], + [-5.076952628335087, 56.80926360225266], + [-5.076989842982081, 56.80920936020085], + [-5.0770991, 56.809109], + [-5.0771592, 56.80903659999996], + [-5.077144635936648, 56.808983740609996], + [-5.077150900745453, 56.80897460923242], + [-5.077155759194521, 56.80896588309476], + [-5.077176351361956, 56.80891825936254], + [-5.0772776, 56.80885029999998], + [-5.0773146, 56.80878189999998], + [-5.0773107, 56.808734399999985], + [-5.077281234166157, 56.80867569386844], + [-5.07733035789224, 56.80856208292662], + [-5.07733334468683, 56.80855207326558], + [-5.077333732386435, 56.8085419326344], + [-5.077331513268288, 56.808531863083815], + [-5.077269926977104, 56.8083570890335], + [-5.077267, 56.808241099999975], + [-5.077221, 56.80814679999999], + [-5.0771487, 56.80792959999997], + [-5.0770781, 56.807787899999965], + [-5.0769818, 56.80762519999995], + [-5.0769008, 56.807536399999975], + [-5.0761416, 56.8067902], + [-5.0760064, 56.806660499999964], + [-5.075947, 56.806616099999985], + [-5.0757464, 56.806487199999985], + [-5.0755538, 56.8063957], + [-5.0754592, 56.806362099999966], + [-5.075408378251169, 56.80633717067541], + [-5.075282292797596, 56.80626652880195], + [-5.075266588105093, 56.80625902775082], + [-5.07516528747315, 56.80621792788577], + [-5.075058, 56.806165299999975], + [-5.0745412, 56.805937099999966], + [-5.0744035, 56.80589559999997], + [-5.074217680509599, 56.80585431710212], + [-5.074173392494825, 56.80583849111142], + [-5.074155533130106, 56.80583314377629], + [-5.074140985640383, 56.805830283741145], + [-5.0741284, 56.8058179], + [-5.0735492, 56.8057288], + [-5.073469533955619, 56.805729559181046], + [-5.073451341717011, 56.80572683595746], + [-5.073277843074884, 56.805692476328595], + [-5.0732691, 56.805688899999986], + [-5.0732026, 56.80567709999998], + [-5.07320057173734, 56.80567717343334], + [-5.073078576512948, 56.80565301325009], + [-5.073078148002581, 56.80565292884826], + [-5.072726495704795, 56.80558404305916], + [-5.072459731350001, 56.805516622896405], + [-5.072385498378591, 56.80549295709813], + [-5.072047135153812, 56.80536725949438], + [-5.071743310874293, 56.805219178664515], + [-5.0714697, 56.805025], + [-5.0711059, 56.80472379999996], + [-5.0710573, 56.80465039999997], + [-5.0710473, 56.80460839999997], + [-5.0710152, 56.80455709999998], + [-5.0708008, 56.80427919999997], + [-5.0702227, 56.80336219999995], + [-5.0700235, 56.80311], + [-5.0698687, 56.802880199999954], + [-5.0696916, 56.802658], + [-5.0695335, 56.802547699999955], + [-5.069544, 56.802516], + [-5.0690218, 56.80197969999995], + [-5.0685784, 56.80150609999998], + [-5.0683886, 56.801349499999986], + [-5.0682417, 56.801209699999966], + [-5.067800957551483, 56.8008976852266], + [-5.067551209684683, 56.800648606926494], + [-5.067379197734261, 56.800320604183895], + [-5.0673164, 56.80016349999995], + [-5.067250297641417, 56.80007480571355], + [-5.067157858011309, 56.799898531266734], + [-5.067148412949355, 56.79988548155604], + [-5.067096863685227, 56.79983060224214], + [-5.0670653, 56.79978009999997], + [-5.0668036, 56.79939709999998], + [-5.0664568, 56.79910939999997], + [-5.066092, 56.79894779999997], + [-5.065790861693006, 56.79885686120155], + [-5.065784864950974, 56.798854429314076], + [-5.065131096379549, 56.798618961134835], + [-5.064593210510688, 56.79840916150834], + [-5.064459402855822, 56.79832497430791], + [-5.064078373324219, 56.7980851909765], + [-5.0639455, 56.79798709999998], + [-5.063921346244208, 56.79795731045964], + [-5.063714604747818, 56.79750839369863], + [-5.063689036070978, 56.79736225573366], + [-5.06369, 56.797361199999976], + [-5.0637241, 56.79731149999998], + [-5.0637619, 56.79712729999996], + [-5.0637997, 56.797042399999974], + [-5.0638299, 56.796951399999955], + [-5.063840545777511, 56.79690825365828], + [-5.063871112516328, 56.796843488764075], + [-5.0639093, 56.796789899999986], + [-5.063932, 56.79671749999997], + [-5.0639698, 56.79664289999998], + [-5.0639773, 56.79653939999994], + [-5.0639055, 56.79642969999995], + [-5.0638034, 56.79631589999997], + [-5.063623328360122, 56.79621350284332], + [-5.063330773953526, 56.79597542748944], + [-5.063328610315422, 56.79597372055465], + [-5.062912309893991, 56.79565522091085], + [-5.062900300053392, 56.79564730001357], + [-5.062886349109989, 56.79564040313278], + [-5.062870743931184, 56.795634672085676], + [-5.062794520457557, 56.795610832288475], + [-5.0627904, 56.795607899999965], + [-5.0626619, 56.79556029999998], + [-5.062596244726551, 56.79554881883488], + [-5.061970617563441, 56.795353141928594], + [-5.061829665075179, 56.79528707942135], + [-5.061732, 56.795220799999974], + [-5.0614863, 56.79509249999998], + [-5.0614006, 56.7950526], + [-5.0612103, 56.79497859999998], + [-5.0610742, 56.79491029999998], + [-5.0609117, 56.794837799999975], + [-5.0607983, 56.794790199999966], + [-5.0606547, 56.7947033], + [-5.060472294716802, 56.79458896281343], + [-5.060196366913685, 56.79437442967579], + [-5.059938431132121, 56.7941111723512], + [-5.059937003483922, 56.79410975382291], + [-5.059692603007896, 56.793873254048236], + [-5.059681302733298, 56.793864055083624], + [-5.059529699068083, 56.793759134204265], + [-5.059448529659369, 56.793631933095426], + [-5.059328739775509, 56.793414152188944], + [-5.05930995647021, 56.79331564447932], + [-5.059308, 56.79326369999996], + [-5.059212275682353, 56.79251355245305], + [-5.05921117960946, 56.79239145573188], + [-5.05928705325, 56.792069825566166], + [-5.059288125524903, 56.792061546483055], + [-5.059287450985335, 56.79205325477282], + [-5.059227849896295, 56.79173495484243], + [-5.059227245654561, 56.791732237848834], + [-5.05917034491058, 56.79151143791297], + [-5.059167808115607, 56.79150425444858], + [-5.059163953297503, 56.79149724980947], + [-5.05903715274842, 56.791303149937924], + [-5.059030289602089, 56.79129448476168], + [-5.059021414141305, 56.79128638867432], + [-5.059010679819252, 56.79127900165282], + [-5.058976409658929, 56.7912583623708], + [-5.0588789, 56.79111249999996], + [-5.0587957, 56.79109659999998], + [-5.0587182, 56.791105], + [-5.0586901, 56.79110809999995], + [-5.0585872, 56.791151099999965], + [-5.058494824635421, 56.7912096088545], + [-5.058427960873987, 56.791223494243475], + [-5.058409870339997, 56.791228145299016], + [-5.058393279672446, 56.79123425257887], + [-5.058131879813535, 56.79134725240899], + [-5.058123668828177, 56.79135111382938], + [-5.057684768895031, 56.79157541351664], + [-5.05767211168842, 56.79158286921267], + [-5.057661503491429, 56.7915912325077], + [-5.057575774094469, 56.79167023124861], + [-5.0575512, 56.79166839999998], + [-5.0574907, 56.79163729999996], + [-5.0573093, 56.79150689999995], + [-5.0572035, 56.79139919999999], + [-5.057119464767872, 56.791320843978156], + [-5.057101738752526, 56.791296905563634], + [-5.0571049, 56.79123069999997], + [-5.0570386, 56.7911325], + [-5.0569804, 56.791003799999956], + [-5.056928, 56.79093369999997], + [-5.0566955, 56.79050019999996], + [-5.0566524, 56.790447099999966], + [-5.056499422840998, 56.79038123234917], + [-5.055869115150336, 56.78997086089894], + [-5.055735418347902, 56.78979802014871], + [-5.055566635008775, 56.78957982319612], + [-5.055195338853872, 56.78902155821231], + [-5.055166872572557, 56.788808926281845], + [-5.055115571252607, 56.78842632634459], + [-5.055114826826991, 56.78842231547202], + [-5.054960852611891, 56.78777375802082], + [-5.055071842243443, 56.787217421317266], + [-5.055072457510139, 56.7872060202266], + [-5.055069778134389, 56.78719470933569], + [-5.054862376394724, 56.786657309559814], + [-5.054857806674836, 56.7866483658985], + [-5.054851173155182, 56.786639820507105], + [-5.054842586683363, 56.78663181617936], + [-5.054832190740584, 56.786624486667556], + [-5.054820159044032, 56.786617954447934], + [-5.05480669264402, 56.78661232867379], + [-5.053398922762203, 56.78609952353009], + [-5.052823869112232, 56.78586649607518], + [-5.052512373696763, 56.78574021165627], + [-5.051647183424055, 56.785227645199754], + [-5.051634428229315, 56.78503272084079], + [-5.051632644620956, 56.78502320465459], + [-5.051628573808174, 56.78501390284921], + [-5.051561130117941, 56.78489522361774], + [-5.05159325976338, 56.78480721907061], + [-5.051595675226743, 56.78479638084742], + [-5.051606774763253, 56.78466308083912], + [-5.051606435304696, 56.784653678102615], + [-5.051603861547536, 56.78464438023261], + [-5.051515360835772, 56.784423280327886], + [-5.051507645690004, 56.784410164864035], + [-5.051402645348595, 56.78427696496709], + [-5.051395135608862, 56.784268881115736], + [-5.05138582967021, 56.78426138122732], + [-5.051374875935312, 56.784254584902364], + [-5.051362449083946, 56.78424860052176], + [-5.051119149240513, 56.78414560067578], + [-5.05109760437492, 56.784138191121066], + [-5.050876504664123, 56.78407769122202], + [-5.050862689931641, 56.78407444029466], + [-5.050848287363703, 56.784072080019726], + [-5.050833486831478, 56.784070641513146], + [-5.050413287620675, 56.78404334155912], + [-5.05039789961582, 56.784042843424665], + [-5.049997820914563, 56.78404284342474], + [-5.049066248466787, 56.78401609834609], + [-5.048450112170306, 56.78391352419519], + [-5.048329843193051, 56.78330495073044], + [-5.048326684289387, 56.78329524192849], + [-5.048321133262226, 56.78328586200232], + [-5.04784693153339, 56.78263936247374], + [-5.04783890516812, 56.78263030846943], + [-5.046916303437762, 56.781751909316036], + [-5.046915413585923, 56.78175107509339], + [-5.046014212013696, 56.78091907591312], + [-5.046005070697779, 56.780911716562905], + [-5.045994340971041, 56.78090503460811], + [-5.044627235608612, 56.780153211771385], + [-5.043682004451961, 56.778802860261585], + [-5.04396962010656, 56.778227720915815], + [-5.044219946111421, 56.77772706567761], + [-5.045108976317644, 56.77697484521091], + [-5.046031634053867, 56.776249817571006], + [-5.046670416790827, 56.776303722689214], + [-5.046687645573158, 56.776304541930514], + [-5.046704920696494, 56.77630410695737], + [-5.046721940571063, 56.77630242536353], + [-5.04713354128229, 56.776246125254644], + [-5.04714907361037, 56.776243426984344], + [-5.047163875044285, 56.776239690221416], + [-5.047177716255251, 56.77623497286219], + [-5.047190382792116, 56.77622934799597], + [-5.047201678404027, 56.77622290277277], + [-5.047211428081086, 56.776215737052816], + [-5.047696727382215, 56.775808436633774], + [-5.047704857746765, 56.775800573819254], + [-5.047711125294253, 56.775792212696956], + [-5.047715430795, 56.77578348564441], + [-5.047717706083597, 56.775774530832585], + [-5.047787104344933, 56.775271830772574], + [-5.047787114515391, 56.77526104354609], + [-5.047784183356109, 56.775250377036436], + [-5.04748088102908, 56.77452237736149], + [-5.047477030932942, 56.774514982084774], + [-5.047471763214956, 56.77450785511505], + [-5.046963728019259, 56.77391389129399], + [-5.04663308896715, 56.773362698822034], + [-5.04656069293501, 56.772898667148255], + [-5.046559288425677, 56.77289265752792], + [-5.046421086958397, 56.77245005768046], + [-5.046416584587734, 56.772440030347134], + [-5.046409510775885, 56.772430460967556], + [-5.046169210152349, 56.77216246119697], + [-5.046163386553889, 56.77215665789507], + [-5.045802385969291, 56.771833158220524], + [-5.045791528573977, 56.771824826483304], + [-5.04577862362996, 56.77181742723784], + [-5.045763933462056, 56.771811110891434], + [-5.045747756683539, 56.771806005838776], + [-5.045730422126136, 56.77180221585212], + [-5.045404222665225, 56.7717453159514], + [-5.045390008014714, 56.771743310553894], + [-5.045375473807582, 56.771742191705385], + [-5.045360802840538, 56.77174197347766], + [-5.044758403989612, 56.771751573451326], + [-5.044756432897056, 56.77175161302337], + [-5.044314633738066, 56.77176231299712], + [-5.044291408362242, 56.77176402868762], + [-5.043456954175049, 56.771868116442874], + [-5.042500006201438, 56.7718013772788], + [-5.041351720463965, 56.77161039251483], + [-5.040803582341719, 56.77151721595063], + [-5.04033291988711, 56.771396404738596], + [-5.040319101159831, 56.7713933705997], + [-5.039825901960779, 56.771302570757754], + [-5.03980528103558, 56.77129977267055], + [-5.039493581610555, 56.77127197271865], + [-5.039477918654264, 56.771271102509836], + [-5.039091289181199, 56.77126246662606], + [-5.038728319759183, 56.77124557529982], + [-5.038487144386079, 56.77121760664362], + [-5.03836516464192, 56.77116833109147], + [-5.038254561705084, 56.77108395288377], + [-5.038090106639766, 56.77088952217539], + [-5.0379813477199, 56.77041267071711], + [-5.03797749388615, 56.77040218309272], + [-5.037970846881517, 56.77039212592545], + [-5.037860846546339, 56.77025782603252], + [-5.037853766822706, 56.770250379403365], + [-5.037845152823503, 56.77024343734495], + [-5.037835122271261, 56.77023709472969], + [-5.037699422267213, 56.77016079483108], + [-5.037687169496897, 56.77015472339523], + [-5.037673622463826, 56.77014954709781], + [-5.037658996647449, 56.77014534827291], + [-5.037643524686095, 56.770142193706974], + [-5.037458424996744, 56.770111593760504], + [-5.037443762860107, 56.77010966784906], + [-5.037428794632018, 56.77010868070171], + [-5.037413718971525, 56.77010864541983], + [-5.037398735963513, 56.7701095624718], + [-5.037219036290796, 56.77012636243805], + [-5.037202199010498, 56.77012857440839], + [-5.037186040835524, 56.77013198748685], + [-5.036985341104968, 56.77018298739695], + [-5.036977987192591, 56.77018518749714], + [-5.036970622003041, 56.77018737619988], + [-5.0369704722437, 56.77018743577455], + [-5.036970309853309, 56.77018748435752], + [-5.036963541827739, 56.77019019271204], + [-5.036956759916273, 56.77019289057328], + [-5.036956625599425, 56.77019296037193], + [-5.036956476146658, 56.770193020178255], + [-5.036950409812859, 56.77019619044584], + [-5.036944327217214, 56.770199351305386], + [-5.036852337238845, 56.77025384528489], + [-5.036785398322123, 56.7702934811466], + [-5.036671581136191, 56.770319522285654], + [-5.03660749054709, 56.77031971629849], + [-5.036533518855928, 56.7703141973479], + [-5.036517994584214, 56.77031355229406], + [-5.036502440666002, 56.77031392416586], + [-5.036487077249141, 56.77031530769984], + [-5.036472121785205, 56.77031768331372], + [-5.036163935479264, 56.77037775686831], + [-5.035483930506816, 56.770488778107236], + [-5.034710747629625, 56.77049426369205], + [-5.033750913309432, 56.77040348584927], + [-5.033739048668949, 56.77040266809259], + [-5.033309165228711, 56.770383941649236], + [-5.033162952842571, 56.770322661478545], + [-5.032745753120217, 56.770147961740655], + [-5.032730637805079, 56.77014249644737], + [-5.032714293848013, 56.77013822854273], + [-5.032697033851368, 56.77013523965664], + [-5.031978535117203, 56.770040239823324], + [-5.03196249566122, 56.77003869138097], + [-5.031946230156653, 56.770038248875046], + [-5.031228163485361, 56.77004327861562], + [-5.030778998533689, 56.77000844898548], + [-5.030757941203743, 56.77000775897847], + [-5.030281865714793, 56.770013270472546], + [-5.029901937432302, 56.76993583402815], + [-5.029884563621346, 56.769933026896986], + [-5.029866650398643, 56.76993156378089], + [-5.029848540852238, 56.76993147270265], + [-5.029612441300336, 56.7699392726847], + [-5.029594601448172, 56.7699405422159], + [-5.029577247224947, 56.76994314320245], + [-5.029324247622088, 56.76999154311278], + [-5.029301923585764, 56.76999715288565], + [-5.028803624124256, 56.770154952622036], + [-5.028791507973671, 56.77015929659929], + [-5.027678490918634, 56.770608413683675], + [-5.027265627452971, 56.77069587910747], + [-5.02639658883008, 56.77081187518612], + [-5.02639658883008, 56.7709597742192], + [-5.027335711621496, 56.77083442357739], + [-5.027351904492563, 56.77083164053779], + [-5.027789005148308, 56.77073904036897], + [-5.027804751357127, 56.770735026785246], + [-5.027819391499965, 56.77072990405236], + [-5.028940653207516, 56.77027745954526], + [-5.029421995867688, 56.77012502946384], + [-5.029646243784535, 56.7700821298563], + [-5.029836723650749, 56.7700758370065], + [-5.030214163036814, 56.770152766097716], + [-5.030229877075177, 56.77015536609115], + [-5.030246060194936, 56.77015686559987], + [-5.030262457853618, 56.77015724103825], + [-5.030752879298577, 56.77015156351889], + [-5.031201502254727, 56.77018635107251], + [-5.031221468462152, 56.77018705114348], + [-5.031933190378858, 56.770182065901565], + [-5.032608966092147, 56.77027141693292], + [-5.033004224230213, 56.770436928972195], + [-5.033181001663783, 56.770511019576126], + [-5.033196658842235, 56.77051665658052], + [-5.033213620757753, 56.77052100900596], + [-5.033231540212038, 56.77052398776132], + [-5.033250050406345, 56.77052553187355], + [-5.033712384895555, 56.770545672010066], + [-5.034678188393849, 56.77063701430622], + [-5.034702089947854, 56.77063805094072], + [-5.035505491482456, 56.77063235091911], + [-5.035523480570888, 56.77063153966424], + [-5.035541095250985, 56.770629376937606], + [-5.03624179641142, 56.770514976721024], + [-5.036248277889867, 56.7705138167812], + [-5.036529750067585, 56.77045895052231], + [-5.036581381235431, 56.77046280265984], + [-5.036599721346842, 56.77046345581749], + [-5.03669882153621, 56.77046315581558], + [-5.036715748407127, 56.770462500444765], + [-5.03673237853071, 56.77046064788621], + [-5.036748432281617, 56.770457629289616], + [-5.036912332517488, 56.77042012922216], + [-5.036929006428533, 56.7704155223606], + [-5.036944317078998, 56.77040965974852], + [-5.036957952971134, 56.770402660662064], + [-5.03704427305481, 56.770351548688836], + [-5.037118708128757, 56.77030745394777], + [-5.037280143687985, 56.770266431434656], + [-5.037412385366501, 56.7702540682777], + [-5.037535757987124, 56.77027446375458], + [-5.037631668828436, 56.770328391580165], + [-5.037724093737016, 56.77044123441909], + [-5.037832950561739, 56.7709185292749], + [-5.037837021472434, 56.770929436674166], + [-5.037844112196551, 56.77093986781723], + [-5.038022411682521, 56.77115066798963], + [-5.038034886202877, 56.77116237660403], + [-5.038164786073096, 56.771261476715], + [-5.038177983352675, 56.77127004488495], + [-5.038193449136521, 56.77127738036255], + [-5.038354849255184, 56.771342580461585], + [-5.038370553345114, 56.77134802587678], + [-5.038387503237015, 56.771352195697915], + [-5.038405357502683, 56.771355005930616], + [-5.038682158000016, 56.77138710598681], + [-5.038698148173042, 56.77138840016596], + [-5.039072048881555, 56.77140580019397], + [-5.039077780585226, 56.77140599747794], + [-5.03945940207112, 56.77141452150777], + [-5.039752800921299, 56.771440689259386], + [-5.040228831948191, 56.77152832838906], + [-5.040700880580803, 56.77164949544446], + [-5.040717597796708, 56.77165304259934], + [-5.041274698724455, 56.77174774276478], + [-5.041275460783456, 56.77174787090825], + [-5.042434662725824, 56.77194067124537], + [-5.042456109458064, 56.77194318404308], + [-5.043446911312539, 56.77201228416034], + [-5.043462122516216, 56.77201285337643], + [-5.043477351059239, 56.77201244732348], + [-5.043492390243135, 56.77201107151286], + [-5.044337919467774, 56.771905602370275], + [-5.044766981849441, 56.77189521083972], + [-5.045346170007636, 56.77188598079118], + [-5.04560469481365, 56.77193107604918], + [-5.045937057527528, 56.77222891414132], + [-5.046166316119592, 56.772484600893556], + [-5.046300378327033, 56.77291395379751], + [-5.046373605396361, 56.77338333280373], + [-5.04637578379235, 56.773391602993634], + [-5.046379696109799, 56.773399678406854], + [-5.046717594464963, 56.77396297875348], + [-5.046723438036395, 56.77397104428017], + [-5.047228856012808, 56.77456195271855], + [-5.047524598017353, 56.775271817360675], + [-5.047459239019699, 56.77574523446726], + [-5.047020464710445, 56.7761134858196], + [-5.046684183889066, 56.7761594833688], + [-5.045990884469436, 56.776100977412035], + [-5.045974768424556, 56.77610017307002], + [-5.045958594770481, 56.77610046677368], + [-5.045942610759093, 56.776101854033115], + [-5.0459270607432, 56.77610431364077], + [-5.045912182441098, 56.776107807995906], + [-5.045898203302536, 56.77611228367915], + [-5.045885337031666, 56.77611767226916], + [-5.045873780320099, 56.776123891388835], + [-5.045863709840021, 56.77613084596423], + [-5.044893108686666, 56.77689354514177], + [-5.044890602907807, 56.77689558782139], + [-5.043989301580958, 56.77765818704146], + [-5.043979681267374, 56.777667885738595], + [-5.043972881618455, 56.777678279201595], + [-5.043717180628941, 56.778189677734446], + [-5.043418179361967, 56.77878757623941], + [-5.043414807507304, 56.77879650323572], + [-5.043413521769236, 56.77880559276595], + [-5.043414342846467, 56.77881469851123], + [-5.043417257523199, 56.77882367389159], + [-5.043422218881773, 56.778832374425455], + [-5.044392815084058, 56.780218975398014], + [-5.044400511949996, 56.780228032989484], + [-5.044410423753367, 56.780236416688496], + [-5.04442235873728, 56.78024396430009], + [-5.045797528698641, 56.78100022467195], + [-5.046689936157024, 56.781824109337286], + [-5.047607502207719, 56.78269771914416], + [-5.048071508151786, 56.78333032394201], + [-5.04819915451194, 56.783976249284365], + [-5.04819992883291, 56.78397856053853], + [-5.048201811977156, 56.783984819805234], + [-5.048202354923839, 56.78398580212361], + [-5.048202646491, 56.78398667241579], + [-5.048204326696695, 56.783989369524555], + [-5.048206783389565, 56.783993814258835], + [-5.048208055780578, 56.78399535554302], + [-5.048208893490106, 56.783996700254974], + [-5.048211100819502, 56.78399904408648], + [-5.048213851099418, 56.78400237557916], + [-5.048216145263805, 56.78400440047995], + [-5.048217759623993, 56.784006114672046], + [-5.048770458734618, 56.78449991516997], + [-5.048779728400123, 56.78450715585577], + [-5.048790549292018, 56.78451371618296], + [-5.048802757282811, 56.78451949664642], + [-5.049360943983058, 56.78475249128862], + [-5.049757930572188, 56.78491828582567], + [-5.049771261281642, 56.78492317591164], + [-5.049785581108873, 56.7849271348274], + [-5.051172016201057, 56.78525364317051], + [-5.051440962795205, 56.78531693014778], + [-5.052328666952865, 56.78584283617055], + [-5.052346919319733, 56.78585179918145], + [-5.052668341727795, 56.78598210836673], + [-5.053246042149018, 56.786216208722024], + [-5.053251405830547, 56.78621827048006], + [-5.054617314004347, 56.786715827890596], + [-5.054809274121202, 56.787213225308285], + [-5.054698855868834, 56.78776667844323], + [-5.054698084822023, 56.78777523656595], + [-5.054699175330116, 56.787783784216], + [-5.054854698360472, 56.788438884688986], + [-5.05490572683024, 56.78881946942477], + [-5.05493552550569, 56.789042065303796], + [-5.054938095439817, 56.789051896077304], + [-5.054943110598742, 56.78906143847741], + [-5.055321809000603, 56.78963083886015], + [-5.05532428204027, 56.789634279568425], + [-5.055494381238994, 56.789854179437675], + [-5.055635780527663, 56.790036979270525], + [-5.055644742257239, 56.79004651495212], + [-5.055656191227153, 56.79005521199068], + [-5.055923320907867, 56.79022913304563], + [-5.0558842, 56.790244599999966], + [-5.056112946043207, 56.790352591605306], + [-5.056305813426518, 56.79047815994251], + [-5.056342445683901, 56.79050454202945], + [-5.0563681, 56.790524899999966], + [-5.056374880239901, 56.79052790094474], + [-5.056462391796525, 56.79059092535902], + [-5.056555818468024, 56.79078644080464], + [-5.0565517, 56.79081129999999], + [-5.0565517, 56.790933099999975], + [-5.0568262, 56.79138029999996], + [-5.05707, 56.791666799999966], + [-5.0571802, 56.791757299999944], + [-5.0573454, 56.79189079999998], + [-5.0574201, 56.79190809999997], + [-5.0574919, 56.791905699999965], + [-5.0575538, 56.791921], + [-5.057605, 56.7919124], + [-5.0576609, 56.79188429999997], + [-5.0576605, 56.791839], + [-5.057679230391617, 56.79180675249511], + [-5.057746953778136, 56.79178085635096], + [-5.057761375470753, 56.791774463977006], + [-5.05777400758786, 56.79176701793309], + [-5.057784596913017, 56.79175866747913], + [-5.057876923474196, 56.7916735891097], + [-5.058298171322838, 56.791458309935784], + [-5.05853948864883, 56.79135399135283], + [-5.058622612064148, 56.791336729338234], + [-5.0587614, 56.79135659999996], + [-5.058809171057008, 56.7913800059129], + [-5.058912929316837, 56.79153883529996], + [-5.058967605005468, 56.79175100667762], + [-5.059025395205642, 56.79205964702162], + [-5.058950345697522, 56.79237777422629], + [-5.05894926356118, 56.79238735378415], + [-5.058950782322862, 56.79255666688042], + [-5.0588983, 56.792658099999976], + [-5.0589159, 56.79287339999996], + [-5.0589992, 56.79309149999995], + [-5.0589602, 56.79331719999997], + [-5.0589764, 56.79341569999998], + [-5.0592242, 56.79374219999997], + [-5.059260276767664, 56.79377175824539], + [-5.05928981506814, 56.79381804824424], + [-5.059295380333332, 56.793825426974415], + [-5.059302403267853, 56.793832421254415], + [-5.059310797131696, 56.79383894469735], + [-5.059469797940468, 56.793948985405294], + [-5.059557295211276, 56.79403365503241], + [-5.0598665, 56.79445179999996], + [-5.0598997, 56.79449409999997], + [-5.060657347046678, 56.794982064082646], + [-5.060674416356393, 56.79499533510432], + [-5.060684305821487, 56.795002114041345], + [-5.060695613229276, 56.7950081888731], + [-5.06070223432766, 56.79501097327642], + [-5.0607133, 56.79501809999997], + [-5.0611689, 56.7952944], + [-5.0614169, 56.795423199999966], + [-5.0615187, 56.79546559999997], + [-5.0618895, 56.795571099999975], + [-5.0622467, 56.795654499999955], + [-5.0625795, 56.79571819999997], + [-5.0626968, 56.79575129999997], + [-5.0627399, 56.795777199999975], + [-5.0628913, 56.79592629999997], + [-5.063099729859053, 56.79604519269657], + [-5.063114685124376, 56.796056634476116], + [-5.06363877432231, 56.79648312784175], + [-5.063670915883596, 56.7966324980781], + [-5.0636267, 56.79670819999996], + [-5.063625, 56.796743699999965], + [-5.063630951378125, 56.79677910742796], + [-5.063573428579678, 56.7969009851488], + [-5.063572115086645, 56.7969040418793], + [-5.063502270686251, 56.797084112265715], + [-5.0634933, 56.797090899999944], + [-5.0634186, 56.79722439999996], + [-5.0633556, 56.7973084], + [-5.0633291, 56.7973747], + [-5.0633945, 56.7975], + [-5.0635941, 56.797913499999964], + [-5.06366136152693, 56.797979378080626], + [-5.063693933385671, 56.79805010439076], + [-5.063698564827959, 56.798058142523644], + [-5.063704880134638, 56.79806582770508], + [-5.063712792380572, 56.7980730541535], + [-5.063722192659599, 56.79807972240142], + [-5.064262001302243, 56.79841942838794], + [-5.0644060012506, 56.79851002850163], + [-5.064416802798192, 56.79851606660646], + [-5.064428822965484, 56.79852136621768], + [-5.064981323407518, 56.79873686654881], + [-5.06498533420564, 56.79873837027412], + [-5.065225703306525, 56.79882494500756], + [-5.0656725, 56.798996099999954], + [-5.066026605450785, 56.79915350852219], + [-5.066299682464358, 56.79936756368276], + [-5.0666183, 56.799651699999956], + [-5.0668297, 56.79999989999999], + [-5.0669763, 56.800116], + [-5.067048146780964, 56.800209062543885], + [-5.067121965496018, 56.80034982826676], + [-5.0671456, 56.80041069999998], + [-5.067215044051697, 56.80052731918506], + [-5.067303539542217, 56.80069606902236], + [-5.067308345040403, 56.80070362195112], + [-5.067314650996707, 56.800710834990156], + [-5.067338471207105, 56.800734591659555], + [-5.067367, 56.80078249999998], + [-5.0675088, 56.80091379999996], + [-5.06753839316311, 56.80093397893352], + [-5.067576050452532, 56.80097153523316], + [-5.067582617258695, 56.800977400413714], + [-5.068074768112272, 56.80137312331462], + [-5.06815, 56.801450399999986], + [-5.0684195, 56.80172729999998], + [-5.0685702, 56.801907199999974], + [-5.0687165, 56.802033], + [-5.0687712, 56.802100899999964], + [-5.0688205, 56.802203], + [-5.0688988, 56.8022595], + [-5.0689218, 56.80229939999998], + [-5.0690105, 56.802382599999966], + [-5.0691134, 56.80251939999995], + [-5.0692419, 56.80264839999998], + [-5.0693444, 56.8027733], + [-5.0694913, 56.80295239999997], + [-5.0697146, 56.803159], + [-5.0697674, 56.803223299999964], + [-5.0698463, 56.80340649999997], + [-5.0701487, 56.8037793], + [-5.070172, 56.80386319999998], + [-5.0703764, 56.80415929999998], + [-5.0704691, 56.804370099999986], + [-5.0709194, 56.80498819999998], + [-5.0710295, 56.80511219999998], + [-5.0712731, 56.80522329999996], + [-5.0714898, 56.80535079999997], + [-5.072206, 56.805612699999976], + [-5.0723789, 56.80568389999996], + [-5.0725285, 56.80572969999997], + [-5.0727688, 56.8057822], + [-5.0728901, 56.80580339999997], + [-5.0731145, 56.805822199999966], + [-5.073259548521571, 56.80584164308395], + [-5.073367323927089, 56.80586298686416], + [-5.073377319000957, 56.805864721598844], + [-5.074034166716566, 56.80596304422003], + [-5.0740621423819, 56.805970249168006], + [-5.074499243396785, 56.80612644265136], + [-5.075102414141387, 56.80637116514891], + [-5.075475256108104, 56.806580056595344], + [-5.076023513526231, 56.807038979725284], + [-5.0763621, 56.80750119999997], + [-5.0765058, 56.80767469999998], + [-5.0766237, 56.80778249999998], + [-5.0766932, 56.80792089999996], + [-5.0767824, 56.80805139999997], + [-5.0768095, 56.808125599999954], + [-5.076821, 56.8082234], + [-5.0768728, 56.8082826], + [-5.0769239, 56.80839729999997], + [-5.0769811, 56.808488099999984], + [-5.0769929, 56.8086541], + [-5.0769364, 56.80885], + [-5.076784787492785, 56.80910022534516], + [-5.076510307792257, 56.80950028567876], + [-5.0764816, 56.8095249], + [-5.076435, 56.809556], + [-5.0763439, 56.80959409999998], + [-5.076316, 56.80962689999996], + [-5.0762096, 56.80974869999997], + [-5.0761356, 56.8098744], + [-5.0760289, 56.8100072], + [-5.075949, 56.81011189999999], + [-5.0758929, 56.8102317], + [-5.0759225, 56.810345699999985], + [-5.0759056, 56.81041619999998], + [-5.0758658, 56.810457799999966], + [-5.0758008, 56.81062059999997], + [-5.0757155, 56.810697199999986], + [-5.0756864, 56.8107647], + [-5.075694456871266, 56.81095775237792], + [-5.075668679041583, 56.811035050719845], + [-5.0756196, 56.81107629999998], + [-5.0755706, 56.811058699999975], + [-5.0755304, 56.81107249999999], + [-5.0755087, 56.81103739999997], + [-5.0754988, 56.81095889999999], + [-5.0754806, 56.8109261], + [-5.0754501, 56.81091569999997], + [-5.0754043, 56.8109436], + [-5.07532, 56.8110585], + [-5.0752694, 56.811278599999945], + [-5.0752788, 56.81133409999996], + [-5.075315, 56.811343], + [-5.0753295, 56.81136439999997], + [-5.0752973, 56.81149769999998], + [-5.0752971, 56.81158709999997], + [-5.0753136, 56.81164149999997], + [-5.0756078, 56.81200929999997], + [-5.075638, 56.81205379999996], + [-5.0758445, 56.81224119999998], + [-5.075871678565633, 56.81218733950714], + [-5.075880768369225, 56.81219632773172], + [-5.076151908325035, 56.81256024045391], + [-5.076222009240063, 56.812795298729085], + [-5.076350892123785, 56.813227522070115], + [-5.076400108731193, 56.81379794799158], + [-5.076303225998736, 56.8141402304768], + [-5.075850863082588, 56.81506447055261], + [-5.075847683819908, 56.81507300046135], + [-5.075846408862165, 56.815081678637945], + [-5.075841008339635, 56.815231378636035], + [-5.075841553502018, 56.81523950016853], + [-5.075843767340653, 56.81524753599317], + [-5.075847621537082, 56.81525538331528], + [-5.076172019966671, 56.81579278364812], + [-5.076179508356363, 56.815802657042454], + [-5.076189585546753, 56.815811811612626], + [-5.07673188497837, 56.81623051207843], + [-5.076742704635766, 56.81623780370603], + [-5.076755167426731, 56.816244258261364], + [-5.077536884887427, 56.81659903967925], + [-5.078055880771903, 56.81700289941917], + [-5.079053362627056, 56.817869595557696], + [-5.079844695524088, 56.8189143755296], + [-5.079813441011627, 56.81942810405679], + [-5.079813388865646, 56.81942922227376], + [-5.079807117335942, 56.81962259217873], + [-5.0797536, 56.819685], + [-5.0797376, 56.81968989999998], + [-5.0797499, 56.8196995], + [-5.079804525098718, 56.81970251818767], + [-5.079801787616651, 56.81978692227056], + [-5.079801924145179, 56.81978839102829], + [-5.0797872, 56.819814599999965], + [-5.0797558, 56.819831499999985], + [-5.079759, 56.81984839999995], + [-5.0797905, 56.8198747], + [-5.0797174, 56.819943], + [-5.0797266, 56.820074], + [-5.0797571, 56.820147], + [-5.0798064, 56.82019129999996], + [-5.0797808, 56.820250799999954], + [-5.0797868, 56.820283099999976], + [-5.0798659, 56.82042119999995], + [-5.0798793, 56.82052419999999], + [-5.0799331, 56.82056149999995], + [-5.0801321, 56.82062939999997], + [-5.080215, 56.8206399], + [-5.0802523, 56.820675], + [-5.0804414, 56.820738199999965], + [-5.0807451, 56.82082629999996], + [-5.0807099, 56.8208462], + [-5.080595, 56.8208657], + [-5.0805053, 56.820895399999976], + [-5.0804674, 56.820922899999964], + [-5.0805194, 56.82094159999997], + [-5.0805758, 56.820904], + [-5.08066, 56.820875299999976], + [-5.0807475, 56.820862599999984], + [-5.0808018, 56.820837499999975], + [-5.0809123, 56.82086419999995], + [-5.0811938, 56.82091359999997], + [-5.0813255, 56.82092119999998], + [-5.0814572, 56.820908], + [-5.081482, 56.820911], + [-5.0815494, 56.82095249999997], + [-5.0818038, 56.82101019999997], + [-5.081880925099665, 56.821020475197784], + [-5.082081284760894, 56.8210893731434], + [-5.082117, 56.82113159999999], + [-5.0822752, 56.82120809999997], + [-5.0824719, 56.821265699999984], + [-5.0826933, 56.82130459999996], + [-5.0828028, 56.82135], + [-5.0828781, 56.821363], + [-5.0831054, 56.821366], + [-5.0832286, 56.82138759999997], + [-5.0836266, 56.82139809999997], + [-5.0836644, 56.82140519999997], + [-5.083799, 56.82140529999998], + [-5.0842168, 56.82144259999996], + [-5.0844225050718475, 56.82145112888207], + [-5.0844225050718475, 56.82118935427821] + ], + [ + [-5.051379858375106, 56.78514618835705], + [-5.051373401463104, 56.7850475033589], + [-5.051301226452125, 56.78492049694643], + [-5.051297340670326, 56.784911775258664], + [-5.051295466805563, 56.78490285566966], + [-5.051295634113581, 56.78489387744342], + [-5.051297839980689, 56.78488498075939], + [-5.051334580273318, 56.78478434939144], + [-5.051344437848347, 56.78466597464513], + [-5.05126234554798, 56.78446088128153], + [-5.051175779914012, 56.78435106618435], + [-5.050969364440095, 56.78426368098362], + [-5.050780086442988, 56.78421188848845], + [-5.050390179593937, 56.78418655658689], + [-5.049994399615806, 56.78418655657996], + [-5.049987563202976, 56.78418645851914], + [-5.049036661389644, 56.78415915848006], + [-5.049020918064802, 56.78415817942333], + [-5.04900550553014, 56.78415616356193], + [-5.048621418931659, 56.78409222143322], + [-5.048980727048144, 56.784413236504776], + [-5.049519442101911, 56.784638102954275], + [-5.049903636793424, 56.78479855495112], + [-5.051275200148113, 56.78512156069807], + [-5.051379858375106, 56.78514618835705] + ] + ], + [ + [ + [-5.0844225050718475, 56.832621492171256], + [-5.0843141, 56.83263489999997], + [-5.0835698, 56.83265639999997], + [-5.0834655, 56.832680299999964], + [-5.0828692, 56.83274349999998], + [-5.0828112, 56.8327434], + [-5.0827731, 56.83272469999997], + [-5.0827228, 56.83273269999997], + [-5.0826786, 56.832753599999954], + [-5.0825515, 56.83274419999995], + [-5.0823024, 56.83274579999997], + [-5.0820384, 56.832765799999976], + [-5.0819758, 56.832762], + [-5.0819236, 56.832745299999964], + [-5.0818978, 56.83275039999997], + [-5.081827, 56.8327872], + [-5.0818004, 56.832782499999944], + [-5.0817711, 56.83276529999996], + [-5.0816977, 56.83275], + [-5.0815713, 56.8327477], + [-5.0808636, 56.832691899999965], + [-5.080459, 56.832719599999955], + [-5.0803587, 56.8327417], + [-5.0802846, 56.83276839999994], + [-5.0802252, 56.83277729999996], + [-5.0801564, 56.832776199999984], + [-5.0800842, 56.8327753], + [-5.0799201, 56.832793699999954], + [-5.0795527, 56.832892699999974], + [-5.0791712883983875, 56.83302498513894], + [-5.0844225050718475, 56.83302498513894], + [-5.0844225050718475, 56.832621492171256] + ] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "intersection"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/nested_polys1.geojson b/test/genericTestCases/nested_polys1.geojson new file mode 100644 index 0000000..442b0d7 --- /dev/null +++ b/test/genericTestCases/nested_polys1.geojson @@ -0,0 +1,38 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [[[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]]], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [[0.1, 0.1], [0.1, 0.9], [0.9, 0.9], [0.9, 0.1], [0.1, 0.1]], + [[0.2, 0.2], [0.2, 0.8], [0.8, 0.8], [0.8, 0.2], [0.2, 0.2]] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]], + [[0.1, 0.1], [0.9, 0.1], [0.9, 0.9], [0.1, 0.9], [0.1, 0.1]] + ], + [[[0.2, 0.2], [0.8, 0.2], [0.8, 0.8], [0.2, 0.8], [0.2, 0.2]]] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "diff"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/nested_polys2.geojson b/test/genericTestCases/nested_polys2.geojson new file mode 100644 index 0000000..cdfe81d --- /dev/null +++ b/test/genericTestCases/nested_polys2.geojson @@ -0,0 +1,44 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [[0, 0], [1, 0], [1, 3], [0, 3], [0, 0]], + [[0.1, 0.1], [0.1, 0.9], [0.9, 0.9], [0.9, 0.1], [0.1, 0.1]], + [[0.1, 2.1], [0.1, 2.9], [0.9, 2.9], [0.9, 2.1], [0.1, 2.1]] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [[0.1, 1.1], [0.1, 1.9], [0.9, 1.9], [0.9, 1.1], [0.1, 1.1]], + [[0.2, 1.2], [0.2, 1.8], [0.8, 1.8], [0.8, 1.2], [0.2, 1.2]] + ], + "type": "Polygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [[0, 0], [1, 0], [1, 3], [0, 3], [0, 0]], + [[0.1, 0.1], [0.9, 0.1], [0.9, 0.9], [0.1, 0.9], [0.1, 0.1]], + [[0.1, 1.1], [0.9, 1.1], [0.9, 1.9], [0.1, 1.9], [0.1, 1.1]], + [[0.1, 2.1], [0.9, 2.1], [0.9, 2.9], [0.1, 2.9], [0.1, 2.1]] + ], + [[[0.2, 1.2], [0.8, 1.2], [0.8, 1.8], [0.2, 1.8], [0.2, 1.2]]] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "diff"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file diff --git a/test/genericTestCases/nested_polys3.geojson b/test/genericTestCases/nested_polys3.geojson new file mode 100644 index 0000000..cf60c3e --- /dev/null +++ b/test/genericTestCases/nested_polys3.geojson @@ -0,0 +1,64 @@ +{ + "features": [ + { + "geometry": { + "coordinates": [ + [ + [[-10, -10], [-10, 10], [10, 10], [10, -10], [-10, -10]], + [[-9.5, -9.5], [-9.5, 9.5], [9.5, 9.5], [9.5, -9.5], [-9.5, -9.5]] + ], + [ + [[-9, -9], [-9, 9], [9, 9], [9, -9], [-9, -9]], + [[-8.5, -8.5], [-8.5, 8.5], [8.5, 8.5], [8.5, -8.5], [-8.5, -8.5]] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [[-7, -7], [-7, 7], [7, 7], [7, -7], [-7, -7]], + [[-6.5, -6.5], [-6.5, 6.5], [6.5, 6.5], [6.5, -6.5], [-6.5, -6.5]] + ], + [ + [[-6, -6], [-6, 6], [6, 6], [6, -6], [-6, -6]], + [[-5.5, -5.5], [-5.5, 5.5], [5.5, 5.5], [5.5, -5.5], [-5.5, -5.5]] + ] + ], + "type": "MultiPolygon" + }, + "properties": {}, + "type": "Feature" + }, + { + "geometry": { + "coordinates": [ + [ + [[-10, -10], [10, -10], [10, 10], [-10, 10], [-10, -10]], + [[-9.5, -9.5], [9.5, -9.5], [9.5, 9.5], [-9.5, 9.5], [-9.5, -9.5]] + ], + [ + [[-9, -9], [9, -9], [9, 9], [-9, 9], [-9, -9]], + [[-8.5, -8.5], [8.5, -8.5], [8.5, 8.5], [-8.5, 8.5], [-8.5, -8.5]] + ], + [ + [[-7, -7], [7, -7], [7, 7], [-7, 7], [-7, -7]], + [[-6.5, -6.5], [6.5, -6.5], [6.5, 6.5], [-6.5, 6.5], [-6.5, -6.5]] + ], + [ + [[-6, -6], [6, -6], [6, 6], [-6, 6], [-6, -6]], + [[-5.5, -5.5], [5.5, -5.5], [5.5, 5.5], [-5.5, 5.5], [-5.5, -5.5]] + ] + ], + "type": "MultiPolygon" + }, + "properties": {"operation": "union"}, + "type": "Feature" + } + ], + "type": "FeatureCollection" +} \ No newline at end of file