34 lines
785 KiB
Vue
34 lines
785 KiB
Vue
|
/*!
|
||
|
* Copyright (c) 2017 TurfJS
|
||
|
* turf.(http://turfjs.org)
|
||
|
* github: https://github.com/Turfjs/turf
|
||
|
* license: MIT
|
||
|
* version: 4.6.1
|
||
|
*/
|
||
|
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.turf=t()}}(function(){var t;return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n||t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s<i.length;s++)r(i[s]);return r}({1:[function(t,e,n){var i=t("@turf/helpers"),r=t("@turf/invariant"),o=t("@turf/meta"),s=t("@turf/clusters"),a={isolines:t("@turf/isolines"),convex:t("@turf/convex"),within:t("@turf/within"),concave:t("@turf/concave"),difference:t("@turf/difference"),dissolve:t("@turf/dissolve"),collect:t("@turf/collect"),flip:t("@turf/flip"),simplify:t("@turf/simplify"),bezier:t("@turf/bezier"),tag:t("@turf/tag"),sample:t("@turf/sample"),envelope:t("@turf/envelope"),square:t("@turf/square"),circle:t("@turf/circle"),midpoint:t("@turf/midpoint"),buffer:t("@turf/buffer"),center:t("@turf/center"),centerOfMass:t("@turf/center-of-mass"),centroid:t("@turf/centroid"),combine:t("@turf/combine"),distance:t("@turf/distance"),explode:t("@turf/explode"),bbox:t("@turf/bbox"),tesselate:t("@turf/tesselate"),bboxPolygon:t("@turf/bbox-polygon"),inside:t("@turf/inside"),intersect:t("@turf/intersect"),nearest:t("@turf/nearest"),planepoint:t("@turf/planepoint"),random:t("@turf/random"),tin:t("@turf/tin"),union:t("@turf/union"),bearing:t("@turf/bearing"),destination:t("@turf/destination"),kinks:t("@turf/kinks"),pointOnSurface:t("@turf/point-on-surface"),area:t("@turf/area"),along:t("@turf/along"),lineDistance:t("@turf/line-distance"),lineSlice:t("@turf/line-slice"),lineSliceAlong:t("@turf/line-slice-along"),pointOnLine:t("@turf/point-on-line"),pointGrid:t("@turf/point-grid"),squareGrid:t("@turf/square-grid"),triangleGrid:t("@turf/triangle-grid"),hexGrid:t("@turf/hex-grid"),idw:t("@turf/idw"),truncate:t("@turf/truncate"),flatten:t("@turf/flatten"),lineIntersect:t("@turf/line-intersect"),mask:t("@turf/mask"),lineChunk:t("@turf/line-chunk"),unkinkPolygon:t("@turf/unkink-polygon"),greatCircle:t("@turf/great-circle"),lineSegment:t("@turf/line-segment"),lineSplit:t("@turf/line-split"),lineArc:t("@turf/line-arc"),polygonToLineString:t("@turf/polygon-to-linestring"),lineStringToPolygon:t("@turf/linestring-to-polygon"),bboxClip:t("@turf/bbox-clip"),lineOverlap:t("@turf/line-overlap"),sector:t("@turf/sector"),rhumbBearing:t("@turf/rhumb-bearing"),rhumbDistance:t("@turf/rhumb-distance"),rhumbDestination:t("@turf/rhumb-destination"),polygonTangents:t("@turf/polygon-tangents"),rewind:t("@turf/rewind"),isobands:t("@turf/isobands"),transformRotate:t("@turf/transform-rotate"),transformScale:t("@turf/transform-scale"),transformTranslate:t("@turf/transform-translate"),lineOffset:t("@turf/line-offset"),polygonize:t("@turf/polygonize"),booleanDisjoint:t("@turf/boolean-disjoint"),booleanContains:t("@turf/boolean-contains"),booleanCrosses:t("@turf/boolean-crosses"),booleanClockwise:t("@turf/boolean-clockwise"),booleanOverlap:t("@turf/boolean-overlap"),booleanPointOnLine:t("@turf/boolean-point-on-line"),booleanEqual:t("@turf/boolean-equal"),clone:t("@turf/clone"),cleanCoords:t("@turf/clean-coords"),interpolate:t("@turf/interpolate"),clustersDbscan:t("@turf/clusters-dbscan"),clustersKmeans:t("@turf/clusters-kmeans"),getCluster:s.getCluster,clusterEach:s.clusterEach,clusterReduce:s.clusterReduce,point:i.point,polygon:i.polygon,lineString:i.lineString,multiPoint:i.multiPoint,multiPolygon:i.multiPolygon,multiLineString:i.multiLineString,feature:i.feature,geometry:i.geometry,featureCollection:i.featureCollection,geometryCollection:i.geometryCollection,radiansToDistance:i.radiansToDistance,distanceToRadians:i.distanceToRadians,distanceToDegrees:i.distanceToDegrees,
|
||
|
"@turf/invariant":41,"@turf/line-intersect":42,"@turf/polygon-to-linestring":54}],38:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],39:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":40,dup:34}],40:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],41:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],42:[function(t,e,n){function i(t,e){var n=a(t),i=a(e);if(2!==n.length)throw new Error("<intersects> line1 must only contain 2 coordinates");if(2!==i.length)throw new Error("<intersects> line2 must only contain 2 coordinates");var r=n[0][0],o=n[0][1],s=n[1][0],u=n[1][1],c=i[0][0],h=i[0][1],f=i[1][0],p=i[1][1],d=(p-h)*(s-r)-(f-c)*(u-o),g=(f-c)*(o-h)-(p-h)*(r-c),v=(s-r)*(o-h)-(u-o)*(r-c);if(0===d)return null;var y=g/d,m=v/d;if(y>=0&&y<=1&&m>=0&&m<=1){return l([r+y*(s-r),o+y*(u-o)])}return null}var r=t("@turf/meta"),o=t("geojson-rbush"),s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("@turf/line-segment"),l=s.point,c=r.featureEach,h=s.featureCollection;e.exports=function(t,e){var n={},r=[];if("LineString"===t.type&&(t=s.feature(t)),"LineString"===e.type&&(e=s.feature(e)),"Feature"===t.type&&"Feature"===e.type&&"LineString"===t.geometry.type&&"LineString"===e.geometry.type&&2===t.geometry.coordinates.length&&2===e.geometry.coordinates.length){var l=i(t,e);return l&&r.push(l),h(r)}var f=o();return f.load(u(e)),c(u(t),function(t){c(f.search(t),function(e){var o=i(t,e);if(o){var s=a(o).join(",");n[s]||(n[s]=!0,r.push(o))}})}),h(r)}},{"@turf/helpers":44,"@turf/invariant":45,"@turf/line-segment":46,"@turf/meta":50,"geojson-rbush":51}],43:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}},{"@turf/meta":50}],44:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],45:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],46:[function(t,e,n){function i(t,e){var n=[],i=t.geometry;switch(i.type){case"Polygon":n=a(i);break;case"LineString":n=[a(i)]}n.forEach(function(n){r(n,t.properties).forEach(function(t){t.id=e.length,e.push(t)})})}function r(t,e){var n=[];return t.reduce(function(t,i){var r=l([t,i],e);return r.bbox=o(t,i),n.push(r),i}),n}function o(t,e){var n=t[0],i=t[1],r=e[0],o=e[1];return[n<r?n:r,i<o?i:o,n>r?n:r,i>o?i:o]}var s=t("@turf/helpers"),a=t("@turf/invariant").getCoords,u=t("@turf/meta").flattenEach,l=s.lineString,c=s.featureCollection;e.exports=function(t){if(!t)throw new Error("geojson is required");var e=[];return u(t,function(t){i(t,e)}),c(e)}},{"@turf/helpers":47,"@turf/invariant":48,"@turf/meta":49}],47:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],48:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],49:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],50:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],51:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/helpers").featureCollection,o=t("@turf/meta").featureEach,s=t("rbush");e.exports=function(t){var e=s(t);return e.insert=function(t){return t.bbox=t.bbox?t.bbox:i(t),s.prototype.insert.call(this,t)},e.load=function(t){var e=[];return o(t,function(t){t.bbox=t.bbox?t.bbox:i(t),e.push(t)}),s.prototype.load.call(this,e)},e.remove=function(t){return s.prototype.remove.call(this,t)},e.clear=function(){return s.prototype.clear.call(this)},e.search=function(t){var e=s.prototype.search.call(this,this.toBBox(t));return r(e)},e.collides=function(t){return s.prototype.collides.call(this,this.toBBox(t))},e.all=function(){var t=s.prototype.all.call(this);return r(t)},e.toJSON=function(){return s.prototype.toJSON.call(this)},e.fromJSON=function(t){return s.prototype.fromJSON.call(this,t)},e.toBBox=function(t){var e=t.bbox?t.bbox:i(t);return{minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}},e}},{"@turf/bbox":43,"@turf/helpers":44,"@turf/meta":50,rbush:53}],52:[function(t,e,n){"use strict";function i(t,e,n,s,a){for(n=n||0,s=s||t.length-1,a=a||o;s>n;){if(s-n>
|
||
|
for(var e,n,i,r=t.length,o=-1,s=0;++o<r;)s+=t[o].length;for(n=new Array(s);--r>=0;)for(i=t[r],e=i.length;--e>=0;)n[--s]=i[e];return n},q=function(t,e){var n,i,r=t.length,o=-1;if(null==e){for(;++o<r;)if(null!=(n=t[o])&&n>=n)for(i=n;++o<r;)null!=(n=t[o])&&i>n&&(i=n)}else for(;++o<r;)if(null!=(n=e(t[o],o,t))&&n>=n)for(i=n;++o<r;)null!=(n=e(t[o],o,t))&&i>n&&(i=n);return i},k=function(t,e){for(var n=e.length,i=new Array(n);n--;)i[n]=t[e[n]];return i},G=function(t,e){if(n=t.length){var n,i,r=0,o=0,a=t[o];for(null==e&&(e=s);++r<n;)(e(i=t[r],a)<0||0!==e(a,a))&&(a=i,o=r);return 0===e(a,a)?o:void 0}},j=function(t,e,n){for(var i,r,o=(null==n?t.length:n)-(e=null==e?0:+e);o;)r=Math.random()*o--|0,i=t[o+e],t[o+e]=t[r+e],t[r+e]=i;return t},B=function(t,e){var n,i=t.length,r=-1,o=0;if(null==e)for(;++r<i;)(n=+t[r])&&(o+=n);else for(;++r<i;)(n=+e(t[r],r,t))&&(o+=n);return o},z=function(t){if(!(r=t.length))return[];for(var e=-1,n=q(t,o),i=new Array(n);++e<n;)for(var r,s=-1,a=i[e]=new Array(r);++s<r;)a[s]=t[s][e];return i},V=function(){return z(arguments)};t.bisect=l,t.bisectRight=l,t.bisectLeft=c,t.ascending=s,t.bisector=a,t.cross=f,t.descending=p,t.deviation=v,t.extent=y,t.histogram=R,t.thresholdFreedmanDiaconis=T,t.thresholdScott=O,t.thresholdSturges=L,t.max=_,t.mean=A,t.median=D,t.merge=F,t.min=q,t.pairs=h,t.permute=k,t.quantile=P,t.range=I,t.scan=G,t.shuffle=j,t.sum=B,t.ticks=M,t.tickIncrement=i,t.tickStep=r,t.transpose=z,t.variance=g,t.zip=V,Object.defineProperty(t,"__esModule",{value:!0})})},{}],129:[function(e,n,i){!function(r,o){"object"==typeof i&&void 0!==n?o(i,e("d3-array")):"function"==typeof t&&t.amd?t(["exports","d3-array"],o):o(r.d3=r.d3||{},r.d3)}(this,function(t,e){"use strict";function n(){this.reset()}function i(t,e,n){var i=t.s=e+n,r=i-e,o=i-r;t.t=e-o+(n-r)}function r(t){return t>1?0:t<-1?Be:Math.acos(t)}function o(t){return t>1?ze:t<-1?-ze:Math.asin(t)}function s(t){return(t=en(t/2))*t}function a(){}function u(t,e){t&&an.hasOwnProperty(t.type)&&an[t.type](t,e)}function l(t,e,n){var i,r=-1,o=t.length-n;for(e.lineStart();++r<o;)i=t[r],e.point(i[0],i[1],i[2]);e.lineEnd()}function c(t,e){var n=-1,i=t.length;for(e.polygonStart();++n<i;)l(t[n],e,1);e.polygonEnd()}function h(){hn.point=p}function f(){d(ue,le)}function p(t,e){hn.point=d,ue=t,le=e,t*=Ue,e*=Ue,ce=t,he=Ze(e=e/2+Ve),fe=en(e)}function d(t,e){t*=Ue,e*=Ue,e=e/2+Ve;var n=t-ce,i=n>=0?1:-1,r=i*n,o=Ze(e),s=en(e),a=fe*s,u=he*o+a*Ze(r),l=a*i*en(r);ln.add(Je(l,u)),ce=t,he=o,fe=s}function g(t){return[Je(t[1],t[0]),o(t[2])]}function v(t){var e=t[0],n=t[1],i=Ze(n);return[i*Ze(e),i*en(e),en(n)]}function y(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function m(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function x(t,e){t[0]+=e[0],t[1]+=e[1],t[2]+=e[2]}function E(t,e){return[t[0]*e,t[1]*e,t[2]*e]}function w(t){var e=rn(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);t[0]/=e,t[1]/=e,t[2]/=e}function b(t,e){we.push(be=[pe=t,ge=t]),e<de&&(de=e),e>ve&&(ve=e)}function I(t,e){var n=v([t*Ue,e*Ue]);if(Ee){var i=m(Ee,n),r=[i[1],-i[0],0],o=m(r,i);w(o),o=g(o);var s,a=t-ye,u=a>0?1:-1,l=o[0]*Ye*u,c=We(a)>180;c^(u*ye<l&&l<u*t)?(s=o[1]*Ye)>ve&&(ve=s):(l=(l+360)%360-180,c^(u*ye<l&&l<u*t)?(s=-o[1]*Ye)<de&&(de=s):(e<de&&(de=e),e>ve&&(ve=e))),c?t<ye?R(pe,t)>R(pe,ge)&&(ge=t):R(t,ge)>R(pe,ge)&&(pe=t):ge>=pe?(t<pe&&(pe=t),t>ge&&(ge=t)):t>ye?R(pe,t)>R(pe,ge)&&(ge=t):R(t,ge)>R(pe,ge)&&(pe=t)}else we.push(be=[pe=t,ge=t]);e<de&&(de=e),e>ve&&(ve=e),Ee=n,ye=t}function N(){dn.point=I}function C(){be[0]=pe,be[1]=ge,dn.point=b,Ee=null}function S(t,e){if(Ee){var n=t-ye;pn.add(We(n)>180?n+(n>0?360:-360):n)}else me=t,xe=e;hn.point(t,e),I(t,e)}function M(){hn.lineStart()}function L(){S(me,xe),hn.lineEnd(),We(pn)>je&&(pe=-(ge=180)),be[0]=pe,be[1]=ge,Ee=null}function R(t,e){return(e-=t)<0?e+360:e}function P(t,e){return t[0]-e[0]}function T(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:e<t[0]||t[1]<e}function O(t,e){t*=Ue,e*=Ue;var n=Ze(e);_(n*Ze(t),n*en(t),en(e))}function _(t,e,n){++Ie,Ce+=(t-Ce)/Ie,Se+=(e-Se)/Ie,Me+=(n-Me)/Ie}function A(){vn.point=D}function D(t,e){t*=Ue,e*=Ue;var n=Ze(e);Fe=n*Ze(t),qe=n*en(t)
|
||
|
o=l.translate([i-.307*n,a+.201*n]).clipExtent([[i-.425*n+je,a+.12*n+je],[i-.214*n-je,a+.234*n-je]]).stream(h),s=c.translate([i-.205*n,a+.212*n]).clipExtent([[i-.214*n+je,a+.166*n+je],[i-.115*n-je,a+.234*n-je]]).stream(h),e()},t.fitExtent=function(e,n){return kt(t,e,n)},t.fitSize=function(e,n){return Gt(t,e,n)},t.scale(1070)},Fi=Ht(function(t){return rn(2/(1+t))});Fi.invert=Jt(function(t){return 2*o(t/2)});var qi=function(){return zt(Fi).scale(124.75).clipAngle(179.999)},ki=Ht(function(t){return(t=r(t))&&t/en(t)});ki.invert=Jt(function(t){return t});var Gi=function(){return zt(ki).scale(79.4188).clipAngle(179.999)};Zt.invert=function(t,e){return[t,2*He(Qe(e))-ze]};var ji=function(){return Kt(Zt).scale(961/Xe)},Bi=function(){return Xt($t).scale(109.5).parallels([30,30])};te.invert=te;var zi=function(){return zt(te).scale(152.63)},Vi=function(){return Xt(ee).scale(131.154).center([0,13.9389])};ne.invert=Jt(He);var Xi=function(){return zt(ne).scale(144.049).clipAngle(60)},Yi=function(){function t(){return r=o=null,s}var e,n,i,r,o,s,a=1,u=0,l=0,c=1,h=1,f=Qn,p=null,d=Qn;return s={stream:function(t){return r&&o===t?r:r=f(d(o=t))},clipExtent:function(r){return arguments.length?(d=null==r?(p=e=n=i=null,Qn):K(p=+r[0][0],e=+r[0][1],n=+r[1][0],i=+r[1][1]),t()):null==p?null:[[p,e],[n,i]]},scale:function(e){return arguments.length?(f=ie((a=+e)*c,a*h,u,l),t()):a},translate:function(e){return arguments.length?(f=ie(a*c,a*h,u=+e[0],l=+e[1]),t()):[u,l]},reflectX:function(e){return arguments.length?(f=ie(a*(c=e?-1:1),a*h,u,l),t()):c<0},reflectY:function(e){return arguments.length?(f=ie(a*c,a*(h=e?-1:1),u,l),t()):h<0},fitExtent:function(t,e){return kt(s,t,e)},fitSize:function(t,e){return Gt(s,t,e)}}};re.invert=Jt(o);var Ui=function(){return zt(re).scale(249.5).clipAngle(90+je)};oe.invert=Jt(function(t){return 2*He(t)});var Wi=function(){return zt(oe).scale(250).clipAngle(142)};se.invert=function(t,e){return[-e,2*He(Qe(t))-ze]};var Hi=function(){var t=Kt(se),e=t.center,n=t.rotate;return t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])},t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])},n([0,0,90]).scale(159.155)};t.geoArea=fn,t.geoBounds=gn,t.geoCentroid=yn,t.geoCircle=On,t.geoClipExtent=Gn,t.geoContains=Zn,t.geoDistance=Wn,t.geoGraticule=ct,t.geoGraticule10=ht,t.geoInterpolate=Kn,t.geoLength=Xn,t.geoPath=Ni,t.geoAlbers=Ai,t.geoAlbersUsa=Di,t.geoAzimuthalEqualArea=qi,t.geoAzimuthalEqualAreaRaw=Fi,t.geoAzimuthalEquidistant=Gi,t.geoAzimuthalEquidistantRaw=ki,t.geoConicConformal=Bi,t.geoConicConformalRaw=$t,t.geoConicEqualArea=_i,t.geoConicEqualAreaRaw=Ut,t.geoConicEquidistant=Vi,t.geoConicEquidistantRaw=ee,t.geoEquirectangular=zi,t.geoEquirectangularRaw=te,t.geoGnomonic=Xi,t.geoGnomonicRaw=ne,t.geoIdentity=Yi,t.geoProjection=zt,t.geoProjectionMutator=Vt,t.geoMercator=ji,t.geoMercatorRaw=Zt,t.geoOrthographic=Ui,t.geoOrthographicRaw=re,t.geoStereographic=Wi,t.geoStereographicRaw=oe,t.geoTransverseMercator=Hi,t.geoTransverseMercatorRaw=se,t.geoRotation=Tn,t.geoStream=un,t.geoTransform=Li,Object.defineProperty(t,"__esModule",{value:!0})})},{"d3-array":128}],130:[function(e,n,i){!function(e,r){"object"==typeof i&&void 0!==n?r(i):"function"==typeof t&&t.amd?t(["exports"],r):r(e.jsts=e.jsts||{})}(this,function(t){"use strict";function e(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function n(){}function i(){}function r(){}function o(){}function s(){}function a(){}function u(){}function l(t){this.name="RuntimeException",this.message=t,this.stack=(new Error).stack,Error.call(this,t)}function c(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t}function h(){if(0===arguments.length)l.call(this);else if(1===arguments.length){var t=arguments[0];l.call(this,t)}}function f(){}function p(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)p.call(this,0,0);else if(1===arguments.length){var t=arguments[0];p.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];p.call(this,e,n,p.NULL_ORDINATE)}else if
|
||
|
this.interval=new hi;var t=arguments[0];this.ring=t,this.buildIndex()}function wi(){li.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function bi(){}function Ii(){this.p0=null,this.p1=null,this.p2=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.p0=t,this.p1=e,this.p2=n}function Ni(){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0;var t=arguments[0];this.input=t}function Ci(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new ce,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var t=arguments[0];Ci.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isConvex=n}}function Si(){this.inputGeom=null,this.distanceTolerance=null;var t=arguments[0];this.inputGeom=t}function Mi(){me.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function Li(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function Ri(){this._isMarked=!1;var t=arguments[0];Li.call(this,t)}function Pi(){this.vertexMap=new $t}function Ti(){this._isStart=!1;var t=arguments[0];Ri.call(this,t)}function Oi(){Pi.apply(this)}function _i(){this.result=null,this.factory=null,this.graph=null,this.lines=new w,this.nodeEdgeStack=new de,this.ringStartEdge=null,this.graph=new Oi}function Ai(){this.items=new w,this.subnode=new Array(4).fill(null)}function Di(){this.pt=new p,this.level=0,this.env=null;var t=arguments[0];this.computeKey(t)}function Fi(){Ai.apply(this),this.env=null,this.centrex=null,this.centrey=null,this.level=null;var t=arguments[0],e=arguments[1];this.env=t,this.level=e,this.centrex=(t.getMinX()+t.getMaxX())/2,this.centrey=(t.getMinY()+t.getMaxY())/2}function qi(){Ai.apply(this)}function ki(){this.root=null,this.minExtent=1,this.root=new qi}function Gi(t){this.geometryFactory=t||new ne}function ji(t){this.geometryFactory=t||new ne,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Gi(this.geometryFactory)}function Bi(){this.parser=new Gi(this.geometryFactory)}function zi(t){this.geometryFactory=t||new ne,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ie(this.geometryFactory)}function Vi(t){return[t.x,t.y]}function Xi(t,e){this.geometryFactory=t||new ne,this.ol=e||"undefined"!=typeof ol&&ol}function Yi(){if(this.noder=null,this.scaleFactor=null,this.offsetX=null,this.offsetY=null,this.isScaled=!1,2===arguments.length){var t=arguments[0],e=arguments[1];Yi.call(this,t,e,0,0)}else if(4===arguments.length){var n=arguments[0],i=arguments[1];arguments[2],arguments[3],this.noder=n,this.scaleFactor=i,this.isScaled=!this.isIntegerPrecision()}}function Ui(){if(this.inputGeom=null,this.isClosedEndpointsInInterior=!0,this.nonSimpleLocation=null,1===arguments.length){var t=arguments[0];this.inputGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isClosedEndpointsInInterior=!n.isInBoundary(2)}}function Wi(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Hi(){if(this.quadrantSegments=Hi.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=Hi.CAP_ROUND,this.joinStyle=Hi.JOIN_ROUND,this.mitreLimit=Hi.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=Hi.DEFAULT_SIMPLIFY_FACTOR,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setQuadrantSegments(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.setQuadrantSegments(e),this.setEndCapStyle(n)}else if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(r),this.setJoinStyle(o),this.setMitreLimit(s)}}function Ji(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function Zi(){this.array_=[]}function Ki(){this.finder=null,this.dirEdgeList=new w,this.nodes=new w,this.rightMostCoord=null,this.env=null,this.finder=new Ji}function Qi(){this.inputLine=null,this.dist
|
||
|
;if(this.isNull())return null;this.minx-=e,this.maxx+=e,this.miny-=n,this.maxy+=n,(this.minx>this.maxx||this.miny>this.maxy)&&this.setToNull()}},contains:function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return this.covers(t)}if(arguments[0]instanceof p){var e=arguments[0];return this.covers(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return this.covers(n,i)}},centre:function(){return this.isNull()?null:new p((this.getMinX()+this.getMaxX())/2,(this.getMinY()+this.getMaxY())/2)},init:function(){if(0===arguments.length)this.setToNull();else if(1===arguments.length){if(arguments[0]instanceof p){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof I){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],i=arguments[1];this.init(n.x,i.x,n.y,i.y)}else if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3];r<o?(this.minx=r,this.maxx=o):(this.minx=o,this.maxx=r),s<a?(this.miny=s,this.maxy=a):(this.miny=a,this.maxy=s)}},getMaxY:function(){return this.maxy},distance:function(t){if(this.intersects(t))return 0;var e=0;this.maxx<t.minx?e=t.minx-this.maxx:this.minx>t.maxx&&(e=this.minx-t.maxx);var n=0;return this.maxy<t.miny?n=t.miny-this.maxy:this.miny>t.maxy&&(n=this.miny-t.maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+p.hashCode(this.minx),t=37*t+p.hashCode(this.maxx),t=37*t+p.hashCode(this.miny),t=37*t+p.hashCode(this.maxy)},interfaces_:function(){return[o,u]},getClass:function(){return I}}),I.intersects=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2];return n.x>=(t.x<e.x?t.x:e.x)&&n.x<=(t.x>e.x?t.x:e.x)&&n.y>=(t.y<e.y?t.y:e.y)&&n.y<=(t.y>e.y?t.y:e.y)}if(4===arguments.length){var i=arguments[0],r=arguments[1],o=arguments[2],s=arguments[3],a=Math.min(o.x,s.x),u=Math.max(o.x,s.x),l=Math.min(i.x,r.x),c=Math.max(i.x,r.x);return!(l>u||c<a||(a=Math.min(o.y,s.y),u=Math.max(o.y,s.y),l=Math.min(i.y,r.y),c=Math.max(i.y,r.y),l>u||c<a))}},I.serialVersionUID=0x51845cd552189800,c(C,N),e(C.prototype,{interfaces_:function(){return[]},getClass:function(){return C}}),e(S.prototype,{interfaces_:function(){return[]},getClass:function(){return S}}),S.toLocationSymbol=function(t){switch(t){case S.EXTERIOR:return"e";case S.BOUNDARY:return"b";case S.INTERIOR:return"i";case S.NONE:return"-"}throw new i("Unknown location value: "+t)},S.INTERIOR=0,S.BOUNDARY=1,S.EXTERIOR=2,S.NONE=-1,e(L.prototype,{interfaces_:function(){return[]},getClass:function(){return L}}),L.log10=function(t){var e=Math.log(t);return r.isInfinite(e)?e:r.isNaN(e)?e:e/L.LOG_10},L.min=function(t,e,n,i){var r=t;return e<r&&(r=e),n<r&&(r=n),i<r&&(r=i),r},L.clamp=function(){if("number"==typeof arguments[2]&&"number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1],n=arguments[2];return t<e?e:t>n?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],o=arguments[2];return i<r?r:i>o?o:i}},L.wrap=function(t,e){return t<0?e- -t%e:t%e},L.max=function(){if(3===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=t;return e>i&&(i=e),n>i&&(i=n),i}if(4===arguments.length){var r=arguments[0],o=arguments[1],s=arguments[2],a=arguments[3],i=r;return o>i&&(i=o),s>i&&(i=s),a>i&&(i=a),i}},L.average=function(t,e){return(t+e)/2},L.LOG_10=Math.log(10),R.prototype.append=function(t){this.str+=t},R.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},R.prototype.toString=function(t){return this.str},P.prototype.intValue=function(){return this.value},P.prototype.compareTo=function(t){return this.value<t?-1:this.value>t?1:0},P.isNaN=function(t){return Number.isNaN(t)},T.isWhitespace=function(t){return t<=32&&t>=0||127==t},T.toUpperCase=function(t){return t.toUpperCase()},e(O.prototype,{le:function(t){return this.hi<t.hi||this.hi===t.hi&&this.lo<=t.lo},extractSignificantDigits
|
||
|
for(var t=lt.FALSE,e=0;e<this.geometries.length;e++)t=Math.max(t,this.geometries[e].getDimension());return t},getLength:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getLength();return t},getNumPoints:function(){for(var t=0,e=0;e<this.geometries.length;e++)t+=this.geometries[e].getNumPoints();return t},getNumGeometries:function(){return this.geometries.length},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[n]=this.geometries[n].reverse();return this.getFactory().createGeometryCollection(e)},compareToSameClass:function(){if(1===arguments.length){var t=arguments[0],e=new at(ut.asList(this.geometries)),n=new at(ut.asList(t.geometries));return this.compare(e,n)}if(2===arguments.length){for(var i=arguments[0],r=arguments[1],o=i,s=this.getNumGeometries(),a=o.getNumGeometries(),u=0;u<s&&u<a;){var l=this.getGeometryN(u),c=o.getGeometryN(u),h=l.compareToSameClass(c,r);if(0!==h)return h;u++}return u<s?1:u<a?-1:0}},apply:function(){if(M(arguments[0],j))for(var t=arguments[0],e=0;e<this.geometries.length;e++)this.geometries[e].apply(t);else if(M(arguments[0],ht)){var n=arguments[0];if(0===this.geometries.length)return null;for(var e=0;e<this.geometries.length&&(this.geometries[e].apply(n),!n.isDone());e++);n.isGeometryChanged()&&this.geometryChanged()}else if(M(arguments[0],ct)){var i=arguments[0];i.filter(this);for(var e=0;e<this.geometries.length;e++)this.geometries[e].apply(i)}else if(M(arguments[0],k)){var r=arguments[0];r.filter(this);for(var e=0;e<this.geometries.length;e++)this.geometries[e].apply(r)}},getBoundary:function(){return this.checkNotGeometryCollection(this),f.shouldNeverReachHere(),null},clone:function(){var t=G.prototype.clone.call(this);t.geometries=new Array(this.geometries.length).fill(null);for(var e=0;e<this.geometries.length;e++)t.geometries[e]=this.geometries[e].clone();return t},getGeometryType:function(){return"GeometryCollection"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new ft(t,this.factory)},isEmpty:function(){for(var t=0;t<this.geometries.length;t++)if(!this.geometries[t].isEmpty())return!1;return!0},interfaces_:function(){return[]},getClass:function(){return ft}}),ft.serialVersionUID=-0x4f07bcb1f857d800,c(pt,ft),e(pt.prototype,{getSortIndex:function(){return G.SORTINDEX_MULTILINESTRING},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&&ft.prototype.equalsExact.call(this,t,e)}return ft.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return this.isClosed()?lt.FALSE:0},isClosed:function(){if(this.isEmpty())return!1;for(var t=0;t<this.geometries.length;t++)if(!this.geometries[t].isClosed())return!1;return!0},getDimension:function(){return 1},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n<this.geometries.length;n++)e[t-1-n]=this.geometries[n].reverse();return this.getFactory().createMultiLineString(e)},getBoundary:function(){return new dt(this).getBoundary()},getGeometryType:function(){return"MultiLineString"},copy:function(){for(var t=new Array(this.geometries.length).fill(null),e=0;e<t.length;e++)t[e]=this.geometries[e].copy();return new pt(t,this.factory)},interfaces_:function(){return[ot]},getClass:function(){return pt}}),pt.serialVersionUID=0x7155d2ab4afa8000,e(dt.prototype,{boundaryMultiLineString:function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();var e=this.computeBoundaryCoordinates(t);return 1===e.length?this.geomFact.createPoint(e[0]):this.geomFact.createMultiPointFromCoords(e)},getBoundary:function(){return this.geom instanceof Nt?this.boundaryLineString(this.geom):this.geom instanceof pt?this.boundaryMultiLineString(this.geom):this.geom.getBoundary()},boundaryLineString:function(t){if(this.geom.isEmpty())return this.getEmptyMultiPoint();if(t.isClosed()){return this.bnRule.isInBoundary(2)?t.getStartPoint():this.geomFact.createMultiPoint()}return this.geomFact.cre
|
||
|
createGeometryCollection:function(){if(0===arguments.length)return new ft(null,this);if(1===arguments.length){return new ft(arguments[0],this)}},createGeometry:function(t){return new Ot(this).edit(t,{edit:function(){if(2===arguments.length){var t=arguments[0];return arguments[1],this.coordinateSequenceFactory.create(t)}}})},getPrecisionModel:function(){return this.precisionModel},createLinearRing:function(){if(0===arguments.length)return this.createLinearRing(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLinearRing(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){return new Pt(arguments[0],this)}}},createMultiPolygon:function(){if(0===arguments.length)return new Tt(null,this);if(1===arguments.length){return new Tt(arguments[0],this)}},createMultiPoint:function(){if(0===arguments.length)return new Rt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){return new Rt(arguments[0],this)}if(arguments[0]instanceof Array){var t=arguments[0];return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(M(arguments[0],A)){var e=arguments[0];if(null===e)return this.createMultiPoint(new Array(0).fill(null));for(var n=new Array(e.size()).fill(null),i=0;i<e.size();i++){var r=this.getCoordinateSequenceFactory().create(1,e.getDimension());It.copy(e,i,r,0,1),n[i]=this.createPoint(r)}return this.createMultiPoint(n)}}},interfaces_:function(){return[u]},getClass:function(){return ne}}),ne.toMultiPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toGeometryArray=function(t){if(null===t)return null;var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.getDefaultCoordinateSequenceFactory=function(){return kt.instance()},ne.toMultiLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toLineStringArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toMultiPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toLinearRingArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toPointArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.toPolygonArray=function(t){var e=new Array(t.size()).fill(null);return t.toArray(e)},ne.createPointFromInternalCoord=function(t,e){return e.getPrecisionModel().makePrecise(t),e.getFactory().createPoint(t)},ne.serialVersionUID=-0x5ea75f2051eeb400;var os={typeStr:/^\s*(\w+)\s*\(\s*(.*)\s*\)\s*$/,emptyTypeStr:/^\s*(\w+)\s*EMPTY\s*$/,spaces:/\s+/,parenComma:/\)\s*,\s*\(/,doubleParenComma:/\)\s*\)\s*,\s*\(\s*\(/,trimParens:/^\s*\(?(.*?)\)?\s*$/};e(ie.prototype,{read:function(t){var e,n,i;t=t.replace(/[\n\r]/g," ");var r=os.typeStr.exec(t);if(-1!==t.search("EMPTY")&&(r=os.emptyTypeStr.exec(t),r[2]=void 0),r&&(n=r[1].toLowerCase(),i=r[2],as[n]&&(e=as[n].apply(this,[i]))),void 0===e)throw new Error("Could not parse WKT "+t);return e},write:function(t){return this.extractGeometry(t)},extractGeometry:function(t){var e=t.getGeometryType().toLowerCase();if(!ss[e])return null;var n=e.toUpperCase();return t.isEmpty()?n+" EMPTY":n+"("+ss[e].apply(this,[t])+")"}});var ss={coordinate:function(t){return t.x+" "+t.y},point:function(t){return ss.coordinate.call(this,t.coordinates.coordinates[0])},multipoint:function(t){for(var e=[],n=0,i=t.geometries.length;n<i;++n)e.push("("+ss.point.apply(this,[t.geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,i=t.points.coordinates.length;n<i;++n)e.push(ss.coordinate.apply(this,[t.points.coordinates[n]]));return e.join(",")},linearring:function(t){for(var e=[],n=0,i=t.points.coordinates.length;n<i;++n)e.push(ss.coordinate.apply(this,[t.points.coordinates[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,i=t.geometries.length;n<i;++n)e.push("("+ss.linestring.apply(this,[t.geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+ss.linestring.apply(this,[t.shell])+")")
|
||
|
;return this.list.toArray(t)},interfaces_:function(){return[j]},getClass:function(){return ge}}),ge.filterCoordinates=function(t){for(var e=new ge,n=0;n<t.length;n++)e.filter(t[n]);return e.getCoordinates()},e(ve.prototype,{preSort:function(t){for(var e=null,n=1;n<t.length;n++)(t[n].y<t[0].y||t[n].y===t[0].y&&t[n].x<t[0].x)&&(e=t[0],t[0]=t[n],t[n]=e);return ut.sort(t,1,t.length,new ye(t[0])),t},computeOctRing:function(t){var e=this.computeOctPts(t),n=new b;return n.add(e,!1),n.size()<3?null:(n.closeRing(),n.toCoordinateArray())},lineOrPolygon:function(t){if(t=this.cleanRing(t),3===t.length)return this.geomFactory.createLineString([t[0],t[1]]);var e=this.geomFactory.createLinearRing(t);return this.geomFactory.createPolygon(e,null)},cleanRing:function(t){f.equals(t[0],t[t.length-1]);for(var e=new w,n=null,i=0;i<=t.length-2;i++){var r=t[i],o=t[i+1];r.equals(o)||null!==n&&this.isBetween(n,r,o)||(e.add(r),n=r)}e.add(t[t.length-1]);var s=new Array(e.size()).fill(null);return e.toArray(s)},isBetween:function(t,e,n){if(0!==le.computeOrientation(t,e,n))return!1;if(t.x!==n.x){if(t.x<=e.x&&e.x<=n.x)return!0;if(n.x<=e.x&&e.x<=t.x)return!0}if(t.y!==n.y){if(t.y<=e.y&&e.y<=n.y)return!0;if(n.y<=e.y&&e.y<=t.y)return!0}return!1},reduce:function(t){var e=this.computeOctRing(t);if(null===e)return t;for(var n=new at,i=0;i<e.length;i++)n.add(e[i]);for(var i=0;i<t.length;i++)le.isPointInRing(t[i],e)||n.add(t[i]);var r=U.toCoordinateArray(n);return r.length<3?this.padArray3(r):r},getConvexHull:function(){if(0===this.inputPts.length)return this.geomFactory.createGeometryCollection(null);if(1===this.inputPts.length)return this.geomFactory.createPoint(this.inputPts[0]);if(2===this.inputPts.length)return this.geomFactory.createLineString(this.inputPts);var t=this.inputPts;this.inputPts.length>50&&(t=this.reduce(this.inputPts));var e=this.preSort(t),n=this.grahamScan(e),i=this.toCoordinateArray(n);return this.lineOrPolygon(i)},padArray3:function(t){for(var e=new Array(3).fill(null),n=0;n<e.length;n++)n<t.length?e[n]=t[n]:e[n]=t[0];return e},computeOctPts:function(t){for(var e=new Array(8).fill(null),n=0;n<e.length;n++)e[n]=t[0];for(var i=1;i<t.length;i++)t[i].x<e[0].x&&(e[0]=t[i]),t[i].x-t[i].y<e[1].x-e[1].y&&(e[1]=t[i]),t[i].y>e[2].y&&(e[2]=t[i]),t[i].x+t[i].y>e[3].x+e[3].y&&(e[3]=t[i]),t[i].x>e[4].x&&(e[4]=t[i]),t[i].x-t[i].y>e[5].x-e[5].y&&(e[5]=t[i]),t[i].y<e[6].y&&(e[6]=t[i]),t[i].x+t[i].y<e[7].x+e[7].y&&(e[7]=t[i]);return e},toCoordinateArray:function(t){for(var e=new Array(t.size()).fill(null),n=0;n<t.size();n++){var i=t.get(n);e[n]=i}return e},grahamScan:function(t){var e=null,n=new de;e=n.push(t[0]),e=n.push(t[1]),e=n.push(t[2]);for(var i=3;i<t.length;i++){for(e=n.pop();!n.empty()&&le.computeOrientation(n.peek(),e,t[i])>0;)e=n.pop();e=n.push(e),e=n.push(t[i])}return e=n.push(t[0]),n},interfaces_:function(){return[]},getClass:function(){return ve}}),ve.extractCoordinates=function(t){var e=new ge;return t.apply(e),e.getCoordinates()},e(ye.prototype,{compare:function(t,e){var n=t,i=e;return ye.polarCompare(this.origin,n,i)},interfaces_:function(){return[a]},getClass:function(){return ye}}),ye.polarCompare=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,o=n.x-t.x,s=n.y-t.y,a=le.computeOrientation(t,e,n);if(a===le.COUNTERCLOCKWISE)return 1;if(a===le.CLOCKWISE)return-1;var u=i*i+r*r,l=o*o+s*s;return u<l?-1:u>l?1:0},ve.RadialComparator=ye,e(me.prototype,{transformPoint:function(t,e){return this.factory.createPoint(this.transformCoordinates(t.getCoordinateSequence(),t))},transformPolygon:function(t,e){var n=!0,i=this.transformLinearRing(t.getExteriorRing(),t);null!==i&&i instanceof Pt&&!i.isEmpty()||(n=!1);for(var r=new w,o=0;o<t.getNumInteriorRing();o++){var s=this.transformLinearRing(t.getInteriorRingN(o),t);null===s||s.isEmpty()||(s instanceof Pt||(n=!1),r.add(s))}if(n)return this.factory.createPolygon(i,r.toArray([]));var a=new w;return null!==i&&a.add(i),a.addAll(r),this.factory.buildGeometry(a)},createCoordinateSequence:function(t){return this.factory.getCoordinateSequenceFactory().create(t)},getInputGeometry:function(){return this.inputGeom},transf
|
||
|
;var r=t.get(t.size()-1),o=r.getCoordinates(),s=o[o.length-1];if(!s.equals2D(e[e.length-1]))throw new l("bad split edge end point at "+s)},interfaces_:function(){return[]},getClass:function(){return Ye}}),e(Ue.prototype,{next:function(){return null===this.currNode?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):null===this.nextNode?null:this.nextNode.segmentIndex===this.currNode.segmentIndex?(this.currNode=this.nextNode,this.currSegIndex=this.currNode.segmentIndex,this.readNextNode(),this.currNode):(this.nextNode.segmentIndex,this.currNode.segmentIndex,null)},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){return null!==this.nextNode},readNextNode:function(){this.nodeIt.hasNext()?this.nextNode=this.nodeIt.next():this.nextNode=null},interfaces_:function(){return[g]},getClass:function(){return Ue}}),e(We.prototype,{addIntersection:function(t,e){},interfaces_:function(){return[Re]},getClass:function(){return We}}),e(He.prototype,{getCoordinates:function(){return this.pts},size:function(){return this.pts.length},getCoordinate:function(t){return this.pts[t]},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getSegmentOctant:function(t){return t===this.pts.length-1?-1:this.safeOctant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},safeOctant:function(t,e){return t.equals2D(e)?0:Le.octant(t,e)},getData:function(){return this.data},addIntersection:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];this.addIntersectionNode(t,e)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=(arguments[2],arguments[3]),o=new p(n.getIntersection(r));this.addIntersection(o,i)}},toString:function(){return re.toLineString(new qt(this.pts))},getNodeList:function(){return this.nodeList},addIntersectionNode:function(t,e){var n=e,i=n+1;if(i<this.pts.length){var r=this.pts[i];t.equals2D(r)&&(n=i)}return this.nodeList.add(t,n)},addIntersections:function(t,e,n){for(var i=0;i<t.getIntersectionNum();i++)this.addIntersection(t,e,n,i)},interfaces_:function(){return[We]},getClass:function(){return He}}),He.getNodedSubstrings=function(){if(1===arguments.length){var t=arguments[0],e=new w;return He.getNodedSubstrings(t,e),e}if(2===arguments.length)for(var n=arguments[0],i=arguments[1],r=n.iterator();r.hasNext();){var o=r.next();o.getNodeList().addSplitEdges(i)}},e(Je.prototype,{overlap:function(){if(2===arguments.length)arguments[0],arguments[1];else if(4===arguments.length){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];t.getLineSegment(e,this.overlapSeg1),n.getLineSegment(i,this.overlapSeg2),this.overlap(this.overlapSeg1,this.overlapSeg2)}},interfaces_:function(){return[]},getClass:function(){return Je}}),e(Ze.prototype,{getLineSegment:function(t,e){e.p0=this.pts[t],e.p1=this.pts[t+1]},computeSelect:function(t,e,n,i){var r=this.pts[e],o=this.pts[n];if(i.tempEnv1.init(r,o),n-e==1)return i.select(this,e),null;if(!t.intersects(i.tempEnv1))return null;var s=Math.trunc((e+n)/2);e<s&&this.computeSelect(t,e,s,i),s<n&&this.computeSelect(t,s,n,i)},getCoordinates:function(){for(var t=new Array(this.end-this.start+1).fill(null),e=0,n=this.start;n<=this.end;n++)t[e++]=this.pts[n];return t},computeOverlaps:function(t,e){this.computeOverlapsInternal(this.start,this.end,t,t.start,t.end,e)},setId:function(t){this.id=t},select:function(t,e){this.computeSelect(t,this.start,this.end,e)},getEnvelope:function(){if(null===this.env){var t=this.pts[this.start],e=this.pts[this.end];this.env=new I(t,e)}return this.env},getEndIndex:function(){return this.end},getStartIndex:function(){return this.start},getContext:function(){return this.context},getId:function(){return this.id},computeOverlapsInternal:function(t,e,n,i,r,o){var s=this.pts[t],a=this.pts[e],u=n.pts[i],l=n.pts[r];if(e-t==1&&r-i==1)return o.overlap(this,t,n,i),null;if(o.tempEnv1.init(s,a),o.tempEnv2.init(u,l),!o.tempEnv1.intersects(o.tempEnv2))return null;var c=Math.trunc((t+e)/2),h=Math.trunc((i+r)/
|
||
|
var n=this.geometryFactory.createPoint(e);this.resultPointList.add(n)}},extractNonCoveredResultNodes:function(t){for(var e=this.op.getGraph().getNodes().iterator();e.hasNext();){var n=e.next();if(!(n.isInResult()||n.isIncidentEdgeInResult()||0!==n.getEdges().getDegree()&&t!==ni.INTERSECTION)){var i=n.getLabel();ni.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return Cn}}),e(Sn.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return Sn}}),e(Mn.prototype,{locate:function(t){return Mn.locate(t,this.geom)},interfaces_:function(){return[Sn]},getClass:function(){return Mn}}),Mn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&le.isPointInRing(t,e.getCoordinates())},Mn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Mn.isPointInRing(t,n))return!1;for(var i=0;i<e.getNumInteriorRing();i++){var r=e.getInteriorRingN(i);if(Mn.isPointInRing(t,r))return!1}return!0},Mn.containsPoint=function(t,e){if(e instanceof Lt)return Mn.containsPointInPolygon(t,e);if(e instanceof ft)for(var n=new Se(e);n.hasNext();){var i=n.next();if(i!==e&&Mn.containsPoint(t,i))return!0}return!1},Mn.locate=function(t,e){return e.isEmpty()?S.EXTERIOR:Mn.containsPoint(t,e)?S.INTERIOR:S.EXTERIOR},e(Ln.prototype,{getNextCW:function(t){this.getEdges();var e=this.edgeList.indexOf(t),n=e-1;return 0===e&&(n=this.edgeList.size()-1),this.edgeList.get(n)},propagateSideLabels:function(t){for(var e=S.NONE,n=this.iterator();n.hasNext();){var i=n.next(),r=i.getLabel();r.isArea(t)&&r.getLocation(t,cn.LEFT)!==S.NONE&&(e=r.getLocation(t,cn.LEFT))}if(e===S.NONE)return null;for(var o=e,n=this.iterator();n.hasNext();){var i=n.next(),r=i.getLabel();if(r.getLocation(t,cn.ON)===S.NONE&&r.setLocation(t,cn.ON,o),r.isArea(t)){var s=r.getLocation(t,cn.LEFT),a=r.getLocation(t,cn.RIGHT);if(a!==S.NONE){if(a!==o)throw new rn("side location conflict",i.getCoordinate());s===S.NONE&&f.shouldNeverReachHere("found single null side (at "+i.getCoordinate()+")"),o=s}else f.isTrue(r.getLocation(t,cn.LEFT)===S.NONE,"found single null side"),r.setLocation(t,cn.RIGHT,o),r.setLocation(t,cn.LEFT,o)}}},getCoordinate:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},print:function(t){D.out.println("EdgeEndStar: "+this.getCoordinate());for(var e=this.iterator();e.hasNext();){e.next().print(t)}},isAreaLabelsConsistent:function(t){return this.computeEdgeEndLabels(t.getBoundaryNodeRule()),this.checkAreaLabelsConsistent(0)},checkAreaLabelsConsistent:function(t){var e=this.getEdges();if(e.size()<=0)return!0;var n=e.size()-1,i=e.get(n).getLabel(),r=i.getLocation(t,cn.LEFT);f.isTrue(r!==S.NONE,"Found unlabelled area edge");for(var o=r,s=this.iterator();s.hasNext();){var a=s.next(),u=a.getLabel();f.isTrue(u.isArea(t),"Found non-area edge");var l=u.getLocation(t,cn.LEFT),c=u.getLocation(t,cn.RIGHT);if(l===c)return!1;if(c!==o)return!1;o=l}return!0},findIndex:function(t){this.iterator();for(var e=0;e<this.edgeList.size();e++){if(this.edgeList.get(e)===t)return e}return-1},iterator:function(){return this.getEdges().iterator()},getEdges:function(){return null===this.edgeList&&(this.edgeList=new w(this.edgeMap.values())),this.edgeList},getLocation:function(t,e,n){return this.ptInAreaLocation[t]===S.NONE&&(this.ptInAreaLocation[t]=Mn.locate(e,n[t].getGeometry())),this.ptInAreaLocation[t]},toString:function(){var t=new R;t.append("EdgeEndStar: "+this.getCoordinate()),t.append("\n");for(var e=this.iterator();e.hasNext();){var n=e.next();t.append(n),t.append("\n")}return t.toString()},computeEdgeEndLabels:function(t){for(var e=this.iterator();e.hasNext();){e.next().computeLabel(t)}},computeLabelling:function(t){this.computeEdgeEndLabels(t[0].getBoundaryNodeRule()),this.propagateSideLabels(0),this.propagateSideLabels(1);for(var e=[!1,!1],n=this.iterator();n.hasNext();)for(var i=n.next(),r=i.getLabel(),o=0;o<2;o++)r.isLine(o)&&r.getLocation(o)===S
|
||
|
iterator:function(){return this.edges.iterator()},getEdges:function(){return this.edges},get:function(t){return this.edges.get(t)},findEqualEdge:function(t){var e=new ti(t.getCoordinates());return this.ocaMap.get(e)},add:function(t){this.edges.add(t);var e=new ti(t.getCoordinates());this.ocaMap.put(e,t)},interfaces_:function(){return[]},getClass:function(){return ei}}),c(ni,$n),e(ni.prototype,{insertUniqueEdge:function(t){var e=this.edgeList.findEqualEdge(t);if(null!==e){var n=e.getLabel(),i=t.getLabel();e.isPointwiseEqual(t)||(i=new fn(t.getLabel()),i.flip());var r=e.getDepth();r.isNull()&&r.add(n),r.add(i),n.merge(i)}else this.edgeList.add(t)},getGraph:function(){return this.graph},cancelDuplicateResultEdges:function(){for(var t=this.graph.getEdgeEnds().iterator();t.hasNext();){var e=t.next(),n=e.getSym();e.isInResult()&&n.isInResult()&&(e.setInResult(!1),n.setInResult(!1))}},isCoveredByLA:function(t){return!!this.isCovered(t,this.resultLineList)||!!this.isCovered(t,this.resultPolyList)},computeGeometry:function(t,e,n,i){var r=new w;return r.addAll(t),r.addAll(e),r.addAll(n),r.isEmpty()?ni.createEmptyResult(i,this.arg[0].getGeometry(),this.arg[1].getGeometry(),this.geomFact):this.geomFact.buildGeometry(r)},mergeSymLabels:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){t.next().getEdges().mergeSymLabels()}},isCovered:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();if(this.ptLocator.locate(t,i)!==S.EXTERIOR)return!0}return!1},replaceCollapsedEdges:function(){for(var t=new w,e=this.edgeList.iterator();e.hasNext();){var n=e.next();n.isCollapsed()&&(e.remove(),t.add(n.getCollapsedEdge()))}this.edgeList.addAll(t)},updateNodeLabelling:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){var e=t.next(),n=e.getEdges().getLabel();e.getLabel().merge(n)}},getResultGeometry:function(t){return this.computeOverlay(t),this.resultGeom},insertUniqueEdges:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.insertUniqueEdge(n)}},computeOverlay:function(t){this.copyPoints(0),this.copyPoints(1),this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1),this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!0);var e=new w;this.arg[0].computeSplitEdges(e),this.arg[1].computeSplitEdges(e),this.insertUniqueEdges(e),this.computeLabelsFromDepths(),this.replaceCollapsedEdges(),un.checkValid(this.edgeList.getEdges()),this.graph.addEdges(this.edgeList.getEdges()),this.computeLabelling(),this.labelIncompleteNodes(),this.findResultAreaEdges(t),this.cancelDuplicateResultEdges();var n=new In(this.geomFact);n.add(this.graph),this.resultPolyList=n.getPolygons();var i=new Nn(this,this.geomFact,this.ptLocator);this.resultLineList=i.build(t);var r=new Cn(this,this.geomFact,this.ptLocator);this.resultPointList=r.build(t),this.resultGeom=this.computeGeometry(this.resultPointList,this.resultLineList,this.resultPolyList,t)},labelIncompleteNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setLocation(e,n)},copyPoints:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next();this.graph.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},findResultAreaEdges:function(t){for(var e=this.graph.getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getLabel();i.isArea()&&!n.isInteriorAreaEdge()&&ni.isResultOfOp(i.getLocation(0,cn.RIGHT),i.getLocation(1,cn.RIGHT),t)&&n.setInResult(!0)}},computeLabelsFromDepths:function(){for(var t=this.edgeList.iterator();t.hasNext();){var e=t.next(),n=e.getLabel(),i=e.getDepth();if(!i.isNull()){i.normalize();for(var r=0;r<2;r++)n.isNull(r)||!n.isArea()||i.isNull(r)||(0===i.getDelta(r)?n.toLine(r):(f.isTrue(!i.isNull(r,cn.LEFT),"depth of LEFT side has not been initialized"),n.setLocation(r,cn.LEFT,i.getLocation(r,cn.LEFT)),f.isTrue(!i.isNull(r,cn.RIGHT),"depth of RIGHT side has not been initialized"),n.setLocation(r,cn.RIGHT,i.getLocation(r,cn.RIGHT))))}}},computeLabelling:function(){for(var t=this.graph.getNodes().iterator();t.hasNext();){t.next
|
||
|
var e=this.deltaX(),n=this.deltaY(),i=t.deltaX(),r=t.deltaY();if(e===i&&n===r)return 0;var o=Ke.quadrant(e,n),s=Ke.quadrant(i,r);return o>s?1:o<s?-1:le.computeOrientation(t._orig,t.dest(),this.dest())},prevNode:function(){for(var t=this;2===t.degree();)if((t=t.prev())===this)return null;return t},compareTo:function(t){var e=t;return this.compareAngularDirection(e)},next:function(){return this._next},setSym:function(t){this._sym=t},orig:function(){return this._orig},toString:function(){return"HE("+this._orig.x+" "+this._orig.y+", "+this._sym._orig.x+" "+this._sym._orig.y+")"},setNext:function(t){this._next=t},init:function(t){this.setSym(t),t.setSym(this),this.setNext(t),t.setNext(this)},deltaX:function(){return this._sym._orig.x-this._orig.x},interfaces_:function(){return[]},getClass:function(){return Li}}),Li.init=function(t,e){if(null!==t._sym||null!==e._sym||null!==t._next||null!==e._next)throw new IllegalStateException("Edges are already initialized");return t.init(e),t},Li.create=function(t,e){var n=new Li(t),i=new Li(e);return n.init(i),n},c(Ri,Li),e(Ri.prototype,{mark:function(){this._isMarked=!0},setMark:function(t){this._isMarked=t},isMarked:function(){return this._isMarked},interfaces_:function(){return[]},getClass:function(){return Ri}}),Ri.setMarkBoth=function(t,e){t.setMark(e),t.sym().setMark(e)},Ri.isMarked=function(t){return t.isMarked()},Ri.setMark=function(t,e){t.setMark(e)},Ri.markBoth=function(t){t.mark(),t.sym().mark()},Ri.mark=function(t){t.mark()},e(Pi.prototype,{insert:function(t,e,n){var i=this.create(t,e);null!==n?n.insert(i):this.vertexMap.put(t,i);var r=this.vertexMap.get(e);return null!==r?r.insert(i.sym()):this.vertexMap.put(e,i.sym()),i},create:function(t,e){var n=this.createEdge(t),i=this.createEdge(e);return Li.init(n,i),n},createEdge:function(t){return new Li(t)},addEdge:function(t,e){if(!Pi.isValidEdge(t,e))return null;var n=this.vertexMap.get(t),i=null;return null!==n&&(i=n.find(e)),null!==i?i:this.insert(t,e,n)},getVertexEdges:function(){return this.vertexMap.values()},findEdge:function(t,e){var n=this.vertexMap.get(t);return null===n?null:n.find(e)},interfaces_:function(){return[]},getClass:function(){return Pi}}),Pi.isValidEdge=function(t,e){return 0!==e.compareTo(t)},c(Ti,Ri),e(Ti.prototype,{setStart:function(){this._isStart=!0},isStart:function(){return this._isStart},interfaces_:function(){return[]},getClass:function(){return Ti}}),c(Oi,Pi),e(Oi.prototype,{createEdge:function(t){return new Ti(t)},interfaces_:function(){return[]},getClass:function(){return Oi}}),e(_i.prototype,{addLine:function(t){this.lines.add(this.factory.createLineString(t.toCoordinateArray()))},updateRingStartEdge:function(t){return t.isStart()||(t=t.sym(),t.isStart())?null===this.ringStartEdge?(this.ringStartEdge=t,null):void(t.orig().compareTo(this.ringStartEdge.orig())<0&&(this.ringStartEdge=t)):null},getResult:function(){return null===this.result&&this.computeResult(),this.result},process:function(t){var e=t.prevNode();null===e&&(e=t),this.stackEdges(e),this.buildLines()},buildRing:function(t){var e=new b,n=t;for(e.add(n.orig().copy(),!1);2===n.sym().degree();){var i=n.next();if(i===t)break;e.add(i.orig().copy(),!1),n=i}e.add(n.dest().copy(),!1),this.addLine(e)},buildLine:function(t){var e=new b,n=t;for(this.ringStartEdge=null,Ri.markBoth(n),e.add(n.orig().copy(),!1);2===n.sym().degree();){this.updateRingStartEdge(n);var i=n.next();if(i===t)return this.buildRing(this.ringStartEdge),null;e.add(i.orig().copy(),!1),n=i,Ri.markBoth(n)}e.add(n.dest().copy(),!1),this.stackEdges(n.sym()),this.addLine(e)},stackEdges:function(t){var e=t;do{Ri.isMarked(e)||this.nodeEdgeStack.add(e),e=e.oNext()}while(e!==t)},computeResult:function(){for(var t=this.graph.getVertexEdges(),e=t.iterator();e.hasNext();){var n=e.next();Ri.isMarked(n)||this.process(n)}this.result=this.factory.buildGeometry(this.lines)},buildLines:function(){for(;!this.nodeEdgeStack.empty();){var t=this.nodeEdgeStack.pop();Ri.isMarked(t)||this.buildLine(t)}},add:function(){if(arguments[0]instanceof G){arguments[0].apply({interfaces_:function(){return[k]},fi
|
||
|
;u.x=Math.abs(this.distance)*Math.cos(a),u.y=Math.abs(this.distance)*Math.sin(a);var l=new p(i.p1.x+u.x,i.p1.y+u.y),c=new p(r.p1.x+u.x,r.p1.y+u.y);this.segList.addPt(l),this.segList.addPt(c)}},getCoordinates:function(){return this.segList.getCoordinates()},addMitreJoin:function(t,e,n,i){var r=!0,o=null;try{o=F.intersection(e.p0,e.p1,n.p0,n.p1);(i<=0?1:o.distance(t)/Math.abs(i))>this.bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof C))throw t;o=new p(0,0),r=!1}r?this.segList.addPt(o):this.addLimitedMitreJoin(e,n,i,this.bufParams.getMitreLimit())},addFilletCorner:function(t,e,n,i,r){var o=e.x-t.x,s=e.y-t.y,a=Math.atan2(s,o),u=n.x-t.x,l=n.y-t.y,c=Math.atan2(l,u);i===le.CLOCKWISE?a<=c&&(a+=2*Math.PI):a>=c&&(a-=2*Math.PI),this.segList.addPt(e),this.addFilletArc(t,a,c,i,r),this.segList.addPt(n)},addOutsideTurn:function(t,e){return this.offset0.p1.distance(this.offset1.p0)<this.distance*tr.OFFSET_SEGMENT_SEPARATION_FACTOR?(this.segList.addPt(this.offset0.p1),null):void(this.bufParams.getJoinStyle()===Hi.JOIN_MITRE?this.addMitreJoin(this.s1,this.offset0,this.offset1,this.distance):this.bufParams.getJoinStyle()===Hi.JOIN_BEVEL?this.addBevelJoin(this.offset0,this.offset1):(e&&this.segList.addPt(this.offset0.p1),this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,t,this.distance),this.segList.addPt(this.offset1.p0)))},createSquare:function(t){this.segList.addPt(new p(t.x+this.distance,t.y+this.distance)),this.segList.addPt(new p(t.x+this.distance,t.y-this.distance)),this.segList.addPt(new p(t.x-this.distance,t.y-this.distance)),this.segList.addPt(new p(t.x-this.distance,t.y+this.distance)),this.segList.closeRing()},addSegments:function(t,e){this.segList.addPts(t,e)},addFirstSegment:function(){this.segList.addPt(this.offset1.p0)},addLastSegment:function(){this.segList.addPt(this.offset1.p1)},initSideSegments:function(t,e,n){this.s1=t,this.s2=e,this.side=n,this.seg1.setCoordinates(t,e),this.computeOffsetSegment(this.seg1,n,this.distance,this.offset1)},addLimitedMitreJoin:function(t,e,n,i){var r=this.seg0.p1,o=bi.angle(r,this.seg0.p0),s=(bi.angle(r,this.seg1.p1),bi.angleBetweenOriented(this.seg0.p0,r,this.seg1.p1)),a=s/2,u=bi.normalize(o+a),l=bi.normalize(u+Math.PI),c=i*n,h=c*Math.abs(Math.sin(a)),f=n-h,d=r.x+c*Math.cos(l),g=r.y+c*Math.sin(l),v=new p(d,g),y=new ce(r,v),m=y.pointAlongOffset(1,f),x=y.pointAlongOffset(1,-f);this.side===cn.LEFT?(this.segList.addPt(m),this.segList.addPt(x)):(this.segList.addPt(x),this.segList.addPt(m))},computeOffsetSegment:function(t,e,n,i){var r=e===cn.LEFT?1:-1,o=t.p1.x-t.p0.x,s=t.p1.y-t.p0.y,a=Math.sqrt(o*o+s*s),u=r*n*o/a,l=r*n*s/a;i.p0.x=t.p0.x-l,i.p0.y=t.p0.y+u,i.p1.x=t.p1.x-l,i.p1.y=t.p1.y+u},addFilletArc:function(t,e,n,i,r){var o=i===le.CLOCKWISE?-1:1,s=Math.abs(e-n),a=Math.trunc(s/this.filletAngleQuantum+.5);if(a<1)return null;var u=null,l=null;u=0,l=s/a;for(var c=u,h=new p;c<s;){var f=e+o*c;h.x=t.x+r*Math.cos(f),h.y=t.y+r*Math.sin(f),this.segList.addPt(h),c+=l}},addInsideTurn:function(t,e){if(this.li.computeIntersection(this.offset0.p0,this.offset0.p1,this.offset1.p0,this.offset1.p1),this.li.hasIntersection())this.segList.addPt(this.li.getIntersection(0));else if(this._hasNarrowConcaveAngle=!0,this.offset0.p1.distance(this.offset1.p0)<this.distance*tr.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR)this.segList.addPt(this.offset0.p1);else{if(this.segList.addPt(this.offset0.p1),this.closingSegLengthFactor>0){var n=new p((this.closingSegLengthFactor*this.offset0.p1.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset0.p1.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(n);var i=new p((this.closingSegLengthFactor*this.offset1.p0.x+this.s1.x)/(this.closingSegLengthFactor+1),(this.closingSegLengthFactor*this.offset1.p0.y+this.s1.y)/(this.closingSegLengthFactor+1));this.segList.addPt(i)}else this.segList.addPt(this.s1);this.segList.addPt(this.offset1.p0)}},createCircle:function(t){var e=new p(t.x+this.distance,t.y);this.segList.addPt(e),this.addFilletArc(t,0,2*Math.PI,-1,this.distance),this.segList.closeRing()},addBevelJoin:function(t,e){th
|
||
|
if(null===this.coordinates){for(var t=0,e=0,n=new b,i=this.directedEdges.iterator();i.hasNext();){var r=i.next();r.getEdgeDirection()?t++:e++,n.add(r.getEdge().getLine().getCoordinates(),!1,r.getEdgeDirection())}this.coordinates=n.toCoordinateArray(),e>t&&U.reverse(this.coordinates)}return this.coordinates},toLineString:function(){return this.factory.createLineString(this.getCoordinates())},add:function(t){this.directedEdges.add(t)},interfaces_:function(){return[]},getClass:function(){return xr}}),e(Er.prototype,{setVisited:function(t){this._isVisited=t},isMarked:function(){return this._isMarked},setData:function(t){this.data=t},getData:function(){return this.data},setMarked:function(t){this._isMarked=t},getContext:function(){return this.data},isVisited:function(){return this._isVisited},setContext:function(t){this.data=t},interfaces_:function(){return[]},getClass:function(){return Er}}),Er.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},Er.setVisited=function(t,e){for(;t.hasNext();){t.next().setVisited(e)}},Er.setMarked=function(t,e){for(;t.hasNext();){t.next().setMarked(e)}},c(wr,Er),e(wr.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(t){return this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:le.computeOrientation(t.p0,t.p1,this.p1)},getCoordinate:function(){return this.from.getCoordinate()},print:function(t){var e=this.getClass().getName(),n=e.lastIndexOf("."),i=e.substring(n+1);t.print(" "+i+": "+this.p0+" - "+this.p1+" "+this.quadrant+":"+this.angle)},getDirectionPt:function(){return this.p1},getAngle:function(){return this.angle},compareTo:function(t){var e=t;return this.compareDirection(e)},getFromNode:function(){return this.from},getSym:function(){return this.sym},setEdge:function(t){this.parentEdge=t},remove:function(){this.sym=null,this.parentEdge=null},getEdge:function(){return this.parentEdge},getQuadrant:function(){return this.quadrant},setSym:function(t){this.sym=t},getToNode:function(){return this.to},getEdgeDirection:function(){return this.edgeDirection},interfaces_:function(){return[o]},getClass:function(){return wr}}),wr.toEdges=function(t){for(var e=new w,n=t.iterator();n.hasNext();)e.add(n.next().parentEdge);return e},c(br,wr),e(br.prototype,{getNext:function(){return 2!==this.getToNode().getDegree()?null:this.getToNode().getOutEdges().getEdges().get(0)===this.getSym()?this.getToNode().getOutEdges().getEdges().get(1):(f.isTrue(this.getToNode().getOutEdges().getEdges().get(1)===this.getSym()),this.getToNode().getOutEdges().getEdges().get(0))},interfaces_:function(){return[]},getClass:function(){return br}}),c(Ir,Er),e(Ir.prototype,{isRemoved:function(){return null===this.dirEdge},setDirectedEdges:function(t,e){this.dirEdge=[t,e],t.setEdge(this),e.setEdge(this),t.setSym(e),e.setSym(t),t.getFromNode().addOutEdge(t),e.getFromNode().addOutEdge(e)},getDirEdge:function(){if(Number.isInteger(arguments[0])){var t=arguments[0];return this.dirEdge[t]}if(arguments[0]instanceof Cr){var e=arguments[0];return this.dirEdge[0].getFromNode()===e?this.dirEdge[0]:this.dirEdge[1].getFromNode()===e?this.dirEdge[1]:null}},remove:function(){this.dirEdge=null},getOppositeNode:function(t){return this.dirEdge[0].getFromNode()===t?this.dirEdge[0].getToNode():this.dirEdge[1].getFromNode()===t?this.dirEdge[1].getToNode():null},interfaces_:function(){return[]},getClass:function(){return Ir}}),e(Nr.prototype,{getNextEdge:function(t){var e=this.getIndex(t);return this.outEdges.get(this.getIndex(e+1))},getCoordinate:function(){var t=this.iterator();return t.hasNext()?t.next().getCoordinate():null},iterator:function(){return this.sortEdges(),this.outEdges.iterator()},sortEdges:function(){this.sorted||(ls.sort(this.outEdges),this.sorted=!0)},remove:function(t){this.outEdges.remove(t)},getEdges:function(){return this.sortEdges(),this.outEdges},getNextCWEdge:function(t){var e=this.getIndex(t);return this.outEdges.get(this.getIndex(e-1))},getIndex:function(){if(arguments[0]instanceof Ir){var t=arguments[0];this.sortEdge
|
||
|
for(var n=t.iterator();n.hasNext();){n.next().setLabel(e)}},Ur.computeNextCWEdges=function(t){for(var e=t.getOutEdges(),n=null,i=null,r=e.getEdges().iterator();r.hasNext();){var o=r.next();if(!o.isMarked()){if(null===n&&(n=o),null!==i){var s=i.getSym();s.setNext(o)}i=o}}if(null!==i){var s=i.getSym();s.setNext(n)}},Ur.computeNextCCWEdges=function(t,e){for(var n=t.getOutEdges(),i=null,r=null,o=n.getEdges(),s=o.size()-1;s>=0;s--){var a=o.get(s),u=a.getSym(),l=null;a.getLabel()===e&&(l=a);var c=null;u.getLabel()===e&&(c=u),null===l&&null===c||(null!==c&&(r=c),null!==l&&(null!==r&&(r.setNext(l),r=null),null===i&&(i=l)))}null!==r&&(f.isTrue(null!==i),r.setNext(i))},Ur.getDegree=function(t,e){for(var n=t.getOutEdges().getEdges(),i=0,r=n.iterator();r.hasNext();){r.next().getLabel()===e&&i++}return i},Ur.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();Ur.getDegree(r,e)>1&&(null===i&&(i=new w),i.add(r)),n=n.getNext(),f.isTrue(null!==n,"found null DE in ring"),f.isTrue(n===t||!n.isInRing(),"found DE already in ring")}while(n!==t);return i},e(Wr.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new ne),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection(ne.toGeometryArray(this.polyList))},getInvalidRingLines:function(){return this.polygonize(),this.invalidRingLines},findValidRings:function(t,e,n){for(var i=t.iterator();i.hasNext();){var r=i.next();r.isValid()?e.add(r):n.add(r.getLineString())}},polygonize:function(){if(null!==this.polyList)return null;if(this.polyList=new w,null===this.graph)return null;this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var t=this.graph.getEdgeRings(),e=new w;this.invalidRingLines=new w,this.isCheckingRingsValid?this.findValidRings(t,e,this.invalidRingLines):e=t,this.findShellsAndHoles(e),Wr.assignHolesToShells(this.holeList,this.shellList),ls.sort(this.shellList,new Xr.EnvelopeComparator);var n=!0;this.extractOnlyPolygonal&&(Wr.findDisjointShells(this.shellList),n=!1),this.polyList=Wr.extractPolygons(this.shellList,n)},getDangles:function(){return this.polygonize(),this.dangles},getCutEdges:function(){return this.polygonize(),this.cutEdges},getPolygons:function(){return this.polygonize(),this.polyList},add:function(){if(M(arguments[0],v))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}else if(arguments[0]instanceof Nt){var i=arguments[0];this.geomFactory=i.getFactory(),null===this.graph&&(this.graph=new Ur(this.geomFactory)),this.graph.addEdge(i)}else if(arguments[0]instanceof G){var r=arguments[0];r.apply(this.lineStringAdder)}},setCheckRingsValid:function(t){this.isCheckingRingsValid=t},findShellsAndHoles:function(t){this.holeList=new w,this.shellList=new w;for(var e=t.iterator();e.hasNext();){var n=e.next();n.computeHole(),n.isHole()?this.holeList.add(n):this.shellList.add(n)}},interfaces_:function(){return[]},getClass:function(){return Wr}}),Wr.findOuterShells=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getOuterHole();null===i||i.isProcessed()||(n.setIncluded(!0),i.setProcessed(!0))}},Wr.extractPolygons=function(t,e){for(var n=new w,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Wr.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Wr.assignHoleToShell(i,e)}},Wr.assignHoleToShell=function(t,e){var n=Xr.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Wr.findDisjointShells=function(t){Wr.findOuterShells(t);var e=null;do{e=!1;for(var n=t.iterator();n.hasNext();){var i=n.next();i.isIncludedSet()||(i.updateIncluded(),i.isIncludedSet()||(e=!0))}}while(e)},e(Hr.prototype,{filter:function(t){t instanceof Nt&&this.p.add(t)},interfaces_:function(){return[k]},getClass:function(){return Hr}}),Wr.LineStringAdder=Hr;var Ss=Object.freeze({Polygonizer:Wr});e(Jr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},computeProperIntersectionIM:f
|
||
|
;return p.selfMultiply(h).selfAdd(d.selfMultiply(f)).selfAdd(g.selfMultiply(c)).doubleValue()>0},Mo.checkRobustInCircle=function(t,e,n,i){var r=Mo.isInCircleNonRobust(t,e,n,i),o=Mo.isInCircleDDSlow(t,e,n,i),s=Mo.isInCircleCC(t,e,n,i),a=Ii.circumcentre(t,e,n);D.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===o&&r===s||(D.out.println("inCircle robustness failure (double result = "+r+", DD result = "+o+", CC result = "+s+")"),D.out.println(re.toLineString(new qt([t,e,n,i]))),D.out.println("Circumcentre = "+re.toPoint(a)+" radius = "+t.distance(a)),D.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)),D.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),D.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),D.out.println())},Mo.isInCircleDDFast=function(t,e,n,i){var r=O.sqr(t.x).selfAdd(O.sqr(t.y)).selfMultiply(Mo.triAreaDDFast(e,n,i)),o=O.sqr(e.x).selfAdd(O.sqr(e.y)).selfMultiply(Mo.triAreaDDFast(t,n,i)),s=O.sqr(n.x).selfAdd(O.sqr(n.y)).selfMultiply(Mo.triAreaDDFast(t,e,i)),a=O.sqr(i.x).selfAdd(O.sqr(i.y)).selfMultiply(Mo.triAreaDDFast(t,e,n));return r.selfSubtract(o).selfAdd(s).selfSubtract(a).doubleValue()>0},Mo.isInCircleCC=function(t,e,n,i){var r=Ii.circumcentre(t,e,n),o=t.distance(r);return i.distance(r)-o<=0},Mo.isInCircleNormalized=function(t,e,n,i){var r=t.x-i.x,o=t.y-i.y,s=e.x-i.x,a=e.y-i.y,u=n.x-i.x,l=n.y-i.y;return(r*r+o*o)*(s*l-u*a)+(s*s+a*a)*(u*o-r*l)+(u*u+l*l)*(r*a-s*o)>0},Mo.isInCircleDDSlow=function(t,e,n,i){var r=O.valueOf(i.x),o=O.valueOf(i.y),s=O.valueOf(t.x),a=O.valueOf(t.y),u=O.valueOf(e.x),l=O.valueOf(e.y),c=O.valueOf(n.x),h=O.valueOf(n.y),f=s.multiply(s).add(a.multiply(a)).multiply(Mo.triAreaDDSlow(u,l,c,h,r,o)),p=u.multiply(u).add(l.multiply(l)).multiply(Mo.triAreaDDSlow(s,a,c,h,r,o)),d=c.multiply(c).add(h.multiply(h)).multiply(Mo.triAreaDDSlow(s,a,u,l,r,o)),g=r.multiply(r).add(o.multiply(o)).multiply(Mo.triAreaDDSlow(s,a,u,l,c,h));return f.subtract(p).add(d).subtract(g).doubleValue()>0},Mo.isInCircleNonRobust=function(t,e,n,i){return(t.x*t.x+t.y*t.y)*Mo.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*Mo.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*Mo.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*Mo.triArea(t,e,n)>0},Mo.isInCircleRobust=function(t,e,n,i){return Mo.isInCircleNormalized(t,e,n,i)},Mo.triAreaDDSlow=function(t,e,n,i,r,o){return n.subtract(t).multiply(o.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},Mo.triAreaDDFast=function(t,e,n){var i=O.valueOf(e.x).selfSubtract(t.x).selfMultiply(O.valueOf(n.y).selfSubtract(t.y)),r=O.valueOf(e.y).selfSubtract(t.y).selfMultiply(O.valueOf(n.x).selfSubtract(t.x));return i.selfSubtract(r)},e(Lo.prototype,{circleCenter:function(t,e){var n=new Lo(this.getX(),this.getY()),i=this.bisector(n,t),r=this.bisector(t,e),o=new F(i,r),s=null;try{s=new Lo(o.getX(),o.getY())}catch(i){if(!(i instanceof C))throw i;D.err.println("a: "+n+" b: "+t+" c: "+e),D.err.println(i)}return s},dot:function(t){return this.p.x*t.getX()+this.p.y*t.getY()},magn:function(){return Math.sqrt(this.p.x*this.p.x+this.p.y*this.p.y)},getZ:function(){return this.p.z},bisector:function(t,e){var n=e.getX()-t.getX(),i=e.getY()-t.getY();return new F(new F(t.getX()+n/2,t.getY()+i/2,1),new F(t.getX()-i+n/2,t.getY()+n+i/2,1))},equals:function(){if(1===arguments.length){var t=arguments[0];return this.p.x===t.getX()&&this.p.y===t.getY()}if(2===arguments.length){var e=arguments[0],n=arguments[1];return this.p.distance(e.getCoordinate())<n}},getCoordinate:function(){return this.p},isInCircle:function(t,e,n){return Mo.isInCircleRobust(t.p,e.p,n.p,this.p)},interpolateZValue:function(t,e,n){var i=t.getX(),r=t.getY(),o=e.getX()-i,s=n.getX()-i,a=e.getY()-r,u=n.getY()-r,l=o*u-s*a,c=this.getX()-i,h=this.getY()-r,f=(u*c-s*h)/l,p=(-a*c+o*h)/l;return t.getZ()+f*(e.getZ()-t.getZ())+p*(n.getZ()-t.getZ())},midPoint:function(t){return new Lo((this.p.x+t.getX())/2,(this.p.y+t.getY())/2,(this.p.z+t.getZ())/2)},rightOf:function(t){return this.isCCW(t.dest(),t.orig())},isCCW:function(t,e){return(t.p.x-this.p.x)*(e.p.y-this.p.y)-(t.p.y-this.p.
|
||
|
isSimple:function(){return new Ui(this).isSimple()},isWithinDistance:function(t,e){return!(this.getEnvelopeInternal().distance(t.getEnvelopeInternal())>e)&&mr.isWithinDistance(this,t,e)},distance:function(t){return mr.distance(this,t)},isEquivalentClass:function(t){return this.getClass()===t.getClass()}});t.version="1.3.0 (6e65adb)",t.algorithm=cs,t.densify=hs,t.dissolve=fs,t.geom=us,t.geomgraph=ps,t.index=vs,t.io=Es,t.noding=ws,t.operation=Ps,t.precision=Ts,t.simplify=Os,t.triangulate=As,Object.defineProperty(t,"__esModule",{value:!0})})},{}],131:[function(t,e,n){function i(t,e){switch(t.geometry?t.geometry.type:t.type){case"Point":return r(u(t),e);case"Polygon":var n=[];l(t,function(t){n.push(t)});var c,h,f,p,d,g,v,y,m=a(t,e),x=m.geometry.coordinates,E=0,w=0,b=0,I=n.map(function(t){return[t[0]-x[0],t[1]-x[1]]});for(c=0;c<n.length-1;c++)h=I[c],p=h[0],g=h[1],f=I[c+1],d=f[0],v=f[1],y=p*v-d*g,b+=y,E+=(p+d)*y,w+=(g+v)*y;if(0===b)return m;var N=.5*b,C=1/(6*N);return r([x[0]+C*E,x[1]+C*w],e);default:var S=o(s(t));return S?i(S,e):a(t,e)}}var r=t("@turf/helpers").point,o=t("@turf/convex"),s=t("@turf/explode"),a=t("@turf/centroid"),u=t("@turf/invariant").getCoord,l=t("@turf/meta").coordEach;e.exports=i},{"@turf/centroid":132,"@turf/convex":135,"@turf/explode":154,"@turf/helpers":157,"@turf/invariant":158,"@turf/meta":159}],132:[function(t,e,n){var i=t("@turf/meta").coordEach,r=t("@turf/helpers").point;e.exports=function(t,e){var n=0,o=0,s=0;return i(t,function(t){n+=t[0],o+=t[1],s++},!0),r([n/s,o/s],e)}},{"@turf/helpers":133,"@turf/meta":134}],133:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],134:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],135:[function(t,e,n){var i=t("@turf/meta").coordEach,r=t("convex-hull"),o=t("@turf/helpers").polygon;e.exports=function(t){var e=[];i(t,function(t){e.push([t[0],t[1]])});var n=r(e);if(n.length>=3){for(var s=[],a=0;a<n.length;a++)s.push(e[n[a][0]]);return s.push(e[n[n.length-1][1]]),o([s])}}},{"@turf/helpers":136,"@turf/meta":137,"convex-hull":140}],136:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],137:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],138:[function(t,e,n){"use strict";function i(t,e){for(var n=new Array(e+1),i=0;i<t.length;++i)n[i]=t[i];for(var i=0;i<=t.length;++i){for(var r=t.length;r<=e;++r){for(var s=new Array(e),a=0;a<e;++a)s[a]=Math.pow(r+1-i,a);n[r]=s}if(o.apply(void 0,n))return!0}return!1}function r(t){var e=t.length;if(0===e)return[];if(1===e)return[0];for(var n=t[0].length,r=[t[0]],o=[0],s=1;s<e;++s)if(r.push(t[s]),i(r,n)){if(o.push(s),o.length===n+1)return o}else r.pop();return o}e.exports=r;var o=t("robust-orientation")},{"robust-orientation":146}],139:[function(t,e,n){"use strict";"use restrict";function i(t){var e=32;return t&=-t,t&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}n.INT_BITS=32,n.INT_MAX=2147483647,n.INT_MIN=-1<<31,n.sign=function(t){return(t>0)-(t<0)},n.abs=function(t){var e=t>>31;return(t^e)-e},n.min=function(t,e){return e^(t^e)&-(t<e)},n.max=function(t,e){return t^(t^e)&-(t<e)},n.isPow2=function(t){return!(t&t-1||!t)},n.log2=function(t){var e,n;return e=(t>65535)<<4,t>>>=e,n=(t>255)<<3,t>>>=n,e|=n,n=(t>15)<<2,t>>>=n,e|=n,n=(t>3)<<1,t>>>=n,(e|=n)|t>>1},n.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},n.popCount=function(t){return t-=t>>>1&1431655765,16843009*((t=(858993459&t)+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},n.countTrailingZeros=i,n.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},n.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},n.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var r=new Array(256);!function(t){for(var e=0;e<256;++e){var n=e,i=e,r=7;for(n>>>=1;n;n>>>=1)i<<=1,i|=1&n,--r;t[e]=i<<r&255}}(r),n.reverse=function(t){return r[255&t]<<24|r[t>>>8&255]<<16|r[t>>>16&255]<<8|r[t>>>24&255]},n.interleave2=function(t,e){return t&=65535,t=16
|
||
|
this._priorities.push(e)):(this._queue.splice(n,0,t),this._priorities.splice(n,0,e))},void 0!==e&&e.exports&&(e.exports=i)},{}],188:[function(t,e,n){void 0!==e&&e.exports&&(e.exports={DBSCAN:t("./DBSCAN.js"),KMEANS:t("./KMEANS.js"),OPTICS:t("./OPTICS.js"),PriorityQueue:t("./PriorityQueue.js")})},{"./DBSCAN.js":184,"./KMEANS.js":185,"./OPTICS.js":186,"./PriorityQueue.js":187}],189:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/clone"),o=t("./skmeans"),s=t("@turf/invariant"),a=i.coordAll,u=i.featureEach,l=s.collectionOf;e.exports=function(t,e,n){l(t,"Point","Input must contain Points");var i=t.features.length;e=e||Math.round(Math.sqrt(i/2)),e>i&&(e=i),!1!==n&&void 0!==n||(t=r(t,!0));var s=a(t),c=s.slice(0,e),h=o(s,e,c),f={};return h.centroids.forEach(function(t,e){f[e]=t}),u(t,function(t,e){var n=h.idxs[e];t.properties.cluster=n,t.properties.centroid=f[n]}),t}},{"./skmeans":193,"@turf/clone":190,"@turf/invariant":191,"@turf/meta":192}],190:[function(t,e,n){arguments[4][175][0].apply(n,arguments)},{dup:175}],191:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],192:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],193:[function(t,e,n){function i(t,e,n){for(var i=t.length,r=0,o=0;o<i;o++){var s=(t[o]||0)-(e[o]||0);r+=s*s}return n?Math.sqrt(r):r}function r(t,e,n){var i=Math.abs(t-e);return n?i:i*i}function o(t,e){for(var n={},i=[],r=e<<2,o=t.length,s=t[0].length>0;i.length<e&&r-- >0;){var a=t[Math.floor(Math.random()*o)],u=s?a.join("_"):""+a;n[u]||(n[u]=!0,i.push(a))}if(i.length<e)throw new Error("Error initializating clusters");return i}function s(t,e){var n=t[0].length?i:r,o=[],s=t.length,a=t[0].length>0,u={},l=t[Math.floor(Math.random()*s)],c=a?l.join("_"):""+l;for(o.push(l),u[c]=!0;o.length<e;){for(var h=[],f=o.length,p=0,d=[],g=0;g<s;g++){for(var v=1/0,y=0;y<f;y++){var m=n(t[g],o[y]);m<=v&&(v=m)}h[g]=v}for(var x=0;x<s;x++)p+=h[x];for(var E=0;E<s;E++)d[E]={i:E,v:t[E],pr:h[E]/p,cs:0};d.sort(function(t,e){return t.pr-e.pr}),d[0].cs=d[0].pr;for(var w=1;w<s;w++)d[w].cs=d[w-1].cs+d[w].pr;for(var b=Math.random(),I=0;I<s-1&&d[I++].cs<b;);o.push(d[I-1].v)}return o}function a(t,e,n){n=n||[];for(var i=0;i<t;i++)n[i]=e;return n}function u(t,e,n,r){var u=[],c=[],h=[],f=[],p=!1,d=r||l,g=t.length,v=t[0].length,y=v>0;if(n)u="kmrand"==n?o(t,e):"kmpp"==n?s(t,e):n;else for(var m={};u.length<e;){var x=Math.floor(Math.random()*g);m[x]||(m[x]=!0,u.push(t[x]))}do{for(var E=0;E<g;E++){for(var w=1/0,b=0,I=0;I<e;I++){var f=y?i(t[E],u[I]):Math.abs(t[E]-u[I]);f<=w&&(w=f,b=I)}h[E]=b}for(var N=[],C=[],c=[],S=0;S<e;S++)N[S]=0,C[S]=y?a(v,0,C[S]):0,c[S]=u[S];if(y){for(var M=0;M<e;M++)u[M]=[];for(var L=0;L<g;L++){for(var R=h[L],P=C[R],T=t[L],O=0;O<v;O++)P[O]+=T[O];N[R]++}p=!0;for(var _=0;_<e;_++){for(var A=u[_],D=C[_],F=c[_],q=N[_],k=0;k<v;k++)A[k]=D[k]/q||0;if(p)for(var G=0;G<v;G++)if(F[G]!=A[G]){p=!1;break}}}else{for(var j=0;j<g;j++){var B=h[j];C[B]+=t[j],N[B]++}for(var z=0;z<e;z++)u[z]=C[z]/N[z]||0;p=!0;for(var V=0;V<e;V++)if(c[V]!=u[V]){p=!1;break}}p=p||--d<=0}while(!p);return{it:l-d,k:e,idxs:h,centroids:u}}var l=1e4;e.exports=u},{}],194:[function(t,e,n){function i(t,e){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("filter is required");var n=[];return c(t,function(t){a(t.properties,e)&&n.push(t)}),h(n)}function r(t,e,n){if(!t)throw new Error("geojson is required");if("FeatureCollection"!==t.type)throw new Error("geojson must be a FeatureCollection");if(void 0===e||null===e)throw new Error("property is required");for(var i=s(t,e),r=Object.keys(i),o=0;o<r.length;o++){for(var a=r[o],u=i[a],l=[],c=0;c<u.length;c++)l.push(t.features[u[c]]);n(h(l),a,o)}}function o(t,e,n,i){var o=i;return r(t,e,function(t,e,r){o=0===r&&void 0===i?t:n(o,t,e,r)}),o}function s(t,e){var n={};return c(t,function(t,i){var r=t.properties||{};if(r.hasOwnProperty(e)){var o=r[e];n.hasOwnProperty(o)?n[o].push(i):n[o]=[i]}}),n}function a(t,e){if(void 0===t)return!1;var n=typeof e;if("number"===n||"string"===n)return t.hasOwnP
|
||
|
296:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],297:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":298,dup:34}],298:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],299:[function(t,e,n){var i=t("@turf/meta"),r=t("@turf/bbox"),o=t("@turf/hex-grid"),s=t("@turf/point-grid"),a=t("@turf/distance"),u=t("@turf/centroid"),l=t("@turf/invariant"),c=t("@turf/square-grid"),h=t("@turf/triangle-grid"),f=i.featureEach,p=l.collectionOf;e.exports=function(t,e,n,i,l,d){if(!t)throw new Error("points is required");if(p(t,"Point","input must contain Points"),!e)throw new Error("cellSize is required");if(void 0!==d&&"number"!=typeof d)throw new Error("weight must be a number");i=i||"elevation",n=n||"square",d=d||1;var g,v=r(t);switch(n){case"point":case"points":g=s(v,e,l,!0);break;case"square":case"squares":g=c(v,e,l);break;case"hex":case"hexes":g=o(v,e,l);break;case"triangle":case"triangles":g=h(v,e,l);break;default:throw new Error("invalid gridType")}return f(g,function(e){var r=0,o=0;f(t,function(t){var s,c="point"===n?e:u(e),h=a(c,t,l);if(void 0!==i&&(s=t.properties[i]),void 0===s&&(s=t.geometry.coordinates[2]),void 0===s)throw new Error("zValue is missing");0===h&&(r=s);var f=1/Math.pow(h,d);o+=f,r+=f*s}),e.properties[i]=r/o}),g}},{"@turf/bbox":300,"@turf/centroid":302,"@turf/distance":305,"@turf/hex-grid":308,"@turf/invariant":313,"@turf/meta":314,"@turf/point-grid":315,"@turf/square-grid":325,"@turf/triangle-grid":332}],300:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":301,dup:22}],301:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],302:[function(t,e,n){arguments[4][132][0].apply(n,arguments)},{"@turf/helpers":303,"@turf/meta":304,dup:132}],303:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],304:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],305:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":306,"@turf/invariant":307,dup:8}],306:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],307:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],308:[function(t,e,n){arguments[4][276][0].apply(n,arguments)},{"@turf/distance":309,"@turf/helpers":312,dup:276}],309:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":310,"@turf/invariant":311,dup:8}],310:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],311:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],312:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],313:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],314:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],315:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/bbox"),o=t("@turf/helpers"),s=t("@turf/inside"),a=t("@turf/invariant"),u=a.getGeomType,l=o.point,c=o.featureCollection;e.exports=function(t,e,n,o,a){var h=[],f=t;if(!t)throw new Error("bbox is required");if(Array.isArray(t)||(t=r(t)),4!==t.length)throw new Error("bbox must contain 4 numbers");var p=t[0],d=t[1],g=t[2],v=t[3],y=e/i(l([p,d]),l([g,d]),n),m=y*(g-p),x=e/i(l([p,d]),l([p,v]),n),E=x*(v-d);if(!1!==o)var w=g-p,b=v-d,I=Math.floor(w/m),N=Math.floor(b/E),C=(w-I*m)/2,S=(b-N*E)/2;var M=!Array.isArray(f)&&("Polygon"===u(f)||"MultiPolygon"===u(f)),L=p;for(!1!==o&&(L+=C);L<=g;){var R=d;for(!1!==o&&(R+=S);R<=v;){var P=l([L,R]);!0===a&&M?s(P,f)&&h.push(P):h.push(P),R+=E}L+=m}return c(h)}},{"@turf/bbox":316,"@turf/distance":318,"@turf/helpers":321,"@turf/inside":322,"@turf/invariant":324}],316:[function(t,e,n){arguments[4][22][0].apply(n,arguments)},{"@turf/meta":317,dup:22}],317:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],318:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":319,"@turf/invariant":320,dup:8}],319:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],320:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],321:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],322:[function(t,e,n){arguments[4][34][0
|
||
|
topright:x,righttop:b,rightbottom:I,bottomright:w,bottomleft:E,leftbottom:C,lefttop:N,edges:S}}}}}return s}function r(t){for(var e=[],n=t.rows,i=t.cols,r=[],s=0;s<n;s++)for(var l=0;l<i;l++)if(void 0!==t.cells[s][l]&&t.cells[s][l].edges.length>0){var c=t.cells[s][l],h=a(c),f=null,p=l,d=s;null!==h&&r.push([h.p[0]+p,h.p[1]+d]);do{if(null===(f=u(t.cells[d][p],h.x,h.y,h.o)))break;if(r.push([f.p[0]+p,f.p[1]+d]),p+=f.x,d+=f.y,h=f,d<0||d>=n||p<0||p>=i||void 0===t.cells[d][p]){p-=f.x,d-=f.y;var g=o(t,p,d,f.x,f.y,f.o);if(null===g)break;g.path.forEach(function(t){r.push(t)}),p=g.i,d=g.j,h=g}}while(void 0!==t.cells[d][p]&&t.cells[d][p].edges.length>0);e.push(r),r=[],t.cells[s][l].edges.length>0&&l--}return e}function o(t,e,n,i,r,o){for(var s=t.cells[n][e],a=s.cval_real,u=e+i,l=n+r,c=[],h=!1;!h;){if(void 0===t.cells[l]||void 0===t.cells[l][u])if(l-=r,u-=i,s=t.cells[l][u],a=s.cval_real,-1===r)if(0===o)if(a&g)c.push([u,l]),i=-1,r=0,o=0;else{if(!(a&d)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+1,l]),i=1,r=0,o=0}else{if(!(a&g)){if(a&d){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u+s.bottomleft,l]),i=0,r=1,o=0,h=!0;break}c.push([u,l]),i=-1,r=0,o=0}else if(1===r)if(0===o){if(!(a&p)){if(a&f){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+s.topright,l+1]),i=0,r=-1,o=1,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}else c.push([u+1,l+1]),i=1,r=0,o=1;else if(-1===i)if(0===o){if(!(a&f)){if(a&g){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+s.lefttop]),i=1,r=0,o=1,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}else{if(!(a&f)){console.log("MarchingSquaresJS-isoBands: wtf");break}c.push([u,l+1]),i=0,r=1,o=0}else{if(1!==i){console.log("MarchingSquaresJS-isoBands: we came from nowhere!");break}if(0===o){if(!(a&d)){c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}else{if(!(a&d)){if(a&p){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1;break}c.push([u+1,l+s.rightbottom]),i=-1,r=0,o=0,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else if(s=t.cells[l][u],a=s.cval_real,-1===i)if(0===o)if(void 0!==t.cells[l-1]&&void 0!==t.cells[l-1][u])i=0,r=-1,o=1;else{if(!(a&g)){c.push([u+s.bottomright,l]),i=0,r=1,o=1,h=!0;break}c.push([u,l])}else{if(!(a&f)){console.log("MarchingSquaresJS-isoBands: found entry from top at "+u+","+l);break}console.log("MarchingSquaresJS-isoBands: proceeding in x-direction!")}else if(1===i){if(0===o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l+1]&&void 0!==t.cells[l+1][u])i=0,r=1,o=0;else{if(!(a&p)){c.push([u+s.topleft,l+1]),i=0,r=-1,o=0,h=!0;break}c.push([u+1,l+1]),i=1,r=0,o=1}}else if(-1===r){if(1!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u+1])i=1,r=0,o=1;else{if(!(a&d)){c.push([u+1,l+s.righttop]),i=-1,r=0,o=1,h=!0;break}c.push([u+1,l]),i=0,r=-1,o=1}}else{if(1!==r){console.log("MarchingSquaresJS-isoBands: where did we came from???");break}if(0!==o){console.log("MarchingSquaresJS-isoBands: wtf");break}if(void 0!==t.cells[l][u-1])i=-1,r=0,o=0;else{if(!(a&f)){c.push([u,l+s.leftbottom]),i=1,r=0,o=0,h=!0;break}c.push([u,l+1]),i=0,r=1,o=0}}if(u+=i,l+=r,u===e&&l===n)break}return{path:c,i:u,j:l,x:i,y:r,o:o}}function s(t,e){delete t.edges[e];for(var n=e+1;n<t.edges.length;n++)t.edges[n-1]=t.edges[n];t.edges.pop()}function a(t){if(t.edges.length>0){var e=t.edges[t.edges.length-1],n=t.cval_real;switch(e){case 0:return n&p?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 1:return n&d?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 2:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topleft,1],x:0,y:-1,o:0};case 3:return n&g?{p:[t.topleft,1],x:0,y:-1,o:0}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 4:return n&p?{p:[1,t.righttop],x:-1,y:0,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 5:return n&d?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[1,t.rightbottom],x:-1,y:0,o:0};case 6:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:[t.topright,1],x:0,y:-1,o:1};case 7:return n&g?{p:[t.topright,1],x:0,y:-1,o:1}:{p:[t.bottomleft,0],x:0,y:1,o:0};case 8:return n&d?{p:[t.bottomright,0],x:0,y:1,o:1}:{p:
|
||
|
},{"@turf/helpers":379,"@turf/line-distance":380,"@turf/line-slice-along":385,"@turf/meta":395}],379:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],380:[function(t,e,n){var i=t("@turf/distance"),r=t("@turf/meta").segmentReduce;e.exports=function(t,e){if(!t)throw new Error("geojson is required");return r(t,function(t,n){var r=n.geometry.coordinates;return t+i(r[0],r[1],e)},0)}},{"@turf/distance":381,"@turf/meta":384}],381:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":382,"@turf/invariant":383,dup:8}],382:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],383:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],384:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],385:[function(t,e,n){var i=t("@turf/bearing"),r=t("@turf/distance"),o=t("@turf/destination"),s=t("@turf/helpers").lineString;e.exports=function(t,e,n,a){var u,l=[];if("Feature"===t.type)u=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");u=t.coordinates}for(var c,h,f,p=0,d=0;d<u.length&&!(e>=p&&d===u.length-1);d++){if(p>e&&0===l.length){if(!(c=e-p))return l.push(u[d]),s(l);h=i(u[d],u[d-1])-180,f=o(u[d],c,h,a),l.push(f.geometry.coordinates)}if(p>=n)return(c=n-p)?(h=i(u[d],u[d-1])-180,f=o(u[d],c,h,a),l.push(f.geometry.coordinates),s(l)):(l.push(u[d]),s(l));if(p>=e&&l.push(u[d]),d===u.length-1)return s(l);p+=r(u[d],u[d+1],a)}return s(u[u.length-1])}},{"@turf/bearing":386,"@turf/destination":388,"@turf/distance":391,"@turf/helpers":394}],386:[function(t,e,n){arguments[4][3][0].apply(n,arguments)},{"@turf/invariant":387,dup:3}],387:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],388:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"@turf/helpers":389,"@turf/invariant":390,dup:5}],389:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],390:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],391:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":392,"@turf/invariant":393,dup:8}],392:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],393:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],394:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],395:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],396:[function(t,e,n){arguments[4][380][0].apply(n,arguments)},{"@turf/distance":397,"@turf/meta":400,dup:380}],397:[function(t,e,n){arguments[4][8][0].apply(n,arguments)},{"@turf/helpers":398,"@turf/invariant":399,dup:8}],398:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],399:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],400:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],401:[function(t,e,n){arguments[4][42][0].apply(n,arguments)},{"@turf/helpers":403,"@turf/invariant":404,"@turf/line-segment":405,"@turf/meta":409,dup:42,"geojson-rbush":410}],402:[function(t,e,n){arguments[4][43][0].apply(n,arguments)},{"@turf/meta":409,dup:43}],403:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],404:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],405:[function(t,e,n){arguments[4][46][0].apply(n,arguments)},{"@turf/helpers":406,"@turf/invariant":407,"@turf/meta":408,dup:46}],406:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],407:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],408:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],409:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],410:[function(t,e,n){arguments[4][51][0].apply(n,arguments)},{"@turf/bbox":402,"@turf/helpers":403,"@turf/meta":409,dup:51,rbush:412}],411:[function(t,e,n){arguments[4][52][0].apply(n,arguments)},{dup:52}],412:[function(t,e,n){arguments[4][53][0].apply(n,arguments)},{dup:53,quickselect:411}],413:[function(t,e,n){function i(t,e,n){var i=[],o=f(e,n),s=a(t),l=[];return s.forEach(function(t,e){if(e!==s.length-1){var n=r(t,s[e+1],o);if(i.push(n),e>0){var a=i[e-1],c=u(n,a);!1!==c&&(a[
|
||
|
611:[function(t,e,n){var i=t("@turf/helpers").polygon;e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],r=[t[2],t[3]],o=[t[2],t[1]];return i([[e,o,r,n,e]])}},{"@turf/helpers":614}],612:[function(t,e,n){var i=t("@turf/meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-1/0,-1/0];return i(t,function(t){e[0]>t[0]&&(e[0]=t[0]),e[1]>t[1]&&(e[1]=t[1]),e[2]<t[0]&&(e[2]=t[0]),e[3]<t[1]&&(e[3]=t[1])}),e}},{"@turf/meta":617}],613:[function(t,e,n){var i=t("@turf/bbox"),r=t("@turf/bbox-polygon");e.exports=function(t){return r(i(t))}},{"@turf/bbox":612,"@turf/bbox-polygon":611}],614:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],615:[function(t,e,n){function i(t,e,n){var i=!1;e[0][0]===e[e.length-1][0]&&e[0][1]===e[e.length-1][1]&&(e=e.slice(0,e.length-1));for(var r=0,o=e.length-1;r<e.length;o=r++){var s=e[r][0],a=e[r][1],u=e[o][0],l=e[o][1];if(t[1]*(s-u)+a*(u-t[0])+l*(t[0]-s)==0&&(s-t[0])*(u-t[0])<=0&&(a-t[1])*(l-t[1])<=0)return!n;a>t[1]!=l>t[1]&&t[0]<(u-s)*(t[1]-a)/(l-a)+s&&(i=!i)}return i}function r(t,e){return e[0]<=t[0]&&e[1]<=t[1]&&e[2]>=t[0]&&e[3]>=t[1]}var o=t("@turf/invariant"),s=o.getCoord,a=o.getCoords;e.exports=function(t,e,n){if(!t)throw new Error("point is required");if(!e)throw new Error("polygon is required");var o=s(t),u=a(e),l=e.geometry?e.geometry.type:e.type,c=e.bbox;if(c&&!1===r(o,c))return!1;"Polygon"===l&&(u=[u]);for(var h=0,f=!1;h<u.length&&!f;h++)if(i(o,u[h][0],n)){for(var p=!1,d=1;d<u[h].length&&!p;)i(o,u[h][d],!n)&&(p=!0),d++;p||(f=!0)}return f}},{"@turf/invariant":616}],616:[function(t,e,n){arguments[4][350][0].apply(n,arguments)},{dup:350}],617:[function(t,e,n){arguments[4][14][0].apply(n,arguments)},{dup:14}],618:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("@turf/helpers"),s=o.lineString,a=t("./util"),u=a.orientationIndex,l=function(){function t(e,n){i(this,t),this.from=e,this.to=n,this.next=void 0,this.label=void 0,this.symetric=void 0,this.ring=void 0,this.from.addOuterEdge(this),this.to.addInnerEdge(this)}return r(t,[{key:"getSymetric",value:function(){return this.symetric||(this.symetric=new t(this.to,this.from),this.symetric.symetric=this),this.symetric}}]),r(t,[{key:"deleteEdge",value:function(){this.from.removeOuterEdge(this),this.to.removeInnerEdge(this)}},{key:"isEqual",value:function(t){return this.from.id===t.from.id&&this.to.id===t.to.id}},{key:"toString",value:function(){return"Edge { "+this.from.id+" -> "+this.to.id+" }"}},{key:"toLineString",value:function(){return s([this.from.coordinates,this.to.coordinates])}},{key:"compareTo",value:function(t){return u(t.from.coordinates,t.to.coordinates,this.to.coordinates)}}]),t}();e.exports=l},{"./util":623,"@turf/helpers":614}],619:[function(t,e,n){"use strict";function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var r=function(){function t(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}return function(e,n,i){return n&&t(e.prototype,n),i&&t(e,i),e}}(),o=t("./util"),s=o.orientationIndex,a=o.envelopeIsEqual,u=o.envelopeContains,l=o.coordinatesEqual,c=t("@turf/helpers"),h=c.multiPoint,f=c.polygon,p=c.point,d=t("@turf/envelope"),g=t("@turf/inside"),v=function(){function t(){i(this,t),this.edges=[],this.polygon=void 0,this.envelope=void 0}return r(t,[{key:"push",value:function(t){this[this.edges.length]=t,this.edges.push(t),this.polygon=this.envelope=void 0}},{key:"get",value:function(t){return this.edges[t]}},{key:"forEach",value:function(t){this.edges.forEach(t)}},{key:"map",value:function(t){return this.edges.map(t)}},{key:"some",value:function(t){return this.edges.some(t)}},{key:"isValid",value:function(){return!0}},{key:"isHole",value:function(){var
|
||
|
g=Math.sign(s.cross(c).dot(h)),p=g>0?h:f;break;case"endpoint+endpoint":p=l.plus(c).plus(e.toVector()).plus(r.toVector()).dot(h)>0?h:f}return p.toLatLonS()},i.prototype.crossTrackDistanceTo=function(t,e,n){if(!(t instanceof i))throw new TypeError("pathStart is not LatLon object");var r=void 0===n?6371e3:Number(n),o=this.toVector();return((e instanceof i?t.toVector().cross(e.toVector()):t.greatCircle(Number(e))).angleTo(o)-Math.PI/2)*r},i.prototype.nearestPointOnSegment=function(t,e){var n=null;if(this.isBetween(t,e)){var i=this.toVector(),r=t.toVector(),o=e.toVector(),s=r.cross(o),a=i.cross(s);n=s.cross(a).toLatLonS()}else{n=this.distanceTo(t)<this.distanceTo(e)?t:e}return n},i.prototype.isBetween=function(t,e){var n=this.toVector(),i=t.toVector(),r=e.toVector(),o=n.minus(i),s=r.minus(i),a=n.minus(r),u=i.minus(r),l=o.dot(s),c=a.dot(u);return l>=0&&c>=0},i.prototype.enclosedBy=function(t){var e=t[0].equals(t[t.length-1]);e||t.push(t[0]);for(var n=t.length-1,i=this.toVector(),r=[],o=0;o<n;o++)r[o]=i.minus(t[o].toVector());r.push(r[0]);for(var s=0,o=0;o<n;o++)s+=r[o].angleTo(r[o+1],i);var a=Math.abs(s)>Math.PI;return e||t.pop(),a},i.areaOf=function(t,e){var n=void 0===e?6371e3:Number(e);t[0].equals(t[t.length-1])||t.push(t[0]);var i=t.length-1;console.log("n",i);for(var r=[],o=0;o<i;o++){var s=t[o].toVector(),a=t[o+1].toVector();r[o]=s.cross(a)}console.log("c",r.length,r),r.push(r[0]);for(var u=0,o=0;o<i;o++)console.log(o,(Math.PI-r[o].angleTo(r[o+1])).toDegrees()),u+=Math.PI-r[o].angleTo(r[o+1]);return console.log("Σθ",u.toDegrees(),((i-2)*Math.PI).toDegrees()),(u-(i-2)*Math.PI)*n*n},i.meanOf=function(t){for(var e=new r(0,0,0),n=0;n<t.length;n++)e=e.plus(t[n].toVector());return e.unit().toLatLonS()},i.prototype.equals=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");return this.lat==t.lat&&this.lon==t.lon},i.prototype.toString=function(t,e){return o.toLat(this.lat,t,e)+", "+o.toLon(this.lon,t,e)},void 0===Number.prototype.toRadians&&(Number.prototype.toRadians=function(){return this*Math.PI/180}),void 0===Number.prototype.toDegrees&&(Number.prototype.toDegrees=function(){return 180*this/Math.PI}),void 0===Math.sign&&(Math.sign=function(t){return t=+t,0===t||isNaN(t)?t:t>0?1:-1}),void 0!==e&&e.exports&&(e.exports=i,e.exports.Vector3d=r)},{"./dms.js":633,"./vector3d.js":642}],637:[function(t,e,n){"use strict";if(void 0!==e&&e.exports)var i=t("./latlon-ellipsoidal.js");i.prototype.distanceTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).distance}catch(t){return NaN}},i.prototype.initialBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).initialBearing}catch(t){return NaN}},i.prototype.finalBearingTo=function(t){if(!(t instanceof i))throw new TypeError("point is not LatLon object");try{return this.inverse(t).finalBearing}catch(t){return NaN}},i.prototype.destinationPoint=function(t,e){return this.direct(Number(t),Number(e)).point},i.prototype.finalBearingOn=function(t,e){return this.direct(Number(t),Number(e)).finalBearing},i.prototype.direct=function(t,e){var n,r,o,s,a,u=this.lat.toRadians(),l=this.lon.toRadians(),c=e.toRadians(),h=t,f=this.datum.ellipsoid.a,p=this.datum.ellipsoid.b,d=this.datum.ellipsoid.f,g=Math.sin(c),v=Math.cos(c),y=(1-d)*Math.tan(u),m=1/Math.sqrt(1+y*y),x=y*m,E=Math.atan2(y,v),w=m*g,b=1-w*w,I=b*(f*f-p*p)/(p*p),N=1+I/16384*(4096+I*(I*(320-175*I)-768)),C=I/1024*(256+I*(I*(74-47*I)-128)),S=h/(p*N),M=0;do{n=Math.cos(2*E+S),r=Math.sin(S),o=Math.cos(S),s=C*r*(n+C/4*(o*(2*n*n-1)-C/6*n*(4*r*r-3)*(4*n*n-3))),a=S,S=h/(p*N)+s}while(Math.abs(S-a)>1e-12&&++M<200);if(M>=200)throw new Error("Formula failed to converge");var L=x*r-m*o*v,R=Math.atan2(x*o+m*r*v,(1-d)*Math.sqrt(w*w+L*L)),P=Math.atan2(r*g,m*o-x*r*v),T=d/16*b*(4+d*(4-3*b)),O=P-(1-T)*d*w*(S+T*r*(n+T*o*(2*n*n-1))),_=(l+O+3*Math.PI)%(2*Math.PI)-Math.PI,A=Math.atan2(w,-L);return A=(A+2*Math.PI)%(2*Math.PI),{point:new i(R.toDegrees(),_.toDegrees(),this.datum),finalBearing:A.toDegrees()}},i.prototyp
|
||
|
function s(t,e,n,i,r,h,f){if(t){!f&&h&&g(t,i,r,h);for(var p,d,v=t;t.prev!==t.next;)if(p=t.prev,d=t.next,h?u(t,i,r,h):a(t))e.push(p.i/n),e.push(t.i/n),e.push(d.i/n),R(t),t=d.next,v=d.next;else if((t=d)===v){f?1===f?(t=l(t,e,n),s(t,e,n,i,r,h,2)):2===f&&c(t,e,n,i,r,h):s(o(t),e,n,i,r,h,1);break}}}function a(t){var e=t.prev,n=t,i=t.next;if(w(e,n,i)>=0)return!1;for(var r=t.next.next;r!==t.prev;){if(x(e.x,e.y,n.x,n.y,i.x,i.y,r.x,r.y)&&w(r.prev,r,r.next)>=0)return!1;r=r.next}return!0}function u(t,e,n,i){var r=t.prev,o=t,s=t.next;if(w(r,o,s)>=0)return!1;for(var a=r.x<o.x?r.x<s.x?r.x:s.x:o.x<s.x?o.x:s.x,u=r.y<o.y?r.y<s.y?r.y:s.y:o.y<s.y?o.y:s.y,l=r.x>o.x?r.x>s.x?r.x:s.x:o.x>s.x?o.x:s.x,c=r.y>o.y?r.y>s.y?r.y:s.y:o.y>s.y?o.y:s.y,h=y(a,u,e,n,i),f=y(l,c,e,n,i),p=t.nextZ;p&&p.z<=f;){if(p!==t.prev&&p!==t.next&&x(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.nextZ}for(p=t.prevZ;p&&p.z>=h;){if(p!==t.prev&&p!==t.next&&x(r.x,r.y,o.x,o.y,s.x,s.y,p.x,p.y)&&w(p.prev,p,p.next)>=0)return!1;p=p.prevZ}return!0}function l(t,e,n){var i=t;do{var r=i.prev,o=i.next.next;!b(r,o)&&I(r,i,i.next,o)&&C(r,o)&&C(o,r)&&(e.push(r.i/n),e.push(i.i/n),e.push(o.i/n),R(i),R(i.next),i=t=o),i=i.next}while(i!==t);return i}function c(t,e,n,i,r,a){var u=t;do{for(var l=u.next.next;l!==u.prev;){if(u.i!==l.i&&E(u,l)){var c=M(u,l);return u=o(u,u.next),c=o(c,c.next),s(u,e,n,i,r,a),void s(c,e,n,i,r,a)}l=l.next}u=u.next}while(u!==t)}function h(t,e,n,i){var s,a,u,l,c,h=[];for(s=0,a=e.length;s<a;s++)u=e[s]*i,l=s<a-1?e[s+1]*i:t.length,c=r(t,u,l,i,!1),c===c.next&&(c.steiner=!0),h.push(m(c));for(h.sort(f),s=0;s<h.length;s++)p(h[s],n),n=o(n,n.next);return n}function f(t,e){return t.x-e.x}function p(t,e){if(e=d(t,e)){var n=M(e,t);o(n,n.next)}}function d(t,e){var n,i=e,r=t.x,o=t.y,s=-1/0;do{if(o<=i.y&&o>=i.next.y){var a=i.x+(o-i.y)*(i.next.x-i.x)/(i.next.y-i.y);if(a<=r&&a>s){if(s=a,a===r){if(o===i.y)return i;if(o===i.next.y)return i.next}n=i.x<i.next.x?i:i.next}}i=i.next}while(i!==e);if(!n)return null;if(r===s)return n.prev;var u,l=n,c=n.x,h=n.y,f=1/0;for(i=n.next;i!==l;)r>=i.x&&i.x>=c&&x(o<h?r:s,o,c,h,o<h?s:r,o,i.x,i.y)&&((u=Math.abs(o-i.y)/(r-i.x))<f||u===f&&i.x>n.x)&&C(i,t)&&(n=i,f=u),i=i.next;return n}function g(t,e,n,i){var r=t;do{null===r.z&&(r.z=y(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next}while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,v(r)}function v(t){var e,n,i,r,o,s,a,u,l=1;do{for(n=t,t=null,o=null,s=0;n;){for(s++,i=n,a=0,e=0;e<l&&(a++,i=i.nextZ);e++);for(u=l;a>0||u>0&&i;)0===a?(r=i,i=i.nextZ,u--):0!==u&&i?n.z<=i.z?(r=n,n=n.nextZ,a--):(r=i,i=i.nextZ,u--):(r=n,n=n.nextZ,a--),o?o.nextZ=r:t=r,r.prevZ=o,o=r;n=i}o.nextZ=null,l*=2}while(s>1);return t}function y(t,e,n,i,r){return t=32767*(t-n)/r,e=32767*(e-i)/r,t=16711935&(t|t<<8),t=252645135&(t|t<<4),t=858993459&(t|t<<2),t=1431655765&(t|t<<1),e=16711935&(e|e<<8),e=252645135&(e|e<<4),e=858993459&(e|e<<2),e=1431655765&(e|e<<1),t|e<<1}function m(t){var e=t,n=t;do{e.x<n.x&&(n=e),e=e.next}while(e!==t);return n}function x(t,e,n,i,r,o,s,a){return(r-s)*(e-a)-(t-s)*(o-a)>=0&&(t-s)*(i-a)-(n-s)*(e-a)>=0&&(n-s)*(o-a)-(r-s)*(i-a)>=0}function E(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!N(t,e)&&C(t,e)&&C(e,t)&&S(t,e)}function w(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function b(t,e){return t.x===e.x&&t.y===e.y}function I(t,e,n,i){return!!(b(t,e)&&b(n,i)||b(t,i)&&b(n,e))||w(t,e,n)>0!=w(t,e,i)>0&&w(n,i,t)>0!=w(n,i,e)>0}function N(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&&I(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function C(t,e){return w(t.prev,t,t.next)<0?w(t,e,t.next)>=0&&w(t,t.prev,e)>=0:w(t,e,t.prev)<0||w(t,t.next,e)<0}function S(t,e){var n=t,i=!1,r=(t.x+e.x)/2,o=(t.y+e.y)/2;do{n.y>o!=n.next.y>o&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next}while(n!==t);return i}function M(t,e){var n=new P(t.i,t.x,t.y),i=new P(e.i,e.x,e.y),r=t.next,o=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function L(t,e,n,i){var r=new P(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r
|
||
|
;A<w?M[A].nxtIsectAlongRingAndEdge2=S[x][L][T].nxtIsectAlongEdgeIn:o(M[A].ringAndEdge1,S[x][L][T].ringAndEdgeIn)?M[A].nxtIsectAlongRingAndEdge1=S[x][L][T].nxtIsectAlongEdgeIn:M[A].nxtIsectAlongRingAndEdge2=S[x][L][T].nxtIsectAlongEdgeIn}f("Porting nextIsect to isectList");for(var D=[],x=0,L=0;L<y;L++){for(var F=x,T=0;T<t.geometry.coordinates[L].length-1;T++)M[x].coord[0]<M[F].coord[0]&&(F=x),x++;for(var q=M[F].nxtIsectAlongRingAndEdge2,T=0;T<M.length;T++)if(M[T].nxtIsectAlongRingAndEdge1==F||M[T].nxtIsectAlongRingAndEdge2==F){var k=T;break}var G=i([M[k].coord,M[F].coord,M[q].coord],!0)?1:-1;D.push({isect:F,parent:-1,winding:G})}D.sort(function(t,e){return M[t.isect].coord>M[e.isect].coord?-1:1}),p("Initial state of the queue: "+JSON.stringify(D)),f("Setting up queue");for(var N=[];D.length>0;){var j=D.pop(),B=j.isect,z=j.parent,V=j.winding,X=N.length,Y=[M[B].coord];p("# Starting output ring number "+N.length+" with winding "+V+" from intersection "+B),B<w&&p("This is a ring-vertex-intersections, which means this output ring does not touch existing output rings");var U=B;if(M[B].ringAndEdge1Walkable)var W=M[B].ringAndEdge1,H=M[B].nxtIsectAlongRingAndEdge1;else var W=M[B].ringAndEdge2,H=M[B].nxtIsectAlongRingAndEdge2;for(;!o(M[B].coord,M[H].coord);){p("Walking from intersection "+U+" to "+H+" over ring "+W[0]+" and edge "+W[1]),Y.push(M[H].coord),p("Adding intersection "+H+" to current output ring");for(var J=void 0,x=0;x<D.length;x++)if(D[x].isect==H){J=x;break}if(void 0!=J&&(p("Removing intersection "+H+" from queue"),D.splice(J,1)),o(W,M[H].ringAndEdge1)){if(W=M[H].ringAndEdge2,M[H].ringAndEdge2Walkable=!1,M[H].ringAndEdge1Walkable){p("Adding intersection "+H+" to queue");var Z={isect:H};i([M[U].coord,M[H].coord,M[M[H].nxtIsectAlongRingAndEdge2].coord],1==V)?(Z.parent=z,Z.winding=-V):(Z.parent=X,Z.winding=V),D.push(Z)}U=H,H=M[H].nxtIsectAlongRingAndEdge2}else{if(W=M[H].ringAndEdge1,M[H].ringAndEdge1Walkable=!1,M[H].ringAndEdge2Walkable){p("Adding intersection "+H+" to queue");var Z={isect:H};i([M[U].coord,M[H].coord,M[M[H].nxtIsectAlongRingAndEdge1].coord],1==V)?(Z.parent=z,Z.winding=-V):(Z.parent=X,Z.winding=V),D.push(Z)}U=H,H=M[H].nxtIsectAlongRingAndEdge1}p("Current state of the queue: "+JSON.stringify(D))}p("Walking from intersection "+U+" to "+H+" over ring "+W[0]+" and edge "+W[1]+" and closing ring"),Y.push(M[H].coord),N.push(u.polygon([Y],{index:X,parent:z,winding:V,netWinding:void 0}))}var C=u.featureCollection(N);return f("Walking"),e(),f("Determining parents"),n(),f("Setting winding number"),p("# Total of "+C.features.length+" rings"),C};var d=function(t,e,n,i,r){this.coord=t,this.param=e,this.ringAndEdgeIn=n,this.ringAndEdgeOut=i,this.nxtIsectAlongEdgeIn=r},g=function(t,e,n,i,r,o,s){this.coord=t,this.ringAndEdge1=e,this.ringAndEdge2=n,this.nxtIsectAlongRingAndEdge1=i,this.nxtIsectAlongRingAndEdge2=r,this.ringAndEdge1Walkable=o,this.ringAndEdge2Walkable=s};Number.prototype.modulo=function(t){return(this%t+t)%t}},{"@turf/area":833,"@turf/helpers":837,"@turf/inside":838,debug:841,"geojson-polygon-self-intersections":843,rbush:846}],848:[function(t,e,n){arguments[4][15][0].apply(n,arguments)},{dup:15}],849:[function(t,e,n){var i=t("@turf/inside"),r=t("@turf/helpers").featureCollection;e.exports=function(t,e){for(var n=r([]),o=0;o<e.features.length;o++)for(var s=0;s<t.features.length;s++){var a=i(t.features[s],e.features[o]);a&&n.features.push(t.features[s])}return n}},{"@turf/helpers":850,"@turf/inside":851}],850:[function(t,e,n){arguments[4][6][0].apply(n,arguments)},{dup:6}],851:[function(t,e,n){arguments[4][34][0].apply(n,arguments)},{"@turf/invariant":852,dup:34}],852:[function(t,e,n){arguments[4][4][0].apply(n,arguments)},{dup:4}],853:[function(t,e,n){function i(){if(!a){a=!0;for(var t,e=s.length;e;){t=s,s=[];for(var n=-1;++n<e;)t[n]();e=s.length}a=!1}}function r(){}var o=e.exports={},s=[],a=!1;o.nextTick=function(t){s.push(t),a||setTimeout(i,0)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=r,o.addListener=r,o.once=r,o.off=r,o.removeListener=r,o.removeAllListeners=r,o.e
|