turf
Version:
a JavaScript library for performing geospatial operations with GeoJSON
2 lines • 527 kB
JavaScript
!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 e(t,n,r){function i(o,a){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!a&&u)return u(o,!0);if(s)return s(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[o]={exports:{}};t[o][0].call(c.exports,function(e){var n=t[o][1][e];return i(n?n:e)},c,c.exports,e,t,n,r)}return n[o].exports}for(var s="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(t,e,n){var r=t("turf-distance"),i=t("turf-helpers").point,s=t("turf-bearing"),o=t("turf-destination");e.exports=function(t,e,n){var a;if("Feature"===t.type)a=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");a=t.coordinates}for(var u=0,l=0;l<a.length&&!(e>=u&&l===a.length-1);l++){if(u>=e){var c=e-u;if(c){var h=s(a[l],a[l-1])-180,g=o(a[l],c,h,n);return g}return i(a[l])}u+=r(a[l],a[l+1],n)}return i(a[a.length-1])}},{"turf-bearing":2,"turf-destination":3,"turf-distance":4,"turf-helpers":5}],2:[function(t,e,n){e.exports=t("/Users/tmcw/src/turf/packages/turf-bearing")},{"/Users/tmcw/src/turf/packages/turf-bearing":13}],3:[function(t,e,n){e.exports=t("/Users/tmcw/src/turf/packages/turf-destination")},{"/Users/tmcw/src/turf/packages/turf-destination":55}],4:[function(t,e,n){e.exports=t("/Users/tmcw/src/turf/packages/turf-distance")},{"/Users/tmcw/src/turf/packages/turf-distance":60}],5:[function(t,e,n){e.exports=t("/Users/tmcw/src/turf/packages/turf-helpers")},{"/Users/tmcw/src/turf/packages/turf-helpers":71}],6:[function(t,e,n){function r(t){if("FeatureCollection"===t.type){for(var e=0,n=0;e<t.features.length;e++)t.features[e].geometry&&(n+=i(t.features[e].geometry));return n}return i("Feature"===t.type?t.geometry:t)}var i=t("geojson-area").geometry;e.exports=r},{"geojson-area":7}],7:[function(t,e,n){function r(t){var e,n=0;switch(t.type){case"Polygon":return s(t.coordinates);case"MultiPolygon":for(e=0;e<t.coordinates.length;e++)n+=s(t.coordinates[e]);return n;case"Point":case"MultiPoint":case"LineString":case"MultiLineString":return 0;case"GeometryCollection":for(e=0;e<t.geometries.length;e++)n+=r(t.geometries[e]);return n}}function s(t){var e=0;if(t&&t.length>0){e+=Math.abs(o(t[0]));for(var n=1;n<t.length;n++)e-=Math.abs(o(t[n]))}return e}function o(t){var e,n,r,s,o,l,c=0,h=t.length;if(h>2){for(i=0;i<h;i++)i===h-2?(s=h-2,o=h-1,l=0):i===h-1?(s=h-1,o=0,l=1):(s=i,o=i+1,l=i+2),e=t[s],n=t[o],r=t[l],c+=(a(r[0])-a(e[0]))*Math.sin(a(n[1]));c=c*u.RADIUS*u.RADIUS/2}return c}function a(t){return t*Math.PI/180}var u=t("wgs84");e.exports.geometry=r,e.exports.ring=o},{wgs84:8}],8:[function(t,e,n){e.exports.RADIUS=6378137,e.exports.FLATTENING=1/298.257223563,e.exports.POLAR_RADIUS=6356752.3142},{}],9:[function(t,e,n){var r=t("turf-helpers").polygon;e.exports=function(t){var e=[t[0],t[1]],n=[t[0],t[3]],i=[t[2],t[3]],s=[t[2],t[1]];return r([[e,s,i,n,e]])}},{"turf-helpers":10}],10:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"/Users/tmcw/src/turf/packages/turf-helpers":71,dup:5}],11:[function(t,e,n){var r=t("turf-meta").coordEach;e.exports=function(t){var e=[1/0,1/0,-(1/0),-(1/0)];return r(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":12}],12:[function(t,e,n){e.exports=t("/Users/tmcw/src/turf/packages/turf-meta")},{"/Users/tmcw/src/turf/packages/turf-meta":98}],13:[function(t,e,n){var r=t("turf-invariant").getCoord;e.exports=function(t,e){var n=Math.PI/180,i=180/Math.PI,s=r(t),o=r(e),a=n*s[0],u=n*o[0],l=n*s[1],c=n*o[1],h=Math.sin(u-a)*Math.cos(c),g=Math.cos(l)*Math.sin(c)-Math.sin(l)*Math.cos(c)*Math.cos(u-a),f=i*Math.atan2(h,g);return f}},{"turf-invariant":14}],14:[function(t,e,n){e.exports=t("/Users/tmcw/src/turf/packages/turf-invariant")},{"/Users/tmcw/src/turf/packages/turf-invariant":79}],15:[function(t,e,n){var r=t("turf-helpers").lineString,i=t("./spline.js");e.exports=function(t,e,n){var s=r([]);s.properties=t.properties;for(var o=new i({points:t.geometry.coordinates.map(function(t){return{x:t[0],y:t[1]}}),duration:e,sharpness:n}),a=0;a<o.duration;a+=10){var u=o.pos(a);Math.floor(a/100)%2===0&&s.geometry.coordinates.push([u.x,u.y])}return s}},{"./spline.js":17,"turf-helpers":16}],16:[function(t,e,n){arguments[4][5][0].apply(n,arguments)},{"/Users/tmcw/src/turf/packages/turf-helpers":71,dup:5}],17:[function(t,e,n){var r=function(t){this.points=t.points||[],this.duration=t.duration||1e4,this.sharpness=t.sharpness||.85,this.centers=[],this.controls=[],this.stepLength=t.stepLength||60,this.length=this.points.length,this.delay=0;for(var e=0;e<this.length;e++)this.points[e].z=this.points[e].z||0;for(var e=0;e<this.length-1;e++){var n=this.points[e],r=this.points[e+1];this.centers.push({x:(n.x+r.x)/2,y:(n.y+r.y)/2,z:(n.z+r.z)/2})}this.controls.push([this.points[0],this.points[0]]);for(var e=0;e<this.centers.length-1;e++){var n=this.centers[e],r=this.centers[e+1],i=this.points[e+1].x-(this.centers[e].x+this.centers[e+1].x)/2,s=this.points[e+1].y-(this.centers[e].y+this.centers[e+1].y)/2,o=this.points[e+1].z-(this.centers[e].y+this.centers[e+1].z)/2;this.controls.push([{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e].y+s),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e].z+o)},{x:(1-this.sharpness)*this.points[e+1].x+this.sharpness*(this.centers[e+1].x+i),y:(1-this.sharpness)*this.points[e+1].y+this.sharpness*(this.centers[e+1].y+s),z:(1-this.sharpness)*this.points[e+1].z+this.sharpness*(this.centers[e+1].z+o)}])}return this.controls.push([this.points[this.length-1],this.points[this.length-1]]),this.steps=this.cacheSteps(this.stepLength),this};r.prototype.cacheSteps=function(t){var e=[],n=this.pos(0);e.push(0);for(var r=0;r<this.duration;r+=10){var i=this.pos(r),s=Math.sqrt((i.x-n.x)*(i.x-n.x)+(i.y-n.y)*(i.y-n.y)+(i.z-n.z)*(i.z-n.z));s>t&&(e.push(r),n=i)}return e},r.prototype.vector=function(t){var e=this.pos(t+10),n=this.pos(t-10);return{angle:180*Math.atan2(e.y-n.y,e.x-n.x)/3.14,speed:Math.sqrt((n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y)+(n.z-e.z)*(n.z-e.z))}},r.prototype.pos=function(t){function e(t,e,n,r,i){var s=function(t){var e=t*t,n=e*t;return[n,3*e*(1-t),3*t*(1-t)*(1-t),(1-t)*(1-t)*(1-t)]},o=s(t),a={x:i.x*o[0]+r.x*o[1]+n.x*o[2]+e.x*o[3],y:i.y*o[0]+r.y*o[1]+n.y*o[2]+e.y*o[3],z:i.z*o[0]+r.z*o[1]+n.z*o[2]+e.z*o[3]};return a}var n=t-this.delay;0>n&&(n=0),n>this.duration&&(n=this.duration-1);var r=n/this.duration;if(r>=1)return this.points[this.length-1];var i=Math.floor((this.points.length-1)*r),s=(this.length-1)*r-i;return e(s,this.points[i],this.controls[i][1],this.controls[i+1][0],this.points[i+1])},e.exports=r},{}],18:[function(t,e,n){function r(t,e){var n=new o.io.GeoJSONReader,r=n.read(t.geometry),i=r.buffer(e),s=new o.io.GeoJSONWriter;return i=s.write(i),{type:"Feature",geometry:i,properties:{}}}var i=t("turf-helpers"),s=i.featureCollection,o=t("jsts"),a=t("geojson-normalize");e.exports=function(t,e,n){var o=i.distanceToDegrees(e,n),u=a(t),l=a(s(u.features.map(function(t){return r(t,o)})));return l.features.length>1?l:1===l.features.length?l.features[0]:void 0}},{"geojson-normalize":19,jsts:20,"turf-helpers":21}],19:[function(t,e,n){function r(t){if(!t||!t.type)return null;var e=i[t.type];return e?"geometry"===e?{type:"FeatureCollection",features:[{type:"Feature",properties:{},geometry:t}]}:"feature"===e?{type:"FeatureCollection",features:[t]}:"featurecollection"===e?t:void 0:null}e.exports=r;var i={Point:"geometry",MultiPoint:"geometry",LineString:"geometry",MultiLineString:"geometry",Polygon:"geometry",MultiPolygon:"geometry",GeometryCollection:"geometry",Feature:"feature",FeatureCollection:"featurecollection"}},{}],20:[function(e,n,r){!function(e,i){"object"==typeof r&&"undefined"!=typeof n?i(r):"function"==typeof t&&t.amd?t(["exports"],i):i(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 r(){}function i(){}function s(){}function o(){}function a(){}function u(){}function l(t){this.message=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 g(){}function f(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)f.call(this,0,0);else if(1===arguments.length){var t=arguments[0];f.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];f.call(this,e,n,f.NULL_ORDINATE)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],s=arguments[2];this.x=r,this.y=i,this.z=s}}function d(){if(this.dimensionsToTest=2,0===arguments.length)d.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new r("only 2 or 3 dimensions may be specified");this.dimensionsToTest=t}}function p(){}function m(){}function v(t){this.message=t||""}function y(){}function x(t){this.message=t||""}function E(t){this.message=t||""}function I(){this.array_=[],arguments[0]instanceof m&&this.addAll(arguments[0])}function N(){if(I.apply(this),0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.ensureCapacity(t.length),this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.ensureCapacity(e.length),this.add(e,n)}}function C(){if(this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,0===arguments.length)this.init();else if(1===arguments.length){if(arguments[0]instanceof f){var t=arguments[0];this.init(t.x,t.x,t.y,t.y)}else if(arguments[0]instanceof C){var e=arguments[0];this.init(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.init(n.x,r.x,n.y,r.y)}else if(4===arguments.length){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];this.init(i,s,o,a)}}function w(){}function S(){w.call(this,"Projective point not representable on the Cartesian plane.")}function L(){}function R(t,e){return t.interfaces_&&t.interfaces_().indexOf(e)>-1}function b(){}function T(t){this.str=t}function P(t){this.value=t}function O(){}function M(){if(this.hi=0,this.lo=0,0===arguments.length)this.init(0);else if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];this.init(t)}else if(arguments[0]instanceof M){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];M.call(this,M.parse(n))}}else if(2===arguments.length){var r=arguments[0],i=arguments[1];this.init(r,i)}}function _(){}function A(){}function D(){}function F(){if(this.x=null,this.y=null,this.w=null,0===arguments.length)this.x=0,this.y=0,this.w=1;else if(1===arguments.length){var t=arguments[0];this.x=t.x,this.y=t.y,this.w=1}else if(2===arguments.length){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var e=arguments[0],n=arguments[1];this.x=e,this.y=n,this.w=1}else if(arguments[0]instanceof F&&arguments[1]instanceof F){var r=arguments[0],i=arguments[1];this.x=r.y*i.w-i.y*r.w,this.y=i.x*r.w-r.x*i.w,this.w=r.x*i.y-i.x*r.y}else if(arguments[0]instanceof f&&arguments[1]instanceof f){var s=arguments[0],o=arguments[1];this.x=s.y-o.y,this.y=o.x-s.x,this.w=s.x*o.y-o.x*s.y}}else if(3===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2];this.x=a,this.y=u,this.w=l}else if(4===arguments.length){var c=arguments[0],h=arguments[1],g=arguments[2],d=arguments[3],p=c.y-h.y,m=h.x-c.x,v=c.x*h.y-h.x*c.y,y=g.y-d.y,x=d.x-g.x,E=g.x*d.y-d.x*g.y;this.x=m*E-x*v,this.y=y*v-p*E,this.w=p*x-y*m}}function G(){}function k(){}function U(){this.envelope=null,this.factory=null,this.SRID=null,this.userData=null;var t=arguments[0];this.factory=t,this.SRID=t.getSRID()}function q(){}function B(){}function z(){}function V(){}function Y(){}function X(){}function H(){}function W(){}function j(){}function Z(){}function J(){}function K(){}function Q(){this.array_=[],arguments[0]instanceof m&&this.addAll(arguments[0])}function $(t){return null==t?$s:t.color}function tt(t){return null==t?null:t.parent}function et(t,e){null!==t&&(t.color=e)}function nt(t){return null==t?null:t.left}function rt(t){return null==t?null:t.right}function it(){this.root_=null,this.size_=0}function st(){}function ot(){}function at(){this.array_=[],arguments[0]instanceof m&&this.addAll(arguments[0])}function ut(){}function lt(){}function ct(){}function ht(){}function gt(){this.geometries=null;var t=arguments[0],e=arguments[1];if(U.call(this,e),null===t&&(t=[]),U.hasNullElements(t))throw new r("geometries must not contain null elements");this.geometries=t}function ft(){var t=arguments[0],e=arguments[1];gt.call(this,t,e)}function dt(){if(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length){var t=arguments[0];dt.call(this,t,B.MOD2_BOUNDARY_RULE)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.geom=e,this.geomFact=e.getFactory(),this.bnRule=n}}function pt(){this.count=null}function mt(){}function vt(){}function yt(){}function xt(){}function Et(){}function It(){}function Nt(){}function Ct(){}function wt(){this.points=null;var t=arguments[0],e=arguments[1];U.call(this,e),this.init(t)}function St(){}function Lt(){this.coordinates=null;var t=arguments[0],e=arguments[1];U.call(this,e),this.init(t)}function Rt(){}function bt(){this.shell=null,this.holes=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(U.call(this,n),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),U.hasNullElements(e))throw new r("holes must not contain null elements");if(t.isEmpty()&&U.hasNonEmptyElements(e))throw new r("shell is empty but holes are not");this.shell=t,this.holes=e}function Tt(){var t=arguments[0],e=arguments[1];gt.call(this,t,e)}function Pt(){if(arguments[0]instanceof f&&arguments[1]instanceof re){var t=arguments[0],e=arguments[1];Pt.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if(R(arguments[0],A)&&arguments[1]instanceof re){var n=arguments[0],r=arguments[1];wt.call(this,n,r),this.validateConstruction()}}function Ot(){var t=arguments[0],e=arguments[1];gt.call(this,t,e)}function Mt(){if(this.factory=null,this.isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.factory=t}}function _t(){}function At(){}function Dt(){}function Ft(){}function Gt(){if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];Gt.call(this,t,3)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.coordinates=new Array(e).fill(null);for(var n=0;e>n;n++)this.coordinates[n]=new f}else if(R(arguments[0],A)){var r=arguments[0];if(null===r)return this.coordinates=new Array(0).fill(null),null;this.dimension=r.getDimension(),this.coordinates=new Array(r.size()).fill(null);for(var n=0;n<this.coordinates.length;n++)this.coordinates[n]=r.getCoordinateCopy(n)}}else if(2===arguments.length)if(arguments[0]instanceof Array&&Number.isInteger(arguments[1])){var i=arguments[0],s=arguments[1];this.coordinates=i,this.dimension=s,null===i&&(this.coordinates=new Array(0).fill(null))}else if(Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var o=arguments[0],a=arguments[1];this.coordinates=new Array(o).fill(null),this.dimension=a;for(var n=0;o>n;n++)this.coordinates[n]=new f}}function kt(){}function Ut(t,e){return t===e||t!==t&&e!==e}function qt(t,e){function n(t){return this&&this.constructor===n?(this._keys=[],this._values=[],this._itp=[],this.objectOnly=e,void(t&&Bt.call(this,t))):new n(t)}return e||ro(t,"size",{get:Qt}),t.constructor=n,n.prototype=t,n}function Bt(t){this.add?t.forEach(this.add,this):t.forEach(function(t){this.set(t[0],t[1])},this)}function zt(t){return this.has(t)&&(this._keys.splice(no,1),this._values.splice(no,1),this._itp.forEach(function(t){no<t[0]&&t[0]--})),no>-1}function Vt(t){return this.has(t)?this._values[no]:void 0}function Yt(t,e){if(this.objectOnly&&e!==Object(e))throw new TypeError("Invalid value used as weak collection key");if(e!==e||0===e)for(no=t.length;no--&&!Ut(t[no],e););else no=t.indexOf(e);return no>-1}function Xt(t){return Yt.call(this,this._keys,t)}function Ht(t,e){return this.has(t)?this._values[no]=e:this._values[this._keys.push(t)-1]=e,this}function Wt(){(this._keys||0).length=this._values.length=0}function jt(){return Kt(this._itp,this._keys)}function Zt(){return Kt(this._itp,this._values)}function Jt(){return Kt(this._itp,this._keys,this._values)}function Kt(t,e,n){var r=[0],i=!1;return t.push(r),{next:function(){var s,o=r[0];return!i&&o<e.length?(s=n?[e[o],n[o]]:e[o],r[0]++):(i=!0,t.splice(t.indexOf(r),1)),{done:i,value:s}}}}function Qt(){return this._values.length}function $t(t,e){for(var n=this.entries();;){var r=n.next();if(r.done)break;t.call(e,r.value[1],r.value[0],this)}}function te(){this.map_=new so}function ee(){if(this.modelType=null,this.scale=null,0===arguments.length)this.modelType=ee.FLOATING;else if(1===arguments.length)if(arguments[0]instanceof ne){var t=arguments[0];this.modelType=t,t===ee.FIXED&&this.setScale(1)}else if("number"==typeof arguments[0]){var e=arguments[0];this.modelType=ee.FIXED,this.setScale(e)}else if(arguments[0]instanceof ee){var n=arguments[0];this.modelType=n.modelType,this.scale=n.scale}}function ne(){this.name=null;var t=arguments[0];this.name=t,ne.nameToTypeMap.put(t,this)}function re(){if(this.precisionModel=null,this.coordinateSequenceFactory=null,this.SRID=null,0===arguments.length)re.call(this,new ee,0);else if(1===arguments.length){if(R(arguments[0],G)){var t=arguments[0];re.call(this,new ee,0,t)}else if(arguments[0]instanceof ee){var e=arguments[0];re.call(this,e,0,re.getDefaultCoordinateSequenceFactory())}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];re.call(this,n,r,re.getDefaultCoordinateSequenceFactory())}else if(3===arguments.length){var i=arguments[0],s=arguments[1],o=arguments[2];this.precisionModel=i,this.coordinateSequenceFactory=o,this.SRID=s}}function ie(t){this.geometryFactory=t||new re}function se(t){this.parser=new ie(t)}function oe(){this.result=null,this.inputLines=Array(2).fill().map(function(){return Array(2)}),this.intPt=new Array(2).fill(null),this.intLineIndex=null,this._isProper=null,this.pa=null,this.pb=null,this.precisionModel=null,this.intPt[0]=new f,this.intPt[1]=new f,this.pa=this.intPt[0],this.pb=this.intPt[1],this.result=0}function ae(){oe.apply(this)}function ue(){}function le(){this.p=null,this.crossingCount=0,this.isPointOnSegment=!1;var t=arguments[0];this.p=t}function ce(){}function he(){if(this.p0=null,this.p1=null,0===arguments.length)he.call(this,new f,new f);else if(1===arguments.length){var t=arguments[0];he.call(this,t.p0,t.p1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p0=e,this.p1=n}else if(4===arguments.length){var r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];he.call(this,new f(r,i),new f(s,o))}}function ge(){if(this.matrix=null,0===arguments.length)this.matrix=Array(3).fill().map(function(){return Array(3)}),this.setAll(lt.FALSE);else if(1===arguments.length)if("string"==typeof arguments[0]){var t=arguments[0];ge.call(this),this.set(t)}else if(arguments[0]instanceof ge){var e=arguments[0];ge.call(this),this.matrix[L.INTERIOR][L.INTERIOR]=e.matrix[L.INTERIOR][L.INTERIOR],this.matrix[L.INTERIOR][L.BOUNDARY]=e.matrix[L.INTERIOR][L.BOUNDARY],this.matrix[L.INTERIOR][L.EXTERIOR]=e.matrix[L.INTERIOR][L.EXTERIOR],this.matrix[L.BOUNDARY][L.INTERIOR]=e.matrix[L.BOUNDARY][L.INTERIOR],this.matrix[L.BOUNDARY][L.BOUNDARY]=e.matrix[L.BOUNDARY][L.BOUNDARY],this.matrix[L.BOUNDARY][L.EXTERIOR]=e.matrix[L.BOUNDARY][L.EXTERIOR],this.matrix[L.EXTERIOR][L.INTERIOR]=e.matrix[L.EXTERIOR][L.INTERIOR],this.matrix[L.EXTERIOR][L.BOUNDARY]=e.matrix[L.EXTERIOR][L.BOUNDARY],this.matrix[L.EXTERIOR][L.EXTERIOR]=e.matrix[L.EXTERIOR][L.EXTERIOR]}}function fe(){this.areaBasePt=null,this.triangleCent3=new f,this.areasum2=0,this.cg3=new f,this.lineCentSum=new f,this.totalLength=0,this.ptCount=0,this.ptCentSum=new f;var t=arguments[0];this.areaBasePt=null,this.add(t)}function de(t){this.message=t||""}function pe(){this.array_=[]}function me(){this.treeSet=new at,this.list=new I}function ve(){if(this.geomFactory=null,this.inputPts=null,1===arguments.length){var t=arguments[0];ve.call(this,ve.extractCoordinates(t),t.getFactory())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputPts=me.filterCoordinates(e),this.geomFactory=n}}function ye(){this.origin=null;var t=arguments[0];this.origin=t}function xe(){this.inputGeom=null,this.factory=null,this.pruneEmptyGeometry=!0,this.preserveGeometryCollectionType=!0,this.preserveCollections=!1,this.preserveType=!1}function Ee(){if(this.snapTolerance=0,this.srcPts=null,this.seg=new he,this.allowSnappingToSourceVertices=!1,this._isClosed=!1,arguments[0]instanceof wt&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];Ee.call(this,t.getCoordinates(),e)}else if(arguments[0]instanceof Array&&"number"==typeof arguments[1]){var n=arguments[0],r=arguments[1];this.srcPts=n,this._isClosed=Ee.isClosed(n),this.snapTolerance=r}}function Ie(){this.srcGeom=null;var t=arguments[0];this.srcGeom=t}function Ne(){if(xe.apply(this),this.snapTolerance=null,this.snapPts=null,this.isSelfSnap=!1,2===arguments.length){var t=arguments[0],e=arguments[1];this.snapTolerance=t,this.snapPts=e}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.snapTolerance=n,this.snapPts=r,this.isSelfSnap=i}}function Ce(){this.isFirst=!0,this.commonMantissaBitsCount=53,this.commonBits=0,this.commonSignExp=null}function we(){this.commonCoord=null,this.ccFilter=new Se}function Se(){this.commonBitsX=new Ce,this.commonBitsY=new Ce}function Le(){this.trans=null;var t=arguments[0];this.trans=t}function Re(){this.parent=null,this.atStart=null,this.max=null,this.index=null,this.subcollectionIterator=null;var t=arguments[0];this.parent=t,this.atStart=!0,this.index=0,this.max=t.getNumGeometries()}function be(){if(this.boundaryRule=B.OGC_SFS_BOUNDARY_RULE,this.isIn=null,this.numBoundaries=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];if(null===t)throw new r("Rule must be non-null");this.boundaryRule=t}}function Te(){}function Pe(){}function Oe(){this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function Me(){}function _e(){this.bounds=null,this.item=null;var t=arguments[0],e=arguments[1];this.bounds=t,this.item=e}function Ae(){this._size=null,this.items=null,this._size=0,this.items=new I,this.items.add(null)}function De(){}function Fe(){}function Ge(){if(this.childBoundables=new I,this.bounds=null,this.level=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.level=t}}function ke(){this.boundable1=null,this.boundable2=null,this._distance=null,this.itemDistance=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.boundable1=t,this.boundable2=e,this.itemDistance=n,this._distance=this.distance()}function Ue(){if(this.root=null,this.built=!1,this.itemBoundables=new I,this.nodeCapacity=null,0===arguments.length)Ue.call(this,Ue.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];g.isTrue(t>1,"Node capacity must be greater than 1"),this.nodeCapacity=t}}function qe(){}function Be(){}function ze(){if(0===arguments.length)ze.call(this,ze.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Ue.call(this,t)}}function Ve(){var t=arguments[0];Ge.call(this,t)}function Ye(){}function Xe(){this.segString=null,this.coord=null,this.segmentIndex=null,this.segmentOctant=null,this._isInterior=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.segString=t,this.coord=new f(e),this.segmentIndex=n,this.segmentOctant=r,this._isInterior=!e.equals2D(t.getCoordinate(n))}function He(){this.nodeMap=new it,this.edge=null;var t=arguments[0];this.edge=t}function We(){this.nodeList=null,this.edge=null,this.nodeIt=null,this.currNode=null,this.nextNode=null,this.currSegIndex=0;var t=arguments[0];this.nodeList=t,this.edge=t.getEdge(),this.nodeIt=t.iterator(),this.readNextNode()}function je(){}function Ze(){this.nodeList=new He(this),this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function Je(){this.tempEnv1=new C,this.tempEnv2=new C,this.overlapSeg1=new he,this.overlapSeg2=new he}function Ke(){this.pts=null,this.start=null,this.end=null,this.env=null,this.context=null,this.id=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.pts=t,this.start=e,this.end=n,this.context=r}function Qe(){}function $e(){}function tn(){}function en(){if(this.segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function nn(){if(this.monoChains=new I,this.index=new ze,this.idCounter=0,this.nodedSegStrings=null,this.nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];en.call(this,t)}}function rn(){Je.apply(this),this.si=null;var t=arguments[0];this.si=t}function sn(){if(this.pt=null,1===arguments.length){var t=arguments[0];l.call(this,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];l.call(this,sn.msgWithCoord(e,n)),this.pt=new f(n)}}function on(){}function an(){this.findAllIntersections=!1,this.isCheckEndSegmentsOnly=!1,this.li=null,this.interiorIntersection=null,this.intSegments=null,this.intersections=new I,this.intersectionCount=0,this.keepIntersections=!0;var t=arguments[0];this.li=t,this.interiorIntersection=null}function un(){this.li=new ae,this.segStrings=null,this.findAllIntersections=!1,this.segInt=null,this._isValid=!0;var t=arguments[0];this.segStrings=t}function ln(){this.nv=null;var t=arguments[0];this.nv=new un(ln.toSegmentStrings(t))}function cn(){this.mapOp=null;var t=arguments[0];this.mapOp=t}function hn(){}function gn(){if(this.location=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];this.init(t.length)}else if(Number.isInteger(arguments[0])){var e=arguments[0];this.init(1),this.location[hn.ON]=e}else if(arguments[0]instanceof gn){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var r=0;r<this.location.length;r++)this.location[r]=n.location[r]}}else if(3===arguments.length){var i=arguments[0],s=arguments[1],o=arguments[2];this.init(3),this.location[hn.ON]=i,this.location[hn.LEFT]=s,this.location[hn.RIGHT]=o}}function fn(){if(this.elt=new Array(2).fill(null),1===arguments.length){if(Number.isInteger(arguments[0])){var t=arguments[0];this.elt[0]=new gn(t),this.elt[1]=new gn(t)}else if(arguments[0]instanceof fn){var e=arguments[0];this.elt[0]=new gn(e.elt[0]),this.elt[1]=new gn(e.elt[1])}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.elt[0]=new gn(L.NONE),this.elt[1]=new gn(L.NONE),this.elt[n].setLocation(r)}else if(3===arguments.length){var i=arguments[0],s=arguments[1],o=arguments[2];this.elt[0]=new gn(i,s,o),this.elt[1]=new gn(i,s,o)}else if(4===arguments.length){var a=arguments[0],u=arguments[1],l=arguments[2],c=arguments[3];this.elt[0]=new gn(L.NONE,L.NONE,L.NONE),this.elt[1]=new gn(L.NONE,L.NONE,L.NONE),this.elt[a].setLocations(u,l,c)}}function dn(){this.startDe=null,this.maxNodeDegree=-1,this.edges=new I,this.pts=new I,this.label=new fn(L.NONE),this.ring=null,this._isHole=null,this.shell=null,this.holes=new I,this.geometryFactory=null;var t=arguments[0],e=arguments[1];this.geometryFactory=e,this.computePoints(t),this.computeRing()}function pn(){var t=arguments[0],e=arguments[1];dn.call(this,t,e)}function mn(){var t=arguments[0],e=arguments[1];dn.call(this,t,e)}function vn(){if(this.label=null,this._isInResult=!1,this._isCovered=!1,this._isCoveredSet=!1,this._isVisited=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.label=t}}function yn(){vn.apply(this),this.coord=null,this.edges=null;var t=arguments[0],e=arguments[1];this.coord=t,this.edges=e,this.label=new fn(0,L.NONE)}function xn(){this.nodeMap=new it,this.nodeFact=null;var t=arguments[0];this.nodeFact=t}function En(){if(this.edge=null,this.label=null,this.node=null,this.p0=null,this.p1=null,this.dx=null,this.dy=null,this.quadrant=null,1===arguments.length){var t=arguments[0];this.edge=t}else if(3===arguments.length){var e=arguments[0],n=arguments[1],r=arguments[2];En.call(this,e,n,r,null)}else if(4===arguments.length){var i=arguments[0],s=arguments[1],o=arguments[2],a=arguments[3];En.call(this,i),this.init(s,o),this.label=a}}function In(){this._isForward=null,this._isInResult=!1,this._isVisited=!1,this.sym=null,this.next=null,this.nextMin=null,this.edgeRing=null,this.minEdgeRing=null,this.depth=[0,-999,-999];var t=arguments[0],e=arguments[1];if(En.call(this,t),this._isForward=e,e)this.init(t.getCoordinate(0),t.getCoordinate(1));else{var n=t.getNumPoints()-1;this.init(t.getCoordinate(n),t.getCoordinate(n-1))}this.computeDirectedLabel()}function Nn(){}function Cn(){if(this.edges=new I,this.nodes=null,this.edgeEndList=new I,0===arguments.length)this.nodes=new xn(new Nn);else if(1===arguments.length){var t=arguments[0];this.nodes=new xn(t)}}function wn(){this.geometryFactory=null,this.shellList=new I;var t=arguments[0];this.geometryFactory=t}function Sn(){this.op=null,this.geometryFactory=null,this.ptLocator=null,this.lineEdgesList=new I,this.resultLineList=new I;var t=arguments[0],e=arguments[1],n=arguments[2];this.op=t,this.geometryFactory=e,this.ptLocator=n}function Ln(){this.op=null,this.geometryFactory=null,this.resultPointList=new I;var t=arguments[0],e=arguments[1];arguments[2],this.op=t,this.geometryFactory=e}function Rn(){}function bn(){this.geom=null;var t=arguments[0];this.geom=t}function Tn(){this.edgeMap=new it,this.edgeList=null,this.ptInAreaLocation=[L.NONE,L.NONE]}function Pn(){Tn.apply(this),this.resultAreaEdgeList=null,this.label=null,this.SCANNING_FOR_INCOMING=1,this.LINKING_TO_OUTGOING=2}function On(){Nn.apply(this)}function Mn(){this.mce=null,this.chainIndex=null;var t=arguments[0],e=arguments[1];this.mce=t,this.chainIndex=e}function _n(){if(this.label=null,this.xValue=null,this.eventType=null,this.insertEvent=null,this.deleteEventIndex=null,this.obj=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.eventType=_n.DELETE,this.xValue=t,this.insertEvent=e}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.eventType=_n.INSERT,this.label=n,this.xValue=r,this.obj=i}}function An(){}function Dn(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.properIntersectionPoint=null,this.li=null,this.includeProper=null,this.recordIsolated=null,this.isSelfIntersection=null,this.numIntersections=0,this.numTests=0,this.bdyNodes=null,this._isDone=!1,this.isDoneWhenProperInt=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.li=t,this.includeProper=e,this.recordIsolated=n}function Fn(){An.apply(this),this.events=new I,this.nOverlaps=null}function Gn(){this.min=i.POSITIVE_INFINITY,this.max=i.NEGATIVE_INFINITY}function kn(){}function Un(){Gn.apply(this),this.item=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.min=t,this.max=e,this.item=n}function qn(){Gn.apply(this),this.node1=null,this.node2=null;var t=arguments[0],e=arguments[1];this.node1=t,this.node2=e,this.buildExtent(this.node1,this.node2)}function Bn(){this.leaves=new I,this.root=null,this.level=0}function zn(){if(this.lines=null,this.isForcedToLineString=!1,1===arguments.length){var t=arguments[0];this.lines=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.lines=e,this.isForcedToLineString=n}}function Vn(){this.items=new I}function Yn(){this.index=null;var t=arguments[0];if(!R(t,Rt))throw new r("Argument must be Polygonal");
this.index=new Hn(t)}function Xn(){this.counter=null;var t=arguments[0];this.counter=t}function Hn(){this.index=new Bn;var t=arguments[0];this.init(t)}function Wn(){this.coord=null,this.segmentIndex=null,this.dist=null;var t=arguments[0],e=arguments[1],n=arguments[2];this.coord=new f(t),this.segmentIndex=e,this.dist=n}function jn(){this.nodeMap=new it,this.edge=null;var t=arguments[0];this.edge=t}function Zn(){}function Jn(){this.e=null,this.pts=null,this.startIndex=null,this.env1=new C,this.env2=new C;var t=arguments[0];this.e=t,this.pts=t.getCoordinates();var e=new Zn;this.startIndex=e.getChainStartIndices(this.pts)}function Kn(){this.depth=Array(2).fill().map(function(){return Array(3)});for(var t=0;2>t;t++)for(var e=0;3>e;e++)this.depth[t][e]=Kn.NULL_VALUE}function Qn(){if(vn.apply(this),this.pts=null,this.env=null,this.eiList=new jn(this),this.name=null,this.mce=null,this._isIsolated=!0,this.depth=new Kn,this.depthDelta=0,1===arguments.length){var t=arguments[0];Qn.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pts=e,this.label=n}}function $n(){if(Cn.apply(this),this.parentGeom=null,this.lineEdgeMap=new te,this.boundaryNodeRule=null,this.useBoundaryDeterminationRule=!0,this.argIndex=null,this.boundaryNodes=null,this._hasTooFewPoints=!1,this.invalidPoint=null,this.areaPtLocator=null,this.ptLocator=new be,2===arguments.length){var t=arguments[0],e=arguments[1];$n.call(this,t,e,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.argIndex=n,this.parentGeom=r,this.boundaryNodeRule=i,null!==r&&this.add(r)}}function tr(){if(this.li=new ae,this.resultPrecisionModel=null,this.arg=null,1===arguments.length){var t=arguments[0];this.setComputationPrecision(t.getPrecisionModel()),this.arg=new Array(1).fill(null),this.arg[0]=new $n(0,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];tr.call(this,e,n,B.OGC_SFS_BOUNDARY_RULE)}else if(3===arguments.length){var r=arguments[0],i=arguments[1],s=arguments[2];r.getPrecisionModel().compareTo(i.getPrecisionModel())>=0?this.setComputationPrecision(r.getPrecisionModel()):this.setComputationPrecision(i.getPrecisionModel()),this.arg=new Array(2).fill(null),this.arg[0]=new $n(0,r,s),this.arg[1]=new $n(1,i,s)}}function er(){this.pts=null,this._orientation=null;var t=arguments[0];this.pts=t,this._orientation=er.orientation(t)}function nr(){this.edges=new I,this.ocaMap=new it}function rr(){this.ptLocator=new be,this.geomFact=null,this.resultGeom=null,this.graph=null,this.edgeList=new nr,this.resultPolyList=new I,this.resultLineList=new I,this.resultPointList=new I;var t=arguments[0],e=arguments[1];tr.call(this,t,e),this.graph=new Cn(new On),this.geomFact=t.getFactory()}function ir(){this.geom=new Array(2).fill(null),this.snapTolerance=null,this.cbr=null;var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e,this.computeSnapTolerance()}function sr(){this.geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e}function or(){this.factory=null,this.interiorPoint=null,this.maxWidth=0;var t=arguments[0];this.factory=t.getFactory(),this.add(t)}function ar(){this.poly=null,this.centreY=null,this.hiY=i.MAX_VALUE,this.loY=-i.MAX_VALUE;var t=arguments[0];this.poly=t,this.hiY=t.getEnvelopeInternal().getMaxY(),this.loY=t.getEnvelopeInternal().getMinY(),this.centreY=or.avg(this.loY,this.hiY)}function ur(){this.centroid=null,this.minDistance=i.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.addInterior(t),null===this.interiorPoint&&this.addEndpoints(t)}function lr(){this.centroid=null,this.minDistance=i.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.add(t)}function cr(){}function hr(){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 gr(){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0;var t=arguments[0];this.input=t}function fr(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new he,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var t=arguments[0];fr.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isConvex=n}}function dr(){this.inputGeom=null,this.distanceTolerance=null;var t=arguments[0];this.inputGeom=t}function pr(){xe.apply(this),this.distanceTolerance=null;var t=arguments[0];this.distanceTolerance=t}function mr(){this._orig=null,this._sym=null,this._next=null;var t=arguments[0];this._orig=t}function vr(){this._isMarked=!1;var t=arguments[0];mr.call(this,t)}function yr(){this.vertexMap=new te}function xr(){this._isStart=!1;var t=arguments[0];vr.call(this,t)}function Er(){yr.apply(this)}function Ir(){this.result=null,this.factory=null,this.graph=null,this.lines=new I,this.nodeEdgeStack=new pe,this.ringStartEdge=null,this.graph=new Er}function Nr(){this.items=new I,this.subnode=new Array(4).fill(null)}function Cr(){}function wr(t,e){var n,r,i,s,o={32:{d:127,c:128,b:0,a:0},64:{d:32752,c:0,b:0,a:0}},a={32:8,64:11}[t];if(s||(n=0>e||0>1/e,isFinite(e)||(s=o[t],n&&(s.d+=1<<t/4-1),r=Math.pow(2,a)-1,i=0)),!s){for(r={32:127,64:1023}[t],i=Math.abs(e);i>=2;)r++,i/=2;for(;1>i&&r>0;)r--,i*=2;0>=r&&(i/=2),32===t&&r>254&&(s={d:n?255:127,c:128,b:0,a:0},r=Math.pow(2,a)-1,i=0)}return r}function Sr(){this.pt=new f,this.level=0,this.env=null;var t=arguments[0];this.computeKey(t)}function Lr(){Nr.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 Rr(){}function br(){Nr.apply(this)}function Tr(){this.root=null,this.minExtent=1,this.root=new br}function Pr(t){this.geometryFactory=t||new re}function Or(t){this.geometryFactory=t||new re,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Pr(this.geometryFactory)}function Mr(){this.parser=new Pr(this.geometryFactory)}function _r(t){this.geometryFactory=t||new re,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new ie(this.geometryFactory)}function Ar(t){return[t.x,t.y]}function Dr(t){this.geometryFactory=t||new re}function Fr(){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];Fr.call(this,t,e,0,0)}else if(4===arguments.length){var n=arguments[0],r=arguments[1];arguments[2],arguments[3],this.noder=n,this.scaleFactor=r,this.isScaled=!this.isIntegerPrecision()}}function Gr(){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 kr(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Ur(){if(this.quadrantSegments=Ur.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=Ur.CAP_ROUND,this.joinStyle=Ur.JOIN_ROUND,this.mitreLimit=Ur.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1,this.simplifyFactor=Ur.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 r=arguments[0],i=arguments[1],s=arguments[2],o=arguments[3];this.setQuadrantSegments(r),this.setEndCapStyle(i),this.setJoinStyle(s),this.setMitreLimit(o)}}function qr(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function Br(){this.array_=[]}function zr(){this.finder=null,this.dirEdgeList=new I,this.nodes=new I,this.rightMostCoord=null,this.env=null,this.finder=new qr}function Vr(){this.inputLine=null,this.distanceTol=null,this.isDeleted=null,this.angleOrientation=ce.COUNTERCLOCKWISE;var t=arguments[0];this.inputLine=t}function Yr(){this.ptList=null,this.precisionModel=null,this.minimimVertexDistance=0,this.ptList=new I}function Xr(){this.maxCurveSegmentError=0,this.filletAngleQuantum=null,this.closingSegLengthFactor=1,this.segList=null,this.distance=0,this.precisionModel=null,this.bufParams=null,this.li=null,this.s0=null,this.s1=null,this.s2=null,this.seg0=new he,this.seg1=new he,this.offset0=new he,this.offset1=new he,this.side=0,this._hasNarrowConcaveAngle=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.precisionModel=t,this.bufParams=e,this.li=new ae,this.filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Ur.JOIN_ROUND&&(this.closingSegLengthFactor=Xr.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function Hr(){this.distance=0,this.precisionModel=null,this.bufParams=null;var t=arguments[0],e=arguments[1];this.precisionModel=t,this.bufParams=e}function Wr(){this.subgraphs=null,this.seg=new he,this.cga=new ce;var t=arguments[0];this.subgraphs=t}function jr(){this.upwardSeg=null,this.leftDepth=null;var t=arguments[0],e=arguments[1];this.upwardSeg=new he(t),this.leftDepth=e}function Zr(){this.inputGeom=null,this.distance=null,this.curveBuilder=null,this.curveList=new I;var t=arguments[0],e=arguments[1],n=arguments[2];this.inputGeom=t,this.distance=e,this.curveBuilder=n}function Jr(){this._hasIntersection=!1,this.hasProper=!1,this.hasProperInterior=!1,this.hasInterior=!1,this.properIntersectionPoint=null,this.li=null,this.isSelfIntersection=null,this.numIntersections=0,this.numInteriorIntersections=0,this.numProperIntersections=0,this.numTests=0;var t=arguments[0];this.li=t}function Kr(){this.bufParams=null,this.workingPrecisionModel=null,this.workingNoder=null,this.geomFact=null,this.graph=null,this.edgeList=new nr;var t=arguments[0];this.bufParams=t}function Qr(){this.li=new ae,this.segStrings=null;var t=arguments[0];this.segStrings=t}function $r(){this.li=null,this.pt=null,this.originalPt=null,this.ptScaled=null,this.p0Scaled=null,this.p1Scaled=null,this.scaleFactor=null,this.minx=null,this.maxx=null,this.miny=null,this.maxy=null,this.corner=new Array(4).fill(null),this.safeEnv=null;var t=arguments[0],e=arguments[1],n=arguments[2];if(this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=n,0>=e)throw new r("Scale factor must be non-zero");1!==e&&(this.pt=new f(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new f,this.p1Scaled=new f),this.initCorners(this.pt)}function ti(){this.tempEnv1=new C,this.selectedSegment=new he}function ei(){this.index=null;var t=arguments[0];this.index=t}function ni(){ti.apply(this),this.hotPixel=null,this.parentEdge=null,this.hotPixelVertexIndex=null,this._isNodeAdded=!1;var t=arguments[0],e=arguments[1],n=arguments[2];this.hotPixel=t,this.parentEdge=e,this.hotPixelVertexIndex=n}function ri(){this.li=null,this.interiorIntersections=null;var t=arguments[0];this.li=t,this.interiorIntersections=new I}function ii(){this.pm=null,this.li=null,this.scaleFactor=null,this.noder=null,this.pointSnapper=null,this.nodedSegStrings=null;var t=arguments[0];this.pm=t,this.li=new ae,this.li.setPrecisionModel(t),this.scaleFactor=t.getScale()}function si(){if(this.argGeom=null,this.distance=null,this.bufParams=new Ur,this.resultGeometry=null,this.saveException=null,1===arguments.length){var t=arguments[0];this.argGeom=t}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.argGeom=e,this.bufParams=n}}function oi(){this.comps=null;var t=arguments[0];this.comps=t}function ai(){if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];ai.call(this,t,ai.INSIDE_AREA,e)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];this.component=n,this.segIndex=r,this.pt=i}}function ui(){this.pts=null;var t=arguments[0];this.pts=t}function li(){this.locations=null;var t=arguments[0];this.locations=t}function ci(){if(this.geom=null,this.terminateDistance=0,this.ptLocator=new be,this.minDistanceLocation=null,this.minDistance=i.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];ci.call(this,t,e,0)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],s=arguments[2];this.geom=new Array(2).fill(null),this.geom[0]=n,this.geom[1]=r,this.terminateDistance=s}}function hi(){this.factory=null,this.directedEdges=new I,this.coordinates=null;var t=arguments[0];this.factory=t}function gi(){this._isMarked=!1,this._isVisited=!1,this.data=null}function fi(){gi.apply(this),this.parentEdge=null,this.from=null,this.to=null,this.p0=null,this.p1=null,this.sym=null,this.edgeDirection=null,this.quadrant=null,this.angle=null;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];this.from=t,this.to=e,this.edgeDirection=r,this.p0=t.getCoordinate(),this.p1=n;var i=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y;this.quadrant=Qe.quadrant(i,s),this.angle=Math.atan2(s,i)}function di(){var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];fi.call(this,t,e,n,r)}function pi(){if(gi.apply(this),this.dirEdge=null,0===arguments.length);else if(2===arguments.length){var t=arguments[0],e=arguments[1];this.setDirectedEdges(t,e)}}function mi(){this.outEdges=new I,this.sorted=!1}function vi(){if(gi.apply(this),this.pt=null,this.deStar=null,1===arguments.length){var t=arguments[0];vi.call(this,t,new mi)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pt=e,this.deStar=n}}function yi(){pi.apply(this),this.line=null;var t=arguments[0];this.line=t}function xi(){this.nodeMap=new it}function Ei(){this.edges=new Q,this.dirEdges=new Q,this.nodeMap=new xi}function Ii(){Ei.apply(this)}function Ni(){this.graph=new Ii,this.mergedLineStrings=null,this.factory=null,this.edgeStrings=null}function Ci(){this.edgeRing=null,this.next=null,this.label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],r=arguments[3];fi.call(this,t,e,n,r)}function wi(){pi.apply(this),this.line=null;var t=arguments[0];this.line=t}function Si(){this.factory=null,this.deList=new I,this.lowestEdge=null,this.ring=null,this.ringPts=null,this.holes=null,this.shell=null,this._isHole=null,this._isProcessed=!1,this._isIncludedSet=!1,this._isIncluded=!1;var t=arguments[0];this.factory=t}function Li(){}function Ri(){Ei.apply(this),this.factory=null;var t=arguments[0];this.factory=t}function bi(){if(this.lineStringAdder=new Ti(this),this.graph=null,this.dangles=new I,this.cutEdges=new I,this.invalidRingLines=new I,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)bi.call(this,!1);else if(1===arguments.length){var t=arguments[0];this.extractOnlyPolygonal=t}}function Ti(){this.p=null;var t=arguments[0];this.p=t}function Pi(){}function Oi(){if(this.edgeEnds=new I,1===arguments.length){var t=arguments[0];Oi.call(this,null,t)}else if(2===arguments.length){var e=(arguments[0],arguments[1]);En.call(this,e.getEdge(),e.getCoordinate(),e.getDirectedCoordinate(),new fn(e.getLabel())),this.insert(e)}}function Mi(){Tn.apply(this)}function _i(){var t=arguments[0],e=arguments[1];yn.call(this,t,e)}function Ai(){Nn.apply(this)}function Di(){this.li=new ae,this.ptLocator=new be,this.arg=null,this.nodes=new xn(new Ai),this.im=null,this.isolatedEdges=new I,this.invalidPoint=null;var t=arguments[0];this.arg=t}function Fi(){this.rectEnv=null;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal()}function Gi(){this.li=new ae,this.rectEnv=null,this.diagUp0=null,this.diagUp1=null,this.diagDown0=null,this.diagDown1=null;var t=arguments[0];this.rectEnv=t,this.diagUp0=new f(t.getMinX(),t.getMinY()),this.diagUp1=new f(t.getMaxX(),t.getMaxY()),this.diagDown0=new f(t.getMinX(),t.getMaxY()),this.diagDown1=new f(t.getMaxX(),t.getMinY())}function ki(){this._isDone=!1}function Ui(){this.rectangle=null,this.rectEnv=null;var t=arguments[0];this.rectangle=t,this.rectEnv=t.getEnvelopeInternal()}function qi(){ki.apply(this),this.rectEnv=null,this._intersects=!1;var t=arguments[0];this.rectEnv=t}function Bi(){ki.apply(this),this.rectSeq=null,this.rectEnv=null,this._containsPoint=!1;var t=arguments[0];this.rectSeq=t.getExteriorRing().getCoordinateSequence(),this.rectEnv=t.getEnvelopeInternal()}function zi(){ki.apply(this),this.rectEnv=null,this.rectIntersector=null,this.hasIntersection=!1,this.p0=new f,this.p1=new f;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal(),this.rectIntersector=new Gi(this.rectEnv)}function Vi(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];tr.call(this,t,e),this._relate=new Di(this.arg)}else if(3===arguments.length){var n=arguments[0],r=arguments[1],i=arguments[2];tr.call(this,n,r,i),this._relate=new Di(this.arg)}}function Yi(){this.geomFactory=null,this.skipEmpty=!1,this.inputGeoms=null;var t=arguments[0];this.geomFactory=Yi.extractFactory(t),this.inputGeoms=t}function Xi(){this.pointGeom=null,this.otherGeom=null,this.geomFact=null;var t=arguments[0],e=arguments[1];this.pointGeom=t,this.otherGeom=e,this.geomFact=e.getFactory()}function Hi(){this.sortIndex=-1,this.comps=null;var t=arguments[0],e=arguments[1];this.sortIndex=t,this.comps=e}function Wi(){this.inputPolys=null,this.geomFactory=null;var t=arguments[0];this.inputPolys=t,null===this.inputPolys&&(this.inputPolys=new I)}function ji(){if(this.polygons=new I,this.lines=new I,this.points=new I,this.geomFact=null,1===arguments.length){if(R(arguments[0],m)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof U){var e=arguments[0];this.extract(e)}}else if(2===arguments.length){var n=arguments[0],r=arguments[1];this.geomFact=r,this.extract(n)}}function Zi(){this.geometryFactory=new re,this.geomGraph=null,this.disconnectedRingcoord=null;var t=arguments[0];this.geomGraph=t}function Ji(){this.items=new I,this.subnode=[null,null]}function Ki