/* 2019-6-3 09:02:03 | 版权所有 火星科技 http://marsgis.cn */ function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}!function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.turf={})}(this,function(t){"use strict";var f=6371008.8,r={meters:f,metres:f,millimeters:1e3*f,millimetres:1e3*f,centimeters:100*f,centimetres:100*f,kilometers:f/1e3,kilometres:f/1e3,miles:f/1609.344,nauticalmiles:f/1852,inches:39.37*f,yards:f/1.0936,feet:3.28084*f,radians:1,degrees:f/111325},e={meters:1,metres:1,millimeters:1e3,millimetres:1e3,centimeters:100,centimetres:100,kilometers:.001,kilometres:.001,miles:1/1609.344,nauticalmiles:1/1852,inches:39.37,yards:1/1.0936,feet:3.28084,radians:1/f,degrees:1/111325},o={meters:1,metres:1,millimeters:1e6,millimetres:1e6,centimeters:1e4,centimetres:1e4,kilometers:1e-6,kilometres:1e-6,acres:247105e-9,miles:386e-9,yards:1.195990046,feet:10.763910417,inches:1550.003100006};function j(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.bbox,i=n.id;if(void 0===t)throw new Error("geometry is required");if(e&&e.constructor!==Object)throw new Error("properties must be an Object");r&&w(r),i&&b(i);var o={type:"Feature"};return i&&(o.id=i),r&&(o.bbox=r),o.properties=e||{},o.geometry=t,o}function n(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r,i=n.bbox;if(!t)throw new Error("type is required");if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");switch(i&&w(i),t){case"Point":r=X(e).geometry;break;case"LineString":r=U(e).geometry;break;case"Polygon":r=B(e).geometry;break;case"MultiPoint":r=u(e).geometry;break;case"MultiLineString":r=v(e).geometry;break;case"MultiPolygon":r=x(e).geometry;break;default:throw new Error(t+" is invalid")}return i&&(r.bbox=i),r}function X(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!V(t[0])||!V(t[1]))throw new Error("coordinates must contain numbers");return j({type:"Point",coordinates:t},e,n)}function i(t,e,n){if(!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");return Y(t.map(function(t){return X(t,e)}),n)}function B(t,e,n){if(!t)throw new Error("coordinates is required");for(var r=0;rt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]=t.minX&&e.maxY>=t.minY}function St(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mt(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(o=e+Math.ceil((n-e)/r/2)*r,pt(t,o,e,n,i),s.push(e,o,o,n))}function Lt(t,e){return t(e={exports:{}},e.exports),e.exports}yt.prototype={all:function(){return this._all(this.data,[])},search:function(t){var e=this.data,n=[],r=this.toBBox;if(!Ct(t,e))return n;for(var i,o,s,a,u=[];e;){for(i=0,o=e.children.length;ithis._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=St(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,mt(n,this.toBBox),mt(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=St([t,e]),this.data.height=t.height+1,this.data.leaf=!1,mt(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h,l,p,f,g,d,y;for(u=c=1/0,r=e;r<=n-e;r++)l=i=vt(t,0,r,this.toBBox),p=o=vt(t,r,n,this.toBBox),f=Math.max(l.minX,p.minX),g=Math.max(l.minY,p.minY),d=Math.min(l.maxX,p.maxX),y=Math.min(l.maxY,p.maxY),s=Math.max(0,d-f)*Math.max(0,y-g),a=bt(i)+bt(o),s>1;return["sum(",l(t.slice(0,e)),",",l(t.slice(e)),")"].join("")}function p(t){if(2===t.length)return[["sum(prod(",t[0][0],",",t[1][1],"),prod(-",t[0][1],",",t[1][0],"))"].join("")];for(var e=[],n=0;n>1)-1;0<=n;n--)this._down(n)}function kt(t,e){return t>1,o=e[i];if(0<=n(r,o))break;e[t]=o,t=i}e[t]=r},_down:function(t){for(var e=this.data,n=this.compare,r=this.length>>1,i=e[t];tr[0]&&(r=s),s[1]i[1]&&(i=s)}var a=[e,n,r,i],u=a.slice();for(o=0;o=e.minX&&t[0]<=e.maxX&&t[1]>=e.minY&&t[1]<=e.maxY}function Zt(t,e,n){for(var r,i,o,s,a=Math.min(t[0],e[0]),u=Math.min(t[1],e[1]),c=Math.max(t[0],e[0]),h=Math.max(t[1],e[1]),l=n.search({minX:a,minY:u,maxX:c,maxY:h}),p=0;p=i[0]&&o[3]>=i[1]))return!1;"Polygon"===u&&(a=[a]);for(var h=0,l=!1;ht[1]!=c>t[1]&&t[0]<(u-s)*(t[1]-a)/(c-a)+s&&(r=!r)}return r}function oe(t,e){var n=[];return R(e,function(e){L(t,function(t){re(t,e)&&n.push(t)})}),Y(n)}function se(t,n){if("FeatureCollection"!==t.type)throw new Error("points must be a FeatureCollection");var o=!1;return Y(function(t){if(t.length<3)return[];t.sort(ue);for(var e,n,r,i,o,s,a=t.length-1,u=t[a].x,c=t[0].x,h=t[a].y,l=h;a--;)t[a].yl&&(l=t[a].y);var p,f=c-u,g=l-h,d=gm[p].r?(v.push(m[p]),m.splice(p,1)):f*f+(g=t[a].y-m[p].y)*g>m[p].r||(x.push(m[p].a,m[p].b,m[p].b,m[p].c,m[p].c,m[p].a),m.splice(p,1));for(ce(x),p=x.length;p;)n=x[--p],e=x[--p],r=t[a],i=n.x-e.x,o=n.y-e.y,s=2*(i*(r.y-n.y)-o*(r.x-n.x)),1e-12=o)throw new Error("full hashmap");r=c[n=n+1&l]}return c[n]=t,h[n]=e},maybeSet:function(t,e){for(var n=s(t)&l,r=c[n],i=0;r!=u;){if(a(r,t))return h[n];if(++i>=o)throw new Error("full hashmap");r=c[n=n+1&l]}return c[n]=t,h[n]=e},get:function(t,e){for(var n=s(t)&l,r=c[n],i=0;r!=u;){if(a(r,t))return h[n];if(++i>=o)break;r=c[n=n+1&l]}return e},keys:function(){for(var t=[],e=0,n=c.length;e>7^be[2]^be[3])}var Ee=new ArrayBuffer(16),we=new Float64Array(Ee),be=new Uint32Array(Ee);function Ie(t,e,n){for(var r,i=e+(n---e>>1);e=i)throw new Error("full hashset");n=u[e=e+1&c]}return u[e]=t,!0},has:function(t){for(var e=o(t)&c,n=u[e],r=0;n!=a;){if(s(n,t))return!0;if(++r>=i)break;n=u[e=e+1&c]}return!1},values:function(){for(var t=[],e=0,n=u.length;es&&(i=n[0],n[0]=n[o],n[o]=i,s=r);return n})}}.apply(this,arguments))}(i,i.objects.geoms.geometries)}(n,t);default:throw new Error(r+" is not supported")}}function Re(t,e){var n="object"==_typeof(e)?e.mutate:e;if(!t)throw new Error("geojson is required");var r=rt(t),i=[];switch(r){case"LineString":i=Te(t);break;case"MultiLineString":case"Polygon":Z(t).forEach(function(t){i.push(Te(t))});break;case"MultiPolygon":Z(t).forEach(function(t){var e=[];t.forEach(function(t){e.push(Te(t))}),i.push(e)});break;case"Point":return t;case"MultiPoint":var o={};Z(t).forEach(function(t){var e=t.join("-");o.hasOwnProperty(e)||(i.push(t),o[e]=!0)});break;default:throw new Error(r+" geometry not supported")}return t.coordinates?!0===n?(t.coordinates=i,t):{type:r,coordinates:i}:!0===n?(t.geometry.coordinates=i,t):j({type:r,coordinates:i},t.properties,t.bbox,t.id)}function Te(t){var e,n,r,i,o,s=Z(t);if(2===s.length&&(e=s[0],n=s[1],e[0]!==n[0]||e[1]!==n[1]))return s;var a,u,c,h,l,p,f,g,d,y,_,m=[],v=s.length-1;m.push(s[0]);for(var x=1;x=Math.abs(_)?0this.duration&&(e=this.duration-1);var n=e/this.duration;if(1<=n)return this.points[this.length-1];var r,i,o,s,a,u,c,h,l=Math.floor((this.points.length-1)*n);return r=(this.length-1)*n-l,i=this.points[l],o=this.controls[l][1],s=this.controls[l+1][0],h=[(c=(u=r)*u)*u,3*c*(1-u),3*u*(1-u)*(1-u),(1-u)*(1-u)*(1-u)],{x:(a=this.points[l+1]).x*h[0]+s.x*h[1]+o.x*h[2]+i.x*h[3],y:a.y*h[0]+s.y*h[1]+o.y*h[2]+i.y*h[3],z:a.z*h[0]+s.z*h[1]+o.z*h[2]+i.z*h[3]}};var Je=Ke,Ze=Ke;function Ke(t,e,n){n=n||2;var r,i,o,s,a,u,c,h=e&&e.length,l=h?e[0]*n:t.length,p=Qe(t,0,l,n,!0),f=[];if(!p)return f;if(h&&(p=function(t,e,n,r){var i,o,s,a=[];for(i=0,o=e.length;i80*n){r=o=t[0],i=s=t[1];for(var g=n;go.x?i.x>s.x?i.x:s.x:o.x>s.x?o.x:s.x,h=i.y>o.y?i.y>s.y?i.y:s.y:o.y>s.y?o.y:s.y,l=un(a,u,e,n,r),p=un(c,h,e,n,r),f=t.nextZ;f&&f.z<=p;){if(f!==t.prev&&f!==t.next&&hn(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=ln(f.prev,f,f.next))return!1;f=f.nextZ}for(f=t.prevZ;f&&f.z>=l;){if(f!==t.prev&&f!==t.next&&hn(i.x,i.y,o.x,o.y,s.x,s.y,f.x,f.y)&&0<=ln(f.prev,f,f.next))return!1;f=f.prevZ}return!0}function rn(t,e,n){var r=t;do{var i=r.prev,o=r.next.next;!pn(i,o)&&fn(i,r,r.next,o)&&gn(i,o)&&gn(o,i)&&(e.push(i.i/n),e.push(r.i/n),e.push(o.i/n),_n(r),_n(r.next),r=t=o),r=r.next}while(r!==t);return r}function on(t,e,n,r,i,o){var s,a,u=t;do{for(var c=u.next.next;c!==u.prev;){if(u.i!==c.i&&(a=c,(s=u).next.i!==a.i&&s.prev.i!==a.i&&!function(t,e){var n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&fn(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}(s,a)&&gn(s,a)&&gn(a,s)&&function(t,e){for(var n=t,r=!1,i=(t.x+e.x)/2,o=(t.y+e.y)/2;n.y>o!=n.next.y>o&&n.next.y!==n.y&&i<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(r=!r),(n=n.next)!==t;);return r}(s,a))){var h=dn(u,c);return u=$e(u,u.next),h=$e(h,h.next),tn(u,e,n,r,i,o),void tn(h,e,n,r,i,o)}c=c.next}u=u.next}while(u!==t)}function sn(t,e){return t.x-e.x}function an(t,e){if(e=function(t,e){var n,r=e,i=t.x,o=t.y,s=-1/0;do{if(o<=r.y&&o>=r.next.y&&r.next.y!==r.y){var a=r.x+(o-r.y)*(r.next.x-r.x)/(r.next.y-r.y);if(a<=i&&s=r.x&&r.x>=h&&i!==r.x&&hn(on.x)&&gn(r,t)&&(n=r,p=u),r=r.next;return n}(t,e)){var n=dn(e,t);$e(n,n.next)}}function un(t,e,n,r,i){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-n)*i)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e=32767*(e-r)*i)|e<<8))|e<<4))|e<<2))|e<<1))<<1}function cn(t){for(var e=t,n=t;e.x=t.minX&&e.maxY>=t.minY}function Dn(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Fn(t,e,n,r,i){for(var o,s=[e,n];s.length;)(n=s.pop())-(e=s.pop())<=r||(a=t,u=o=e+Math.ceil((n-e)/r/2)*r,c=i,function t(e,n,r,i,o){for(;rt[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2] line1 must only contain 2 coordinates");if(2!==r.length)throw new Error(" line2 must only contain 2 coordinates");var i=n[0][0],o=n[0][1],s=n[1][0],a=n[1][1],u=r[0][0],c=r[0][1],h=r[1][0],l=r[1][1],p=(l-c)*(s-i)-(h-u)*(a-o);if(0==p)return null;var f=((h-u)*(o-c)-(l-c)*(i-u))/p,g=((s-i)*(o-c)-(a-o)*(i-u))/p;return 0<=f&&f<=1&&0<=g&&g<=1?X([i+f*(s-i),o+f*(a-o)]):null}function Xn(t,p,f){if(!H(f=f||{}))throw new Error("options is invalid");var e=t.geometry?t.geometry.type:t.type;if("LineString"!==e&&"MultiLineString"!==e)throw new Error("lines must be LineString or MultiLineString");var g=X([1/0,1/0],{dist:1/0}),d=0;return A(t,function(t){for(var e=Z(t),n=0;nMath.PI&&(i-=2*Math.PI),i<-Math.PI&&(i+=2*Math.PI);var o=Math.log(Math.tan(r/2+Math.PI/4)/Math.tan(n/2+Math.PI/4));return(_(Math.atan2(i,o))+360)%360}function Vn(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.units;if(!t)throw new Error("from point is required");if(!e)throw new Error("to point is required");var i=J(t),o=J(e);return o[0]+=180Math.PI&&(a-=2*Math.PI);var u=Math.log(Math.tan(o/2+Math.PI/4)/Math.tan(i/2+Math.PI/4)),c=1e-11r&&(i[0]=r),i[0]<-r&&(i[0]=-r),i[1]>r&&(i[1]=r),i[1]<-r&&(i[1]=-r),i}function Kn(t){var e=180/Math.PI;return[t[0]*e/6378137,(.5*Math.PI-2*Math.atan(Math.exp(-t[1]/6378137)))*e]}Ke.deviation=function(t,e,n,r){var i=e&&e.length,o=i?e[0]*n:t.length,s=Math.abs(vn(t,0,o,n));if(i)for(var a=0,u=e.length;athis._maxEntries;)this._split(o,e),e--;this._adjustParentBBoxes(i,o,e)},_split:function(t,e){var n=t[e],r=n.children.length,i=this._minEntries;this._chooseSplitAxis(n,i,r);var o=this._chooseSplitIndex(n,i,r),s=Dn(n.children.splice(o,n.children.length-o));s.height=n.height,s.leaf=n.leaf,Cn(n,this.toBBox),Cn(s,this.toBBox),e?t[e-1].children.push(s):this._splitRoot(n,s)},_splitRoot:function(t,e){this.data=Dn([t,e]),this.data.height=t.height+1,this.data.leaf=!1,Cn(this.data,this.toBBox)},_chooseSplitIndex:function(t,e,n){var r,i,o,s,a,u,c,h,l,p,f,g,d,y;for(u=c=1/0,r=e;r<=n-e;r++)l=i=Sn(t,0,r,this.toBBox),p=o=Sn(t,r,n,this.toBBox),f=Math.max(l.minX,p.minX),g=Math.max(l.minY,p.minY),d=Math.min(l.maxX,p.maxX),y=Math.min(l.maxY,p.maxY),s=Math.max(0,d-f)*Math.max(0,y-g),a=On(i)+On(o),s=Math.abs(g)?0=Math.abs(g)?0=Math.abs(g)?0=Math.abs(g)?0e[0]||t[2]e[1]||t[3] is required");if("number"!=typeof n)throw new Error(" must be a number");if("number"!=typeof r)throw new Error(" must be a number");!1!==i&&void 0!==i||(t=JSON.parse(JSON.stringify(t)));var o=Math.pow(10,n);return N(t,function(t){!function(t,e,n){t.length>n&&t.splice(n,t.length);for(var r=0;rp){var E=parseFloat(n[v-1][0]),w=parseFloat(n[v-1][1]),b=parseFloat(n[v][0]),I=parseFloat(n[v][1]);if(-180h&&n[v-1][0]<180){m.push([180,n[v][1]]),v++,m.push([n[v][0],n[v][1]]);continue}if(Eh?180:-180,M]),(m=[]).push([n[v-1][0]>h?-180:180,M]),_.push(m)}else m=[],_.push(m);m.push([x,n[v][1]])}else m.push([n[v][0],n[v][1]])}}else{var L=[];_.push(L);for(var P=0;Pe[2]&&(n|=2),t[1]e[3]&&(n|=8),n}function Xr(t,e){for(var n=[],r=0;rMath.PI/2&&(c=0 "+this.to.id+" }"},mo.prototype.toLineString=function(){return U([this.from.coordinates,this.to.coordinates])},mo.prototype.compareTo=function(t){return go(t.from.coordinates,t.to.coordinates,this.to.coordinates)};function vo(){this.edges=[],this.polygon=void 0,this.envelope=void 0}var xo={length:{configurable:!0}};vo.prototype.push=function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0},vo.prototype.get=function(t){return this.edges[t]},xo.length.get=function(){return this.edges.length},vo.prototype.forEach=function(t){this.edges.forEach(t)},vo.prototype.map=function(t){return this.edges.map(t)},vo.prototype.some=function(t){return this.edges.some(t)},vo.prototype.isValid=function(){return!0},vo.prototype.isHole=function(){var r=this,t=this.edges.reduce(function(t,e,n){return e.from.coordinates[1]>r.edges[t].from.coordinates[1]&&(t=n),t},0),e=(0===t?this.length:t)-1,n=(t+1)%this.length,i=go(this.edges[e].from.coordinates,this.edges[t].from.coordinates,this.edges[n].from.coordinates);return 0===i?this.edges[e].from.coordinates[0]>this.edges[n].from.coordinates[0]:0=Math.abs(c)?0e[0]||t[2]e[1]||t[3]=Math.abs(a)?0=Math.abs(a)?0=this.minPts&&(e=this._mergeArrays(e,i))}1!==this._assigned[r]&&this._addToCluster(r,t)}},e.prototype._addToCluster=function(t,e){this.clusters[e].push(t),this._assigned[t]=1},e.prototype._regionQuery=function(t){for(var e=[],n=0;n=this.minPts)return n},e.prototype._regionQuery=function(t,e){e=e||this.epsilon;for(var n=[],r=0,i=this.dataset.length;r>1)-1,r=this.content[n];if(!(this.scoreFunction(e)=i)return}else u=[d,n];o=[d,i]}else{if(u){if(u[1]=i)return}else u=[(n-a)/s,n];o=[(i-a)/s,i]}else{if(u){if(u[1]=r)return}else u=[e,s*e+a];o=[r,s*r+a]}else{if(u){if(u[0]As||Math.abs(i[0][1]-i[1][1])>As)||delete Ts[o]}(s,a,u,c),function(t,e,n,r){var i,o,s,a,u,c,h,l,p,f,g,d,y,_,m=Os.length,v=!0;for(i=0;iAs||Math.abs(d-p)>As)&&(u.splice(a,0,Ts.push(ps(s,f,Math.abs(g-t)=n)return null;for(var r=s-u.site[0],i=a-u.site[1],l=r*r+i*i;u=c.cells[e=h],h=null,u.halfedges.forEach(function(t){var e=c.edges[t],n=e.left;if(n!==u.site&&n||(n=e.right)){var r=s-n[0],i=a-n[1],o=r*r+i*i;oe.x?1:this.ye.y?1:0},pa.prototype.clone=function(){},pa.prototype.copy=function(){return new pa(this)},pa.prototype.toString=function(){return"("+this.x+", "+this.y+", "+this.z+")"},pa.prototype.distance3D=function(t){var e=this.x-t.x,n=this.y-t.y,r=this.z-t.z;return Math.sqrt(e*e+n*n+r*r)},pa.prototype.distance=function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},pa.prototype.hashCode=function(){var t=17;return 37*(t=37*t+pa.hashCode(this.x))+pa.hashCode(this.y)},pa.prototype.setCoordinate=function(t){this.x=t.x,this.y=t.y,this.z=t.z},pa.prototype.interfaces_=function(){return[ua,ca,la]},pa.prototype.getClass=function(){return pa},pa.hashCode=function(){if(1===arguments.length){var t=sa.doubleToLongBits(arguments[0]);return Math.trunc((t^t)>>>32)}},fa.DimensionalComparator.get=function(){return ga},fa.serialVersionUID.get=function(){return 0x5cbf2c235c7e5800},fa.NULL_ORDINATE.get=function(){return sa.NaN},fa.X.get=function(){return 0},fa.Y.get=function(){return 1},fa.Z.get=function(){return 2},Object.defineProperties(pa,fa);var ga=function(t){if(this._dimensionsToTest=2,0===arguments.length);else if(1===arguments.length){var e=t;if(2!==e&&3!==e)throw new oa("only 2 or 3 dimensions may be specified");this._dimensionsToTest=e}};ga.prototype.compare=function(t,e){var n=t,r=e,i=ga.compare(n.x,r.x);if(0!==i)return i;var o=ga.compare(n.y,r.y);return 0!==o?o:this._dimensionsToTest<=2?0:ga.compare(n.z,r.z)},ga.prototype.interfaces_=function(){return[ha]},ga.prototype.getClass=function(){return ga},ga.compare=function(t,e){return tt?1:0},wa.isNaN=function(t){return Number.isNaN(t)};function ba(){}ba.isWhitespace=function(t){return t<=32&&0<=t||127===t},ba.toUpperCase=function(t){return t.toUpperCase()};function Ia(){if(this._hi=0,(this._lo=0)===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof Ia){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){Ia.call(this,Ia.parse(arguments[0]))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n,r)}}var Na={PI:{configurable:!0},TWO_PI:{configurable:!0},PI_2:{configurable:!0},E:{configurable:!0},NaN:{configurable:!0},EPS:{configurable:!0},SPLIT:{configurable:!0},MAX_PRINT_DIGITS:{configurable:!0},TEN:{configurable:!0},ONE:{configurable:!0},SCI_NOT_EXPONENT_CHAR:{configurable:!0},SCI_NOT_ZERO:{configurable:!0}};Ia.prototype.le=function(t){return(this._hi=a-u&&(p=!1),!p)break}return e[0]=r,s.toString()},Ia.prototype.sqr=function(){return this.multiply(this)},Ia.prototype.doubleValue=function(){return this._hi+this._lo},Ia.prototype.subtract=function(){if(arguments[0]instanceof Ia){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},Ia.prototype.equals=function(){if(1===arguments.length){var t=arguments[0];return this._hi===t._hi&&this._lo===t._lo}},Ia.prototype.isZero=function(){return 0===this._hi&&0===this._lo},Ia.prototype.selfSubtract=function(){if(arguments[0]instanceof Ia){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t._hi,-t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},Ia.prototype.getSpecialNumberString=function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},Ia.prototype.min=function(t){return this.le(t)?this:t},Ia.prototype.selfDivide=function(){if(1===arguments.length){if(arguments[0]instanceof Ia){var t=arguments[0];return this.selfDivide(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n,r,i,o,s=arguments[0],a=arguments[1],u=null,c=null,h=null,l=null;return i=this._hi/s,l=(u=(h=Ia.SPLIT*i)-(u=h-i))*(c=(l=Ia.SPLIT*s)-(c=l-s))-(o=i*s)+u*(r=s-c)+(n=i-u)*c+n*r,l=i+(h=(this._hi-o-l+this._lo-i*a)/s),this._hi=l,this._lo=i-l+h,this}},Ia.prototype.dump=function(){return"DD<"+this._hi+", "+this._lo+">"},Ia.prototype.divide=function(){if(arguments[0]instanceof Ia){var t,e,n,r,i=arguments[0],o=null,s=null,a=null,u=null;return t=(n=this._hi/i._hi)-(o=(a=Ia.SPLIT*n)-(o=a-n)),u=o*(s=(u=Ia.SPLIT*i._hi)-(s=u-i._hi))-(r=n*i._hi)+o*(e=i._hi-s)+t*s+t*e,a=(this._hi-r-u+this._lo-n*i._lo)/i._hi,new Ia(u=n+a,n-u+a)}if("number"==typeof arguments[0]){var c=arguments[0];return sa.isNaN(c)?Ia.createNaN():Ia.copy(this).selfDivide(c,0)}},Ia.prototype.ge=function(t){return(this._hi>t._hi||this._hi===t._hi)&&this._lo>=t._lo},Ia.prototype.pow=function(t){if(0===t)return Ia.valueOf(1);var e=new Ia(this),n=Ia.valueOf(1),r=Math.abs(t);if(1e._hi?1:this._loe._lo?1:0},Ia.prototype.rint=function(){return this.isNaN()?this:this.add(.5).floor()},Ia.prototype.setValue=function(){if(arguments[0]instanceof Ia){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},Ia.prototype.max=function(t){return this.ge(t)?this:t},Ia.prototype.sqrt=function(){if(this.isZero())return Ia.valueOf(0);if(this.isNegative())return Ia.NaN;var t=1/Math.sqrt(this._hi),e=this._hi*t,n=Ia.valueOf(e),r=this.subtract(n.sqr())._hi*(.5*t);return n.add(r)},Ia.prototype.selfAdd=function(){if(1===arguments.length){if(arguments[0]instanceof Ia){var t=arguments[0];return this.selfAdd(t._hi,t._lo)}if("number"==typeof arguments[0]){var e,n,r,i,o,s=arguments[0],a=null;return a=(r=this._hi+s)-(i=r-this._hi),n=(o=(a=s-i+(this._hi-a))+this._lo)+(r-(e=r+o)),this._hi=e+n,this._lo=n+(e-this._hi),this}}else if(2===arguments.length){var u,c,h,l,p=arguments[0],f=arguments[1],g=null,d=null,y=null;h=this._hi+p,c=this._lo+f,d=h-(y=h-this._hi),g=c-(l=c-this._lo);var _=(u=h+(y=(d=p-y+(this._hi-d))+c))+(y=(g=f-l+(this._lo-g))+(y+(h-u))),m=y+(u-_);return this._hi=_,this._lo=m,this}},Ia.prototype.selfMultiply=function(){if(1===arguments.length){if(arguments[0]instanceof Ia){var t=arguments[0];return this.selfMultiply(t._hi,t._lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n,r,i=arguments[0],o=arguments[1],s=null,a=null,u=null,c=null;s=(u=Ia.SPLIT*this._hi)-this._hi,c=Ia.SPLIT*i,s=u-s,n=this._hi-s,a=c-i;var h=(u=this._hi*i)+(c=s*(a=c-a)-u+s*(r=i-a)+n*a+n*r+(this._hi*o+this._lo*i)),l=c+(s=u-h);return this._hi=h,this._lo=l,this}},Ia.prototype.selfSqr=function(){return this.selfMultiply(this)},Ia.prototype.floor=function(){if(this.isNaN())return Ia.NaN;var t=Math.floor(this._hi),e=0;return t===this._hi&&(e=Math.floor(this._lo)),new Ia(t,e)},Ia.prototype.negate=function(){return this.isNaN()?this:new Ia(-this._hi,-this._lo)},Ia.prototype.clone=function(){},Ia.prototype.multiply=function(){if(arguments[0]instanceof Ia){var t=arguments[0];return t.isNaN()?Ia.createNaN():Ia.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return sa.isNaN(e)?Ia.createNaN():Ia.copy(this).selfMultiply(e,0)}},Ia.prototype.isNaN=function(){return sa.isNaN(this._hi)},Ia.prototype.intValue=function(){return Math.trunc(this._hi)},Ia.prototype.toString=function(){var t=Ia.magnitude(this._hi);return-3<=t&&t<=20?this.toStandardNotation():this.toSciNotation()},Ia.prototype.toStandardNotation=function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),r=e[0]+1,i=n;if("."===n.charAt(0))i="0"+n;else if(r<0)i="0."+Ia.stringOfChar("0",-r)+n;else if(-1===n.indexOf(".")){var o=r-n.length;i=n+Ia.stringOfChar("0",o)+".0"}return this.isNegative()?"-"+i:i},Ia.prototype.reciprocal=function(){var t,e,n,r,i=null,o=null,s=null,a=null;t=(n=1/this._hi)-(i=(s=Ia.SPLIT*n)-(i=s-n)),o=(a=Ia.SPLIT*this._hi)-this._hi;var u=n+(s=(1-(r=n*this._hi)-(a=i*(o=a-o)-r+i*(e=this._hi-o)+t*o+t*e)-n*this._lo)/this._hi);return new Ia(u,n-u+s)},Ia.prototype.toSciNotation=function(){if(this.isZero())return Ia.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),r=Ia.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new Error("Found leading zero: "+n);var i="";1t._hi||this._hi===t._hi)&&this._lo>t._lo},Ia.prototype.isNegative=function(){return(this._hi<0||0===this._hi)&&this._lo<0},Ia.prototype.trunc=function(){return this.isNaN()?Ia.NaN:this.isPositive()?this.floor():this.ceil()},Ia.prototype.signum=function(){return 0t._minx?this._minx:t._minx,n=this._miny>t._miny?this._miny:t._miny,r=this._maxx=this._minx&&e.getMaxX()<=this._maxx&&e.getMinY()>=this._miny&&e.getMaxY()<=this._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return!this.isNull()&&n>=this._minx&&n<=this._maxx&&r>=this._miny&&r<=this._maxy}},Fa.prototype.intersects=function(){if(1===arguments.length){if(arguments[0]instanceof Fa){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t._minx>this._maxx||t._maxxthis._maxy||t._maxythis._maxx||nthis._maxy||rthis._maxx&&(this._maxx=e._maxx),e._minythis._maxy&&(this._maxy=e._maxy))}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.isNull()?(this._minx=n,this._maxx=n,this._miny=r,this._maxy=r):(nthis._maxx&&(this._maxx=n),rthis._maxy&&(this._maxy=r))}},Fa.prototype.minExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te._minx?1:this._minye._miny?1:this._maxxe._maxx?1:this._maxye._maxy?1:0},Fa.prototype.translate=function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},Fa.prototype.toString=function(){return"Env["+this._minx+" : "+this._maxx+", "+this._miny+" : "+this._maxy+"]"},Fa.prototype.setToNull=function(){this._minx=0,this._maxx=-1,this._miny=0,this._maxy=-1},Fa.prototype.getHeight=function(){return this.isNull()?0:this._maxy-this._miny},Fa.prototype.maxExtent=function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return ethis._maxx||this._miny>this._maxy)&&this.setToNull()}},Fa.prototype.contains=function(){if(1===arguments.length){if(arguments[0]instanceof Fa){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof pa){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];return this.covers(n,r)}},Fa.prototype.centre=function(){return this.isNull()?null:new pa((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},Fa.prototype.init=function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof pa){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof Fa){var e=arguments[0];this._minx=e._minx,this._maxx=e._maxx,this._miny=e._miny,this._maxy=e._maxy}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];this._maxx=it._maxx&&(e=this._minx-t._maxx);var n=0;return this._maxyt._maxy&&(n=this._miny-t._maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},Fa.prototype.hashCode=function(){var t=17;return 37*(t=37*(t=37*(t=37*t+pa.hashCode(this._minx))+pa.hashCode(this._maxx))+pa.hashCode(this._miny))+pa.hashCode(this._maxy)},Fa.prototype.interfaces_=function(){return[ua,la]},Fa.prototype.getClass=function(){return Fa},Fa.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var r=arguments[0],i=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),c=Math.min(r.x,i.x),h=Math.max(r.x,i.x);return!(un.y&&(n=o,r=i)}for(var s=r;(s-=1)<0&&(s=e),t[s].equals2D(n)&&s!==r;);for(var a=r;t[a=(a+1)%e].equals2D(n)&&a!==r;);var u=t[s],c=t[a];if(u.equals2D(n)||c.equals2D(n)||u.equals2D(c))return!1;var h=ru.computeOrientation(u,n,c);return 0===h?u.x>c.x:0=this.size())throw new mu;return this.array_[t]},Ou.prototype.isEmpty=function(){return 0===this.array_.length},Ou.prototype.size=function(){return this.array_.length},Ou.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=t?e:[]},bu.indexOf=function(t,e){for(var n=0;n=t.length&&(r=0),nr.length)return 1;if(0===n.length)return 0;var i=bu.compare(n,r);return bu.isEqualReversed(n,r)?0:i},Tu.prototype.OLDcompare=function(t,e){var n=t,r=e;if(n.lengthr.length)return 1;if(0===n.length)return 0;for(var i=bu.increasingDirection(n),o=bu.increasingDirection(r),s=0= 2)");this._points=t},e.prototype.isCoordinate=function(t){for(var e=0;e= 4)")},t.prototype.getGeometryType=function(){return"LinearRing"},t.prototype.copy=function(){return new t(this._points.copy(),this._factory)},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},e.MINIMUM_VALID_SIZE.get=function(){return 4},e.serialVersionUID.get=function(){return-0x3b229e262367a600},Object.defineProperties(t,e),t}(wc),Lc=function(n){function r(){n.apply(this,arguments)}n&&(r.__proto__=n);var t={serialVersionUID:{configurable:!0}};return((r.prototype=Object.create(n&&n.prototype)).constructor=r).prototype.getSortIndex=function(){return su.SORTINDEX_MULTIPOLYGON},r.prototype.equalsExact=function(){if(2!==arguments.length)return n.prototype.equalsExact.apply(this,arguments);var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&n.prototype.equalsExact.call(this,t,e)},r.prototype.getBoundaryDimension=function(){return 1},r.prototype.getDimension=function(){return 2},r.prototype.reverse=function(){for(var t=this._geometries.length,e=new Array(t).fill(null),n=0;n=this.size())throw new Error;return this.array_[t]},nh.prototype.push=function(t){return this.array_.push(t),t},nh.prototype.pop=function(t){if(0===this.array_.length)throw new eh;return this.array_.pop()},nh.prototype.peek=function(){if(0===this.array_.length)throw new eh;return this.array_[this.array_.length-1]},nh.prototype.empty=function(){return 0===this.array_.length},nh.prototype.isEmpty=function(){return this.empty()},nh.prototype.search=function(t){return this.array_.indexOf(t)},nh.prototype.size=function(){return this.array_.length},nh.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;ethis._minCoord.y&&n.y>this._minCoord.y&&r===ru.CLOCKWISE&&(i=!0),i&&(this._minIndex=this._minIndex-1)},rh.prototype.getRightmostSideOfSegment=function(t,e){var n=t.getEdge().getCoordinates();if(e<0||e+1>=n.length)return-1;if(n[e].y===n[e+1].y)return-1;var r=$c.LEFT;return n[e].ythis._minCoord.x)&&(this._minDe=t,this._minIndex=n,this._minCoord=e[n])},rh.prototype.findRightmostEdgeAtNode=function(){var t=this._minDe.getNode().getEdges();this._minDe=t.getRightmostEdge(),this._minDe.isForward()||(this._minDe=this._minDe.getSym(),this._minIndex=this._minDe.getEdge().getCoordinates().length-1)},rh.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}Xa.isTrue(0!==this._minIndex||this._minCoord.equals(this._minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this._minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this._orientedDe=this._minDe,this.getRightmostSide(this._minDe,this._minIndex)===$c.LEFT&&(this._orientedDe=this._minDe.getSym())},rh.prototype.interfaces_=function(){return[]},rh.prototype.getClass=function(){return rh};function ih(){this.array_=[]}var oh,sh=((oh=Va)&&(ah.__proto__=oh),((ah.prototype=Object.create(oh&&oh.prototype)).constructor=ah).prototype.getCoordinate=function(){return this.pt},ah.prototype.interfaces_=function(){return[]},ah.prototype.getClass=function(){return ah},ah.msgWithCoord=function(t,e){return e?t:t+" [ "+e+" ]"},ah);function ah(t,e){oh.call(this,ah.msgWithCoord(t,e)),this.pt=e?new pa(e):null,this.name="TopologyException"}ih.prototype.addLast=function(t){this.array_.push(t)},ih.prototype.removeFirst=function(){return this.array_.shift()},ih.prototype.isEmpty=function(){return 0===this.array_.length};function uh(){this._finder=null,this._dirEdgeList=new Cu,this._nodes=new Cu,this._rightMostCoord=null,this._env=null,this._finder=new rh}uh.prototype.clearVisitedEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();)t.next().setVisited(!1)},uh.prototype.getRightmostCoordinate=function(){return this._rightMostCoord},uh.prototype.computeNodeDepth=function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var r=n.next();if(r.isVisited()||r.getSym().isVisited()){e=r;break}}if(null===e)throw new sh("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var i=t.getEdges().iterator();i.hasNext();){var o=i.next();o.setVisited(!0),this.copySymDepths(o)}},uh.prototype.computeDepth=function(t){this.clearVisitedEdges();var e=this._finder.getEdge();e.setEdgeDepths($c.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},uh.prototype.create=function(t){this.addReachable(t),this._finder.findEdge(this._dirEdgeList),this._rightMostCoord=this._finder.getCoordinate()},uh.prototype.findResultEdges=function(){for(var t=this._dirEdgeList.iterator();t.hasNext();){var e=t.next();1<=e.getDepth($c.RIGHT)&&e.getDepth($c.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},uh.prototype.computeDepths=function(t){var e=new ju,n=new ih,r=t.getNode();for(n.addLast(r),e.add(r),t.setVisited(!0);!n.isEmpty();){var i=n.removeFirst();e.add(i),this.computeNodeDepth(i);for(var o=i.getEdges().iterator();o.hasNext();){var s=o.next().getSym();if(!s.isVisited()){var a=s.getNode();e.contains(a)||(n.addLast(a),e.add(a))}}}},uh.prototype.compareTo=function(t){var e=t;return this._rightMostCoord.xe._rightMostCoord.x?1:0},uh.prototype.getEnvelope=function(){if(null===this._env){for(var t=new Fa,e=this._dirEdgeList.iterator();e.hasNext();)for(var n=e.next().getEdge().getCoordinates(),r=0;rthis.location.length){var e=new Array(3).fill(null);e[$c.ON]=this.location[$c.ON],e[$c.LEFT]=ya.NONE,e[$c.RIGHT]=ya.NONE,this.location=e}for(var n=0;nthis._maxNodeDegree&&(this._maxNodeDegree=e),t=this.getNext(t)}while(t!==this._startDe);this._maxNodeDegree*=2},lh.prototype.addPoints=function(t,e,n){var r=t.getCoordinates();if(e){var i=1;n&&(i=0);for(var o=i;o=n.x?r.y>=n.y?bh.NE:bh.SE:r.y>=n.y?bh.NW:bh.SW}},Ih.NE.get=function(){return 0},Ih.NW.get=function(){return 1},Ih.SW.get=function(){return 2},Ih.SE.get=function(){return 3},Object.defineProperties(bh,Ih);function Nh(t,e,n,r){if(this._edge=null,this._label=null,this._node=null,this._p0=null,this._p1=null,this._dx=null,this._dy=null,this._quadrant=null,1===arguments.length){var i=t;this._edge=i}else if(3===arguments.length){var o=t,s=e,a=n;this._edge=o,this.init(s,a),this._label=null}else if(4===arguments.length){var u=t,c=e,h=n,l=r;this._edge=u,this.init(c,h),this._label=l}}Nh.prototype.compareDirection=function(t){return this._dx===t._dx&&this._dy===t._dy?0:this._quadrant>t._quadrant?1:this._quadrantkh.area(this._boundable2)?this.expand(this._boundable1,this._boundable2,t,e):this.expand(this._boundable2,this._boundable1,t,e),null;if(n)return this.expand(this._boundable1,this._boundable2,t,e),null;if(r)return this.expand(this._boundable2,this._boundable1,t,e),null;throw new oa("neither boundable is composite")},kh.prototype.isLeaves=function(){return!(kh.isComposite(this._boundable1)||kh.isComposite(this._boundable2))},kh.prototype.compareTo=function(t){var e=t;return this._distancee._distance?1:0},kh.prototype.expand=function(t,e,n,r){for(var i=t.getChildBoundables().iterator();i.hasNext();){var o=i.next(),s=new kh(o,e,this._itemDistance);s.getDistance()>32),n=sa.doubleToLongBits(this.p1.x);return n^=31*sa.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},nl.prototype.interfaces_=function(){return[ua,la]},nl.prototype.getClass=function(){return nl},nl.midPoint=function(t,e){return new pa((t.x+e.x)/2,(t.y+e.y)/2)},rl.serialVersionUID.get=function(){return 0x2d2172135f411c00},Object.defineProperties(nl,rl);function il(){this.tempEnv1=new Fa,this.tempEnv2=new Fa,this._overlapSeg1=new nl,this._overlapSeg2=new nl}il.prototype.overlap=function(){if(2===arguments.length);else if(4===arguments.length){var t=arguments[1],e=arguments[2],n=arguments[3];arguments[0].getLineSegment(t,this._overlapSeg1),e.getLineSegment(n,this._overlapSeg2),this.overlap(this._overlapSeg1,this._overlapSeg2)}},il.prototype.interfaces_=function(){return[]},il.prototype.getClass=function(){return il};function ol(t,e,n,r){this._pts=null,this._start=null,this._end=null,this._env=null,this._context=null,this._id=null;var i=t,o=e,s=n,a=r;this._pts=i,this._start=o,this._end=s,this._context=a}ol.prototype.getLineSegment=function(t,e){e.p0=this._pts[t],e.p1=this._pts[t+1]},ol.prototype.computeSelect=function(t,e,n,r){var i=this._pts[e],o=this._pts[n];if(r.tempEnv1.init(i,o),n-e==1)return r.select(this,e),null;if(!t.intersects(r.tempEnv1))return null;var s=Math.trunc((e+n)/2);e=t.length-1)return t.length-1;for(var r=bh.quadrant(t[n],t[n+1]),i=e+1;in.getId()&&(n.computeOverlaps(i,t),this._nOverlaps++),this._segInt.isDone())return null}},t.prototype.interfaces_=function(){return[]},t.prototype.getClass=function(){return t},n.SegmentOverlapAction.get=function(){return pl},Object.defineProperties(t,n),t}(ul),pl=((hl=il)&&(gl.__proto__=hl),((gl.prototype=Object.create(hl&&hl.prototype)).constructor=gl).prototype.overlap=function(){if(4!==arguments.length)return hl.prototype.overlap.apply(this,arguments);var t=arguments[1],e=arguments[2],n=arguments[3],r=arguments[0].getContext(),i=e.getContext();this._si.processIntersections(r,t,i,n)},gl.prototype.interfaces_=function(){return[]},gl.prototype.getClass=function(){return gl},gl),fl={CAP_ROUND:{configurable:!0},CAP_FLAT:{configurable:!0},CAP_SQUARE:{configurable:!0},JOIN_ROUND:{configurable:!0},JOIN_MITRE:{configurable:!0},JOIN_BEVEL:{configurable:!0},DEFAULT_QUADRANT_SEGMENTS:{configurable:!0},DEFAULT_MITRE_LIMIT:{configurable:!0},DEFAULT_SIMPLIFY_FACTOR:{configurable:!0}};function gl(){hl.call(this),this._si=null;var t=arguments[0];this._si=t}cl.prototype.getEndCapStyle=function(){return this._endCapStyle},cl.prototype.isSingleSided=function(){return this._isSingleSided},cl.prototype.setQuadrantSegments=function(t){this._quadrantSegments=t,0===this._quadrantSegments&&(this._joinStyle=cl.JOIN_BEVEL),this._quadrantSegments<0&&(this._joinStyle=cl.JOIN_MITRE,this._mitreLimit=Math.abs(this._quadrantSegments)),t<=0&&(this._quadrantSegments=1),this._joinStyle!==cl.JOIN_ROUND&&(this._quadrantSegments=cl.DEFAULT_QUADRANT_SEGMENTS)},cl.prototype.getJoinStyle=function(){return this._joinStyle},cl.prototype.setJoinStyle=function(t){this._joinStyle=t},cl.prototype.setSimplifyFactor=function(t){this._simplifyFactor=t<0?0:t},cl.prototype.getSimplifyFactor=function(){return this._simplifyFactor},cl.prototype.getQuadrantSegments=function(){return this._quadrantSegments},cl.prototype.setEndCapStyle=function(t){this._endCapStyle=t},cl.prototype.getMitreLimit=function(){return this._mitreLimit},cl.prototype.setMitreLimit=function(t){this._mitreLimit=t},cl.prototype.setSingleSided=function(t){this._isSingleSided=t},cl.prototype.interfaces_=function(){return[]},cl.prototype.getClass=function(){return cl},cl.bufferDistanceError=function(t){var e=Math.PI/2/t;return 1-Math.cos(e/2)},fl.CAP_ROUND.get=function(){return 1},fl.CAP_FLAT.get=function(){return 2},fl.CAP_SQUARE.get=function(){return 3},fl.JOIN_ROUND.get=function(){return 1},fl.JOIN_MITRE.get=function(){return 2},fl.JOIN_BEVEL.get=function(){return 3},fl.DEFAULT_QUADRANT_SEGMENTS.get=function(){return 8},fl.DEFAULT_MITRE_LIMIT.get=function(){return 5},fl.DEFAULT_SIMPLIFY_FACTOR.get=function(){return.01},Object.defineProperties(cl,fl);function dl(t){this._distanceTol=null,this._isDeleted=null,this._angleOrientation=ru.COUNTERCLOCKWISE,this._inputLine=t||null}var yl={INIT:{configurable:!0},DELETE:{configurable:!0},KEEP:{configurable:!0},NUM_PTS_TO_CHECK:{configurable:!0}};dl.prototype.isDeletable=function(t,e,n,r){var i=this._inputLine[t],o=this._inputLine[e],s=this._inputLine[n];return!!this.isConcave(i,o,s)&&!!this.isShallow(i,o,s,r)&&this.isShallowSampled(i,o,t,n,r)},dl.prototype.deleteShallowConcavities=function(){for(var t=1,e=this.findNextNonDeletedIndex(t),n=this.findNextNonDeletedIndex(e),r=!1;nMath.PI;)t-=vl.PI_TIMES_2;for(;t<=-Math.PI;)t+=vl.PI_TIMES_2;return t},vl.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],r=n.x-e.x,i=n.y-e.y;return Math.atan2(i,r)}},vl.isAcute=function(t,e,n){var r=t.x-e.x,i=t.y-e.y;return 0Math.PI&&(n=2*Math.PI-n),n},vl.toRadians=function(t){return t*Math.PI/180},vl.getTurn=function(t,e){var n=Math.sin(e-t);return 0Math.PI?i-vl.PI_TIMES_2:i},xl.PI_TIMES_2.get=function(){return 2*Math.PI},xl.PI_OVER_2.get=function(){return Math.PI/2},xl.PI_OVER_4.get=function(){return Math.PI/4},xl.COUNTERCLOCKWISE.get=function(){return ru.COUNTERCLOCKWISE},xl.CLOCKWISE.get=function(){return ru.CLOCKWISE},xl.NONE.get=function(){return ru.COLLINEAR},Object.defineProperties(vl,xl);function El(){this._maxCurveSegmentError=0,this._filletAngleQuantum=null,this._closingSegLengthFactor=1,this._segList=null,this._distance=0,this._precisionModel=null,this._bufParams=null,this._li=null,this._s0=null,this._s1=null,this._s2=null,this._seg0=new nl,this._seg1=new nl,this._offset0=new nl,this._offset1=new nl,this._side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._precisionModel=t,this._bufParams=e,this._li=new tu,this._filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),8<=e.getQuadrantSegments()&&e.getJoinStyle()===cl.JOIN_ROUND&&(this._closingSegLengthFactor=El.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}var wl={OFFSET_SEGMENT_SEPARATION_FACTOR:{configurable:!0},INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},CURVE_VERTEX_SNAP_DISTANCE_FACTOR:{configurable:!0},MAX_CLOSING_SEG_LEN_FACTOR:{configurable:!0}};El.prototype.addNextSegment=function(t,e){if(this._s0=this._s1,this._s1=this._s2,this._s2=t,this._seg0.setCoordinates(this._s0,this._s1),this.computeOffsetSegment(this._seg0,this._side,this._distance,this._offset0),this._seg1.setCoordinates(this._s1,this._s2),this.computeOffsetSegment(this._seg1,this._side,this._distance,this._offset1),this._s1.equals(this._s2))return null;var n=ru.computeOrientation(this._s0,this._s1,this._s2),r=n===ru.CLOCKWISE&&this._side===$c.LEFT||n===ru.COUNTERCLOCKWISE&&this._side===$c.RIGHT;0===n?this.addCollinear(e):r?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},El.prototype.addLineEndCap=function(t,e){var n=new nl(t,e),r=new nl;this.computeOffsetSegment(n,$c.LEFT,this._distance,r);var i=new nl;this.computeOffsetSegment(n,$c.RIGHT,this._distance,i);var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o);switch(this._bufParams.getEndCapStyle()){case cl.CAP_ROUND:this._segList.addPt(r.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,ru.CLOCKWISE,this._distance),this._segList.addPt(i.p1);break;case cl.CAP_FLAT:this._segList.addPt(r.p1),this._segList.addPt(i.p1);break;case cl.CAP_SQUARE:var u=new pa;u.x=Math.abs(this._distance)*Math.cos(a),u.y=Math.abs(this._distance)*Math.sin(a);var c=new pa(r.p1.x+u.x,r.p1.y+u.y),h=new pa(i.p1.x+u.x,i.p1.y+u.y);this._segList.addPt(c),this._segList.addPt(h)}},El.prototype.getCoordinates=function(){return this._segList.getCoordinates()},El.prototype.addMitreJoin=function(t,e,n,r){var i=!0,o=null;try{o=Da.intersection(e.p0,e.p1,n.p0,n.p1),(r<=0?1:o.distance(t)/Math.abs(r))>this._bufParams.getMitreLimit()&&(i=!1)}catch(t){if(!(t instanceof Ta))throw t;o=new pa(0,0),i=!1}i?this._segList.addPt(o):this.addLimitedMitreJoin(e,n,r,this._bufParams.getMitreLimit())},El.prototype.addFilletCorner=function(t,e,n,r,i){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,c=n.y-t.y,h=Math.atan2(c,u);r===ru.CLOCKWISE?a<=h&&(a+=2*Math.PI):h<=a&&(a-=2*Math.PI),this._segList.addPt(e),this.addFilletArc(t,a,h,r,i),this._segList.addPt(n)},El.prototype.addOutsideTurn=function(t,e){if(this._offset0.p1.distance(this._offset1.p0)o.getMaxY()||t.findStabbedSegments(e,i.getDirectedEdges(),n)}return n}if(3===arguments.length)if(ma(arguments[2],xu)&&arguments[0]instanceof pa&&arguments[1]instanceof Mh){for(var s=arguments[0],a=arguments[1],u=arguments[2],c=a.getEdge().getCoordinates(),h=0;ht._seg.p1.y&&t._seg.reverse(),!(Math.max(t._seg.p0.x,t._seg.p1.x)t._seg.p1.y||ru.computeOrientation(t._seg.p0,t._seg.p1,s)===ru.RIGHT)){var l=a.getDepth($c.LEFT);t._seg.p0.equals(c[h])||(l=a.getDepth($c.RIGHT));var p=new Cl(t._seg,l);u.add(p)}}else if(ma(arguments[2],xu)&&arguments[0]instanceof pa&&ma(arguments[1],xu))for(var f=arguments[0],g=arguments[2],d=arguments[1].iterator();d.hasNext();){var y=d.next();y.isForward()&&t.findStabbedSegments(f,y,g)}},Il.prototype.getDepth=function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:Bh.min(e)._leftDepth},Il.prototype.interfaces_=function(){return[]},Il.prototype.getClass=function(){return Il},Nl.DepthSegment.get=function(){return Cl},Object.defineProperties(Il,Nl);var Cl=function(t,e){this._upwardSeg=null,this._leftDepth=null;var n=t,r=e;this._upwardSeg=new nl(n),this._leftDepth=r};Cl.prototype.compareTo=function(t){var e=t;if(this._upwardSeg.minX()>=e._upwardSeg.maxX())return 1;if(this._upwardSeg.maxX()<=e._upwardSeg.minX())return-1;var n=this._upwardSeg.orientationIndex(e._upwardSeg);return 0!==n?n:0!=(n=-1*e._upwardSeg.orientationIndex(this._upwardSeg))?n:this._upwardSeg.compareTo(e._upwardSeg)},Cl.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},Cl.prototype.toString=function(){return this._upwardSeg.toString()},Cl.prototype.interfaces_=function(){return[ua]},Cl.prototype.getClass=function(){return Cl};function Sl(t,e,n){this.p0=t||null,this.p1=e||null,this.p2=n||null}Sl.prototype.area=function(){return Sl.area(this.p0,this.p1,this.p2)},Sl.prototype.signedArea=function(){return Sl.signedArea(this.p0,this.p1,this.p2)},Sl.prototype.interpolateZ=function(t){if(null===t)throw new oa("Supplied point is null.");return Sl.interpolateZ(t,this.p0,this.p1,this.p2)},Sl.prototype.longestSideLength=function(){return Sl.longestSideLength(this.p0,this.p1,this.p2)},Sl.prototype.isAcute=function(){return Sl.isAcute(this.p0,this.p1,this.p2)},Sl.prototype.circumcentre=function(){return Sl.circumcentre(this.p0,this.p1,this.p2)},Sl.prototype.area3D=function(){return Sl.area3D(this.p0,this.p1,this.p2)},Sl.prototype.centroid=function(){return Sl.centroid(this.p0,this.p1,this.p2)},Sl.prototype.inCentre=function(){return Sl.inCentre(this.p0,this.p1,this.p2)},Sl.prototype.interfaces_=function(){return[]},Sl.prototype.getClass=function(){return Sl},Sl.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Sl.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Sl.det=function(t,e,n,r){return t*r-e*n},Sl.interpolateZ=function(t,e,n,r){var i=e.x,o=e.y,s=n.x-i,a=r.x-i,u=n.y-o,c=r.y-o,h=s*c-a*u,l=t.x-i,p=t.y-o,f=(c*l-a*p)/h,g=(-u*l+s*p)/h;return e.z+f*(n.z-e.z)+g*(r.z-e.z)},Sl.longestSideLength=function(t,e,n){var r=t.distance(e),i=e.distance(n),o=n.distance(t),s=r;return s=Mc.MINIMUM_VALID_SIZE&&ru.isCCW(t)&&(o=i,s=r,n=$c.opposite(n));var a=this._curveBuilder.getRingCurve(t,n,e);this.addCurve(a,o,s)},Ml.prototype.add=function(t){if(t.isEmpty())return null;t instanceof Cc?this.addPolygon(t):t instanceof wc?this.addLineString(t):t instanceof Ic?this.addPoint(t):t instanceof Sc?this.addCollection(t):t instanceof cc?this.addCollection(t):t instanceof Lc?this.addCollection(t):t instanceof uc&&this.addCollection(t)},Ml.prototype.isErodedCompletely=function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var r=t.getEnvelopeInternal(),i=Math.min(r.getHeight(),r.getWidth());return e<0&&2*Math.abs(e)>i},Ml.prototype.addCollection=function(t){for(var e=0;e=this._max)throw new wu;var t=this._parent.getGeometryN(this._index++);return t instanceof uc?(this._subcollectionIterator=new Pl(t),this._subcollectionIterator.next()):t},Pl.prototype.remove=function(){throw new Error(this.getClass().getName())},Pl.prototype.hasNext=function(){if(this._atStart)return!0;if(null!==this._subcollectionIterator){if(this._subcollectionIterator.hasNext())return!0;this._subcollectionIterator=null}return!(this._index>=this._max)},Pl.prototype.interfaces_=function(){return[_u]},Pl.prototype.getClass=function(){return Pl},Pl.isAtomic=function(t){return!(t instanceof uc)};function Ol(t){this._geom=null;var e=t;this._geom=e}Ol.prototype.locate=function(t){return Ol.locate(t,this._geom)},Ol.prototype.interfaces_=function(){return[Ll]},Ol.prototype.getClass=function(){return Ol},Ol.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&ru.isPointInRing(t,e.getCoordinates())},Ol.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Ol.isPointInRing(t,n))return!1;for(var r=0;re&&(r=1),this._depth[t][n]=r}}},Hl.prototype.getDelta=function(t){return this._depth[t][$c.RIGHT]-this._depth[t][$c.LEFT]},Hl.prototype.getLocation=function(t,e){return this._depth[t][e]<=0?ya.EXTERIOR:ya.INTERIOR},Hl.prototype.toString=function(){return"A: "+this._depth[0][1]+","+this._depth[0][2]+" B: "+this._depth[1][1]+","+this._depth[1][2]},Hl.prototype.add=function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var r=t.getLocation(e,n);r!==ya.EXTERIOR&&r!==ya.INTERIOR||(this.isNull(e,n)?this._depth[e][n]=Hl.depthAtLocation(r):this._depth[e][n]+=Hl.depthAtLocation(r))}else if(3===arguments.length){var i=arguments[0],o=arguments[1];arguments[2]===ya.INTERIOR&&this._depth[i][o]++}},Hl.prototype.interfaces_=function(){return[]},Hl.prototype.getClass=function(){return Hl},Hl.depthAtLocation=function(t){return t===ya.EXTERIOR?0:t===ya.INTERIOR?1:Hl.NULL_VALUE},Wl.NULL_VALUE.get=function(){return-1},Object.defineProperties(Hl,Wl);function Jl(t){this._workingPrecisionModel=null,this._workingNoder=null,this._geomFact=null,this._graph=null,this._edgeList=new kl,this._bufParams=t||null}var Zl,Kl=((Zl=ph)&&(Ql.__proto__=Zl),((Ql.prototype=Object.create(Zl&&Zl.prototype)).constructor=Ql).prototype.getDepth=function(){return this._depth},Ql.prototype.getCollapsedEdge=function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new Ql(t,hh.toLineLabel(this._label))},Ql.prototype.isIsolated=function(){return this._isIsolated},Ql.prototype.getCoordinates=function(){return this.pts},Ql.prototype.setIsolated=function(t){this._isIsolated=t},Ql.prototype.setName=function(t){this._name=t},Ql.prototype.equals=function(t){if(!(t instanceof Ql))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,r=!0,i=this.pts.length,o=0;or||this._maxyo;if(s)return!1;var a=this.intersectsToleranceSquare(t,e);return Xa.isTrue(!(s&&a),"Found bad envelope test"),a},np.prototype.initCorners=function(t){this._minx=t.x-.5,this._maxx=t.x+.5,this._miny=t.y-.5,this._maxy=t.y+.5,this._corner[0]=new pa(this._maxx,this._maxy),this._corner[1]=new pa(this._minx,this._maxy),this._corner[2]=new pa(this._minx,this._miny),this._corner[3]=new pa(this._maxx,this._miny)},np.prototype.intersects=function(t,e){return 1===this._scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this._p0Scaled),this.copyScaled(e,this._p1Scaled),this.intersectsScaled(this._p0Scaled,this._p1Scaled))},np.prototype.scale=function(t){return Math.round(t*this._scaleFactor)},np.prototype.getCoordinate=function(){return this._originalPt},np.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},np.prototype.getSafeEnvelope=function(){if(null===this._safeEnv){var t=np.SAFE_ENV_EXPANSION_FACTOR/this._scaleFactor;this._safeEnv=new Fa(this._originalPt.x-t,this._originalPt.x+t,this._originalPt.y-t,this._originalPt.y+t)}return this._safeEnv},np.prototype.intersectsPixelClosure=function(t,e){return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.hasIntersection()||(this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.hasIntersection()))))},np.prototype.intersectsToleranceSquare=function(t,e){var n=!1,r=!1;return this._li.computeIntersection(t,e,this._corner[0],this._corner[1]),!!(this._li.isProper()||(this._li.computeIntersection(t,e,this._corner[1],this._corner[2]),this._li.isProper()||(this._li.hasIntersection()&&(n=!0),this._li.computeIntersection(t,e,this._corner[2],this._corner[3]),this._li.isProper()||(this._li.hasIntersection()&&(r=!0),this._li.computeIntersection(t,e,this._corner[3],this._corner[0]),this._li.isProper()||n&&r||t.equals(this._pt)||e.equals(this._pt)))))},np.prototype.addSnappedNode=function(t,e){var n=t.getCoordinate(e),r=t.getCoordinate(e+1);return!!this.intersects(n,r)&&(t.addIntersection(this.getCoordinate(),e),!0)},np.prototype.interfaces_=function(){return[]},np.prototype.getClass=function(){return np},rp.SAFE_ENV_EXPANSION_FACTOR.get=function(){return.75},Object.defineProperties(np,rp);function ip(){this.tempEnv1=new Fa,this.selectedSegment=new nl}ip.prototype.select=function(){if(1===arguments.length);else if(2===arguments.length){var t=arguments[1];arguments[0].getLineSegment(t,this.selectedSegment),this.select(this.selectedSegment)}},ip.prototype.interfaces_=function(){return[]},ip.prototype.getClass=function(){return ip};function op(t){this._index=null;var e=t;this._index=e}var sp={HotPixelSnapAction:{configurable:!0}};op.prototype.snap=function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2],i=e.getSafeEnvelope(),o=new cp(e,n,r);return this._index.query(i,{interfaces_:function(){return[Dh]},visitItem:function(t){t.select(i,o)}}),o.isNodeAdded()}},op.prototype.interfaces_=function(){return[]},op.prototype.getClass=function(){return op},sp.HotPixelSnapAction.get=function(){return cp},Object.defineProperties(op,sp);function ap(t){this._li=null,this._interiorIntersections=null;var e=t;this._li=e,this._interiorIntersections=new Cu}var up,cp=((up=ip)&&(hp.__proto__=up),((hp.prototype=Object.create(up&&up.prototype)).constructor=hp).prototype.isNodeAdded=function(){return this._isNodeAdded},hp.prototype.select=function(){if(2!==arguments.length)return up.prototype.select.apply(this,arguments);var t=arguments[1],e=arguments[0].getContext();if(null!==this._parentEdge&&e===this._parentEdge&&t===this._hotPixelVertexIndex)return null;this._isNodeAdded=this._hotPixel.addSnappedNode(e,t)},hp.prototype.interfaces_=function(){return[]},hp.prototype.getClass=function(){return hp},hp);function hp(){up.call(this),this._hotPixel=null,this._parentEdge=null,this._hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this._hotPixel=t,this._parentEdge=e,this._hotPixelVertexIndex=n}ap.prototype.processIntersections=function(t,e,n,r){if(t===n&&e===r)return null;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];if(this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&this._li.isInteriorIntersection()){for(var u=0;uthis._distance&&this.initialize(e,n,r)}},gp.prototype.interfaces_=function(){return[]},gp.prototype.getClass=function(){return gp};function dp(){}dp.prototype.interfaces_=function(){return[]},dp.prototype.getClass=function(){return dp},dp.computeDistance=function(){if(arguments[2]instanceof gp&&arguments[0]instanceof wc&&arguments[1]instanceof pa)for(var t=arguments[1],e=arguments[2],n=arguments[0].getCoordinates(),r=new nl,i=0;ithis._minDistance)return null;for(var r=t.getCoordinates(),i=e.getCoordinate(),o=0;othis._minDistance)return null;for(var l=u.getCoordinates(),p=c.getCoordinates(),f=0;fthis._distance&&this.initialize(e,n,r)}},Mp.prototype.interfaces_=function(){return[]},Mp.prototype.getClass=function(){return Mp};function Lp(){}Lp.prototype.interfaces_=function(){return[]},Lp.prototype.getClass=function(){return Lp},Lp.computeDistance=function(){if(arguments[2]instanceof Mp&&arguments[0]instanceof wc&&arguments[1]instanceof pa)for(var t=arguments[0],e=arguments[1],n=arguments[2],r=new nl,i=t.getCoordinates(),o=0;on){this._isValid=!1;var i=r.getCoordinates();this._errorLocation=i[1],this._errorIndicator=t.getFactory().createLineString(i),this._errMsg="Distance between buffer curve and input is too large ("+this._maxDistanceFound+" at "+ka.toLineString(i[0],i[1])+")"}},Ap.prototype.isValid=function(){var t=Math.abs(this._bufDistance),e=Ap.MAX_DISTANCE_DIFF_FRAC*t;return this._minValidDistance=t-e,this._maxValidDistance=t+e,!(!this._input.isEmpty()&&!this._result.isEmpty())||(0=t.size()-2},Bp.prototype.hasIntersection=function(){return null!==this._interiorIntersection},Bp.prototype.isDone=function(){return!this._findAllIntersections&&null!==this._interiorIntersection},Bp.prototype.interfaces_=function(){return[zl]},Bp.prototype.getClass=function(){return Bp},Bp.createAllIntersectionsFinder=function(t){var e=new Bp(t);return e.setFindAllIntersections(!0),e},Bp.createAnyIntersectionFinder=function(t){return new Bp(t)},Bp.createIntersectionCounter=function(t){var e=new Bp(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e};function kp(t){this._li=new tu,this._segStrings=null,this._findAllIntersections=!1,this._segInt=null,this._isValid=!0;var e=t;this._segStrings=e}kp.prototype.execute=function(){if(null!==this._segInt)return null;this.checkInteriorIntersections()},kp.prototype.getIntersections=function(){return this._segInt.getIntersections()},kp.prototype.isValid=function(){return this.execute(),this._isValid},kp.prototype.setFindAllIntersections=function(t){this._findAllIntersections=t},kp.prototype.checkInteriorIntersections=function(){this._isValid=!0,this._segInt=new Bp(this._li),this._segInt.setFindAllIntersections(this._findAllIntersections);var t=new ll;if(t.setSegmentIntersector(this._segInt),t.computeNodes(this._segStrings),this._segInt.hasIntersection())return this._isValid=!1,null},kp.prototype.checkValid=function(){if(this.execute(),!this._isValid)throw new sh(this.getErrorMessage(),this._segInt.getInteriorIntersection())},kp.prototype.getErrorMessage=function(){if(this._isValid)return"no intersections found";var t=this._segInt.getIntersectionSegments();return"found non-noded intersection between "+ka.toLineString(t[0],t[1])+" and "+ka.toLineString(t[2],t[3])},kp.prototype.interfaces_=function(){return[]},kp.prototype.getClass=function(){return kp},kp.computeIntersections=function(t){var e=new kp(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()};function zp(){this._nv=null;var t=arguments[0];this._nv=new kp(zp.toSegmentStrings(t))}zp.prototype.checkValid=function(){this._nv.checkValid()},zp.prototype.interfaces_=function(){return[]},zp.prototype.getClass=function(){return zp},zp.toSegmentStrings=function(t){for(var e=new Cu,n=t.iterator();n.hasNext();){var r=n.next();e.add(new Gp(r.getCoordinates(),r))}return e},zp.checkValid=function(t){new zp(t).checkValid()};function jp(t){this._mapOp=t}jp.prototype.map=function(t){for(var e=new Cu,n=0;n>52},Jp.zeroLowerBits=function(t,e){return t&~((1<e._xValue?1:this._eventTypee._eventType?1:0},af.prototype.getInsertEvent=function(){return this._insertEvent},af.prototype.isInsert=function(){return this._eventType===af.INSERT},af.prototype.isSameLabel=function(t){return null!==this._label&&this._label===t._label},af.prototype.getDeleteEventIndex=function(){return this._deleteEventIndex},af.prototype.interfaces_=function(){return[ua]},af.prototype.getClass=function(){return af},uf.INSERT.get=function(){return 1},uf.DELETE.get=function(){return 2},Object.defineProperties(af,uf);function cf(){}cf.prototype.interfaces_=function(){return[]},cf.prototype.getClass=function(){return cf};function hf(t,e,n){this._hasIntersection=!1,this._hasProper=!1,this._hasProperInterior=!1,this._properIntersectionPoint=null,this._li=null,this._includeProper=null,this._recordIsolated=null,this._isSelfIntersection=null,this._numIntersections=0,this.numTests=0,this._bdyNodes=null,this._isDone=!1,this._isDoneWhenProperInt=!1;var r=t,i=e,o=n;this._li=r,this._includeProper=i,this._recordIsolated=o}hf.prototype.isTrivialIntersection=function(t,e,n,r){if(t===n&&1===this._li.getIntersectionNum()){if(hf.isAdjacentSegments(e,r))return!0;if(t.isClosed()){var i=t.getNumPoints()-1;if(0===e&&r===i||0===r&&e===i)return!0}}return!1},hf.prototype.getProperIntersectionPoint=function(){return this._properIntersectionPoint},hf.prototype.setIsDoneIfProperInt=function(t){this._isDoneWhenProperInt=t},hf.prototype.hasProperInteriorIntersection=function(){return this._hasProperInterior},hf.prototype.isBoundaryPointInternal=function(t,e){for(var n=e.iterator();n.hasNext();){var r=n.next().getCoordinate();if(t.isIntersection(r))return!0}return!1},hf.prototype.hasProperIntersection=function(){return this._hasProper},hf.prototype.hasIntersection=function(){return this._hasIntersection},hf.prototype.isDone=function(){return this._isDone},hf.prototype.isBoundaryPoint=function(t,e){return!(null===e||!this.isBoundaryPointInternal(t,e[0])&&!this.isBoundaryPointInternal(t,e[1]))},hf.prototype.setBoundaryNodes=function(t,e){this._bdyNodes=new Array(2).fill(null),this._bdyNodes[0]=t,this._bdyNodes[1]=e},hf.prototype.addIntersections=function(t,e,n,r){if(t===n&&e===r)return null;this.numTests++;var i=t.getCoordinates()[e],o=t.getCoordinates()[e+1],s=n.getCoordinates()[r],a=n.getCoordinates()[r+1];this._li.computeIntersection(i,o,s,a),this._li.hasIntersection()&&(this._recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this._numIntersections++,this.isTrivialIntersection(t,e,n,r)||(this._hasIntersection=!0,!this._includeProper&&this._li.isProper()||(t.addIntersections(this._li,e,0),n.addIntersections(this._li,r,1)),this._li.isProper()&&(this._properIntersectionPoint=this._li.getIntersection(0).copy(),this._hasProper=!0,this._isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this._li,this._bdyNodes)||(this._hasProperInterior=!0))))},hf.prototype.interfaces_=function(){return[]},hf.prototype.getClass=function(){return hf},hf.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)};function lf(){this._min=sa.POSITIVE_INFINITY,this._max=sa.NEGATIVE_INFINITY}var pf,ff=((pf=cf)&&(df.__proto__=pf),((df.prototype=Object.create(pf&&pf.prototype)).constructor=df).prototype.prepareEvents=function(){Bh.sort(this.events);for(var t=0;te||this._max=t.size()?null:t.get(e)},Xf.union=function(t){return new Xf(t).union()},Uf.STRTREE_NODE_CAPACITY.get=function(){return 4},Object.defineProperties(Xf,Uf);var Yf=function(){};function Vf(t){switch(t.type){case"Polygon":return 1Kf?og((hg(r)*(a=ag(o))*hg(i)-hg(o)*(s=ag(r))*hg(n))/(s*a*u)):(r+o)/2,l.point(d,g),l.lineEnd(),l.lineStart(),l.point(c,g),p=0),l.point(f=t,g=e),d=c},lineEnd:function(){l.lineEnd(),f=g=NaN},clean:function(){return 2-p}}},function(t,e,n,r){var i;if(null==t)i=n*$f,r.point(-Qf,i),r.point(0,i),r.point(Qf,i),r.point(Qf,0),r.point(Qf,-i),r.point(0,-i),r.point(-Qf,-i),r.point(-Qf,0),r.point(-Qf,i);else if(ig(t[0]-e[0])>Kf){var o=t[0]Kf;function d(t,e){return ag(t)*ag(e)>C}function y(t,e,n){var r=[1,0,0],i=Ig(wg(t),wg(e)),o=bg(i,i),s=i[0],a=o-s*s;if(!a)return!n&&t;var u=C*o/a,c=-C*s/a,h=Ig(r,i),l=Cg(r,u);Ng(l,Cg(i,c));var p=h,f=bg(l,p),g=bg(p,p),d=f*f-g*(bg(l,l)-1);if(!(d<0)){var y=lg(d),_=Cg(p,(-f-y)/g);if(Ng(_,l),_=Eg(_),!n)return _;var m,v=t[0],x=e[0],E=t[1],w=e[1];xs;)n=i[r=Math.floor((o+1)*Math.random())],i[r]=i[o],i[o]=n;return i.slice(s)}(t.features,e))},t.envelope=ze,t.square=je,t.circle=Ue,t.midpoint=function(t,e){return Xe(t,he(t,e)/2,Ye(t,e))},t.center=Ve,t.centerOfMass=function t(e,n){switch(rt(e)){case"Point":return e;case"Polygon":var r=[];N(e,function(t){r.push(t)});var i,o,s,a,u,c,h,l,p=He(e,n),f=p.geometry.coordinates,g=0,d=0,y=0,_=r.map(function(t){return[t[0]-f[0],t[1]-f[1]]});for(i=0;il[e.isect].coord?-1:1}),u=[];0 is required");if("boolean"!=typeof n)throw new Error(" must be a boolean");if("boolean"!=typeof r)throw new Error(" must be a boolean");!1===r&&(t=le(t));var i=[];switch(t.type){case"GeometryCollection":return R(t,function(t){ni(t,n)}),t;case"FeatureCollection":return L(t,function(t){L(ni(t,n),function(t){i.push(t)})}),Y(i)}return ni(t,n)},t.isobands=function(t,e,n){if(!H(n=n||{}))throw new Error("options is invalid");var r=n.zProperty||"elevation",i=n.commonProperties||{},o=n.breaksProperties||[];if(tt(t,"Point","Input must contain Points"),!e)throw new Error("breaks is required");if(!Array.isArray(e))throw new Error("breaks is not an Array");if(!H(i))throw new Error("commonProperties is not an Object");if(!Array.isArray(o))throw new Error("breaksProperties is not an Array");var s,a,u,c,h,l,p,f,g,d,y,_,m=function(t,e){if(!H(e=e||{}))throw new Error("options is invalid");var n=e.zProperty||"elevation",r=e.flip,i=e.flags;tt(t,"Point","input must contain Points");for(var o,s,a=(o=r,s={},L(t,function(t){var e=Z(t)[1];s[e]||(s[e]=[]),s[e].push(t)}),Object.keys(s).map(function(t){return s[t].sort(function(t,e){return Z(t)[0]-Z(e)[0]})}).sort(function(t,e){return o?Z(t[0])[1]-Z(e[0])[1]:Z(e[0])[1]-Z(t[0])[1]})),u=[],c=0;ca[a.length-1])e-=a.length;else{var n=function(r,t){var i,o;if(!Array.isArray(t))throw new Error("Get closest expects an array as second argument");return t.forEach(function(t,e){var n=function(t,e){return t-e}(t,r);0<=n&&(void 0===o||n