/** * JSTS. See https://github.com/bjornharrtell/jsts * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EDLv1.txt * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_EPLv1.txt * https://github.com/bjornharrtell/jsts/blob/master/LICENSE_LICENSE_ES6_COLLECTIONS.txt * @license */ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(t.jsts=t.jsts||{})}(this,function(t){"use strict";function e(){}function n(){}function i(){}function r(){}function s(){}function o(){}function a(){}function u(t){this.name="RuntimeException",this.message=t,this.stack=(new Error).stack,Error.call(this,t)}function l(){if(0===arguments.length)u.call(this);else if(1===arguments.length){var t=arguments[0];u.call(this,t)}}function h(){}function c(){if(this.x=null,this.y=null,this.z=null,0===arguments.length)c.call(this,0,0);else if(1===arguments.length){var t=arguments[0];c.call(this,t.x,t.y,t.z)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];c.call(this,e,n,c.NULL_ORDINATE)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2];this.x=i,this.y=r,this.z=s}}function f(){if(this.dimensionsToTest=2,0===arguments.length)f.call(this,2);else if(1===arguments.length){var t=arguments[0];if(2!==t&&3!==t)throw new n("only 2 or 3 dimensions may be specified");this.dimensionsToTest=t}}function g(){}function d(){}function p(t){this.message=t||""}function m(){}function v(t){this.message=t||""}function y(t){this.message=t||""}function x(){this.array_=[],arguments[0]instanceof d&&this.addAll(arguments[0])}function E(){if(x.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 I(){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 c){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.init(e)}}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],s=arguments[1],o=arguments[2],a=arguments[3];this.init(r,s,o,a)}}function N(){}function C(){N.call(this,"Projective point not representable on the Cartesian plane.")}function S(){}function L(){}function w(t){this.str=t}function R(t){this.value=t}function T(){}function O(){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 O){var e=arguments[0];this.init(e)}else if("string"==typeof arguments[0]){var n=arguments[0];O.call(this,O.parse(n))}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.init(i,r)}}function P(){}function b(){}function _(){}function M(){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 M&&arguments[1]instanceof M){var i=arguments[0],r=arguments[1];this.x=i.y*r.w-r.y*i.w,this.y=r.x*i.w-i.x*r.w,this.w=i.x*r.y-r.x*i.y}else if(arguments[0]instanceof c&&arguments[1]instanceof c){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 h=arguments[0],f=arguments[1],g=arguments[2],d=arguments[3],p=h.y-f.y,m=f.x-h.x,v=h.x*f.y-f.x*h.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 D(){}function A(){}function F(){this.envelope=null,this.factory=null,this.SRID=null,this.userData=null;var t=arguments[0];this.factory=t,this.SRID=t.getSRID()}function G(){}function q(){}function B(){}function V(){}function z(){}function k(){}function Y(){}function U(){}function X(){}function H(){}function W(){}function j(){}function K(){this.array_=[],arguments[0]instanceof d&&this.addAll(arguments[0])}function Z(t){return null==t?uo:t.color}function Q(t){return null==t?null:t.parent}function J(t,e){null!==t&&(t.color=e)}function $(t){return null==t?null:t.left}function tt(t){return null==t?null:t.right}function et(){this.root_=null,this.size_=0}function nt(){}function it(){}function rt(){this.array_=[],arguments[0]instanceof d&&this.addAll(arguments[0])}function st(){}function ot(){}function at(){}function ut(){}function lt(){this.geometries=null;var t=arguments[0],e=arguments[1];if(F.call(this,e),null===t&&(t=[]),F.hasNullElements(t))throw new n("geometries must not contain null elements");this.geometries=t}function ht(){var t=arguments[0],e=arguments[1];lt.call(this,t,e)}function ct(){if(this.geom=null,this.geomFact=null,this.bnRule=null,this.endpointMap=null,1===arguments.length){var t=arguments[0];ct.call(this,t,q.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 ft(){this.count=null}function gt(){}function dt(){}function pt(){}function mt(){}function vt(){}function yt(){}function xt(){}function Et(){}function It(){this.points=null;var t=arguments[0],e=arguments[1];F.call(this,e),this.init(t)}function Nt(){}function Ct(){this.coordinates=null;var t=arguments[0],e=arguments[1];F.call(this,e),this.init(t)}function St(){}function Lt(){this.shell=null,this.holes=null;var t=arguments[0],e=arguments[1],i=arguments[2];if(F.call(this,i),null===t&&(t=this.getFactory().createLinearRing()),null===e&&(e=[]),F.hasNullElements(e))throw new n("holes must not contain null elements");if(t.isEmpty()&&F.hasNonEmptyElements(e))throw new n("shell is empty but holes are not");this.shell=t,this.holes=e}function wt(){var t=arguments[0],e=arguments[1];lt.call(this,t,e)}function Rt(){if(arguments[0]instanceof c&&arguments[1]instanceof $t){var t=arguments[0],e=arguments[1];Rt.call(this,e.getCoordinateSequenceFactory().create(t),e)}else if(oo(arguments[0],b)&&arguments[1]instanceof $t){var n=arguments[0],i=arguments[1];It.call(this,n,i),this.validateConstruction()}}function Tt(){var t=arguments[0],e=arguments[1];lt.call(this,t,e)}function Ot(){if(this.factory=null,this.isUserDataCopied=!1,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.factory=t}}function Pt(){}function bt(){}function _t(){}function Mt(){}function Dt(){if(this.dimension=3,this.coordinates=null,1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];Dt.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;n-1}function Bt(t){return this.has(t)?this._values[ho]:void 0}function Vt(t,e){if(this.objectOnly&&e!==Object(e))throw new TypeError("Invalid value used as weak collection key");if(e!==e||0===e)for(ho=t.length;ho--&&!Ft(t[ho],e););else ho=t.indexOf(e);return ho>-1}function zt(t){return Vt.call(this,this._keys,t)}function kt(t,e){return this.has(t)?this._values[ho]=e:this._values[this._keys.push(t)-1]=e,this}function Yt(){(this._keys||0).length=this._values.length=0}function Ut(){return Wt(this._itp,this._keys)}function Xt(){return Wt(this._itp,this._values)}function Ht(){return Wt(this._itp,this._keys,this._values)}function Wt(t,e,n){var i=[0],r=!1;return t.push(i),{next:function(){var s,o=i[0];return!r&&o1,"Node capacity must be greater than 1"),this.nodeCapacity=t}}function Fe(){}function Ge(){}function qe(){if(0===arguments.length)qe.call(this,qe.DEFAULT_NODE_CAPACITY);else if(1===arguments.length){var t=arguments[0];Ae.call(this,t)}}function Be(){var t=arguments[0];Me.call(this,t)}function Ve(){}function ze(){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],i=arguments[3];this.segString=t,this.coord=new c(e),this.segmentIndex=n,this.segmentOctant=i,this._isInterior=!e.equals2D(t.getCoordinate(n))}function ke(){this.nodeMap=new et,this.edge=null;var t=arguments[0];this.edge=t}function Ye(){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 Ue(){}function Xe(){this.nodeList=new ke(this),this.pts=null,this.data=null;var t=arguments[0],e=arguments[1];this.pts=t,this.data=e}function He(){this.tempEnv1=new I,this.tempEnv2=new I,this.overlapSeg1=new ae,this.overlapSeg2=new ae}function We(){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],i=arguments[3];this.pts=t,this.start=e,this.end=n,this.context=i}function je(){}function Ke(){}function Ze(){}function Qe(){if(this.segInt=null,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.setSegmentIntersector(t)}}function Je(){if(this.monoChains=new x,this.index=new qe,this.idCounter=0,this.nodedSegStrings=null,this.nOverlaps=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];Qe.call(this,t)}}function $e(){He.apply(this),this.si=null;var t=arguments[0];this.si=t}function tn(){if(this.pt=null,1===arguments.length){var t=arguments[0];u.call(this,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];u.call(this,tn.msgWithCoord(e,n)),this.name="TopologyException",this.pt=new c(n)}}function en(){}function nn(){this.findAllIntersections=!1,this.isCheckEndSegmentsOnly=!1,this.li=null,this.interiorIntersection=null,this.intSegments=null,this.intersections=new x,this.intersectionCount=0,this.keepIntersections=!0;var t=arguments[0];this.li=t,this.interiorIntersection=null}function rn(){this.li=new ie,this.segStrings=null,this.findAllIntersections=!1,this.segInt=null,this._isValid=!0;var t=arguments[0];this.segStrings=t}function sn(){this.nv=null;var t=arguments[0];this.nv=new rn(sn.toSegmentStrings(t))}function on(){this.mapOp=null;var t=arguments[0];this.mapOp=t}function an(){}function un(){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[an.ON]=e}else if(arguments[0]instanceof un){var n=arguments[0];if(this.init(n.location.length),null!==n)for(var i=0;i=0?this.setComputationPrecision(i.getPrecisionModel()):this.setComputationPrecision(r.getPrecisionModel()),this.arg=new Array(2).fill(null),this.arg[0]=new Kn(0,i,s),this.arg[1]=new Kn(1,r,s)}}function Qn(){this.pts=null,this._orientation=null;var t=arguments[0];this.pts=t,this._orientation=Qn.orientation(t)}function Jn(){this.edges=new x,this.ocaMap=new et}function $n(){this.ptLocator=new Se,this.geomFact=null,this.resultGeom=null,this.graph=null,this.edgeList=new Jn,this.resultPolyList=new x,this.resultLineList=new x,this.resultPointList=new x;var t=arguments[0],e=arguments[1];Zn.call(this,t,e),this.graph=new xn(new Rn),this.geomFact=t.getFactory()}function ti(){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 ei(){this.geom=new Array(2).fill(null);var t=arguments[0],e=arguments[1];this.geom[0]=t,this.geom[1]=e}function ni(){this.factory=null,this.interiorPoint=null,this.maxWidth=0;var t=arguments[0];this.factory=t.getFactory(),this.add(t)}function ii(){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=ni.avg(this.loY,this.hiY)}function ri(){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 si(){this.centroid=null,this.minDistance=i.MAX_VALUE,this.interiorPoint=null;var t=arguments[0];this.centroid=t.getCentroid().getCoordinate(),this.add(t)}function oi(){this.tempEnv1=new I,this.selectedSegment=new ae}function ai(){this.items=new x,this.subnode=[null,null]}function ui(){if(this.min=null,this.max=null,0===arguments.length)this.min=0,this.max=0;else if(1===arguments.length){var t=arguments[0];this.init(t.min,t.max)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.init(e,n)}}function li(){}function hi(t,e){var n,i,r,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=e<0||1/e<0,isFinite(e)||(s=o[t],n&&(s.d+=1<=2;)i++,r/=2;for(;r<1&&i>0;)i--,r*=2;i<=0&&(r/=2),32===t&&i>254&&(s={d:n?255:127,c:128,b:0,a:0},i=Math.pow(2,a)-1,r=0)}return i}function ci(){this.pt=0,this.level=0,this.interval=null;var t=arguments[0];this.computeKey(t)}function fi(){ai.apply(this),this.interval=null,this.centre=null,this.level=null;var t=arguments[0],e=arguments[1];this.interval=t,this.level=e,this.centre=(t.getMin()+t.getMax())/2}function gi(){}function di(){ai.apply(this)}function pi(){this.root=null,this.minExtent=1,this.root=new di}function mi(){}function vi(){this.ring=null,this.tree=null,this.crossings=0,this.interval=new ui;var t=arguments[0];this.ring=t,this.buildIndex()}function yi(){oi.apply(this),this.mcp=null,this.p=null;var t=arguments[0],e=arguments[1];this.mcp=t,this.p=e}function xi(){}function Ei(){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 Ii(){this.input=null,this.extremalPts=null,this.centre=null,this.radius=0;var t=arguments[0];this.input=t}function Ni(){if(this.inputGeom=null,this.isConvex=null,this.convexHullPts=null,this.minBaseSeg=new ae,this.minWidthPt=null,this.minPtIndex=null,this.minWidth=0,1===arguments.length){var t=arguments[0];Ni.call(this,t,!1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.inputGeom=e,this.isConvex=n}}function Ci(){this.inputGeom=null,this.distanceTolerance=null;var t=arguments[0];this.inputGeom=t}function Si(){pe.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 wi(){this._isMarked=!1;var t=arguments[0];Li.call(this,t)}function Ri(){this.vertexMap=new Zt}function Ti(){this._isStart=!1;var t=arguments[0];wi.call(this,t)}function Oi(){Ri.apply(this)}function Pi(){this.result=null,this.factory=null,this.graph=null,this.lines=new x,this.nodeEdgeStack=new ce,this.ringStartEdge=null,this.graph=new Oi}function bi(){this.items=new x,this.subnode=new Array(4).fill(null)}function _i(){this.pt=new c,this.level=0,this.env=null;var t=arguments[0];this.computeKey(t)}function Mi(){bi.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 Di(){bi.apply(this)}function Ai(){this.root=null,this.minExtent=1,this.root=new Di}function Fi(t){this.geometryFactory=t||new $t}function Gi(t){this.geometryFactory=t||new $t,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new Fi(this.geometryFactory)}function qi(){this.parser=new Fi(this.geometryFactory)}function Bi(t){this.geometryFactory=t||new $t,this.precisionModel=this.geometryFactory.getPrecisionModel(),this.parser=new te(this.geometryFactory)}function Vi(t){return[t.x,t.y]}function zi(t,e){this.geometryFactory=t||new $t,this.ol=e||"undefined"!=typeof ol&&ol}function ki(){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];ki.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 Yi(){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 Ui(){this.pt=null,this.isClosed=null,this.degree=null;var t=arguments[0];this.pt=t,this.isClosed=!1,this.degree=0}function Xi(){if(this.quadrantSegments=Xi.DEFAULT_QUADRANT_SEGMENTS,this.endCapStyle=Xi.CAP_ROUND,this.joinStyle=Xi.JOIN_ROUND,this.mitreLimit=Xi.DEFAULT_MITRE_LIMIT,this._isSingleSided=!1, this.simplifyFactor=Xi.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],s=arguments[2],o=arguments[3];this.setQuadrantSegments(i),this.setEndCapStyle(r),this.setJoinStyle(s),this.setMitreLimit(o)}}function Hi(){this.minIndex=-1,this.minCoord=null,this.minDe=null,this.orientedDe=null}function Wi(){this.array_=[]}function ji(){this.finder=null,this.dirEdgeList=new x,this.nodes=new x,this.rightMostCoord=null,this.env=null,this.finder=new Hi}function Ki(){this.inputLine=null,this.distanceTol=null,this.isDeleted=null,this.angleOrientation=oe.COUNTERCLOCKWISE;var t=arguments[0];this.inputLine=t}function Zi(){this.ptList=null,this.precisionModel=null,this.minimimVertexDistance=0,this.ptList=new x}function Qi(){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 ae,this.seg1=new ae,this.offset0=new ae,this.offset1=new ae,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 ie,this.filletAngleQuantum=Math.PI/2/e.getQuadrantSegments(),e.getQuadrantSegments()>=8&&e.getJoinStyle()===Xi.JOIN_ROUND&&(this.closingSegLengthFactor=Qi.MAX_CLOSING_SEG_LEN_FACTOR),this.init(n)}function Ji(){this.distance=0,this.precisionModel=null,this.bufParams=null;var t=arguments[0],e=arguments[1];this.precisionModel=t,this.bufParams=e}function $i(){this.subgraphs=null,this.seg=new ae,this.cga=new oe;var t=arguments[0];this.subgraphs=t}function tr(){this.upwardSeg=null,this.leftDepth=null;var t=arguments[0],e=arguments[1];this.upwardSeg=new ae(t),this.leftDepth=e}function er(){this.inputGeom=null,this.distance=null,this.curveBuilder=null,this.curveList=new x;var t=arguments[0],e=arguments[1],n=arguments[2];this.inputGeom=t,this.distance=e,this.curveBuilder=n}function nr(){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 ir(){this.bufParams=null,this.workingPrecisionModel=null,this.workingNoder=null,this.geomFact=null,this.graph=null,this.edgeList=new Jn;var t=arguments[0];this.bufParams=t}function rr(){this.li=new ie,this.segStrings=null;var t=arguments[0];this.segStrings=t}function sr(){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],i=arguments[2];if(this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=i,e<=0)throw new n("Scale factor must be non-zero");1!==e&&(this.pt=new c(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new c,this.p1Scaled=new c),this.initCorners(this.pt)}function or(){this.index=null;var t=arguments[0];this.index=t}function ar(){oi.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 ur(){this.li=null,this.interiorIntersections=null;var t=arguments[0];this.li=t,this.interiorIntersections=new x}function lr(){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 ie,this.li.setPrecisionModel(t),this.scaleFactor=t.getScale()}function hr(){if(this.argGeom=null,this.distance=null,this.bufParams=new Xi,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 cr(){this.comps=null;var t=arguments[0];this.comps=t}function fr(){if(this.component=null,this.segIndex=null,this.pt=null,2===arguments.length){var t=arguments[0],e=arguments[1];fr.call(this,t,fr.INSIDE_AREA,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.component=n,this.segIndex=i,this.pt=r}}function gr(){this.pts=null;var t=arguments[0];this.pts=t}function dr(){this.locations=null;var t=arguments[0];this.locations=t}function pr(){if(this.geom=null,this.terminateDistance=0,this.ptLocator=new Se,this.minDistanceLocation=null,this.minDistance=i.MAX_VALUE,2===arguments.length){var t=arguments[0],e=arguments[1];pr.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 mr(){this.factory=null,this.directedEdges=new x,this.coordinates=null;var t=arguments[0];this.factory=t}function vr(){this._isMarked=!1,this._isVisited=!1,this.data=null}function yr(){vr.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],i=arguments[3];this.from=t,this.to=e,this.edgeDirection=i,this.p0=t.getCoordinate(),this.p1=n;var r=this.p1.x-this.p0.x,s=this.p1.y-this.p0.y;this.quadrant=je.quadrant(r,s),this.angle=Math.atan2(s,r)}function xr(){var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];yr.call(this,t,e,n,i)}function Er(){if(vr.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 Ir(){this.outEdges=new x,this.sorted=!1}function Nr(){if(vr.apply(this),this.pt=null,this.deStar=null,1===arguments.length){var t=arguments[0];Nr.call(this,t,new Ir)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.pt=e,this.deStar=n}}function Cr(){Er.apply(this),this.line=null;var t=arguments[0];this.line=t}function Sr(){this.nodeMap=new et}function Lr(){this.edges=new K,this.dirEdges=new K,this.nodeMap=new Sr}function wr(){Lr.apply(this)}function Rr(){this.graph=new wr,this.mergedLineStrings=null,this.factory=null,this.edgeStrings=null}function Tr(){this.edgeRing=null,this.next=null,this.label=-1;var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3];yr.call(this,t,e,n,i)}function Or(){Er.apply(this),this.line=null;var t=arguments[0];this.line=t}function Pr(){this.geometryFactory=new $t,this.geomGraph=null,this.disconnectedRingcoord=null;var t=arguments[0];this.geomGraph=t}function br(){}function _r(){if(this.edgeEnds=new x,1===arguments.length){var t=arguments[0];_r.call(this,null,t)}else if(2===arguments.length){var e=(arguments[0],arguments[1]);mn.call(this,e.getEdge(),e.getCoordinate(),e.getDirectedCoordinate(),new ln(e.getLabel())),this.insert(e)}}function Mr(){Ln.apply(this)}function Dr(){var t=arguments[0],e=arguments[1];dn.call(this,t,e)}function Ar(){yn.apply(this)}function Fr(){this.nodes=new pn(new Ar)}function Gr(){this.li=new ie,this.geomGraph=null,this.nodeGraph=new Fr,this.invalidPoint=null;var t=arguments[0];this.geomGraph=t}function qr(){this.graph=null,this.rings=new x,this.totalEnv=new I,this.index=null,this.nestedPt=null;var t=arguments[0];this.graph=t}function Br(){if(this.errorType=null,this.pt=null,1===arguments.length){var t=arguments[0];Br.call(this,t,null)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.errorType=e,null!==n&&(this.pt=n.copy())}}function Vr(){this.parentGeometry=null,this.isSelfTouchingRingFormingHoleValid=!1,this.validErr=null;var t=arguments[0];this.parentGeometry=t}function zr(){this.factory=null,this.deList=new x,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 kr(){}function Yr(){Lr.apply(this),this.factory=null;var t=arguments[0];this.factory=t}function Ur(){if(this.lineStringAdder=new Xr(this),this.graph=null,this.dangles=new x,this.cutEdges=new x,this.invalidRingLines=new x,this.holeList=null,this.shellList=null,this.polyList=null,this.isCheckingRingsValid=!0,this.extractOnlyPolygonal=null,this.geomFactory=null,0===arguments.length)Ur.call(this,!1);else if(1===arguments.length){var t=arguments[0];this.extractOnlyPolygonal=t}}function Xr(){this.p=null;var t=arguments[0];this.p=t}function Hr(){this.li=new ie,this.ptLocator=new Se,this.arg=null,this.nodes=new pn(new Ar),this.im=null,this.isolatedEdges=new x,this.invalidPoint=null;var t=arguments[0];this.arg=t}function Wr(){this.rectEnv=null;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal()}function jr(){this.li=new ie,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 c(t.getMinX(),t.getMinY()),this.diagUp1=new c(t.getMaxX(),t.getMaxY()),this.diagDown0=new c(t.getMinX(),t.getMaxY()),this.diagDown1=new c(t.getMaxX(),t.getMinY())}function Kr(){this._isDone=!1}function Zr(){this.rectangle=null,this.rectEnv=null;var t=arguments[0];this.rectangle=t,this.rectEnv=t.getEnvelopeInternal()}function Qr(){Kr.apply(this),this.rectEnv=null,this._intersects=!1;var t=arguments[0];this.rectEnv=t}function Jr(){Kr.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 $r(){Kr.apply(this),this.rectEnv=null,this.rectIntersector=null,this.hasIntersection=!1,this.p0=new c,this.p1=new c;var t=arguments[0];this.rectEnv=t.getEnvelopeInternal(),this.rectIntersector=new jr(this.rectEnv)}function ts(){if(this._relate=null,2===arguments.length){var t=arguments[0],e=arguments[1];Zn.call(this,t,e),this._relate=new Hr(this.arg)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];Zn.call(this,n,i,r),this._relate=new Hr(this.arg)}}function es(){this.geomFactory=null,this.skipEmpty=!1,this.inputGeoms=null;var t=arguments[0];this.geomFactory=es.extractFactory(t),this.inputGeoms=t}function ns(){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 is(){this.sortIndex=-1,this.comps=null;var t=arguments[0],e=arguments[1];this.sortIndex=t,this.comps=e}function rs(){this.inputPolys=null,this.geomFactory=null;var t=arguments[0];this.inputPolys=t,null===this.inputPolys&&(this.inputPolys=new x)}function ss(){if(this.polygons=new x,this.lines=new x,this.points=new x,this.geomFact=null,1===arguments.length){if(oo(arguments[0],d)){var t=arguments[0];this.extract(t)}else if(arguments[0]instanceof F){var e=arguments[0];this.extract(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.geomFact=i,this.extract(n)}}function os(){Ot.CoordinateOperation.apply(this),this.targetPM=null,this.removeCollapsed=!0;var t=arguments[0],e=arguments[1];this.targetPM=t,this.removeCollapsed=e}function as(){this.targetPM=null,this.removeCollapsed=!0,this.changePrecisionModel=!1,this.isPointwise=!1;var t=arguments[0];this.targetPM=t}function us(){this.pts=null,this.usePt=null,this.distanceTolerance=null,this.seg=new ae;var t=arguments[0];this.pts=t}function ls(){this.inputGeom=null,this.distanceTolerance=null,this.isEnsureValidTopology=!0;var t=arguments[0];this.inputGeom=t}function hs(){pe.apply(this),this.isEnsureValidTopology=!0,this.distanceTolerance=null;var t=arguments[0],e=arguments[1];this.isEnsureValidTopology=t,this.distanceTolerance=e}function cs(){if(this.parent=null,this.index=null,2===arguments.length){var t=arguments[0],e=arguments[1];cs.call(this,t,e,null,-1)}else if(4===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2],s=arguments[3];ae.call(this,n,i),this.parent=r,this.index=s}}function fs(){if(this.parentLine=null,this.segs=null,this.resultSegs=new x,this.minimumSize=null,1===arguments.length){var t=arguments[0];fs.call(this,t,2)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.parentLine=e,this.minimumSize=n,this.init()}}function gs(){this.index=new Ai}function ds(){this.querySeg=null,this.items=new x;var t=arguments[0];this.querySeg=t}function ps(){this.li=new ie,this.inputIndex=new gs,this.outputIndex=new gs,this.line=null,this.linePts=null,this.distanceTolerance=0;var t=arguments[0],e=arguments[1];this.inputIndex=t,this.outputIndex=e}function ms(){this.inputIndex=new gs,this.outputIndex=new gs,this.distanceTolerance=0}function vs(){this.inputGeom=null,this.lineSimplifier=new ms,this.linestringMap=null;var t=arguments[0];this.inputGeom=t}function ys(){pe.apply(this),this.linestringMap=null;var t=arguments[0];this.linestringMap=t}function xs(){this.tps=null;var t=arguments[0];this.tps=t}function Es(){this.seg=null,this.segLen=null,this.splitPt=null,this.minimumLen=0;var t=arguments[0];this.seg=t,this.segLen=t.getLength()}function Is(){}function Ns(){}function Cs(){}function Ss(){if(this.p=null,1===arguments.length){var t=arguments[0];this.p=new c(t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];this.p=new c(e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2];this.p=new c(i,r,s)}}function Ls(){this._isOnConstraint=null,this.constraint=null;var t=arguments[0];Ss.call(this,t)}function ws(){this._rot=null,this.vertex=null,this.next=null,this.data=null}function Rs(){this.subdiv=null,this.isUsingTolerance=!1;var t=arguments[0];this.subdiv=t,this.isUsingTolerance=t.getTolerance()>0}function Ts(){}function Os(){this.subdiv=null,this.lastEdge=null;var t=arguments[0];this.subdiv=t,this.init()}function Ps(){if(this.seg=null,1===arguments.length){if("string"==typeof arguments[0]){var t=arguments[0];u.call(this,t)}else if(arguments[0]instanceof ae){var e=arguments[0];u.call(this,"Locate failed to converge (at edge: "+e+"). Possible causes include invalid Subdivision topology or very close sites"),this.seg=new ae(e)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];u.call(this,Ps.msgWithSpatial(n,i)),this.seg=new ae(i)}}function bs(){}function _s(){this.visitedKey=0,this.quadEdges=new x,this.startingEdge=null,this.tolerance=null,this.edgeCoincidenceTolerance=null,this.frameVertex=new Array(3).fill(null),this.frameEnv=null,this.locator=null,this.seg=new ae,this.triEdges=new Array(3).fill(null);var t=arguments[0],e=arguments[1];this.tolerance=e,this.edgeCoincidenceTolerance=e/_s.EDGE_COINCIDENCE_TOL_FACTOR,this.createFrame(t),this.startingEdge=this.initSubdiv(),this.locator=new Os(this)}function Ms(){}function Ds(){this.triList=new x}function As(){this.triList=new x}function Fs(){this.coordList=new E,this.triCoords=new x}function Gs(){if(this.ls=null,this.data=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.ls=new ae(t,e)}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.ls=new ae(n,i),this.data=r}else if(6===arguments.length){var s=arguments[0],o=arguments[1],a=arguments[2],u=arguments[3],l=arguments[4],h=arguments[5];Gs.call(this,new c(s,o,a),new c(u,l,h))}else if(7===arguments.length){var f=arguments[0],g=arguments[1],d=arguments[2],p=arguments[3],m=arguments[4],v=arguments[5],y=arguments[6];Gs.call(this,new c(f,g,d),new c(p,m,v),y)}}function qs(){}function Bs(){if(this.p=null,this.data=null,this.left=null,this.right=null,this.count=null,2===arguments.length){var t=arguments[0],e=arguments[1];this.p=new c(t),this.left=null,this.right=null,this.count=1,this.data=e}else if(3===arguments.length){var n=arguments[0],i=arguments[1],r=arguments[2];this.p=new c(n,i),this.left=null,this.right=null,this.count=1,this.data=r}}function Vs(){if(this.root=null,this.numberOfNodes=null,this.tolerance=null,0===arguments.length)Vs.call(this,0);else if(1===arguments.length){var t=arguments[0];this.tolerance=t}}function zs(){this.tolerance=null,this.matchNode=null,this.matchDist=0,this.p=null;var t=arguments[0],e=arguments[1];this.p=t,this.tolerance=e}function ks(){this.initialVertices=null,this.segVertices=null,this.segments=new x,this.subdiv=null,this.incDel=null,this.convexHull=null,this.splitFinder=new Ns,this.kdt=null,this.vertexFactory=null,this.computeAreaEnv=null,this.splitPt=null,this.tolerance=null;var t=arguments[0],e=arguments[1];this.initialVertices=new x(t),this.tolerance=e,this.kdt=new Vs(e)}function Ys(){this.siteCoords=null,this.tolerance=0,this.subdiv=null}function Us(){this.siteCoords=null,this.constraintLines=null,this.tolerance=0,this.subdiv=null,this.constraintVertexMap=new et}function Xs(){this.siteCoords=null,this.tolerance=0,this.subdiv=null,this.clipEnv=null,this.diagramEnv=null}function Hs(){if(this.componentIndex=0,this.segmentIndex=0,this.segmentFraction=0,0===arguments.length);else if(1===arguments.length){var t=arguments[0];this.componentIndex=t.componentIndex,this.segmentIndex=t.segmentIndex,this.segmentFraction=t.segmentFraction}else if(2===arguments.length){var e=arguments[0],n=arguments[1];Hs.call(this,0,e,n)}else if(3===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2];this.componentIndex=i,this.segmentIndex=r,this.segmentFraction=s,this.normalize()}else if(4===arguments.length){var o=arguments[0],a=arguments[1],u=arguments[2],l=arguments[3];this.componentIndex=o,this.segmentIndex=a,this.segmentFraction=u,l&&this.normalize()}}function Ws(){if(this.linearGeom=null,this.numLines=null,this.currentLine=null,this.componentIndex=0,this.vertexIndex=0,1===arguments.length){var t=arguments[0];Ws.call(this,t,0,0)}else if(2===arguments.length){var e=arguments[0],i=arguments[1];Ws.call(this,e,i.getComponentIndex(),Ws.segmentEndVertexIndex(i))}else if(3===arguments.length){var r=arguments[0],s=arguments[1],o=arguments[2];if(!oo(r,nt))throw new n("Lineal geometry is required");this.linearGeom=r,this.numLines=r.getNumGeometries(),this.componentIndex=s,this.vertexIndex=o,this.loadCurrentLine()}}function js(){this.linearGeom=null;var t=arguments[0];this.linearGeom=t}function Ks(){this.linearGeom=null;var t=arguments[0];this.linearGeom=t}function Zs(){this.geomFact=null,this.lines=new x,this.coordList=null,this.ignoreInvalidLines=!1,this.fixInvalidLines=!1,this.lastPt=null;var t=arguments[0];this.geomFact=t}function Qs(){this.line=null;var t=arguments[0];this.line=t}function Js(){this.linearGeom=null;var t=arguments[0];this.linearGeom=t,this.checkGeometryType()}function $s(){this.linearGeom=null;var t=arguments[0];this.linearGeom=t}function to(){this.linearGeom=null;var t=arguments[0];this.linearGeom=t}function eo(){this.linearGeom=null;var t=arguments[0];this.linearGeom=t}function no(){}"fill"in Array.prototype||Object.defineProperty(Array.prototype,"fill",{configurable:!0,value:function(t){if(void 0===this||null===this)throw new TypeError(this+" is not an object");var e=Object(this),n=Math.max(Math.min(e.length,9007199254740991),0)||0,i=1 in arguments?parseInt(Number(arguments[1]),10)||0:0;i=i<0?Math.max(n+i,0):Math.min(i,n);var r=2 in arguments&&void 0!==arguments[2]?parseInt(Number(arguments[2]),10)||0:n;for(r=r<0?Math.max(n+arguments[2],0):Math.min(r,n);ie.x?1:this.ye.y?1:0},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return h.shouldNeverReachHere("this shouldn't happen because this class is Cloneable"),null;throw t}},copy:function(){return new c(this)},toString:function(){return"("+this.x+", "+this.y+", "+this.z+")"},distance3D:function(t){var e=this.x-t.x,n=this.y-t.y,i=this.z-t.z;return Math.sqrt(e*e+n*n+i*i)},distance:function(t){var e=this.x-t.x,n=this.y-t.y;return Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+c.hashCode(this.x),t=37*t+c.hashCode(this.y)},setCoordinate:function(t){this.x=t.x,this.y=t.y,this.z=t.z},interfaces_:function(){return[r,s,a]},getClass:function(){return c}}),c.hashCode=function(){if(1===arguments.length){var t=arguments[0],e=i.doubleToLongBits(t);return Math.trunc(e^e>>>32)}},io(f.prototype,{compare:function(t,e){var n=t,i=e,r=f.compare(n.x,i.x);if(0!==r)return r;var s=f.compare(n.y,i.y);return 0!==s?s:this.dimensionsToTest<=2?0:f.compare(n.z,i.z)},interfaces_:function(){return[o]},getClass:function(){return f}}),f.compare=function(t,e){return te?1:i.isNaN(t)?i.isNaN(e)?0:-1:i.isNaN(e)?1:0},c.DimensionalComparator=f,c.serialVersionUID=0x5cbf2c235c7e5800,c.NULL_ORDINATE=i.NaN,c.X=0,c.Y=1,c.Z=2,g.prototype.hasNext=function(){},g.prototype.next=function(){},g.prototype.remove=function(){},d.prototype.add=function(){},d.prototype.addAll=function(){},d.prototype.isEmpty=function(){},d.prototype.iterator=function(){},d.prototype.size=function(){},d.prototype.toArray=function(){},d.prototype.remove=function(){},p.prototype=new Error,p.prototype.name="IndexOutOfBoundsException",m.prototype=Object.create(d.prototype),m.prototype.constructor=m,m.prototype.get=function(){},m.prototype.set=function(){},m.prototype.isEmpty=function(){},v.prototype=new Error,v.prototype.name="NoSuchElementException",y.prototype=new Error,y.prototype.name="OperationNotSupported",x.prototype=Object.create(m.prototype),x.prototype.constructor=x,x.prototype.ensureCapacity=function(){},x.prototype.interfaces_=function(){return[m,d]},x.prototype.add=function(t){return 1===arguments.length?this.array_.push(t):this.array_.splice(arguments[0],arguments[1]),!0},x.prototype.clear=function(){this.array_=[]},x.prototype.addAll=function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next());return!0},x.prototype.set=function(t,e){var n=this.array_[t];return this.array_[t]=e,n},x.prototype.iterator=function(){return new so(this)},x.prototype.get=function(t){if(t<0||t>=this.size())throw new p;return this.array_[t]},x.prototype.isEmpty=function(){return 0===this.array_.length},x.prototype.size=function(){return this.array_.length},x.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e=1){var s=this.get(this.size()-1);if(s.equals2D(i))return null}x.prototype.add.call(this,i)}else if(arguments[0]instanceof Object&&"boolean"==typeof arguments[1]){var o=arguments[0],a=arguments[1];return this.add(o,a),!0}}else if(3===arguments.length){if("boolean"==typeof arguments[2]&&arguments[0]instanceof Array&&"boolean"==typeof arguments[1]){var u=arguments[0],l=arguments[1],h=arguments[2];if(h)for(var f=0;f=0;f--)this.add(u[f],l);return!0}if("boolean"==typeof arguments[2]&&Number.isInteger(arguments[0])&&arguments[1]instanceof c){var g=arguments[0],d=arguments[1],p=arguments[2];if(!p){var m=this.size();if(m>0){if(g>0){var v=this.get(g-1);if(v.equals2D(d))return null}if(gC&&(S=-1);for(var f=N;f!==C;f+=S)this.add(E[f],I);return!0}},closeRing:function(){this.size()>0&&this.add(new c(this.get(0)),!1)},interfaces_:function(){return[]},getClass:function(){return E}}),E.coordArrayType=new Array(0).fill(null),io(I.prototype,{getArea:function(){return this.getWidth()*this.getHeight()},equals:function(t){if(!(t instanceof I))return!1;var e=t;return this.isNull()?e.isNull():this.maxx===e.getMaxX()&&this.maxy===e.getMaxY()&&this.minx===e.getMinX()&&this.miny===e.getMinY()},intersection:function(t){if(this.isNull()||t.isNull()||!this.intersects(t))return new I;var e=this.minx>t.minx?this.minx:t.minx,n=this.miny>t.miny?this.miny:t.miny;return new I(e,this.maxx=this.minx&&e.getMaxX()<=this.maxx&&e.getMinY()>=this.miny&&e.getMaxY()<=this.maxy)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return!this.isNull()&&(n>=this.minx&&n<=this.maxx&&i>=this.miny&&i<=this.maxy)}},intersects:function(){if(1===arguments.length){if(arguments[0]instanceof I){var t=arguments[0];return!this.isNull()&&!t.isNull()&&!(t.minx>this.maxx||t.maxxthis.maxy||t.maxythis.maxx||nthis.maxy||ithis.maxx&&(this.maxx=e.maxx),e.minythis.maxy&&(this.maxy=e.maxy))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];this.isNull()?(this.minx=n,this.maxx=n,this.miny=i,this.maxy=i):(nthis.maxx&&(this.maxx=n),ithis.maxy&&(this.maxy=i))}},minExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return te.minx?1:this.minye.miny?1:this.maxxe.maxx?1:this.maxye.maxy?1:0},translate:function(t,e){if(this.isNull())return null;this.init(this.getMinX()+t,this.getMaxX()+t,this.getMinY()+e,this.getMaxY()+e)},toString:function(){return"Env["+this.minx+" : "+this.maxx+", "+this.miny+" : "+this.maxy+"]"},setToNull:function(){this.minx=0,this.maxx=-1,this.miny=0,this.maxy=-1},getHeight:function(){return this.isNull()?0:this.maxy-this.miny},maxExtent:function(){if(this.isNull())return 0;var t=this.getWidth(),e=this.getHeight();return t>e?t:e},expandBy:function(){if(1===arguments.length){var t=arguments[0];this.expandBy(t,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];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 c){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 c((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 c){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],s=arguments[1],o=arguments[2],a=arguments[3];rt.maxx&&(e=this.minx-t.maxx);var n=0;return this.maxyt.maxy&&(n=this.miny-t.maxy),0===e?n:0===n?e:Math.sqrt(e*e+n*n)},hashCode:function(){var t=17;return t=37*t+c.hashCode(this.minx),t=37*t+c.hashCode(this.maxx),t=37*t+c.hashCode(this.miny),t=37*t+c.hashCode(this.maxy)},interfaces_:function(){return[r,a]},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.xe.x?t.x:e.x)&&n.y>=(t.ye.y?t.y:e.y)}if(4===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2],o=arguments[3],a=Math.min(s.x,o.x),u=Math.max(s.x,o.x),l=Math.min(i.x,r.x),h=Math.max(i.x,r.x);return!(l>u)&&(!(hu)&&!(h-1};io(L.prototype,{interfaces_:function(){return[]},getClass:function(){return L}}),L.log10=function(t){var e=Math.log(t);return i.isInfinite(e)?e:i.isNaN(e)?e:e/L.LOG_10},L.min=function(t,e,n,i){var r=t;return en?n:t}if(Number.isInteger(arguments[2])&&Number.isInteger(arguments[0])&&Number.isInteger(arguments[1])){var i=arguments[0],r=arguments[1],s=arguments[2];return is?s: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],s=arguments[1],o=arguments[2],a=arguments[3],i=r;return s>i&&(i=s),o>i&&(i=o),a>i&&(i=a),i}},L.average=function(t,e){return(t+e)/2},L.LOG_10=Math.log(10),w.prototype.append=function(t){this.str+=t},w.prototype.setCharAt=function(t,e){this.str=this.str.substr(0,t)+e+this.str.substr(t+1)},w.prototype.toString=function(t){return this.str},R.prototype.intValue=function(){return this.value},R.prototype.compareTo=function(t){return this.valuet?1:0},R.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()},io(O.prototype,{le:function(t){return this.hi9?(h=!0,c="9"):c="0"+l,o.append(c),n=n.subtract(O.valueOf(l)).multiply(O.TEN),h&&n.selfAdd(O.TEN);var f=!0,g=O.magnitude(n.hi);if(g<0&&Math.abs(g)>=a-u&&(f=!1),!f)break}return e[0]=i,o.toString()},sqr:function(){return this.multiply(this)},doubleValue:function(){return this.hi+this.lo},subtract:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.add(t.negate())}if("number"==typeof arguments[0]){var e=arguments[0];return this.add(-e)}},equals:function(){if(1===arguments.length){var t=arguments[0];return this.hi===t.hi&&this.lo===t.lo}},isZero:function(){return 0===this.hi&&0===this.lo},selfSubtract:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.isNaN()?this:this.selfAdd(-t.hi,-t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.isNaN()?this:this.selfAdd(-e,0)}},getSpecialNumberString:function(){return this.isZero()?"0.0":this.isNaN()?"NaN ":null},min:function(t){return this.le(t)?this:t},selfDivide:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfDivide(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfDivide(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,s=null,o=null,a=null,u=null,l=null,h=null,c=null;return u=this.hi/n,l=O.SPLIT*u,r=l-u,c=O.SPLIT*n,r=l-r,s=u-r,o=c-n,h=u*n,o=c-o,a=n-o,c=r*o-h+r*a+s*o+s*a,l=(this.hi-h-c+this.lo-u*i)/n,c=u+l,this.hi=c,this.lo=u-c+l,this}},dump:function(){return"DD<"+this.hi+", "+this.lo+">"},divide:function(){if(arguments[0]instanceof O){var t=arguments[0],e=null,n=null,r=null,s=null,o=null,a=null,u=null,l=null;o=this.hi/t.hi,a=O.SPLIT*o,e=a-o,l=O.SPLIT*t.hi,e=a-e,n=o-e,r=l-t.hi,u=o*t.hi,r=l-r,s=t.hi-r,l=e*r-u+e*s+n*r+n*s,a=(this.hi-u-l+this.lo-o*t.lo)/t.hi,l=o+a;return new O(l,o-l+a)}if("number"==typeof arguments[0]){var h=arguments[0];return i.isNaN(h)?O.createNaN():O.copy(this).selfDivide(h,0)}},ge:function(t){return this.hi>t.hi||this.hi===t.hi&&this.lo>=t.lo},pow:function(t){if(0===t)return O.valueOf(1);var e=new O(this),n=O.valueOf(1),i=Math.abs(t);if(i>1)for(;i>0;)i%2==1&&n.selfMultiply(e),(i/=2)>0&&(e=e.sqr());else n=e;return t<0?n.reciprocal():n},ceil:function(){if(this.isNaN())return O.NaN;var t=Math.ceil(this.hi),e=0;return t===this.hi&&(e=Math.ceil(this.lo)),new O(t,e)},compareTo:function(t){var e=t;return this.hie.hi?1:this.loe.lo?1:0},rint:function(){return this.isNaN()?this:this.add(.5).floor()},setValue:function(){if(arguments[0]instanceof O){var t=arguments[0];return this.init(t),this}if("number"==typeof arguments[0]){var e=arguments[0];return this.init(e),this}},max:function(t){return this.ge(t)?this:t},sqrt:function(){if(this.isZero())return O.valueOf(0);if(this.isNegative())return O.NaN;var t=1/Math.sqrt(this.hi),e=this.hi*t,n=O.valueOf(e),i=this.subtract(n.sqr()),r=i.hi*(.5*t);return n.add(r)},selfAdd:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfAdd(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0],n=null,i=null,r=null,s=null,o=null,a=null;return r=this.hi+e,o=r-this.hi,s=r-o,s=e-o+(this.hi-s),a=s+this.lo,n=r+a,i=a+(r-n),this.hi=n+i,this.lo=i+(n-this.hi),this}}else if(2===arguments.length){var u=arguments[0],l=arguments[1],n=null,i=null,h=null,c=null,r=null,s=null,o=null,a=null;r=this.hi+u,h=this.lo+l,o=r-this.hi,a=h-this.lo,s=r-o,c=h-a,s=u-o+(this.hi-s),c=l-a+(this.lo-c),o=s+h,n=r+o,i=o+(r-n),o=c+i;var f=n+o,g=o+(n-f);return this.hi=f,this.lo=g,this}},selfMultiply:function(){if(1===arguments.length){if(arguments[0]instanceof O){var t=arguments[0];return this.selfMultiply(t.hi,t.lo)}if("number"==typeof arguments[0]){var e=arguments[0];return this.selfMultiply(e,0)}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=null,s=null,o=null,a=null,u=null,l=null;u=O.SPLIT*this.hi,r=u-this.hi,l=O.SPLIT*n,r=u-r,s=this.hi-r,o=l-n,u=this.hi*n,o=l-o,a=n-o,l=r*o-u+r*a+s*o+s*a+(this.hi*i+this.lo*n);var h=u+l;r=u-h;var c=l+r;return this.hi=h,this.lo=c,this}},selfSqr:function(){return this.selfMultiply(this)},floor:function(){if(this.isNaN())return O.NaN;var t=Math.floor(this.hi),e=0;return t===this.hi&&(e=Math.floor(this.lo)),new O(t,e)},negate:function(){return this.isNaN()?this:new O(-this.hi,-this.lo)},clone:function(){try{return null}catch(t){if(t instanceof CloneNotSupportedException)return null;throw t}},multiply:function(){if(arguments[0]instanceof O){var t=arguments[0];return t.isNaN()?O.createNaN():O.copy(this).selfMultiply(t)}if("number"==typeof arguments[0]){var e=arguments[0];return i.isNaN(e)?O.createNaN():O.copy(this).selfMultiply(e,0)}},isNaN:function(){return i.isNaN(this.hi)},intValue:function(){return Math.trunc(this.hi)},toString:function(){var t=O.magnitude(this.hi);return t>=-3&&t<=20?this.toStandardNotation():this.toSciNotation()},toStandardNotation:function(){var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!0,e),i=e[0]+1,r=n;if("."===n.charAt(0))r="0"+n;else if(i<0)r="0."+O.stringOfChar("0",-i)+n;else if(-1===n.indexOf(".")){var s=i-n.length,o=O.stringOfChar("0",s);r=n+o+".0"}return this.isNegative()?"-"+r:r},reciprocal:function(){var t=null,e=null,n=null,i=null,r=null,s=null,o=null,a=null;r=1/this.hi,s=O.SPLIT*r,t=s-r,a=O.SPLIT*this.hi,t=s-t,e=r-t,n=a-this.hi,o=r*this.hi,n=a-n,i=this.hi-n,a=t*n-o+t*i+e*n+e*i,s=(1-o-a-r*this.lo)/this.hi;var u=r+s;return new O(u,r-u+s)},toSciNotation:function(){if(this.isZero())return O.SCI_NOT_ZERO;var t=this.getSpecialNumberString();if(null!==t)return t;var e=new Array(1).fill(null),n=this.extractSignificantDigits(!1,e),i=O.SCI_NOT_EXPONENT_CHAR+e[0];if("0"===n.charAt(0))throw new IllegalStateException("Found leading zero: "+n);var r="";n.length>1&&(r=n.substring(1));var s=n.charAt(0)+"."+r;return this.isNegative()?"-"+s+i:s+i},abs:function(){return this.isNaN()?O.NaN:this.isNegative()?this.negate():new O(this)},isPositive:function(){return this.hi>0||0===this.hi&&this.lo>0},lt:function(t){return this.hit.hi||this.hi===t.hi&&this.lo>t.lo},isNegative:function(){return this.hi<0||0===this.hi&&this.lo<0},trunc:function(){return this.isNaN()?O.NaN:this.isPositive()?this.floor():this.ceil()},signum:function(){return this.hi>0?1:this.hi<0?-1:this.lo>0?1:this.lo<0?-1:0},interfaces_:function(){return[a,r,s]},getClass:function(){return O}}),O.sqr=function(t){return O.valueOf(t).selfMultiply(t)},O.valueOf=function(){if("string"==typeof arguments[0]){var t=arguments[0];return O.parse(t)}if("number"==typeof arguments[0]){return new O(arguments[0])}},O.sqrt=function(t){return O.valueOf(t).sqrt()},O.parse=function(t){for(var e=0,n=t.length;T.isWhitespace(t.charAt(e));)e++;var i=!1;if(e=n)break;var l=t.charAt(e);if(e++,T.isDigit(l)){var h=l-"0";s.selfMultiply(O.TEN),s.selfAdd(h),o++}else{if("."!==l){if("e"===l||"E"===l){var c=t.substring(e);try{u=R.parseInt(c)}catch(e){throw e instanceof NumberFormatException?new NumberFormatException("Invalid exponent "+c+" in string "+t):e}break}throw new NumberFormatException("Unexpected character '"+l+"' at position "+e+" in string "+t)}a=o}}var f=s,g=o-a-u;if(0===g)f=s;else if(g>0){var d=O.TEN.pow(g);f=s.divide(d)}else if(g<0){var d=O.TEN.pow(-g);f=s.multiply(d)}return i?f.negate():f},O.createNaN=function(){return new O(i.NaN,i.NaN)},O.copy=function(t){return new O(t)},O.magnitude=function(t){var e=Math.abs(t),n=Math.log(e)/Math.log(10),i=Math.trunc(Math.floor(n));return 10*Math.pow(10,i)<=e&&(i+=1),i},O.stringOfChar=function(t,e){for(var n=new w,i=0;i0){if(s<=0)return P.signum(o);i=r+s}else{if(!(r<0))return P.signum(o);if(s>=0)return P.signum(o);i=-r-s}var a=P.DP_SAFE_EPSILON*i;return o>=a||-o>=a?P.signum(o):2},P.signum=function(t){return t>0?1:t<0?-1:0},P.DP_SAFE_EPSILON=1e-15,io(b.prototype,{setOrdinate:function(t,e,n){},size:function(){},getOrdinate:function(t,e){},getCoordinate:function(){if(1===arguments.length){arguments[0]}else if(2===arguments.length){arguments[0],arguments[1]}},getCoordinateCopy:function(t){},getDimension:function(){},getX:function(t){},clone:function(){},expandEnvelope:function(t){},copy:function(){},getY:function(t){},toCoordinateArray:function(){},interfaces_:function(){return[s]},getClass:function(){return b}}),b.X=0,b.Y=1,b.Z=2,b.M=3,_.arraycopy=function(t,e,n,i,r){for(var s=0,o=e;o0},interfaces_:function(){return[q]},getClass:function(){return V}}),io(z.prototype,{isInBoundary:function(t){return t>1},interfaces_:function(){return[q]},getClass:function(){return z}}),io(k.prototype,{isInBoundary:function(t){return 1===t},interfaces_:function(){return[q]},getClass:function(){return k}}),q.Mod2BoundaryNodeRule=B,q.EndPointBoundaryNodeRule=V,q.MultiValentEndPointBoundaryNodeRule=z,q.MonoValentEndPointBoundaryNodeRule=k,q.MOD2_BOUNDARY_RULE=new B,q.ENDPOINT_BOUNDARY_RULE=new V,q.MULTIVALENT_ENDPOINT_BOUNDARY_RULE=new z,q.MONOVALENT_ENDPOINT_BOUNDARY_RULE=new k,q.OGC_SFS_BOUNDARY_RULE=q.MOD2_BOUNDARY_RULE,io(Y.prototype,{interfaces_:function(){return[]},getClass:function(){return Y}}),Y.isRing=function(t){return!(t.length<4)&&!!t[0].equals2D(t[t.length-1])},Y.ptNotInList=function(t,e){for(var n=0;n=t?e:[]},Y.indexOf=function(t,e){for(var n=0;n0)&&(e=t[n]);return e},Y.extract=function(t,e,n){e=L.clamp(e,0,t.length),n=L.clamp(n,-1,t.length);var i=n-e+1;n<0&&(i=0),e>=t.length&&(i=0),ni.length)return 1;if(0===n.length)return 0;var r=Y.compare(n,i);return Y.isEqualReversed(n,i)?0:r},OLDcompare:function(t,e){var n=t,i=e;if(n.lengthi.length)return 1;if(0===n.length)return 0;for(var r=Y.increasingDirection(n),s=Y.increasingDirection(i),o=r>0?0:n.length-1,a=s>0?0:n.length-1,u=0;u0))return e.value;e=e.right}}return null},et.prototype.put=function(t,e){if(null===this.root_)return this.root_={key:t,value:e,left:null,right:null,parent:null,color:uo,getValue:function(){return this.value},getKey:function(){return this.key}},this.size_=1,null;var n,i,r=this.root_;do{if(n=r,(i=t.compareTo(r.key))<0)r=r.left;else{if(!(i>0)){var s=r.value;return r.value=e,s}r=r.right}}while(null!==r);var o={key:t,left:null,right:null,value:e,parent:n,color:uo,getValue:function(){return this.value},getKey:function(){return this.key}};return i<0?n.left=o:n.right=o,this.fixAfterInsertion(o),this.size_++,null},et.prototype.fixAfterInsertion=function(t){for(t.color=1;null!=t&&t!=this.root_&&1==t.parent.color;)if(Q(t)==$(Q(Q(t)))){var e=tt(Q(Q(t)));1==Z(e)?(J(Q(t),uo),J(e,uo),J(Q(Q(t)),1),t=Q(Q(t))):(t==tt(Q(t))&&(t=Q(t),this.rotateLeft(t)),J(Q(t),uo),J(Q(Q(t)),1),this.rotateRight(Q(Q(t))))}else{var e=$(Q(Q(t)));1==Z(e)?(J(Q(t),uo),J(e,uo),J(Q(Q(t)),1),t=Q(Q(t))):(t==$(Q(t))&&(t=Q(t),this.rotateRight(t)),J(Q(t),uo),J(Q(Q(t)),1),this.rotateLeft(Q(Q(t))))}this.root_.color=uo},et.prototype.values=function(){var t=new x,e=this.getFirstEntry();if(null!==e)for(t.add(e.value);null!==(e=et.successor(e));)t.add(e.value);return t},et.prototype.entrySet=function(){var t=new K,e=this.getFirstEntry();if(null!==e)for(t.add(e);null!==(e=et.successor(e));)t.add(e);return t},et.prototype.rotateLeft=function(t){if(null!=t){var e=t.right;t.right=e.left,null!=e.left&&(e.left.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.left==t?t.parent.left=e:t.parent.right=e,e.left=t,t.parent=e}},et.prototype.rotateRight=function(t){if(null!=t){var e=t.left;t.left=e.right,null!=e.right&&(e.right.parent=t),e.parent=t.parent,null==t.parent?this.root_=e:t.parent.right==t?t.parent.right=e:t.parent.left=e,e.right=t,t.parent=e}},et.prototype.getFirstEntry=function(){var t=this.root_;if(null!=t)for(;null!=t.left;)t=t.left;return t},et.successor=function(t){if(null===t)return null;if(null!==t.right){for(var e=t.right;null!==e.left;)e=e.left;return e}for(var e=t.parent,n=t;null!==e&&n===e.right;)n=e,e=e.parent;return e},et.prototype.size=function(){return this.size_},io(nt.prototype,{interfaces_:function(){return[]},getClass:function(){return nt}}),it.prototype=new j,rt.prototype=new it,rt.prototype.contains=function(t){for(var e=0,n=this.array_.length;e=0;){var o=r.substring(0,s);i.add(o),r=r.substring(s+n),s=r.indexOf(e)}r.length>0&&i.add(r);for(var a=new Array(i.size()).fill(null),u=0;u0)for(var s=r;s0&&i.append(" ");for(var s=0;s0&&i.append(","),i.append(xt.toString(t.getOrdinate(r,s)))}return i.append(")"),i.toString()}},Et.ensureValidRing=function(t,e){var n=e.size();return 0===n?e:n<=3?Et.createClosedRing(t,e,4):e.getOrdinate(0,b.X)===e.getOrdinate(n-1,b.X)&&e.getOrdinate(0,b.Y)===e.getOrdinate(n-1,b.Y)?e:Et.createClosedRing(t,e,n+1)},Et.createClosedRing=function(t,e,n){var i=t.create(n,e.getDimension()),r=e.size();Et.copy(e,0,i,0,r);for(var s=r;s0&&Et.reverse(this.points),null}},getCoordinate:function(){return this.isEmpty()?null:this.points.getCoordinate(0)},getBoundaryDimension:function(){return this.isClosed()?ot.FALSE:0},isClosed:function(){return!this.isEmpty()&&this.getCoordinateN(0).equals2D(this.getCoordinateN(this.getNumPoints()-1))},getEndPoint:function(){return this.isEmpty()?null:this.getPointN(this.getNumPoints()-1)},getDimension:function(){return 1},getLength:function(){return oe.computeLength(this.points)},getNumPoints:function(){return this.points.size()},reverse:function(){var t=this.points.copy();return Et.reverse(t),this.getFactory().createLineString(t)},compareToSameClass:function(){if(1===arguments.length){for(var t=arguments[0],e=t,n=0,i=0;n= 2)");this.points=t},isCoordinate:function(t){for(var e=0;e=1&&this.getCoordinateSequence().size()= 4)")},getGeometryType:function(){return"LinearRing"},copy:function(){return new Rt(this.points.copy(),this.factory)},interfaces_:function(){return[]},getClass:function(){return Rt}}),Rt.MINIMUM_VALID_SIZE=4,Rt.serialVersionUID=-0x3b229e262367a600,ro(Tt,lt),io(Tt.prototype,{getSortIndex:function(){return F.SORTINDEX_MULTIPOLYGON},equalsExact:function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];return!!this.isEquivalentClass(t)&<.prototype.equalsExact.call(this,t,e)}return lt.prototype.equalsExact.apply(this,arguments)},getBoundaryDimension:function(){return 1},getDimension:function(){return 2},reverse:function(){for(var t=this.geometries.length,e=new Array(t).fill(null),n=0;n0?e.createPoint(n[0]):e.createPoint():t},interfaces_:function(){return[Pt]},getClass:function(){return _t}}),io(Mt.prototype,{edit:function(t,e){return t instanceof Rt?e.createLinearRing(this.edit(t.getCoordinateSequence(),t)):t instanceof It?e.createLineString(this.edit(t.getCoordinateSequence(),t)):t instanceof Ct?e.createPoint(this.edit(t.getCoordinateSequence(),t)):t},interfaces_:function(){return[Pt]},getClass:function(){return Mt}}),Ot.NoOpGeometryOperation=bt,Ot.CoordinateOperation=_t,Ot.CoordinateSequenceOperation=Mt,io(Dt.prototype,{setOrdinate:function(t,e,i){switch(e){case b.X:this.coordinates[t].x=i;break;case b.Y:this.coordinates[t].y=i;break;case b.Z:this.coordinates[t].z=i;break;default:throw new n("invalid ordinateIndex")}},size:function(){return this.coordinates.length},getOrdinate:function(t,e){switch(e){case b.X:return this.coordinates[t].x;case b.Y:return this.coordinates[t].y;case b.Z:return this.coordinates[t].z}return i.NaN},getCoordinate:function(){if(1===arguments.length){var t=arguments[0];return this.coordinates[t]}if(2===arguments.length){var e=arguments[0],n=arguments[1];n.x=this.coordinates[e].x,n.y=this.coordinates[e].y,n.z=this.coordinates[e].z}},getCoordinateCopy:function(t){return new c(this.coordinates[t])},getDimension:function(){return this.dimension},getX:function(t){return this.coordinates[t].x},clone:function(){for(var t=new Array(this.size()).fill(null),e=0;e0){var t=new w(17*this.coordinates.length);t.append("("),t.append(this.coordinates[0]);for(var e=1;e3&&(e=3),e<2?new Dt(t):new Dt(t,e)}},interfaces_:function(){return[D,a]},getClass:function(){return At}}),At.instance=function(){return At.instanceObject},At.serialVersionUID=-0x38e49fa6cf6f2e00,At.instanceObject=new At;var ho,co=Object.defineProperty,fo=function(t,e){function n(t){if(!this||this.constructor!==n)return new n(t);this._keys=[],this._values=[],this._itp=[],this.objectOnly=e,t&&Gt.call(this,t)}return e||co(t,"size",{get:jt}),t.constructor=n,n.prototype=t,n}({delete:qt,has:zt,get:Bt,set:kt,keys:Ut,values:Xt,entries:Ht,forEach:Kt,clear:Yt}),go="undefined"!=typeof Map&&Map.prototype.values?Map:fo;Zt.prototype=new H,Zt.prototype.get=function(t){return this.map_.get(t)||null},Zt.prototype.put=function(t,e){return this.map_.set(t,e),e},Zt.prototype.values=function(){for(var t=new x,e=this.map_.values(),n=e.next();!n.done;)t.add(n.value),n=e.next();return t},Zt.prototype.entrySet=function(){var t=new K;return this.map_.entries().forEach(function(e){return t.add(e)}),t},Zt.prototype.size=function(){return this.map_.size()},io(Qt.prototype,{equals:function(t){if(!(t instanceof Qt))return!1;var e=t;return this.modelType===e.modelType&&this.scale===e.scale},compareTo:function(t){var e=t,n=this.getMaximumSignificantDigits(),i=e.getMaximumSignificantDigits();return new R(n).compareTo(new R(i))},getScale:function(){return this.scale},isFloating:function(){return this.modelType===Qt.FLOATING||this.modelType===Qt.FLOATING_SINGLE},getType:function(){return this.modelType},toString:function(){var t="UNKNOWN";return this.modelType===Qt.FLOATING?t="Floating":this.modelType===Qt.FLOATING_SINGLE?t="Floating-Single":this.modelType===Qt.FIXED&&(t="Fixed (Scale="+this.getScale()+")"),t},makePrecise:function(){if("number"==typeof arguments[0]){var t=arguments[0];if(i.isNaN(t))return t;if(this.modelType===Qt.FLOATING_SINGLE){return t}return this.modelType===Qt.FIXED?Math.round(t*this.scale)/this.scale:t}if(arguments[0]instanceof c){var e=arguments[0];if(this.modelType===Qt.FLOATING)return null;e.x=this.makePrecise(e.x),e.y=this.makePrecise(e.y)}},getMaximumSignificantDigits:function(){var t=16;return this.modelType===Qt.FLOATING?t=16:this.modelType===Qt.FLOATING_SINGLE?t=6:this.modelType===Qt.FIXED&&(t=1+Math.trunc(Math.ceil(Math.log(this.getScale())/Math.log(10)))),t},setScale:function(t){this.scale=Math.abs(t)},interfaces_:function(){return[a,r]},getClass:function(){return Qt}}),Qt.mostPrecise=function(t,e){return t.compareTo(e)>=0?t:e},io(Jt.prototype,{readResolve:function(){return Jt.nameToTypeMap.get(this.name)},toString:function(){return this.name},interfaces_:function(){return[a]},getClass:function(){return Jt}}),Jt.serialVersionUID=-552860263173159e4,Jt.nameToTypeMap=new Zt,Qt.Type=Jt,Qt.serialVersionUID=0x6bee6404e9a25c00,Qt.FIXED=new Jt("FIXED"),Qt.FLOATING=new Jt("FLOATING"),Qt.FLOATING_SINGLE=new Jt("FLOATING SINGLE"),Qt.maximumPreciseValue=9007199254740992,io($t.prototype,{toGeometry:function(t){return t.isNull()?this.createPoint(null):t.getMinX()===t.getMaxX()&&t.getMinY()===t.getMaxY()?this.createPoint(new c(t.getMinX(),t.getMinY())):t.getMinX()===t.getMaxX()||t.getMinY()===t.getMaxY()?this.createLineString([new c(t.getMinX(),t.getMinY()),new c(t.getMaxX(),t.getMaxY())]):this.createPolygon(this.createLinearRing([new c(t.getMinX(),t.getMinY()),new c(t.getMinX(),t.getMaxY()),new c(t.getMaxX(),t.getMaxY()),new c(t.getMaxX(),t.getMinY()),new c(t.getMinX(),t.getMinY())]),null)},createLineString:function(){if(0===arguments.length)return this.createLineString(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof Array){var t=arguments[0];return this.createLineString(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(oo(arguments[0],b)){return new It(arguments[0],this)}}},createMultiLineString:function(){if(0===arguments.length)return new ht(null,this);if(1===arguments.length){return new ht(arguments[0],this)}},buildGeometry:function(t){for(var e=null,n=!1,i=!1,r=t.iterator();r.hasNext();){var s=r.next(),o=s.getClass();null===e&&(e=o),o!==e&&(n=!0),s.isGeometryCollectionOrDerived()&&(i=!0)}if(null===e)return this.createGeometryCollection();if(n||i)return this.createGeometryCollection($t.toGeometryArray(t));var a=t.iterator().next();if(t.size()>1){if(a instanceof Lt)return this.createMultiPolygon($t.toPolygonArray(t));if(a instanceof It)return this.createMultiLineString($t.toLineStringArray(t));if(a instanceof Ct)return this.createMultiPoint($t.toPointArray(t));h.shouldNeverReachHere("Unhandled class: "+a.getClass().getName())}return a},createMultiPointFromCoords:function(t){return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)},createPoint:function(){if(0===arguments.length)return this.createPoint(this.getCoordinateSequenceFactory().create([]));if(1===arguments.length){if(arguments[0]instanceof c){var t=arguments[0];return this.createPoint(null!==t?this.getCoordinateSequenceFactory().create([t]):null)}if(oo(arguments[0],b)){return new Ct(arguments[0],this)}}},getCoordinateSequenceFactory:function(){return this.coordinateSequenceFactory},createPolygon:function(){if(0===arguments.length)return new Lt(null,null,this);if(1===arguments.length){if(oo(arguments[0],b)){var t=arguments[0];return this.createPolygon(this.createLinearRing(t))}if(arguments[0]instanceof Array){var e=arguments[0];return this.createPolygon(this.createLinearRing(e))}if(arguments[0]instanceof Rt){var n=arguments[0];return this.createPolygon(n,null)}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];return new Lt(i,r,this)}},getSRID:function(){return this.SRID},createGeometryCollection:function(){if(0===arguments.length)return new lt(null,this);if(1===arguments.length){return new lt(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(oo(arguments[0],b)){return new Rt(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 wt(null,this);if(1===arguments.length){if(arguments[0]instanceof Array){return new wt(arguments[0],this)}if(arguments[0]instanceof Array){var t=arguments[0] ;return this.createMultiPoint(null!==t?this.getCoordinateSequenceFactory().create(t):null)}if(oo(arguments[0],b)){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;in?(this.intLineIndex[t][0]=0,this.intLineIndex[t][1]=1):(this.intLineIndex[t][0]=1,this.intLineIndex[t][1]=0)}},isProper:function(){return this.hasIntersection()&&this._isProper},setPrecisionModel:function(t){this.precisionModel=t},isInteriorIntersection:function(){if(0===arguments.length)return!!this.isInteriorIntersection(0)||!!this.isInteriorIntersection(1);if(1===arguments.length){for(var t=arguments[0],e=0;er?i:r;else{var o=Math.abs(t.x-e.x),a=Math.abs(t.y-e.y);s=i>r?o:a,0!==s||t.equals(e)||(s=Math.max(o,a))}return h.isTrue(!(0===s&&!t.equals(e)),"Bad distance calculation"),s},ne.nonRobustComputeEdgeDistance=function(t,e,n){var i=t.x-e.x,r=t.y-e.y,s=Math.sqrt(i*i+r*r);return h.isTrue(!(0===s&&!t.equals(e)),"Invalid distance calculation"),s},ne.DONT_INTERSECT=0,ne.DO_INTERSECT=1,ne.COLLINEAR=2,ne.NO_INTERSECTION=0,ne.POINT_INTERSECTION=1,ne.COLLINEAR_INTERSECTION=2,ro(ie,ne),io(ie.prototype,{isInSegmentEnvelopes:function(t){var e=new I(this.inputLines[0][0],this.inputLines[0][1]),n=new I(this.inputLines[1][0],this.inputLines[1][1]);return e.contains(t)&&n.contains(t)},computeIntersection:function(){if(3!==arguments.length)return ne.prototype.computeIntersection.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2];if(this._isProper=!1,I.intersects(e,n,t)&&0===oe.orientationIndex(e,n,t)&&0===oe.orientationIndex(n,e,t))return this._isProper=!0,(t.equals(e)||t.equals(n))&&(this._isProper=!1),this.result=ne.POINT_INTERSECTION,null;this.result=ne.NO_INTERSECTION},normalizeToMinimum:function(t,e,n,i,r){r.x=this.smallestInAbsValue(t.x,e.x,n.x,i.x),r.y=this.smallestInAbsValue(t.y,e.y,n.y,i.y),t.x-=r.x,t.y-=r.y,e.x-=r.x,e.y-=r.y,n.x-=r.x,n.y-=r.y,i.x-=r.x,i.y-=r.y},safeHCoordinateIntersection:function(t,e,n,i){var r=null;try{r=M.intersection(t,e,n,i)}catch(s){if(!(s instanceof C))throw s;r=ie.nearestEndpoint(t,e,n,i)}return r},intersection:function(t,e,n,i){var r=this.intersectionWithNormalization(t,e,n,i);return this.isInSegmentEnvelopes(r)||(r=new c(ie.nearestEndpoint(t,e,n,i))),null!==this.precisionModel&&this.precisionModel.makePrecise(r),r},smallestInAbsValue:function(t,e,n,i){var r=t,s=Math.abs(r);return Math.abs(e)1e-4&&_.out.println("Distance = "+r.distance(s))},intersectionWithNormalization:function(t,e,n,i){var r=new c(t),s=new c(e),o=new c(n),a=new c(i),u=new c;this.normalizeToEnvCentre(r,s,o,a,u);var l=this.safeHCoordinateIntersection(r,s,o,a);return l.x+=u.x,l.y+=u.y,l},computeCollinearIntersection:function(t,e,n,i){var r=I.intersects(t,e,n),s=I.intersects(t,e,i),o=I.intersects(n,i,t),a=I.intersects(n,i,e);return r&&s?(this.intPt[0]=n,this.intPt[1]=i,ne.COLLINEAR_INTERSECTION):o&&a?(this.intPt[0]=t,this.intPt[1]=e,ne.COLLINEAR_INTERSECTION):r&&o?(this.intPt[0]=n,this.intPt[1]=t,!n.equals(t)||s||a?ne.COLLINEAR_INTERSECTION:ne.POINT_INTERSECTION):r&&a?(this.intPt[0]=n,this.intPt[1]=e,!n.equals(e)||s||o?ne.COLLINEAR_INTERSECTION:ne.POINT_INTERSECTION):s&&o?(this.intPt[0]=i,this.intPt[1]=t,!i.equals(t)||r||a?ne.COLLINEAR_INTERSECTION:ne.POINT_INTERSECTION):s&&a?(this.intPt[0]=i,this.intPt[1]=e,!i.equals(e)||r||o?ne.COLLINEAR_INTERSECTION:ne.POINT_INTERSECTION):ne.NO_INTERSECTION},normalizeToEnvCentre:function(t,e,n,i,r){var s=t.xe.x?t.x:e.x,u=t.y>e.y?t.y:e.y,l=n.xi.x?n.x:i.x,f=n.y>i.y?n.y:i.y,g=s>l?s:l,d=ah?o:h,m=u0&&s>0||r<0&&s<0)return ne.NO_INTERSECTION;var o=oe.orientationIndex(n,i,t),a=oe.orientationIndex(n,i,e);return o>0&&a>0||o<0&&a<0?ne.NO_INTERSECTION:0===r&&0===s&&0===o&&0===a?this.computeCollinearIntersection(t,e,n,i):(0===r||0===s||0===o||0===a?(this._isProper=!1,t.equals2D(n)||t.equals2D(i)?this.intPt[0]=t:e.equals2D(n)||e.equals2D(i)?this.intPt[0]=e:0===r?this.intPt[0]=new c(n):0===s?this.intPt[0]=new c(i):0===o?this.intPt[0]=new c(t):0===a&&(this.intPt[0]=new c(e))):(this._isProper=!0,this.intPt[0]=this.intersection(t,e,n,i)),ne.POINT_INTERSECTION)},interfaces_:function(){return[]},getClass:function(){return ie}}),ie.nearestEndpoint=function(t,e,n,i){var r=t,s=oe.distancePointLine(t,n,i),o=oe.distancePointLine(e,n,i);return o0?n>0?-r:r:n>0?r:-r;if(0===e||0===n)return i>0?t>0?r:-r:t>0?-r:r;if(0=i?(t=-t,e=-e,n=-n,i=-i):(r=-r,s=-t,t=-n,n=s,s=-e,e=-i,i=s),0=n))return-r;r=-r,t=-t,n=-n}for(;;){if(a+=1,o=Math.floor(n/t),n-=o*t,(i-=o*e)<0)return-r;if(i>e)return r;if(t>n+n){if(ei+i)return-r;n=t-n,i=e-i,r=-r}if(0===i)return 0===n?0:-r;if(0===n)return r;if(o=Math.floor(t/n),t-=o*n,(e-=o*i)<0)return r;if(e>i)return-r;if(n>t+t){if(ie+e)return r;t=n-t,e=i-e,r=-r}if(0===e)return 0===t?0:r;if(0===t)return-r}},io(se.prototype,{countSegment:function(t,e){if(t.xi&&(n=e.x,i=t.x),this.p.x>=n&&this.p.x<=i&&(this.isPointOnSegment=!0),null}if(t.y>this.p.y&&e.y<=this.p.y||e.y>this.p.y&&t.y<=this.p.y){var r=t.x-this.p.x,s=t.y-this.p.y,o=e.x-this.p.x,a=e.y-this.p.y,u=re.signOfDet2x2(r,s,o,a);if(0===u)return this.isPointOnSegment=!0,null;a0&&this.crossingCount++}},isPointInPolygon:function(){return this.getLocation()!==S.EXTERIOR},getLocation:function(){return this.isPointOnSegment?S.BOUNDARY:this.crossingCount%2==1?S.INTERIOR:S.EXTERIOR},isOnSegment:function(){return this.isPointOnSegment},interfaces_:function(){return[]},getClass:function(){return se}}),se.locatePointInRing=function(){if(arguments[0]instanceof c&&oo(arguments[1],b)){for(var t=arguments[0],e=arguments[1],n=new se(t),i=new c,r=new c,s=1;s1||u<0||u>1)&&(r=!0)}}else r=!0;return r?L.min(oe.distancePointLine(t,n,i),oe.distancePointLine(e,n,i),oe.distancePointLine(n,t,e),oe.distancePointLine(i,t,e)):0},oe.isPointInRing=function(t,e){return oe.locatePointInRing(t,e)!==S.EXTERIOR},oe.computeLength=function(t){var e=t.size();if(e<=1)return 0;var n=0,i=new c;t.getCoordinate(0,i);for(var r=i.x,s=i.y,o=1;oi.y&&(i=o,r=s)}var a=r;do{(a-=1)<0&&(a=e)}while(t[a].equals2D(i)&&a!==r);var u=r;do{u=(u+1)%e}while(t[u].equals2D(i)&&u!==r);var l=t[a],h=t[u];if(l.equals2D(i)||h.equals2D(i)||l.equals2D(h))return!1;var c=oe.computeOrientation(l,i,h);return 0===c?l.x>h.x:c>0},oe.locatePointInRing=function(t,e){return se.locatePointInRing(t,e)},oe.distancePointLinePerpendicular=function(t,e,n){var i=(n.x-e.x)*(n.x-e.x)+(n.y-e.y)*(n.y-e.y),r=((e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y))/i;return Math.abs(r)*Math.sqrt(i)},oe.computeOrientation=function(t,e,n){return oe.orientationIndex(t,e,n)},oe.distancePointLine=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1];if(0===e.length)throw new n("Line array must contain at least one vertex");for(var i=t.distance(e[0]),r=0;r=1)return o.distance(u);var c=((a.y-o.y)*(u.x-a.x)-(a.x-o.x)*(u.y-a.y))/l;return Math.abs(c)*Math.sqrt(l)}},oe.isOnLine=function(t,e){for(var n=new ie,i=1;i=0&&n>=0?Math.max(e,n):e<=0&&n<=0?Math.max(e,n):0}if(arguments[0]instanceof c){var i=arguments[0];return oe.orientationIndex(this.p0,this.p1,i)}},toGeometry:function(t){return t.createLineString([this.p0,this.p1])},isVertical:function(){return this.p0.x===this.p1.x},equals:function(t){if(!(t instanceof ae))return!1;var e=t;return this.p0.equals(e.p0)&&this.p1.equals(e.p1)},intersection:function(t){var e=new ie;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},project:function(){if(arguments[0]instanceof c){var t=arguments[0];if(t.equals(this.p0)||t.equals(this.p1))return new c(t);var e=this.projectionFactor(t),n=new c;return n.x=this.p0.x+e*(this.p1.x-this.p0.x),n.y=this.p0.y+e*(this.p1.y-this.p0.y),n}if(arguments[0]instanceof ae){var i=arguments[0],r=this.projectionFactor(i.p0),s=this.projectionFactor(i.p1);if(r>=1&&s>=1)return null;if(r<=0&&s<=0)return null;var o=this.project(i.p0);r<0&&(o=this.p0),r>1&&(o=this.p1);var a=this.project(i.p1);return s<0&&(a=this.p0),s>1&&(a=this.p1),new ae(o,a)}},normalize:function(){this.p1.compareTo(this.p0)<0&&this.reverse()},angle:function(){return Math.atan2(this.p1.y-this.p0.y,this.p1.x-this.p0.x)},getCoordinate:function(t){return 0===t?this.p0:this.p1},distancePerpendicular:function(t){return oe.distancePointLinePerpendicular(t,this.p0,this.p1)},minY:function(){return Math.min(this.p0.y,this.p1.y)},midPoint:function(){return ae.midPoint(this.p0,this.p1)},projectionFactor:function(t){if(t.equals(this.p0))return 0;if(t.equals(this.p1))return 1;var e=this.p1.x-this.p0.x,n=this.p1.y-this.p0.y,r=e*e+n*n;return r<=0?i.NaN:((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/r},closestPoints:function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n=new Array(2).fill(null),r=i.MAX_VALUE,s=null,o=this.closestPoint(t.p0);r=o.distance(t.p0),n[0]=o,n[1]=t.p0;var a=this.closestPoint(t.p1);(s=a.distance(t.p1))0&&e<1?this.project(t):this.p0.distance(t)1||i.isNaN(e))&&(e=1),e},toString:function(){return"LINESTRING( "+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},isHorizontal:function(){return this.p0.y===this.p1.y},distance:function(){if(arguments[0]instanceof ae){var t=arguments[0];return oe.distanceLineLine(this.p0,this.p1,t.p0,t.p1)}if(arguments[0]instanceof c){var e=arguments[0];return oe.distancePointLine(e,this.p0,this.p1)}},pointAlong:function(t){var e=new c;return e.x=this.p0.x+t*(this.p1.x-this.p0.x),e.y=this.p0.y+t*(this.p1.y-this.p0.y),e},hashCode:function(){var t=java.lang.Double.doubleToLongBits(this.p0.x);t^=31*java.lang.Double.doubleToLongBits(this.p0.y);var e=Math.trunc(t)^Math.trunc(t>>32),n=java.lang.Double.doubleToLongBits(this.p1.x);return n^=31*java.lang.Double.doubleToLongBits(this.p1.y),e^Math.trunc(n)^Math.trunc(n>>32)},interfaces_:function(){return[r,a]},getClass:function(){return ae}}),ae.midPoint=function(t,e){return new c((t.x+e.x)/2,(t.y+e.y)/2)},ae.serialVersionUID=0x2d2172135f411c00,io(ue.prototype,{isIntersects:function(){return!this.isDisjoint()},isCovers:function(){return(ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])||ue.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||ue.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||ue.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))&&this.matrix[S.EXTERIOR][S.INTERIOR]===ot.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===ot.FALSE},isCoveredBy:function(){return(ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])||ue.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||ue.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||ue.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY]))&&this.matrix[S.INTERIOR][S.EXTERIOR]===ot.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===ot.FALSE},set:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e=0&&e>=0&&this.setAtLeast(t,e,n)},isWithin:function(){return ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.INTERIOR][S.EXTERIOR]===ot.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===ot.FALSE},isTouches:function(t,e){return t>e?this.isTouches(e,t):(t===ot.A&&e===ot.A||t===ot.L&&e===ot.L||t===ot.L&&e===ot.A||t===ot.P&&e===ot.A||t===ot.P&&e===ot.L)&&(this.matrix[S.INTERIOR][S.INTERIOR]===ot.FALSE&&(ue.isTrue(this.matrix[S.INTERIOR][S.BOUNDARY])||ue.isTrue(this.matrix[S.BOUNDARY][S.INTERIOR])||ue.isTrue(this.matrix[S.BOUNDARY][S.BOUNDARY])))},isOverlaps:function(t,e){return t===ot.P&&e===ot.P||t===ot.A&&e===ot.A?ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&ue.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR])&&ue.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]):t===ot.L&&e===ot.L&&(1===this.matrix[S.INTERIOR][S.INTERIOR]&&ue.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR])&&ue.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]))},isEquals:function(t,e){return t===e&&(ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&this.matrix[S.INTERIOR][S.EXTERIOR]===ot.FALSE&&this.matrix[S.BOUNDARY][S.EXTERIOR]===ot.FALSE&&this.matrix[S.EXTERIOR][S.INTERIOR]===ot.FALSE&&this.matrix[S.EXTERIOR][S.BOUNDARY]===ot.FALSE)},toString:function(){for(var t=new w("123456789"),e=0;e<3;e++)for(var n=0;n<3;n++)t.setCharAt(3*e+n,ot.toDimensionSymbol(this.matrix[e][n]));return t.toString()},setAll:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.matrix[e][n]=t},get:function(t,e){return this.matrix[t][e]},transpose:function(){var t=this.matrix[1][0];return this.matrix[1][0]=this.matrix[0][1],this.matrix[0][1]=t,t=this.matrix[2][0],this.matrix[2][0]=this.matrix[0][2],this.matrix[0][2]=t,t=this.matrix[2][1],this.matrix[2][1]=this.matrix[1][2],this.matrix[1][2]=t,this},matches:function(t){if(9!==t.length)throw new n("Should be length 9: "+t);for(var e=0;e<3;e++)for(var i=0;i<3;i++)if(!ue.matches(this.matrix[e][i],t.charAt(3*e+i)))return!1;return!0},add:function(t){for(var e=0;e<3;e++)for(var n=0;n<3;n++)this.setAtLeast(e,n,t.get(e,n))},isDisjoint:function(){return this.matrix[S.INTERIOR][S.INTERIOR]===ot.FALSE&&this.matrix[S.INTERIOR][S.BOUNDARY]===ot.FALSE&&this.matrix[S.BOUNDARY][S.INTERIOR]===ot.FALSE&&this.matrix[S.BOUNDARY][S.BOUNDARY]===ot.FALSE},isCrosses:function(t,e){return t===ot.P&&e===ot.L||t===ot.P&&e===ot.A||t===ot.L&&e===ot.A?ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&ue.isTrue(this.matrix[S.INTERIOR][S.EXTERIOR]):t===ot.L&&e===ot.P||t===ot.A&&e===ot.P||t===ot.A&&e===ot.L?ue.isTrue(this.matrix[S.INTERIOR][S.INTERIOR])&&ue.isTrue(this.matrix[S.EXTERIOR][S.INTERIOR]):t===ot.L&&e===ot.L&&0===this.matrix[S.INTERIOR][S.INTERIOR]},interfaces_:function(){return[s]},getClass:function(){return ue}}),ue.matches=function(){if(Number.isInteger(arguments[0])&&"string"==typeof arguments[1]){var t=arguments[0],e=arguments[1];return e===ot.SYM_DONTCARE||(e===ot.SYM_TRUE&&(t>=0||t===ot.TRUE)||(e===ot.SYM_FALSE&&t===ot.FALSE||(e===ot.SYM_P&&t===ot.P||(e===ot.SYM_L&&t===ot.L||e===ot.SYM_A&&t===ot.A))))}if("string"==typeof arguments[0]&&"string"==typeof arguments[1]){var n=arguments[0],i=arguments[1];return new ue(n).matches(i)}},ue.isTrue=function(t){return t>=0||t===ot.TRUE};var yo=Object.freeze({Coordinate:c,CoordinateList:E,Envelope:I,LineSegment:ae,GeometryFactory:$t,Geometry:F,Point:Ct,LineString:It,LinearRing:Rt,Polygon:Lt,GeometryCollection:lt,MultiPoint:wt,MultiLineString:ht,MultiPolygon:Tt,Dimension:ot,IntersectionMatrix:ue,PrecisionModel:Qt});io(le.prototype,{addPoint:function(t){this.ptCount+=1,this.ptCentSum.x+=t.x,this.ptCentSum.y+=t.y},setBasePoint:function(t){null===this.areaBasePt&&(this.areaBasePt=t)},addLineSegments:function(t){for(var e=0,n=0;n0&&this.addPoint(t[0])},addHole:function(t){for(var e=oe.isCCW(t),n=0;n0)t.x=this.cg3.x/3/this.areasum2,t.y=this.cg3.y/3/this.areasum2;else if(this.totalLength>0)t.x=this.lineCentSum.x/this.totalLength,t.y=this.lineCentSum.y/this.totalLength;else{if(!(this.ptCount>0))return null;t.x=this.ptCentSum.x/this.ptCount,t.y=this.ptCentSum.y/this.ptCount}return t},addShell:function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!oe.isCCW(t),n=0;n=this.size())throw new IndexOutOfBoundsException;return this.array_[t]},ce.prototype.push=function(t){return this.array_.push(t),t},ce.prototype.pop=function(t){if(0===this.array_.length)throw new he;return this.array_.pop()},ce.prototype.peek=function(){if(0===this.array_.length)throw new he;return this.array_[this.array_.length-1]},ce.prototype.empty=function(){return 0===this.array_.length},ce.prototype.isEmpty=function(){return this.empty()},ce.prototype.search=function(t){return this.array_.indexOf(t)},ce.prototype.size=function(){return this.array_.length},ce.prototype.toArray=function(){for(var t=[],e=0,n=this.array_.length;e50&&(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;ne[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].y0;)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 ge}}),ge.extractCoordinates=function(t){var e=new fe;return t.apply(e),e.getCoordinates()},io(de.prototype,{compare:function(t,e){var n=t,i=e;return de.polarCompare(this.origin,n,i)},interfaces_:function(){return[o]},getClass:function(){return de}}),de.polarCompare=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,s=n.x-t.x,o=n.y-t.y,a=oe.computeOrientation(t,e,n);if(a===oe.COUNTERCLOCKWISE)return 1;if(a===oe.CLOCKWISE)return-1;var u=i*i+r*r,l=s*s+o*o;return ul?1:0},ge.RadialComparator=de,io(pe.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 Rt&&!i.isEmpty()||(n=!1);for(var r=new x,s=0;s0&&i<4&&!this.preserveType?this.factory.createLineString(n):this.factory.createLinearRing(n)},interfaces_:function(){return[]},getClass:function(){return pe}}),io(me.prototype,{snapVertices:function(t,e){for(var n=this._isClosed?t.size()-1:t.size(),i=0;i=0&&t.add(s+1,new c(r),!1)}},findSegmentIndexToSnap:function(t,e){for(var n=i.MAX_VALUE,r=-1,s=0;se&&(e=i)}return e}if(2===arguments.length){var r=arguments[0],s=arguments[1];return Math.min(ve.computeOverlaySnapTolerance(r),ve.computeOverlaySnapTolerance(s))}},ve.computeSizeBasedSnapTolerance=function(t){var e=t.getEnvelopeInternal();return Math.min(e.getHeight(),e.getWidth())*ve.SNAP_PRECISION_FACTOR},ve.snapToSelf=function(t,e,n){return new ve(t).snapToSelf(e,n)},ve.SNAP_PRECISION_FACTOR=1e-9,ro(ye,pe),io(ye.prototype,{snapLine:function(t,e){var n=new me(t,this.snapTolerance);return n.setAllowSnappingToSourceVertices(this.isSelfSnap),n.snapTo(e)},transformCoordinates:function(t,e){var n=t.toCoordinateArray(),i=this.snapLine(n,this.snapPts);return this.factory.getCoordinateSequenceFactory().create(i)},interfaces_:function(){return[]},getClass:function(){return ye}}),io(xe.prototype,{getCommon:function(){return i.longBitsToDouble(this.commonBits)},add:function(t){var e=i.doubleToLongBits(t);return this.isFirst?(this.commonBits=e,this.commonSignExp=xe.signExpBits(this.commonBits),this.isFirst=!1,null):xe.signExpBits(e)!==this.commonSignExp?(this.commonBits=0,null):(this.commonMantissaBitsCount=xe.numCommonMostSigMantissaBits(this.commonBits,e),void(this.commonBits=xe.zeroLowerBits(this.commonBits,64-(12+this.commonMantissaBitsCount))))},toString:function(){if(1===arguments.length){var t=arguments[0],e=i.longBitsToDouble(t),n=Long.toBinaryString(t),r="0000000000000000000000000000000000000000000000000000000000000000"+n,s=r.substring(r.length-64);return s.substring(0,1)+" "+s.substring(1,12)+"(exp) "+s.substring(12)+" [ "+e+" ]"}},interfaces_:function(){return[]},getClass:function(){return xe}}),xe.getBit=function(t,e){return 0!=(t&1<>52},xe.zeroLowerBits=function(t,e){return t&~((1<=0;i--){if(xe.getBit(t,i)!==xe.getBit(e,i))return n;n++}return 52},io(Ee.prototype,{addCommonBits:function(t){var e=new Ne(this.commonCoord);t.apply(e),t.geometryChanged()},removeCommonBits:function(t){if(0===this.commonCoord.x&&0===this.commonCoord.y)return t;var e=new c(this.commonCoord);e.x=-e.x,e.y=-e.y;var n=new Ne(e);return t.apply(n),t.geometryChanged(),t},getCommonCoordinate:function(){return this.commonCoord},add:function(t){t.apply(this.ccFilter),this.commonCoord=this.ccFilter.getCommonCoordinate()},interfaces_:function(){return[]},getClass:function(){return Ee}}),io(Ie.prototype,{filter:function(t){this.commonBitsX.add(t.x),this.commonBitsY.add(t.y)},getCommonCoordinate:function(){return new c(this.commonBitsX.getCommon(),this.commonBitsY.getCommon())},interfaces_:function(){return[G]},getClass:function(){return Ie}}),io(Ne.prototype,{filter:function(t,e){var n=t.getOrdinate(e,0)+this.trans.x,i=t.getOrdinate(e,1)+this.trans.y;t.setOrdinate(e,0,n),t.setOrdinate(e,1,i)},isDone:function(){return!1},isGeometryChanged:function(){return!0},interfaces_:function(){return[ut]},getClass:function(){return Ne}}),Ee.CommonCoordinateFilter=Ie,Ee.Translater=Ne,io(Ce.prototype,{next:function(){if(this.atStart)return this.atStart=!1,Ce.isAtomic(this.parent)&&this.index++,this.parent;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return this.subcollectionIterator.next();this.subcollectionIterator=null}if(this.index>=this.max)throw new v;var t=this.parent.getGeometryN(this.index++);return t instanceof lt?(this.subcollectionIterator=new Ce(t),this.subcollectionIterator.next()):t},remove:function(){throw new UnsupportedOperationException(this.getClass().getName())},hasNext:function(){if(this.atStart)return!0;if(null!==this.subcollectionIterator){if(this.subcollectionIterator.hasNext())return!0;this.subcollectionIterator=null}return!(this.index>=this.max)},interfaces_:function(){return[g]},getClass:function(){return Ce}}),Ce.isAtomic=function(t){return!(t instanceof lt)},io(Se.prototype,{locateInternal:function(){if(arguments[0]instanceof c&&arguments[1]instanceof Lt){var t=arguments[0],e=arguments[1];if(e.isEmpty())return S.EXTERIOR;var n=e.getExteriorRing(),i=this.locateInPolygonRing(t,n);if(i===S.EXTERIOR)return S.EXTERIOR;if(i===S.BOUNDARY)return S.BOUNDARY;for(var r=0;r0||this.isIn?S.INTERIOR:S.EXTERIOR)},interfaces_:function(){return[]},getClass:function(){return Se}}),io(Le.prototype,{interfaces_:function(){return[]},getClass:function(){return Le}}),Le.octant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new n("Cannot compute the octant for point ( "+t+", "+e+" )");var i=Math.abs(t),r=Math.abs(e);return t>=0?e>=0?i>=r?0:1:i>=r?7:6:e>=0?i>=r?3:2:i>=r?4:5}if(arguments[0]instanceof c&&arguments[1]instanceof c){var s=arguments[0],o=arguments[1],a=o.x-s.x,u=o.y-s.y;if(0===a&&0===u)throw new n("Cannot compute the octant for two identical points "+s);return Le.octant(a,u)}},io(we.prototype,{getCoordinates:function(){},size:function(){},getCoordinate:function(t){},isClosed:function(){},setData:function(t){},getData:function(){},interfaces_:function(){return[]},getClass:function(){return we}}),io(Re.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:Le.octant(this.getCoordinate(t),this.getCoordinate(t+1))},setData:function(t){this.data=t},getData:function(){return this.data},toString:function(){return ee.toLineString(new Dt(this.pts))},interfaces_:function(){return[we]},getClass:function(){return Re}}),io(Te.prototype,{getBounds:function(){},interfaces_:function(){return[]},getClass:function(){return Te}}),io(Oe.prototype,{getItem:function(){return this.item},getBounds:function(){return this.bounds},interfaces_:function(){return[Te,a]},getClass:function(){return Oe}}),io(Pe.prototype,{poll:function(){if(this.isEmpty())return null;var t=this.items.get(1);return this.items.set(1,this.items.get(this._size)),this._size-=1,this.reorder(1),t},size:function(){return this._size},reorder:function(t){for(var e=null,n=this.items.get(t);2*t<=this._size&&(e=2*t,e!==this._size&&this.items.get(e+1).compareTo(this.items.get(e))<0&&e++,this.items.get(e).compareTo(n)<0);t=e)this.items.set(t,this.items.get(e));this.items.set(t,n)},clear:function(){this._size=0,this.items.clear()},isEmpty:function(){return 0===this._size},add:function(t){this.items.add(null),this._size+=1;var e=this._size;for(this.items.set(0,t);t.compareTo(this.items.get(Math.trunc(e/2)))<0;e/=2)this.items.set(e,this.items.get(Math.trunc(e/2)));this.items.set(e,t)},interfaces_:function(){return[]},getClass:function(){return Pe}}),io(be.prototype,{visitItem:function(t){},interfaces_:function(){return[]},getClass:function(){return be}}),io(_e.prototype,{insert:function(t,e){},remove:function(t,e){},query:function(){if(1===arguments.length){arguments[0]}else if(2===arguments.length){arguments[0],arguments[1]}},interfaces_:function(){return[]},getClass:function(){return _e}}),io(Me.prototype,{getLevel:function(){return this.level},size:function(){return this.childBoundables.size()},getChildBoundables:function(){return this.childBoundables},addChildBoundable:function(t){h.isTrue(null===this.bounds),this.childBoundables.add(t)},isEmpty:function(){return this.childBoundables.isEmpty()},getBounds:function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},interfaces_:function(){return[Te,a]},getClass:function(){return Me}}),Me.serialVersionUID=0x5a1e55ec41369800;var xo={reverseOrder:function(){return{compare:function(t,e){return e.compareTo(t)}}},min:function(t){return xo.sort(t),t.get(0)},sort:function(t,e){var n=t.toArray();e?st.sort(n,e):st.sort(n);for(var i=t.iterator(),r=0,s=n.length;rDe.area(this.boundable2)?(this.expand(this.boundable1,this.boundable2,t,e),null):(this.expand(this.boundable2,this.boundable1,t,e),null);if(i)return this.expand(this.boundable1,this.boundable2,t,e),null;if(r)return this.expand(this.boundable2,this.boundable1,t,e),null;throw new n("neither boundable is composite")},isLeaves:function(){return!(De.isComposite(this.boundable1)||De.isComposite(this.boundable2))},compareTo:function(t){var e=t;return this._distancee._distance?1:0},expand:function(t,e,n,i){for(var r=t.getChildBoundables(),s=r.iterator();s.hasNext();){var o=s.next(),a=new De(o,e,this.itemDistance);a.getDistance()-2),i.getLevel()===n)return r.add(i),null;for(var s=i.getChildBoundables().iterator();s.hasNext();){var o=s.next();o instanceof Me?this.boundablesAtLevel(n,o,r):(h.isTrue(o instanceof Oe),-1===n&&r.add(o))}return null}},query:function(){if(1===arguments.length){var t=arguments[0];this.build();var e=new x;return this.isEmpty()?e:(this.getIntersectsOp().intersects(this.root.getBounds(),t)&&this.query(t,this.root,e),e)}if(2===arguments.length){var n=arguments[0],i=arguments[1];if(this.build(),this.isEmpty())return null;this.getIntersectsOp().intersects(this.root.getBounds(),n)&&this.query(n,this.root,i)}else if(3===arguments.length)if(oo(arguments[2],be)&&arguments[0]instanceof Object&&arguments[1]instanceof Me)for(var r=arguments[0],s=arguments[1],o=arguments[2],a=s.getChildBoundables(),u=0;ue&&(e=r)}}return e+1}},createParentBoundables:function(t,e){h.isTrue(!t.isEmpty());var n=new x;n.add(this.createNode(e));var i=new x(t);xo.sort(i,this.getComparator());for(var r=i.iterator();r.hasNext();){var s=r.next();this.lastNode(n).getChildBoundables().size()===this.getNodeCapacity()&&n.add(this.createNode(e)),this.lastNode(n).addChildBoundable(s)}return n},isEmpty:function(){return this.built?this.root.isEmpty():this.itemBoundables.isEmpty()},interfaces_:function(){return[a]},getClass:function(){return Ae}}),Ae.compareDoubles=function(t,e){return t>e?1:t0);for(var n=new x,i=0;i0;){var c=h.poll(),f=c.getDistance();if(f>=u)break;c.isLeaves()?(u=f,l=c):c.expandToQueue(h,u)}return[l.getBoundable(0).getItem(),l.getBoundable(1).getItem()]}}else if(3===arguments.length){var g=arguments[0],d=arguments[1],p=arguments[2],m=new Oe(g,d),e=new De(this.getRoot(),m,p);return this.nearestNeighbour(e)[0]}},interfaces_:function(){return[_e,a]},getClass:function(){return qe}}),qe.centreX=function(t){return qe.avg(t.getMinX(),t.getMaxX())},qe.avg=function(t,e){return(t+e)/2},qe.centreY=function(t){return qe.avg(t.getMinY(),t.getMaxY())},ro(Be,Me),io(Be.prototype,{computeBounds:function(){for(var t=null,e=this.getChildBoundables().iterator();e.hasNext();){var n=e.next();null===t?t=new I(n.getBounds()):t.expandToInclude(n.getBounds())}return t},interfaces_:function(){return[]},getClass:function(){return Be}}),qe.STRtreeNode=Be,qe.serialVersionUID=0x39920f7d5f261e0,qe.xComparator={interfaces_:function(){return[o]},compare:function(t,e){return Ae.compareDoubles(qe.centreX(t.getBounds()),qe.centreX(e.getBounds()))}},qe.yComparator={interfaces_:function(){return[o]},compare:function(t,e){return Ae.compareDoubles(qe.centreY(t.getBounds()),qe.centreY(e.getBounds()))}},qe.intersectsOp={interfaces_:function(){return[IntersectsOp]},intersects:function(t,e){return t.intersects(e)}},qe.DEFAULT_NODE_CAPACITY=10,io(Ve.prototype,{interfaces_:function(){return[]},getClass:function(){return Ve}}),Ve.relativeSign=function(t,e){return te?1:0},Ve.compare=function(t,e,n){if(e.equals2D(n))return 0;var i=Ve.relativeSign(e.x,n.x),r=Ve.relativeSign(e.y,n.y);switch(t){case 0:return Ve.compareValue(i,r);case 1:return Ve.compareValue(r,i);case 2:return Ve.compareValue(r,-i);case 3:return Ve.compareValue(-i,r);case 4:return Ve.compareValue(-i,-r);case 5:return Ve.compareValue(-r,-i);case 6:return Ve.compareValue(-r,i);case 7:return Ve.compareValue(i,-r)}return h.shouldNeverReachHere("invalid octant value"),0},Ve.compareValue=function(t,e){return t<0?-1:t>0?1:e<0?-1:e>0?1:0},io(ze.prototype,{getCoordinate:function(){return this.coord},print:function(t){t.print(this.coord),t.print(" seg # = "+this.segmentIndex)},compareTo:function(t){var e=t;return this.segmentIndexe.segmentIndex?1:this.coord.equals2D(e.coord)?0:Ve.compare(this.segmentOctant,this.coord,e.coord)},isEndPoint:function(t){return 0===this.segmentIndex&&!this._isInterior||this.segmentIndex===t},isInterior:function(){return this._isInterior},interfaces_:function(){return[r]},getClass:function(){return ze}}),io(ke.prototype,{getSplitCoordinates:function(){var t=new E;this.addEndpoints();for(var e=this.iterator(),n=e.next();e.hasNext();){var i=e.next();this.addEdgeCoordinates(n,i,t),n=i}return t.toCoordinateArray()},addCollapsedNodes:function(){var t=new x;this.findCollapsesFromInsertedNodes(t),this.findCollapsesFromExistingVertices(t);for(var e=t.iterator();e.hasNext();){var n=e.next().intValue();this.add(this.edge.getCoordinate(n),n)}},print:function(t){t.println("Intersections:");for(var e=this.iterator();e.hasNext();){e.next().print(t)}},findCollapsesFromExistingVertices:function(t){for(var e=0;ee?t:e;return 0===n&&3===i?3:n},je.isInHalfPlane=function(t,e){return e===je.SE?t===je.SE||t===je.SW:t===e||t===e+1},je.quadrant=function(){if("number"==typeof arguments[0]&&"number"==typeof arguments[1]){var t=arguments[0],e=arguments[1];if(0===t&&0===e)throw new n("Cannot compute the quadrant for point ( "+t+", "+e+" )");return t>=0?e>=0?je.NE:je.SE:e>=0?je.NW:je.SW}if(arguments[0]instanceof c&&arguments[1]instanceof c){var i=arguments[0],r=arguments[1];if(r.x===i.x&&r.y===i.y)throw new n("Cannot compute the quadrant for two identical points "+i);return r.x>=i.x?r.y>=i.y?je.NE:je.SE:r.y>=i.y?je.NW:je.SW}},je.NE=0,je.NW=1,je.SW=2,je.SE=3,io(Ke.prototype,{interfaces_:function(){return[]},getClass:function(){return Ke}}),Ke.getChainStartIndices=function(t){var e=0,n=new x;n.add(new R(e));do{var i=Ke.findChainEnd(t,e);n.add(new R(i)),e=i}while(e=t.length-1)return t.length-1;for(var i=je.quadrant(t[n],t[n+1]),r=e+1;rn.getId()&&(n.computeOverlaps(s,t),this.nOverlaps++),this.segInt.isDone())return null}},interfaces_:function(){return[]},getClass:function(){return Je}}),ro($e,He),io($e.prototype,{overlap:function(){if(4!==arguments.length)return He.prototype.overlap.apply(this,arguments);var t=arguments[0],e=arguments[1],n=arguments[2],i=arguments[3],r=t.getContext(),s=n.getContext();this.si.processIntersections(r,e,s,i)},interfaces_:function(){return[]},getClass:function(){return $e}}),Je.SegmentOverlapAction=$e,ro(tn,u),io(tn.prototype,{getCoordinate:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return tn}}),tn.msgWithCoord=function(t,e){return null!==e?t+" [ "+e+" ]":t},io(en.prototype,{processIntersections:function(t,e,n,i){},isDone:function(){},interfaces_:function(){return[]},getClass:function(){return en}}),io(nn.prototype,{getInteriorIntersection:function(){return this.interiorIntersection},setCheckEndSegmentsOnly:function(t){this.isCheckEndSegmentsOnly=t},getIntersectionSegments:function(){return this.intSegments},count:function(){return this.intersectionCount},getIntersections:function(){return this.intersections},setFindAllIntersections:function(t){this.findAllIntersections=t},setKeepIntersections:function(t){this.keepIntersections=t},processIntersections:function(t,e,n,i){if(!this.findAllIntersections&&this.hasIntersection())return null;if(t===n&&e===i)return null;if(this.isCheckEndSegmentsOnly){if(!(this.isEndSegment(t,e)||this.isEndSegment(n,i)))return null}var r=t.getCoordinates()[e],s=t.getCoordinates()[e+1],o=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,s,o,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()&&(this.intSegments=new Array(4).fill(null),this.intSegments[0]=r,this.intSegments[1]=s,this.intSegments[2]=o,this.intSegments[3]=a,this.interiorIntersection=this.li.getIntersection(0),this.keepIntersections&&this.intersections.add(this.interiorIntersection),this.intersectionCount++)},isEndSegment:function(t,e){return 0===e||e>=t.size()-2},hasIntersection:function(){return null!==this.interiorIntersection},isDone:function(){return!this.findAllIntersections&&null!==this.interiorIntersection},interfaces_:function(){return[en]},getClass:function(){return nn}}),nn.createAllIntersectionsFinder=function(t){var e=new nn(t);return e.setFindAllIntersections(!0),e},nn.createAnyIntersectionFinder=function(t){return new nn(t)},nn.createIntersectionCounter=function(t){var e=new nn(t);return e.setFindAllIntersections(!0),e.setKeepIntersections(!1),e},io(rn.prototype,{execute:function(){if(null!==this.segInt)return null;this.checkInteriorIntersections()},getIntersections:function(){return this.segInt.getIntersections()},isValid:function(){return this.execute(),this._isValid},setFindAllIntersections:function(t){this.findAllIntersections=t},checkInteriorIntersections:function(){this._isValid=!0,this.segInt=new nn(this.li),this.segInt.setFindAllIntersections(this.findAllIntersections);var t=new Je;if(t.setSegmentIntersector(this.segInt),t.computeNodes(this.segStrings),this.segInt.hasIntersection())return this._isValid=!1,null},checkValid:function(){if(this.execute(),!this._isValid)throw new tn(this.getErrorMessage(),this.segInt.getInteriorIntersection())},getErrorMessage:function(){if(this._isValid)return"no intersections found";var t=this.segInt.getIntersectionSegments();return"found non-noded intersection between "+ee.toLineString(t[0],t[1])+" and "+ee.toLineString(t[2],t[3])},interfaces_:function(){return[]},getClass:function(){return rn}}),rn.computeIntersections=function(t){var e=new rn(t);return e.setFindAllIntersections(!0),e.isValid(),e.getIntersections()},io(sn.prototype,{checkValid:function(){this.nv.checkValid()},interfaces_:function(){return[]},getClass:function(){return sn}}),sn.toSegmentStrings=function(t){for(var e=new x,n=t.iterator();n.hasNext();){var i=n.next();e.add(new Re(i.getCoordinates(),i))}return e},sn.checkValid=function(t){new sn(t).checkValid()},io(on.prototype,{map:function(t){for(var e=new x,n=0;nthis.location.length){var e=new Array(3).fill(null);e[an.ON]=this.location[an.ON],e[an.LEFT]=S.NONE,e[an.RIGHT]=S.NONE,this.location=e}for(var n=0;n1&&t.append(S.toLocationSymbol(this.location[an.LEFT])),t.append(S.toLocationSymbol(this.location[an.ON])),this.location.length>1&&t.append(S.toLocationSymbol(this.location[an.RIGHT])),t.toString()},setLocations:function(t,e,n){this.location[an.ON]=t,this.location[an.LEFT]=e,this.location[an.RIGHT]=n},get:function(t){return t1},isAnyNull:function(){for(var t=0;tthis.maxNodeDegree&&(this.maxNodeDegree=n),t=this.getNext(t)}while(t!==this.startDe);this.maxNodeDegree*=2},addPoints:function(t,e,n){var i=t.getCoordinates();if(e){var r=1;n&&(r=0);for(var s=r;s=0;s--)this.pts.add(i[s])}},isHole:function(){return this._isHole},setInResult:function(){var t=this.startDe;do{t.getEdge().setInResult(!0),t=t.getNext()}while(t!==this.startDe)},containsPoint:function(t){var e=this.getLinearRing();if(!e.getEnvelopeInternal().contains(t))return!1;if(!oe.isPointInRing(t,e.getCoordinates()))return!1;for(var n=this.holes.iterator();n.hasNext();){if(n.next().containsPoint(t))return!1}return!0},addHole:function(t){this.holes.add(t)},isShell:function(){return null===this.shell},getLabel:function(){return this.label},getEdges:function(){return this.edges},getMaxNodeDegree:function(){return this.maxNodeDegree<0&&this.computeMaxNodeDegree(),this.maxNodeDegree},getShell:function(){return this.shell},mergeLabel:function(){if(1===arguments.length){var t=arguments[0];this.mergeLabel(t,0),this.mergeLabel(t,1)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=e.getLocation(n,an.RIGHT);if(i===S.NONE)return null;if(this.label.getLocation(n)===S.NONE)return this.label.setLocation(n,i),null}},setShell:function(t){this.shell=t,null!==t&&t.addHole(this)},toPolygon:function(t){for(var e=new Array(this.holes.size()).fill(null),n=0;n=2,"found partial label"),this.computeIM(t)},isInResult:function(){return this._isInResult},isVisited:function(){return this._isVisited},interfaces_:function(){return[]},getClass:function(){return gn}}),ro(dn,gn),io(dn.prototype,{isIncidentEdgeInResult:function(){for(var t=this.getEdges().getEdges().iterator();t.hasNext();){if(t.next().getEdge().isInResult())return!0}return!1},isIsolated:function(){return 1===this.label.getGeometryCount()},getCoordinate:function(){return this.coord},print:function(t){t.println("node "+this.coord+" lbl: "+this.label)},computeIM:function(t){},computeMergedLocation:function(t,e){var n=S.NONE;if(n=this.label.getLocation(e),!t.isNull(e)){var i=t.getLocation(e);n!==S.BOUNDARY&&(n=i)}return n},setLabel:function(){if(2!==arguments.length)return gn.prototype.setLabel.apply(this,arguments);var t=arguments[0],e=arguments[1];null===this.label?this.label=new ln(t,e):this.label.setLocation(t,e)},getEdges:function(){return this.edges},mergeLabel:function(){if(arguments[0]instanceof dn){var t=arguments[0];this.mergeLabel(t.label)}else if(arguments[0]instanceof ln)for(var e=arguments[0],n=0;n<2;n++){var i=this.computeMergedLocation(e,n),r=this.label.getLocation(n);r===S.NONE&&this.label.setLocation(n,i)}},add:function(t){this.edges.insert(t),t.setNode(this)},setLabelBoundary:function(t){if(null===this.label)return null;var e=S.NONE;null!==this.label&&(e=this.label.getLocation(t));var n=null;switch(e){case S.BOUNDARY:n=S.INTERIOR;break;case S.INTERIOR:default:n=S.BOUNDARY}this.label.setLocation(t,n)},interfaces_:function(){return[]},getClass:function(){return dn}}),io(pn.prototype,{find:function(t){return this.nodeMap.get(t)},addNode:function(){if(arguments[0]instanceof c){var t=arguments[0],e=this.nodeMap.get(t);return null===e&&(e=this.nodeFact.createNode(t),this.nodeMap.put(t,e)),e}if(arguments[0]instanceof dn){var n=arguments[0],e=this.nodeMap.get(n.getCoordinate());return null===e?(this.nodeMap.put(n.getCoordinate(),n),n):(e.mergeLabel(n),e)}},print:function(t){for(var e=this.iterator();e.hasNext();){e.next().print(t)}},iterator:function(){return this.nodeMap.values().iterator()},values:function(){return this.nodeMap.values()},getBoundaryNodes:function(t){for(var e=new x,n=this.iterator();n.hasNext();){var i=n.next();i.getLabel().getLocation(t)===S.BOUNDARY&&e.add(i)}return e},add:function(t){var e=t.getCoordinate();this.addNode(e).add(t)},interfaces_:function(){return[]},getClass:function(){return pn}}),io(mn.prototype,{compareDirection:function(t){return this.dx===t.dx&&this.dy===t.dy?0:this.quadrant>t.quadrant?1:this.quadrant2){s.linkDirectedEdgesForMinimalEdgeRings();var o=s.buildMinimalRings(),a=this.findShell(o);null!==a?(this.placePolygonHoles(a,o),e.add(a)):n.addAll(o)}else i.add(s)}return i},containsPoint:function(t){for(var e=this.shellList.iterator();e.hasNext();){if(e.next().containsPoint(t))return!0}return!1},buildMaximalEdgeRings:function(t){for(var e=new x,n=t.iterator();n.hasNext();){var i=n.next();if(i.isInResult()&&i.getLabel().isArea()&&null===i.getEdgeRing()){var r=new fn(i,this.geometryFactory);e.add(r),r.setInResult()}}return e},placePolygonHoles:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next();i.isHole()&&i.setShell(t)}},getPolygons:function(){return this.computePolygons(this.shellList)},findEdgeRingContaining:function(t,e){for(var n=t.getLinearRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),s=null,o=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getLinearRing(),h=l.getEnvelopeInternal();null!==s&&(o=s.getLinearRing().getEnvelopeInternal());var c=!1;h.contains(i)&&oe.isPointInRing(r,l.getCoordinates())&&(c=!0),c&&(null===s||o.contains(h))&&(s=u)}return s},findShell:function(t){for(var e=0,n=null,i=t.iterator();i.hasNext();){var r=i.next();r.isHole()||(n=r,e++)}return h.isTrue(e<=1,"found two shells in MinimalEdgeRing list"),n},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t.getEdgeEnds(),t.getNodes())}else if(2===arguments.length){var e=arguments[0],n=arguments[1];xn.linkResultDirectedEdges(n);var i=this.buildMaximalEdgeRings(e),r=new x,s=this.buildMinimalEdgeRings(i,this.shellList,r);this.sortShellsAndHoles(s,this.shellList,r),this.placeFreeHoles(this.shellList,r)}},interfaces_:function(){return[]},getClass:function(){return En}}),io(In.prototype,{collectLines:function(t){for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next();this.collectLineEdge(n,t,this.lineEdgesList),this.collectBoundaryTouchEdge(n,t,this.lineEdgesList)}},labelIsolatedLine:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.op.getArgGeometry(e));t.getLabel().setLocation(e,n)},build:function(t){return this.findCoveredLineEdges(),this.collectLines(t),this.buildLines(t),this.resultLineList},collectLineEdge:function(t,e,n){var i=t.getLabel(),r=t.getEdge();t.isLineEdge()&&(t.isVisited()||!$n.isResultOfOp(i,e)||r.isCovered()||(n.add(r),t.setVisitedEdge(!0)))},findCoveredLineEdges:function(){for(var t=this.op.getGraph().getNodes().iterator();t.hasNext();){t.next().getEdges().findCoveredLineEdges()}for(var e=this.op.getGraph().getEdgeEnds().iterator();e.hasNext();){var n=e.next(),i=n.getEdge();if(n.isLineEdge()&&!i.isCoveredSet()){var r=this.op.isCoveredByA(n.getCoordinate());i.setCovered(r)}}},labelIsolatedLines:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel();n.isIsolated()&&(i.isNull(0)?this.labelIsolatedLine(n,0):this.labelIsolatedLine(n,1))}},buildLines:function(t){for(var e=this.lineEdgesList.iterator();e.hasNext();){var n=e.next(),i=(n.getLabel(),this.geometryFactory.createLineString(n.getCoordinates()));this.resultLineList.add(i),n.setInResult(!0)}},collectBoundaryTouchEdge:function(t,e,n){var i=t.getLabel();return t.isLineEdge()?null:t.isVisited()?null:t.isInteriorAreaEdge()?null:t.getEdge().isInResult()?null:(h.isTrue(!(t.isInResult()||t.getSym().isInResult())||!t.getEdge().isInResult()),void($n.isResultOfOp(i,e)&&e===$n.INTERSECTION&&(n.add(t.getEdge()),t.setVisitedEdge(!0))))},interfaces_:function(){return[]},getClass:function(){return In}}),io(Nn.prototype,{filterCoveredNodeToPoint:function(t){var e=t.getCoordinate();if(!this.op.isCoveredByLA(e)){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===$n.INTERSECTION))){var i=n.getLabel();$n.isResultOfOp(i,t)&&this.filterCoveredNodeToPoint(n)}}},build:function(t){return this.extractNonCoveredResultNodes(t),this.resultPointList},interfaces_:function(){return[]},getClass:function(){return Nn}}),io(Cn.prototype,{locate:function(t){},interfaces_:function(){return[]},getClass:function(){return Cn}}),io(Sn.prototype,{locate:function(t){return Sn.locate(t,this.geom)},interfaces_:function(){return[Cn]},getClass:function(){return Sn}}),Sn.isPointInRing=function(t,e){return!!e.getEnvelopeInternal().intersects(t)&&oe.isPointInRing(t,e.getCoordinates())},Sn.containsPointInPolygon=function(t,e){if(e.isEmpty())return!1;var n=e.getExteriorRing();if(!Sn.isPointInRing(t,n))return!1 ;for(var i=0;i=0;n--){var i=this.edgeList.get(n),r=i.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=i}e.setNext(t)},computeDepths:function(){if(1===arguments.length){var t=arguments[0],e=this.findIndex(t),n=(t.getLabel(),t.getDepth(an.LEFT)),i=t.getDepth(an.RIGHT),r=this.computeDepths(e+1,this.edgeList.size(),n);if(this.computeDepths(0,e,r)!==i)throw new tn("depth mismatch at "+t.getCoordinate())}else if(3===arguments.length){for(var s=arguments[0],o=arguments[1],a=arguments[2],u=a,l=s;l=0;r--){var s=this.resultAreaEdgeList.get(r),o=s.getSym();switch(null===e&&s.getEdgeRing()===t&&(e=s),i){case this.SCANNING_FOR_INCOMING:if(o.getEdgeRing()!==t)continue;n=o,i=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(s.getEdgeRing()!==t)continue;n.setNextMin(s),i=this.SCANNING_FOR_INCOMING}}i===this.LINKING_TO_OUTGOING&&(h.isTrue(null!==e,"found null for first outgoing dirEdge"),h.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},getOutgoingDegree:function(){if(0===arguments.length){for(var t=0,e=this.iterator();e.hasNext();){var n=e.next();n.isInResult()&&t++}return t}if(1===arguments.length){for(var i=arguments[0],t=0,e=this.iterator();e.hasNext();){var n=e.next();n.getEdgeRing()===i&&t++}return t}},getLabel:function(){return this.label},findCoveredLineEdges:function(){for(var t=S.NONE,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();if(!n.isLineEdge()){if(n.isInResult()){t=S.INTERIOR;break}if(i.isInResult()){t=S.EXTERIOR;break}}}if(t===S.NONE)return null;for(var r=t,e=this.iterator();e.hasNext();){var n=e.next(),i=n.getSym();n.isLineEdge()?n.getEdge().setCovered(r===S.INTERIOR):(n.isInResult()&&(r=S.EXTERIOR),i.isInResult()&&(r=S.INTERIOR))}},computeLabelling:function(t){Ln.prototype.computeLabelling.call(this,t),this.label=new ln(S.NONE);for(var e=this.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge(),r=i.getLabel(),s=0;s<2;s++){var o=r.getLocation(s);o!==S.INTERIOR&&o!==S.BOUNDARY||this.label.setLocation(s,S.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return wn}}),ro(Rn,yn),io(Rn.prototype,{createNode:function(t){return new dn(t,new wn)},interfaces_:function(){return[]},getClass:function(){return Rn}}),io(Tn.prototype,{computeIntersections:function(t,e){this.mce.computeIntersectsForChain(this.chainIndex,t.mce,t.chainIndex,e)},interfaces_:function(){return[]},getClass:function(){return Tn}}),io(On.prototype,{isDelete:function(){return this.eventType===On.DELETE},setDeleteEventIndex:function(t){this.deleteEventIndex=t},getObject:function(){return this.obj},compareTo:function(t){var e=t;return this.xValuee.xValue?1:this.eventTypee.eventType?1:0},getInsertEvent:function(){return this.insertEvent},isInsert:function(){return this.eventType===On.INSERT},isSameLabel:function(t){return null!==this.label&&this.label===t.label},getDeleteEventIndex:function(){return this.deleteEventIndex},interfaces_:function(){return[r]},getClass:function(){return On}}),On.INSERT=1,On.DELETE=2,io(Pn.prototype,{interfaces_:function(){return[]},getClass:function(){return Pn}}),io(bn.prototype,{isTrivialIntersection:function(t,e,n,i){if(t===n&&1===this.li.getIntersectionNum()){if(bn.isAdjacentSegments(e,i))return!0;if(t.isClosed()){var r=t.getNumPoints()-1;if(0===e&&i===r||0===i&&e===r)return!0}}return!1},getProperIntersectionPoint:function(){return this.properIntersectionPoint},setIsDoneIfProperInt:function(t){this.isDoneWhenProperInt=t},hasProperInteriorIntersection:function(){return this.hasProperInterior},isBoundaryPointInternal:function(t,e){for(var n=e.iterator();n.hasNext();){var i=n.next(),r=i.getCoordinate();if(t.isIntersection(r))return!0}return!1},hasProperIntersection:function(){return this.hasProper},hasIntersection:function(){return this._hasIntersection},isDone:function(){return this._isDone},isBoundaryPoint:function(t,e){return null!==e&&(!!this.isBoundaryPointInternal(t,e[0])||!!this.isBoundaryPointInternal(t,e[1]))},setBoundaryNodes:function(t,e){this.bdyNodes=new Array(2).fill(null),this.bdyNodes[0]=t,this.bdyNodes[1]=e},addIntersections:function(t,e,n,i){if(t===n&&e===i)return null;this.numTests++;var r=t.getCoordinates()[e],s=t.getCoordinates()[e+1],o=n.getCoordinates()[i],a=n.getCoordinates()[i+1];this.li.computeIntersection(r,s,o,a),this.li.hasIntersection()&&(this.recordIsolated&&(t.setIsolated(!1),n.setIsolated(!1)),this.numIntersections++,this.isTrivialIntersection(t,e,n,i)||(this._hasIntersection=!0,!this.includeProper&&this.li.isProper()||(t.addIntersections(this.li,e,0),n.addIntersections(this.li,i,1)),this.li.isProper()&&(this.properIntersectionPoint=this.li.getIntersection(0).copy(),this.hasProper=!0,this.isDoneWhenProperInt&&(this._isDone=!0),this.isBoundaryPoint(this.li,this.bdyNodes)||(this.hasProperInterior=!0))))},interfaces_:function(){return[]},getClass:function(){return bn}}),bn.isAdjacentSegments=function(t,e){return 1===Math.abs(t-e)},ro(_n,Pn),io(_n.prototype,{prepareEvents:function(){xo.sort(this.events);for(var t=0;te||this.maxs?1:0},interfaces_:function(){return[o]},getClass:function(){return Dn}}),Mn.NodeComparator=Dn,ro(An,Mn),io(An.prototype,{query:function(t,e,n){if(!this.intersects(t,e))return null;n.visitItem(this.item)},interfaces_:function(){return[]},getClass:function(){return An}}),ro(Fn,Mn),io(Fn.prototype,{buildExtent:function(t,e){this.min=Math.min(t.min,e.min),this.max=Math.max(t.max,e.max)},query:function(t,e,n){if(!this.intersects(t,e))return null;null!==this.node1&&this.node1.query(t,e,n),null!==this.node2&&this.node2.query(t,e,n)},interfaces_:function(){return[]},getClass:function(){return Fn}}),io(Gn.prototype,{buildTree:function(){xo.sort(this.leaves,new IntervalRTreeNode.NodeComparator);for(var t=this.leaves,e=null,n=new x;;){if(this.buildLevel(t,n),1===n.size())return n.get(0);e=t,t=n,n=e}},insert:function(t,e,n){if(null!==this.root)throw new IllegalStateException("Index cannot be added to once it has been queried");this.leaves.add(new An(t,e,n))},query:function(t,e,n){this.init(),this.root.query(t,e,n)},buildRoot:function(){if(null!==this.root)return null;this.root=this.buildTree()},printNode:function(t){_.out.println(ee.toLineString(new c(t.min,this.level),new c(t.max,this.level)))},init:function(){if(null!==this.root)return null;this.buildRoot()},buildLevel:function(t,e){this.level++,e.clear();for(var n=0;n0||!e.coord.equals2D(i);r||n--;var s=new Array(n).fill(null),o=0;s[o++]=new c(t.coord);for(var a=t.segmentIndex+1;a<=e.segmentIndex;a++)s[o++]=this.edge.pts[a];return r&&(s[o]=e.coord),new jn(s,new ln(this.edge.label))},add:function(t,e,n){var i=new Yn(t,e,n),r=this.nodeMap.get(i);return null!==r?r:(this.nodeMap.put(i,i),i)},isIntersection:function(t){for(var e=this.iterator();e.hasNext();){if(e.next().coord.equals(t))return!0}return!1},interfaces_:function(){return[]},getClass:function(){return Un}}),io(Xn.prototype,{getChainStartIndices:function(t){var e=0,n=new x;n.add(new R(e));do{var i=this.findChainEnd(t,e);n.add(new R(i)),e=i}while(en?e:n},getMinX:function(t){var e=this.pts[this.startIndex[t]].x,n=this.pts[this.startIndex[t+1]].x;return ee&&(i=1),this.depth[t][n]=i}}},getDelta:function(t){return this.depth[t][an.RIGHT]-this.depth[t][an.LEFT]},getLocation:function(t,e){return this.depth[t][e]<=0?S.EXTERIOR:S.INTERIOR},toString:function(){return"A: "+this.depth[0][1]+","+this.depth[0][2]+" B: "+this.depth[1][1]+","+this.depth[1][2]},add:function(){if(1===arguments.length)for(var t=arguments[0],e=0;e<2;e++)for(var n=1;n<3;n++){var i=t.getLocation(e,n);i!==S.EXTERIOR&&i!==S.INTERIOR||(this.isNull(e,n)?this.depth[e][n]=Wn.depthAtLocation(i):this.depth[e][n]+=Wn.depthAtLocation(i))}else if(3===arguments.length){var r=arguments[0],s=arguments[1],o=arguments[2];o===S.INTERIOR&&this.depth[r][s]++}},interfaces_:function(){return[]},getClass:function(){return Wn}}),Wn.depthAtLocation=function(t){return t===S.EXTERIOR?0:t===S.INTERIOR?1:Wn.NULL_VALUE},Wn.NULL_VALUE=-1,ro(jn,gn),io(jn.prototype,{getDepth:function(){return this.depth},getCollapsedEdge:function(){var t=new Array(2).fill(null);return t[0]=this.pts[0],t[1]=this.pts[1],new jn(t,ln.toLineLabel(this.label))},isIsolated:function(){return this._isIsolated},getCoordinates:function(){return this.pts},setIsolated:function(t){this._isIsolated=t},setName:function(t){this.name=t},equals:function(t){if(!(t instanceof jn))return!1;var e=t;if(this.pts.length!==e.pts.length)return!1;for(var n=!0,i=!0,r=this.pts.length,s=0;s0?this.pts[0]:null;if(1===arguments.length){var t=arguments[0];return this.pts[t]}},print:function(t){t.print("edge "+this.name+": "),t.print("LINESTRING (");for(var e=0;e0&&t.print(","),t.print(this.pts[e].x+" "+this.pts[e].y);t.print(") "+this.label+" "+this.depthDelta)},computeIM:function(t){jn.updateIM(this.label,t)},isCollapsed:function(){return!!this.label.isArea()&&(3===this.pts.length&&!!this.pts[0].equals(this.pts[2]))},isClosed:function(){return this.pts[0].equals(this.pts[this.pts.length-1])},getMaximumSegmentIndex:function(){return this.pts.length-1},getDepthDelta:function(){return this.depthDelta},getNumPoints:function(){return this.pts.length},printReverse:function(t){t.print("edge "+this.name+": ");for(var e=this.pts.length-1;e>=0;e--)t.print(this.pts[e]+" ");t.println("")},getMonotoneChainEdge:function(){return null===this.mce&&(this.mce=new Hn(this)),this.mce},getEnvelope:function(){if(null===this.env){this.env=new I;for(var t=0;t0&&t.append(","),t.append(this.pts[e].x+" "+this.pts[e].y);return t.append(") "+this.label+" "+this.depthDelta),t.toString()},isPointwiseEqual:function(t){if(this.pts.length!==t.pts.length)return!1;for(var e=0;e=2,"found LineString with single point"),this.insertBoundaryPoint(this.argIndex,e[0]),this.insertBoundaryPoint(this.argIndex,e[e.length-1])},getInvalidPoint:function(){return this.invalidPoint},getBoundaryPoints:function(){for(var t=this.getBoundaryNodes(),e=new Array(t.size()).fill(null),n=0,i=t.iterator();i.hasNext();){var r=i.next();e[n++]=r.getCoordinate().copy()}return e},getBoundaryNodes:function(){return null===this.boundaryNodes&&(this.boundaryNodes=this.nodes.getBoundaryNodes(this.argIndex)),this.boundaryNodes},addSelfIntersectionNode:function(t,e,n){if(this.isBoundaryNode(t,e))return null;n===S.BOUNDARY&&this.useBoundaryDeterminationRule?this.insertBoundaryPoint(t,e):this.insertPoint(t,e,n)},addPolygonRing:function(t,e,n){if(t.isEmpty())return null;var i=Y.removeRepeatedPoints(t.getCoordinates());if(i.length<4)return this._hasTooFewPoints=!0,this.invalidPoint=i[0],null;var r=e,s=n;oe.isCCW(i)&&(r=n,s=e);var o=new jn(i,new ln(this.argIndex,S.BOUNDARY,r,s));this.lineEdgeMap.put(t,o),this.insertEdge(o),this.insertPoint(this.argIndex,i[0],S.BOUNDARY)},insertPoint:function(t,e,n){var i=this.nodes.addNode(e),r=i.getLabel();null===r?i.label=new ln(t,n):r.setLocation(t,n)},createEdgeSetIntersector:function(){return new _n},addSelfIntersectionNodes:function(t){for(var e=this.edges.iterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.eiList.iterator();r.hasNext();){var s=r.next();this.addSelfIntersectionNode(t,s.coord,i)}},add:function(){if(1!==arguments.length)return xn.prototype.add.apply(this,arguments);var t=arguments[0];if(t.isEmpty())return null;if(t instanceof Tt&&(this.useBoundaryDeterminationRule=!1),t instanceof Lt)this.addPolygon(t);else if(t instanceof It)this.addLineString(t);else if(t instanceof Ct)this.addPoint(t);else if(t instanceof wt)this.addCollection(t);else if(t instanceof ht)this.addCollection(t);else if(t instanceof Tt)this.addCollection(t);else{if(!(t instanceof lt))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},addCollection:function(t){for(var e=0;e50?(null===this.areaPtLocator&&(this.areaPtLocator=new Vn(this.parentGeom)),this.areaPtLocator.locate(t)):this.ptLocator.locate(t,this.parentGeom)},findEdge:function(){if(1===arguments.length){var t=arguments[0];return this.lineEdgeMap.get(t)}return xn.prototype.findEdge.apply(this,arguments)},interfaces_:function(){return[]},getClass:function(){return Kn}}),Kn.determineBoundary=function(t,e){return t.isInBoundary(e)?S.BOUNDARY:S.INTERIOR},io(Zn.prototype,{getArgGeometry:function(t){return this.arg[t].getGeometry()},setComputationPrecision:function(t){this.resultPrecisionModel=t,this.li.setPrecisionModel(this.resultPrecisionModel)},interfaces_:function(){return[]},getClass:function(){return Zn}}),io(Qn.prototype,{compareTo:function(t){var e=t;return Qn.compareOriented(this.pts,this._orientation,e.pts,e._orientation)},interfaces_:function(){return[r]},getClass:function(){return Qn}}),Qn.orientation=function(t){return 1===Y.increasingDirection(t)},Qn.compareOriented=function(t,e,n,i){for(var r=e?1:-1,s=i?1:-1,o=e?t.length:-1,a=i?n.length:-1,u=e?0:t.length-1,l=i?0:n.length-1;;){var h=t[u].compareTo(n[l]);if(0!==h)return h;u+=r,l+=s;var c=u===o,f=l===a;if(c&&!f)return-1;if(!c&&f)return 1;if(c&&f)return 0}},io(Jn.prototype,{print:function(t){t.print("MULTILINESTRING ( ");for(var e=0;e0&&t.print(","),t.print("(");for(var i=n.getCoordinates(),r=0;r0&&t.print(","),t.print(i[r].x+" "+i[r].y);t.println(")")}t.print(") ")},addAll:function(t){for(var e=t.iterator();e.hasNext();)this.add(e.next())},findEdgeIndex:function(t){for(var e=0;ethis.maxWidth)&&(this.interiorPoint=e,this.maxWidth=n)},getInteriorPoint:function(){return this.interiorPoint},widestGeometry:function(){if(arguments[0]instanceof lt){var t=arguments[0];if(t.isEmpty())return t;for(var e=t.getGeometryN(0),n=1;ne.getEnvelopeInternal().getWidth()&&(e=t.getGeometryN(n));return e}if(arguments[0]instanceof F){var i=arguments[0];return i instanceof lt?this.widestGeometry(i):i}},horizontalBisector:function(t){var e=t.getEnvelopeInternal(),n=ii.getBisectorY(t);return this.factory.createLineString([new c(e.getMinX(),n),new c(e.getMaxX(),n)])},add:function(t){if(t instanceof Lt)this.addPolygon(t);else if(t instanceof lt)for(var e=t,n=0;nthis.loY&&(this.loY=t):t>this.centreY&&tt&&(t=n)}return t+1},nodeSize:function(){for(var t=0,e=0;e<2;e++)null!==this.subnode[e]&&(t+=this.subnode[e].nodeSize());return t+1},add:function(t){this.items.add(t)},interfaces_:function(){return[]},getClass:function(){return ai}}),ai.getSubnodeIndex=function(t,e){var n=-1;return t.min>=e&&(n=1),t.max<=e&&(n=0),n},io(ui.prototype,{expandToInclude:function(t){t.max>this.max&&(this.max=t.max),t.minn||this.max=this.min&&e<=this.max}}else if(2===arguments.length){var n=arguments[0],i=arguments[1];return n>=this.min&&i<=this.max}},init:function(t,e){this.min=t,this.max=e,t>e&&(this.min=e,this.max=t)},getMax:function(){return this.max},interfaces_:function(){return[]},getClass:function(){return ui}}),li.exponent=function(t){return hi(64,t)-1023},li.powerOf2=function(t){return Math.pow(2,t)},io(ci.prototype,{getInterval:function(){return this.interval},getLevel:function(){return this.level},computeKey:function(t){for(this.level=ci.computeLevel(t),this.interval=new ui,this.computeInterval(this.level,t);!this.interval.contains(t);)this.level+=1,this.computeInterval(this.level,t)},computeInterval:function(t,e){var n=li.powerOf2(t);this.pt=Math.floor(e.getMin()/n)*n,this.interval.init(this.pt,this.pt+n)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return ci}}),ci.computeLevel=function(t){var e=t.getWidth();return li.exponent(e)+1},ro(fi,ai),io(fi.prototype,{getInterval:function(){return this.interval},find:function(t){var e=ai.getSubnodeIndex(t,this.centre);if(-1===e)return this;if(null!==this.subnode[e]){return this.subnode[e].find(t)}return this},insert:function(t){h.isTrue(null===this.interval||this.interval.contains(t.interval));var e=ai.getSubnodeIndex(t.interval,this.centre);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insert(t),this.subnode[e]=n}},isSearchMatch:function(t){return t.overlaps(this.interval)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getNode:function(t){var e=ai.getSubnodeIndex(t,this.centre);if(-1!==e){return this.getSubnode(e).getNode(t)}return this},createSubnode:function(t){var e=0,n=0;switch(t){case 0:e=this.interval.getMin(),n=this.centre;break;case 1:e=this.centre,n=this.interval.getMax()}return new fi(new ui(e,n),this.level-1)},interfaces_:function(){return[]},getClass:function(){return fi}}),fi.createNode=function(t){var e=new ci(t);return new fi(e.getInterval(),e.getLevel())},fi.createExpanded=function(t,e){var n=new ui(e);null!==t&&n.expandToInclude(t.interval);var i=fi.createNode(n);return null!==t&&i.insert(t),i},io(gi.prototype,{interfaces_:function(){return[]},getClass:function(){return gi}});gi.isZeroWidth=function(t,e){var n=e-t;if(0===n)return!0;var i=Math.max(Math.abs(t),Math.abs(e)),r=n/i;return li.exponent(r)<=gi.MIN_BINARY_EXPONENT},gi.MIN_BINARY_EXPONENT=-50,ro(di,ai),io(di.prototype,{insert:function(t,e){var n=ai.getSubnodeIndex(t,di.origin);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getInterval().contains(t)){var r=fi.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){h.isTrue(t.getInterval().contains(e));var i=gi.isZeroWidth(e.getMin(),e.getMax()),r=null;r=i?t.find(e):t.getNode(e),r.add(n)},interfaces_:function(){return[]},getClass:function(){return di}}),di.origin=0,io(pi.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=pi.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){if("number"==typeof arguments[0]){var t=arguments[0];return this.query(new ui(t,t))}if(arguments[0]instanceof ui){var e=arguments[0],n=new x;return this.query(e,n),n}}else if(2===arguments.length){var i=arguments[0],r=arguments[1];this.root.addAllItemsFromOverlapping(i,r)}},iterator:function(){var t=new x;return this.root.addAllItems(t),t.iterator()},remove:function(t,e){var n=pi.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e0&&(this.minExtent=e)},depth:function(){return null!==this.root?this.root.depth():0},nodeSize:function(){return null!==this.root?this.root.nodeSize():0},interfaces_:function(){return[]},getClass:function(){return pi}}),pi.ensureExtent=function(t,e){var n=t.getMin(),i=t.getMax();return n!==i?t:(n===i&&(n-=e/2,i=n+e/2),new ui(n,i))},io(mi.prototype,{isInside:function(t){},interfaces_:function(){return[]},getClass:function(){return mi}}),io(vi.prototype,{testLineSegment:function(t,e){var n=null,i=null,r=null,s=null,o=e.p0,a=e.p1;n=o.x-t.x,i=o.y-t.y,r=a.x-t.x,s=a.y-t.y,(i>0&&s<=0||s>0&&i<=0)&&0Math.PI;)t-=xi.PI_TIMES_2;for(;t<=-Math.PI;)t+=xi.PI_TIMES_2;return t},xi.angle=function(){if(1===arguments.length){var t=arguments[0];return Math.atan2(t.y,t.x)}if(2===arguments.length){var e=arguments[0],n=arguments[1],i=n.x-e.x,r=n.y-e.y;return Math.atan2(r,i)}},xi.isAcute=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)>0},xi.isObtuse=function(t,e,n){var i=t.x-e.x,r=t.y-e.y;return i*(n.x-e.x)+r*(n.y-e.y)<0},xi.interiorAngle=function(t,e,n){var i=xi.angle(e,t),r=xi.angle(e,n);return Math.abs(r-i)},xi.normalizePositive=function(t){if(t<0){for(;t<0;)t+=xi.PI_TIMES_2;t>=xi.PI_TIMES_2&&(t=0)}else{for(;t>=xi.PI_TIMES_2;)t-=xi.PI_TIMES_2;t<0&&(t=0)}return t},xi.angleBetween=function(t,e,n){var i=xi.angle(e,t),r=xi.angle(e,n);return xi.diff(i,r)},xi.diff=function(t,e){var n=null;return n=tMath.PI&&(n=2*Math.PI-n),n},xi.toRadians=function(t){return t*Math.PI/180},xi.getTurn=function(t,e){var n=Math.sin(e-t);return n>0?xi.COUNTERCLOCKWISE:n<0?xi.CLOCKWISE:xi.NONE},xi.angleBetweenOriented=function(t,e,n){var i=xi.angle(e,t),r=xi.angle(e,n),s=r-i;return s<=-Math.PI?s+xi.PI_TIMES_2:s>Math.PI?s-xi.PI_TIMES_2:s},xi.PI_TIMES_2=2*Math.PI,xi.PI_OVER_2=Math.PI/2,xi.PI_OVER_4=Math.PI/4,xi.COUNTERCLOCKWISE=oe.COUNTERCLOCKWISE,xi.CLOCKWISE=oe.CLOCKWISE,xi.NONE=oe.COLLINEAR,io(Ei.prototype,{area:function(){return Ei.area(this.p0,this.p1,this.p2)},signedArea:function(){return Ei.signedArea(this.p0,this.p1,this.p2)},interpolateZ:function(t){if(null===t)throw new n("Supplied point is null.");return Ei.interpolateZ(t,this.p0,this.p1,this.p2)},longestSideLength:function(){return Ei.longestSideLength(this.p0,this.p1,this.p2)},isAcute:function(){return Ei.isAcute(this.p0,this.p1,this.p2)},circumcentre:function(){return Ei.circumcentre(this.p0,this.p1,this.p2)},area3D:function(){return Ei.area3D(this.p0,this.p1,this.p2)},centroid:function(){return Ei.centroid(this.p0,this.p1,this.p2)},inCentre:function(){return Ei.inCentre(this.p0,this.p1,this.p2)},interfaces_:function(){return[]},getClass:function(){return Ei}}),Ei.area=function(t,e,n){return Math.abs(((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2)},Ei.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},Ei.det=function(t,e,n,i){return t*i-e*n},Ei.interpolateZ=function(t,e,n,i){var r=e.x,s=e.y,o=n.x-r,a=i.x-r,u=n.y-s,l=i.y-s,h=o*l-a*u,c=t.x-r,f=t.y-s,g=(l*c-a*f)/h,d=(-u*c+o*f)/h;return e.z+g*(n.z-e.z)+d*(i.z-e.z)},Ei.longestSideLength=function(t,e,n){var i=t.distance(e),r=e.distance(n),s=n.distance(t),o=i;return r>o&&(o=r),s>o&&(o=s),o},Ei.isAcute=function(t,e,n){return!!xi.isAcute(t,e,n)&&(!!xi.isAcute(e,n,t)&&!!xi.isAcute(n,t,e))},Ei.circumcentre=function(t,e,n){var i=n.x,r=n.y,s=t.x-i,o=t.y-r,a=e.x-i,u=e.y-r,l=2*Ei.det(s,o,a,u);return new c(i-Ei.det(o,s*s+o*o,u,a*a+u*u)/l,r+Ei.det(s,s*s+o*o,a,a*a+u*u)/l)},Ei.perpendicularBisector=function(t,e){var n=e.x-t.x,i=e.y-t.y;return new M(new M(t.x+n/2,t.y+i/2,1),new M(t.x-i+n/2,t.y+n+i/2,1))},Ei.angleBisector=function(t,e,n){var i=e.distance(t),r=e.distance(n),s=i/(i+r),o=n.x-t.x,a=n.y-t.y;return new c(t.x+s*o,t.y+s*a)},Ei.area3D=function(t,e,n){var i=e.x-t.x,r=e.y-t.y,s=e.z-t.z,o=n.x-t.x,a=n.y-t.y,u=n.z-t.z,l=r*u-s*a,h=s*o-i*u,c=i*a-r*o,f=l*l+h*h+c*c;return Math.sqrt(f)/2},Ei.centroid=function(t,e,n){return new c((t.x+e.x+n.x)/3,(t.y+e.y+n.y)/3)},Ei.inCentre=function(t,e,n){var i=e.distance(n),r=t.distance(n),s=t.distance(e),o=i+r+s;return new c((i*t.x+r*e.x+s*n.x)/o,(i*t.y+r*e.y+s*n.y)/o)},io(Ii.prototype,{getRadius:function(){return this.compute(),this.radius},getDiameter:function(){switch(this.compute(),this.extremalPts.length){case 0:return this.input.getFactory().createLineString();case 1:return this.input.getFactory().createPoint(this.centre)}var t=this.extremalPts[0],e=this.extremalPts[1];return this.input.getFactory().createLineString([t,e])},getExtremalPoints:function(){return this.compute(),this.extremalPts},computeCirclePoints:function(){if(this.input.isEmpty())return this.extremalPts=new Array(0).fill(null),null;if(1===this.input.getNumPoints()){var t=this.input.getCoordinates();return this.extremalPts=[new c(t[0])],null}var e=this.input.convexHull(),n=e.getCoordinates(),t=n;if(n[0].equals2D(n[n.length-1])&&(t=new Array(n.length-1).fill(null),Y.copyDeep(n,0,t,0,n.length-1)),t.length<=2)return this.extremalPts=Y.copyDeep(t),null;for(var i=Ii.lowestPoint(t),r=Ii.pointWitMinAngleWithX(t,i),s=0;s=i;)i=r,s=o,o=Ni.nextIndex(t,s),r=e.distancePerpendicular(t[o]);return ir&&(r=u),uo&&(o=l),l=t.length&&(e=0),e},Ni.computeC=function(t,e,n){return t*n.y-e*n.x},Ni.getMinimumDiameter=function(t){return new Ni(t).getDiameter()},Ni.getMinimumRectangle=function(t){return new Ni(t).getMinimumRectangle()},Ni.computeSegmentForLine=function(t,e,n){var i=null,r=null;return Math.abs(e)>Math.abs(t)?(i=new c(0,n/e),r=new c(1,n/e-t/e)):(i=new c(n/t,0),r=new c(n/t-e/t,1)),new ae(i,r)};var Eo=Object.freeze({Centroid:le,CGAlgorithms:oe,ConvexHull:ge,InteriorPointArea:ni,InteriorPointLine:ri,InteriorPointPoint:si,RobustLineIntersector:ie,MCPointInRing:vi,MinimumBoundingCircle:Ii,MinimumDiameter:Ni});io(Ci.prototype,{getResultGeometry:function(){return new Si(this.distanceTolerance).transform(this.inputGeom)},setDistanceTolerance:function(t){if(t<=0)throw new n("Tolerance must be positive");this.distanceTolerance=t},interfaces_:function(){return[]},getClass:function(){return Ci}}),Ci.densifyPoints=function(t,e,n){for(var i=new ae,r=new E,s=0;s1)for(var u=o/a,l=1;lo?1:st&&(t=n)}return t+1},isEmpty:function(){var t=!0;this.items.isEmpty()||(t=!1);for(var e=0;e<4;e++)null!==this.subnode[e]&&(this.subnode[e].isEmpty()||(t=!1));return t},add:function(t){this.items.add(t)},interfaces_:function(){return[a]},getClass:function(){return bi}}),bi.getSubnodeIndex=function(t,e,n){var i=-1;return t.getMinX()>=e&&(t.getMinY()>=n&&(i=3),t.getMaxY()<=n&&(i=1)),t.getMaxX()<=e&&(t.getMinY()>=n&&(i=2),t.getMaxY()<=n&&(i=0)),i},io(_i.prototype,{getLevel:function(){return this.level},computeKey:function(){if(1===arguments.length){var t=arguments[0];for(this.level=_i.computeQuadLevel(t),this.env=new I,this.computeKey(this.level,t);!this.env.contains(t);)this.level+=1,this.computeKey(this.level,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=li.powerOf2(e);this.pt.x=Math.floor(n.getMinX()/i)*i,this.pt.y=Math.floor(n.getMinY()/i)*i,this.env.init(this.pt.x,this.pt.x+i,this.pt.y,this.pt.y+i)}},getEnvelope:function(){return this.env},getCentre:function(){return new c((this.env.getMinX()+this.env.getMaxX())/2,(this.env.getMinY()+this.env.getMaxY())/2)},getPoint:function(){return this.pt},interfaces_:function(){return[]},getClass:function(){return _i}}),_i.computeQuadLevel=function(t){var e=t.getWidth(),n=t.getHeight(),i=e>n?e:n;return li.exponent(i)+1},ro(Mi,bi),io(Mi.prototype,{find:function(t){var e=bi.getSubnodeIndex(t,this.centrex,this.centrey);if(-1===e)return this;if(null!==this.subnode[e]){return this.subnode[e].find(t)}return this},isSearchMatch:function(t){return this.env.intersects(t)},getSubnode:function(t){return null===this.subnode[t]&&(this.subnode[t]=this.createSubnode(t)),this.subnode[t]},getEnvelope:function(){return this.env},getNode:function(t){var e=bi.getSubnodeIndex(t,this.centrex,this.centrey);if(-1!==e){return this.getSubnode(e).getNode(t)}return this},createSubnode:function(t){var e=0,n=0,i=0,r=0;switch(t){case 0:e=this.env.getMinX(),n=this.centrex,i=this.env.getMinY(),r=this.centrey;break;case 1:e=this.centrex,n=this.env.getMaxX(),i=this.env.getMinY(),r=this.centrey;break;case 2:e=this.env.getMinX(),n=this.centrex,i=this.centrey,r=this.env.getMaxY();break;case 3:e=this.centrex,n=this.env.getMaxX(),i=this.centrey,r=this.env.getMaxY()}return new Mi(new I(e,n,i,r),this.level-1)},insertNode:function(t){h.isTrue(null===this.env||this.env.contains(t.env));var e=bi.getSubnodeIndex(t.env,this.centrex,this.centrey);if(t.level===this.level-1)this.subnode[e]=t;else{var n=this.createSubnode(e);n.insertNode(t),this.subnode[e]=n}},interfaces_:function(){return[]},getClass:function(){return Mi}}),Mi.createNode=function(t){var e=new _i(t);return new Mi(e.getEnvelope(),e.getLevel())},Mi.createExpanded=function(t,e){var n=new I(e);null!==t&&n.expandToInclude(t.env);var i=Mi.createNode(n);return null!==t&&i.insertNode(t),i},ro(Di,bi),io(Di.prototype,{insert:function(t,e){var n=bi.getSubnodeIndex(t,Di.origin.x,Di.origin.y);if(-1===n)return this.add(e),null;var i=this.subnode[n];if(null===i||!i.getEnvelope().contains(t)){var r=Mi.createExpanded(i,t);this.subnode[n]=r}this.insertContained(this.subnode[n],t,e)},isSearchMatch:function(t){return!0},insertContained:function(t,e,n){h.isTrue(t.getEnvelope().contains(e));var i=gi.isZeroWidth(e.getMinX(),e.getMaxX()),r=gi.isZeroWidth(e.getMinY(),e.getMaxY()),s=null;s=i||r?t.find(e):t.getNode(e),s.add(n)},interfaces_:function(){return[]},getClass:function(){return Di}}),Di.origin=new c(0,0),io(Ai.prototype,{size:function(){return null!==this.root?this.root.size():0},insert:function(t,e){this.collectStats(t);var n=Ai.ensureExtent(t,this.minExtent);this.root.insert(n,e)},query:function(){if(1===arguments.length){var t=arguments[0],e=new Bn;return this.query(t,e),e.getItems()}if(2===arguments.length){var n=arguments[0],i=arguments[1];this.root.visit(n,i)}},queryAll:function(){var t=new x;return this.root.addAllItems(t),t},remove:function(t,e){var n=Ai.ensureExtent(t,this.minExtent);return this.root.remove(n,e)},collectStats:function(t){var e=t.getWidth();e0&&(this.minExtent=e);var n=t.getHeight();n0&&(this.minExtent=n)},depth:function(){return null!==this.root?this.root.depth():0},isEmpty:function(){return null===this.root},interfaces_:function(){return[_e,a]},getClass:function(){return Ai}}),Ai.ensureExtent=function(t,e){var n=t.getMinX(),i=t.getMaxX(),r=t.getMinY(),s=t.getMaxY();return n!==i&&r!==s?t:(n===i&&(n-=e/2,i=n+e/2),r===s&&(r-=e/2,s=r+e/2),new I(n,i,r,s))},Ai.serialVersionUID=-0x678b60c967a25400;var So=Object.freeze({Quadtree:Ai}),Lo=Object.freeze({STRtree:qe}),wo=Object.freeze({quadtree:So,strtree:Lo}),Ro=["Point","MultiPoint","LineString","MultiLineString","Polygon","MultiPolygon"];io(Fi.prototype,{read:function(t){var e=void 0;e="string"==typeof t?JSON.parse(t):t;var n=e.type;if(!To[n])throw new Error("Unknown GeoJSON type: "+e.type);return-1!==Ro.indexOf(n)?To[n].apply(this,[e.coordinates]):"GeometryCollection"===n?To[n].apply(this,[e.geometries]):To[n].apply(this,[e])},write:function(t){var e=t.getGeometryType();if(!Oo[e])throw new Error("Geometry is not supported");return Oo[e].apply(this,[t])}});var To={Feature:function(t){var e={};for(var n in t)e[n]=t[n];if(t.geometry){var i=t.geometry.type;if(!To[i])throw new Error("Unknown GeoJSON type: "+t.type);e.geometry=this.read(t.geometry)}return t.bbox&&(e.bbox=To.bbox.apply(this,[t.bbox])),e},FeatureCollection:function(t){var e={};if(t.features){e.features=[];for(var n=0;n0&&this.minIndexthis.minCoord.y&&n.y>this.minCoord.y&&i===oe.CLOCKWISE&&(r=!0),r&&(this.minIndex=this.minIndex-1)},getRightmostSideOfSegment:function(t,e){var n=t.getEdge(),i=n.getCoordinates();if(e<0||e+1>=i.length)return-1;if(i[e].y===i[e+1].y)return-1;var r=an.LEFT;return i[e].ythis.minCoord.x)&&(this.minDe=t,this.minIndex=n,this.minCoord=e[n])},findRightmostEdgeAtNode:function(){var t=this.minDe.getNode(),e=t.getEdges();this.minDe=e.getRightmostEdge(),this.minDe.isForward()||(this.minDe=this.minDe.getSym(),this.minIndex=this.minDe.getEdge().getCoordinates().length-1)},findEdge:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}h.isTrue(0!==this.minIndex||this.minCoord.equals(this.minDe.getCoordinate()),"inconsistency in rightmost processing"),0===this.minIndex?this.findRightmostEdgeAtNode():this.findRightmostEdgeAtVertex(),this.orientedDe=this.minDe,this.getRightmostSide(this.minDe,this.minIndex)===an.LEFT&&(this.orientedDe=this.minDe.getSym())},interfaces_:function(){return[]},getClass:function(){return Hi}}),Wi.prototype.addLast=function(t){this.array_.push(t)},Wi.prototype.removeFirst=function(){return this.array_.shift()},Wi.prototype.isEmpty=function(){return 0===this.array_.length},io(ji.prototype,{clearVisitedEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){t.next().setVisited(!1)}},getRightmostCoordinate:function(){return this.rightMostCoord},computeNodeDepth:function(t){for(var e=null,n=t.getEdges().iterator();n.hasNext();){var i=n.next();if(i.isVisited()||i.getSym().isVisited()){e=i;break}}if(null===e)throw new tn("unable to find edge to compute depths at "+t.getCoordinate());t.getEdges().computeDepths(e);for(var n=t.getEdges().iterator();n.hasNext();){var i=n.next();i.setVisited(!0),this.copySymDepths(i)}},computeDepth:function(t){this.clearVisitedEdges();var e=this.finder.getEdge();e.getNode(),e.getLabel();e.setEdgeDepths(an.RIGHT,t),this.copySymDepths(e),this.computeDepths(e)},create:function(t){this.addReachable(t),this.finder.findEdge(this.dirEdgeList),this.rightMostCoord=this.finder.getCoordinate()},findResultEdges:function(){for(var t=this.dirEdgeList.iterator();t.hasNext();){var e=t.next();e.getDepth(an.RIGHT)>=1&&e.getDepth(an.LEFT)<=0&&!e.isInteriorAreaEdge()&&e.setInResult(!0)}},computeDepths:function(t){var e=new K,n=new Wi,i=t.getNode();for(n.addLast(i),e.add(i),t.setVisited(!0);!n.isEmpty();){var r=n.removeFirst();e.add(r),this.computeNodeDepth(r);for(var s=r.getEdges().iterator();s.hasNext();){var o=s.next(),a=o.getSym();if(!a.isVisited()){var u=a.getNode();e.contains(u)||(n.addLast(u),e.add(u))}}}},compareTo:function(t){var e=t;return this.rightMostCoord.xe.rightMostCoord.x?1:0},getEnvelope:function(){if(null===this.env){for(var t=new I,e=this.dirEdgeList.iterator();e.hasNext();)for(var n=e.next(),i=n.getEdge().getCoordinates(),r=0;r=0;n--)this.addPt(t[n])},isRedundant:function(t){if(this.ptList.size()<1)return!1;var e=this.ptList.get(this.ptList.size()-1);return t.distance(e)=2&&this.ptList.get(this.ptList.size()-2),t.equals(e))return null;this.ptList.add(t)},setMinimumVertexDistance:function(t){this.minimimVertexDistance=t},interfaces_:function(){return[]},getClass:function(){return Zi}}),Zi.COORDINATE_ARRAY_TYPE=new Array(0).fill(null),io(Qi.prototype,{addNextSegment:function(t,e){if(this.s0=this.s1,this.s1=this.s2,this.s2=t,this.seg0.setCoordinates(this.s0,this.s1),this.computeOffsetSegment(this.seg0,this.side,this.distance,this.offset0),this.seg1.setCoordinates(this.s1,this.s2),this.computeOffsetSegment(this.seg1,this.side,this.distance,this.offset1),this.s1.equals(this.s2))return null;var n=oe.computeOrientation(this.s0,this.s1,this.s2),i=n===oe.CLOCKWISE&&this.side===an.LEFT||n===oe.COUNTERCLOCKWISE&&this.side===an.RIGHT;0===n?this.addCollinear(e):i?this.addOutsideTurn(n,e):this.addInsideTurn(n,e)},addLineEndCap:function(t,e){var n=new ae(t,e),i=new ae;this.computeOffsetSegment(n,an.LEFT,this.distance,i);var r=new ae;this.computeOffsetSegment(n,an.RIGHT,this.distance,r);var s=e.x-t.x,o=e.y-t.y,a=Math.atan2(o,s);switch(this.bufParams.getEndCapStyle()){case Xi.CAP_ROUND:this.segList.addPt(i.p1),this.addFilletArc(e,a+Math.PI/2,a-Math.PI/2,oe.CLOCKWISE,this.distance),this.segList.addPt(r.p1);break;case Xi.CAP_FLAT:this.segList.addPt(i.p1),this.segList.addPt(r.p1);break;case Xi.CAP_SQUARE:var u=new c;u.x=Math.abs(this.distance)*Math.cos(a),u.y=Math.abs(this.distance)*Math.sin(a);var l=new c(i.p1.x+u.x,i.p1.y+u.y),h=new c(r.p1.x+u.x,r.p1.y+u.y);this.segList.addPt(l),this.segList.addPt(h)}},getCoordinates:function(){return this.segList.getCoordinates()},addMitreJoin:function(t,e,n,i){var r=!0,s=null;try{s=M.intersection(e.p0,e.p1,n.p0,n.p1);(i<=0?1:s.distance(t)/Math.abs(i))>this.bufParams.getMitreLimit()&&(r=!1)}catch(t){if(!(t instanceof C))throw t;s=new c(0,0),r=!1}r?this.segList.addPt(s):this.addLimitedMitreJoin(e,n,i,this.bufParams.getMitreLimit())},addFilletCorner:function(t,e,n,i,r){var s=e.x-t.x,o=e.y-t.y,a=Math.atan2(o,s),u=n.x-t.x,l=n.y-t.y,h=Math.atan2(l,u);i===oe.CLOCKWISE?a<=h&&(a+=2*Math.PI):a>=h&&(a-=2*Math.PI),this.segList.addPt(e),this.addFilletArc(t,a,h,i,r),this.segList.addPt(n)}, addOutsideTurn:function(t,e){if(this.offset0.p1.distance(this.offset1.p0)0){var n=new c((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 c((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 c(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){this.segList.addPt(t.p1),this.segList.addPt(e.p0)},init:function(t){this.distance=t,this.maxCurveSegmentError=t*(1-Math.cos(this.filletAngleQuantum/2)),this.segList=new Zi,this.segList.setPrecisionModel(this.precisionModel),this.segList.setMinimumVertexDistance(t*Qi.CURVE_VERTEX_SNAP_DISTANCE_FACTOR)},addCollinear:function(t){this.li.computeIntersection(this.s0,this.s1,this.s1,this.s2),this.li.getIntersectionNum()>=2&&(this.bufParams.getJoinStyle()===Xi.JOIN_BEVEL||this.bufParams.getJoinStyle()===Xi.JOIN_MITRE?(t&&this.segList.addPt(this.offset0.p1),this.segList.addPt(this.offset1.p0)):this.addFilletCorner(this.s1,this.offset0.p1,this.offset1.p0,oe.CLOCKWISE,this.distance))},closeRing:function(){this.segList.closeRing()},hasNarrowConcaveAngle:function(){return this._hasNarrowConcaveAngle},interfaces_:function(){return[]},getClass:function(){return Qi}}),Qi.OFFSET_SEGMENT_SEPARATION_FACTOR=.001,Qi.INSIDE_TURN_VERTEX_SNAP_DISTANCE_FACTOR=.001,Qi.CURVE_VERTEX_SNAP_DISTANCE_FACTOR=1e-6,Qi.MAX_CLOSING_SEG_LEN_FACTOR=80,io(Ji.prototype,{getOffsetCurve:function(t,e){if(this.distance=e,0===e)return null;var n=e<0,i=Math.abs(e),r=this.getSegGen(i);t.length<=1?this.computePointCurve(t[0],r):this.computeOffsetCurve(t,n,r);var s=r.getCoordinates();return n&&Y.reverse(s),s},computeSingleSidedBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){n.addSegments(t,!0);var r=Ki.simplify(t,-i),s=r.length-1;n.initSideSegments(r[s],r[s-1],an.LEFT),n.addFirstSegment();for(var o=s-2;o>=0;o--)n.addNextSegment(r[o],!0)}else{n.addSegments(t,!1);var a=Ki.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],an.LEFT),n.addFirstSegment();for(var o=2;o<=u;o++)n.addNextSegment(a[o],!0)}n.addLastSegment(),n.closeRing()},computeRingBufferCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);e===an.RIGHT&&(i=-i);var r=Ki.simplify(t,i),s=r.length-1;n.initSideSegments(r[s-1],r[0],e);for(var o=1;o<=s;o++){var a=1!==o;n.addNextSegment(r[o],a)}n.closeRing()},computeLineBufferCurve:function(t,e){var n=this.simplifyTolerance(this.distance),i=Ki.simplify(t,n),r=i.length-1;e.initSideSegments(i[0],i[1],an.LEFT);for(var s=2;s<=r;s++)e.addNextSegment(i[s],!0);e.addLastSegment(),e.addLineEndCap(i[r-1],i[r]);var o=Ki.simplify(t,-n),a=o.length-1;e.initSideSegments(o[a],o[a-1],an.LEFT);for(var s=a-2;s>=0;s--)e.addNextSegment(o[s],!0);e.addLastSegment(),e.addLineEndCap(o[1],o[0]),e.closeRing()},computePointCurve:function(t,e){switch(this.bufParams.getEndCapStyle()){case Xi.CAP_ROUND:e.createCircle(t);break;case Xi.CAP_SQUARE:e.createSquare(t)}},getLineCurve:function(t,e){if(this.distance=e,e<0&&!this.bufParams.isSingleSided())return null;if(0===e)return null;var n=Math.abs(e),i=this.getSegGen(n);if(t.length<=1)this.computePointCurve(t[0],i);else if(this.bufParams.isSingleSided()){var r=e<0;this.computeSingleSidedBufferCurve(t,r,i)}else this.computeLineBufferCurve(t,i);return i.getCoordinates()},getBufferParameters:function(){return this.bufParams},simplifyTolerance:function(t){return t*this.bufParams.getSimplifyFactor()},getRingCurve:function(t,e,n){if(this.distance=n,t.length<=2)return this.getLineCurve(t,n);if(0===n)return Ji.copyCoordinates(t);var i=this.getSegGen(n);return this.computeRingBufferCurve(t,e,i),i.getCoordinates()},computeOffsetCurve:function(t,e,n){var i=this.simplifyTolerance(this.distance);if(e){var r=Ki.simplify(t,-i),s=r.length-1;n.initSideSegments(r[s],r[s-1],an.LEFT),n.addFirstSegment();for(var o=s-2;o>=0;o--)n.addNextSegment(r[o],!0)}else{var a=Ki.simplify(t,i),u=a.length-1;n.initSideSegments(a[0],a[1],an.LEFT),n.addFirstSegment();for(var o=2;o<=u;o++)n.addNextSegment(a[o],!0)}n.addLastSegment()},getSegGen:function(t){return new Qi(this.precisionModel,this.bufParams,t)},interfaces_:function(){return[]},getClass:function(){return Ji}}),Ji.copyCoordinates=function(t){for(var e=new Array(t.length).fill(null),n=0;nr.getMaxY()||this.findStabbedSegments(t,i.getDirectedEdges(),e)}return e}if(3===arguments.length)if(oo(arguments[2],m)&&arguments[0]instanceof c&&arguments[1]instanceof vn)for(var s=arguments[0],o=arguments[1],a=arguments[2],u=o.getEdge().getCoordinates(),n=0;nthis.seg.p1.y&&this.seg.reverse();var l=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(lthis.seg.p1.y||oe.computeOrientation(this.seg.p0,this.seg.p1,s)===oe.RIGHT)){var h=o.getDepth(an.LEFT);this.seg.p0.equals(u[n])||(h=o.getDepth(an.RIGHT));var f=new tr(this.seg,h);a.add(f)}}else if(oo(arguments[2],m)&&arguments[0]instanceof c&&oo(arguments[1],m))for(var g=arguments[0],d=arguments[1],p=arguments[2],n=d.iterator();n.hasNext();){var v=n.next();v.isForward()&&this.findStabbedSegments(g,v,p)}},getDepth:function(t){var e=this.findStabbedSegments(t);return 0===e.size()?0:xo.min(e).leftDepth},interfaces_:function(){return[]},getClass:function(){return $i}}),io(tr.prototype,{compareTo:function(t){var e=t;if(this.upwardSeg.minX()>=e.upwardSeg.maxX())return 1;if(this.upwardSeg.maxX()<=e.upwardSeg.minX())return-1;var n=this.upwardSeg.orientationIndex(e.upwardSeg);return 0!==n?n:(n=-1*e.upwardSeg.orientationIndex(this.upwardSeg),0!==n?n:this.upwardSeg.compareTo(e.upwardSeg))},compareX:function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},toString:function(){return this.upwardSeg.toString()},interfaces_:function(){return[r]},getClass:function(){return tr}}),$i.DepthSegment=tr,io(er.prototype,{addPoint:function(t){if(this.distance<=0)return null;var e=t.getCoordinates(),n=this.curveBuilder.getLineCurve(e,this.distance);this.addCurve(n,S.EXTERIOR,S.INTERIOR)},addPolygon:function(t){var e=this.distance,n=an.LEFT;this.distance<0&&(e=-this.distance,n=an.RIGHT);var i=t.getExteriorRing(),r=Y.removeRepeatedPoints(i.getCoordinates());if(this.distance<0&&this.isErodedCompletely(i,this.distance))return null;if(this.distance<=0&&r.length<3)return null;this.addPolygonRing(r,e,n,S.EXTERIOR,S.INTERIOR);for(var s=0;s0&&this.isErodedCompletely(o,-this.distance)||this.addPolygonRing(a,e,an.opposite(n),S.INTERIOR,S.EXTERIOR)}},isTriangleErodedCompletely:function(t,e){var n=new Ei(t[0],t[1],t[2]),i=n.inCentre();return oe.distancePointLine(i,n.p0,n.p1)=Rt.MINIMUM_VALID_SIZE&&oe.isCCW(t)&&(s=r,o=i,n=an.opposite(n));var a=this.curveBuilder.getRingCurve(t,n,e);this.addCurve(a,s,o)},add:function(t){if(t.isEmpty())return null;if(t instanceof Lt)this.addPolygon(t);else if(t instanceof It)this.addLineString(t);else if(t instanceof Ct)this.addPoint(t);else if(t instanceof wt)this.addCollection(t);else if(t instanceof ht)this.addCollection(t);else if(t instanceof Tt)this.addCollection(t);else{if(!(t instanceof lt))throw new UnsupportedOperationException(t.getClass().getName());this.addCollection(t)}},isErodedCompletely:function(t,e){var n=t.getCoordinates();if(n.length<4)return e<0;if(4===n.length)return this.isTriangleErodedCompletely(n,e);var i=t.getEnvelopeInternal(),r=Math.min(i.getHeight(),i.getWidth());return e<0&&2*Math.abs(e)>r},addCollection:function(t){for(var e=0;ei||this.maxys;if(o)return!1;var a=this.intersectsToleranceSquare(t,e);return h.isTrue(!(o&&a),"Found bad envelope test"),a},initCorners:function(t){this.minx=t.x-.5,this.maxx=t.x+.5,this.miny=t.y-.5,this.maxy=t.y+.5,this.corner[0]=new c(this.maxx,this.maxy),this.corner[1]=new c(this.minx,this.maxy),this.corner[2]=new c(this.minx,this.miny),this.corner[3]=new c(this.maxx,this.miny)},intersects:function(t,e){return 1===this.scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this.p0Scaled),this.copyScaled(e,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},scale:function(t){return Math.round(t*this.scaleFactor)},getCoordinate:function(){return this.originalPt},copyScaled:function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},getSafeEnvelope:function(){if(null===this.safeEnv){var t=sr.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new I(this.originalPt.x-t,this.originalPt.x+t,this.originalPt.y-t,this.originalPt.y+t)}return this.safeEnv},intersectsPixelClosure:function(t,e){return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),!!this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),!!this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),!!this.li.hasIntersection()||(this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),!!this.li.hasIntersection())))},intersectsToleranceSquare:function(t,e){var n=!1,i=!1;return this.li.computeIntersection(t,e,this.corner[0],this.corner[1]),!!this.li.isProper()||(this.li.computeIntersection(t,e,this.corner[1],this.corner[2]),!!this.li.isProper()||(this.li.hasIntersection()&&(n=!0),this.li.computeIntersection(t,e,this.corner[2],this.corner[3]),!!this.li.isProper()||(this.li.hasIntersection()&&(i=!0),this.li.computeIntersection(t,e,this.corner[3],this.corner[0]),!!this.li.isProper()||(!(!n||!i)||(!!t.equals(this.pt)||!!e.equals(this.pt))))))},addSnappedNode:function(t,e){var n=t.getCoordinate(e),i=t.getCoordinate(e+1);return!!this.intersects(n,i)&&(t.addIntersection(this.getCoordinate(),e),!0)},interfaces_:function(){return[]},getClass:function(){return sr}}),sr.SAFE_ENV_EXPANSION_FACTOR=.75,io(or.prototype,{snap:function(){if(1===arguments.length){var t=arguments[0];return this.snap(t,null,-1)}if(3===arguments.length){var e=arguments[0],n=arguments[1],i=arguments[2],r=e.getSafeEnvelope(),s=new ar(e,n,i);return this.index.query(r,{interfaces_:function(){return[be]},visitItem:function(t){t.select(r,s)}}),s.isNodeAdded()}},interfaces_:function(){return[]},getClass:function(){return or}}),ro(ar,oi),io(ar.prototype,{isNodeAdded:function(){return this._isNodeAdded},select:function(){if(2!==arguments.length)return oi.prototype.select.apply(this,arguments);var t=arguments[0],e=arguments[1],n=t.getContext();if(null!==this.parentEdge&&n===this.parentEdge&&e===this.hotPixelVertexIndex)return null;this._isNodeAdded=this.hotPixel.addSnappedNode(n,e)},interfaces_:function(){return[]},getClass:function(){return ar}}),or.HotPixelSnapAction=ar,io(ur.prototype,{processIntersections:function(t,e,n,i){if(t===n&&e===i)return null;var r=t.getCoordinates()[e],s=t.getCoordinates()[e+1],o=n.getCoordinates()[i],a=n.getCoordinates()[i+1];if(this.li.computeIntersection(r,s,o,a),this.li.hasIntersection()&&this.li.isInteriorIntersection()){for(var u=0;u=0;t--){try{this.bufferReducedPrecision(t)}catch(t){if(!(t instanceof tn))throw t;this.saveException=t}if(null!==this.resultGeometry)return null}throw this.saveException}if(1===arguments.length){var e=arguments[0],n=hr.precisionScaleFactor(this.argGeom,this.distance,e),i=new Qt(n);this.bufferFixedPrecision(i)}},computeGeometry:function(){if(this.bufferOriginalPrecision(),null!==this.resultGeometry)return null;var t=this.argGeom.getFactory().getPrecisionModel();t.getType()===Qt.FIXED?this.bufferFixedPrecision(t):this.bufferReducedPrecision()},setQuadrantSegments:function(t){this.bufParams.setQuadrantSegments(t)},bufferOriginalPrecision:function(){try{var t=new ir(this.bufParams);this.resultGeometry=t.buffer(this.argGeom,this.distance)}catch(t){if(!(t instanceof u))throw t;this.saveException=t}},getResultGeometry:function(t){return this.distance=t,this.computeGeometry(),this.resultGeometry},setEndCapStyle:function(t){this.bufParams.setEndCapStyle(t)},interfaces_:function(){return[]},getClass:function(){return hr}}),hr.bufferOp=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new hr(t),i=n.getResultGeometry(e);return i}if(3===arguments.length){if(Number.isInteger(arguments[2])&&arguments[0]instanceof F&&"number"==typeof arguments[1]){var r=arguments[0],s=arguments[1],o=arguments[2],a=new hr(r);a.setQuadrantSegments(o);var i=a.getResultGeometry(s);return i}if(arguments[2]instanceof Xi&&arguments[0]instanceof F&&"number"==typeof arguments[1]){var u=arguments[0],l=arguments[1],h=arguments[2],a=new hr(u,h),i=a.getResultGeometry(l);return i}}else if(4===arguments.length){var c=arguments[0],f=arguments[1],g=arguments[2],d=arguments[3],a=new hr(c);a.setQuadrantSegments(g),a.setEndCapStyle(d);var i=a.getResultGeometry(f);return i}},hr.precisionScaleFactor=function(t,e,n){var i=t.getEnvelopeInternal(),r=L.max(Math.abs(i.getMaxX()),Math.abs(i.getMaxY()),Math.abs(i.getMinX()),Math.abs(i.getMinY())),s=e>0?e:0,o=r+2*s,a=Math.trunc(Math.log(o)/Math.log(10)+1),u=n-a;return Math.pow(10,u)},hr.CAP_ROUND=Xi.CAP_ROUND,hr.CAP_BUTT=Xi.CAP_FLAT,hr.CAP_FLAT=Xi.CAP_FLAT,hr.CAP_SQUARE=Xi.CAP_SQUARE,hr.MAX_PRECISION_DIGITS=12;var _o=Object.freeze({BufferOp:hr,BufferParameters:Xi});io(cr.prototype,{filter:function(t){t instanceof Lt&&this.comps.add(t)},interfaces_:function(){return[at]},getClass:function(){return cr}}),cr.getPolygons=function(){if(1===arguments.length){var t=arguments[0];return cr.getPolygons(t,new x)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Lt?n.add(e):e instanceof lt&&e.apply(new cr(n)),n}},io(fr.prototype,{isInsideArea:function(){return this.segIndex===fr.INSIDE_AREA},getCoordinate:function(){return this.pt},getGeometryComponent:function(){return this.component},getSegmentIndex:function(){return this.segIndex},interfaces_:function(){return[]},getClass:function(){return fr}}),fr.INSIDE_AREA=-1,io(gr.prototype,{filter:function(t){t instanceof Ct&&this.pts.add(t)},interfaces_:function(){return[at]},getClass:function(){return gr}}),gr.getPoints=function(){if(1===arguments.length){var t=arguments[0];return t instanceof Ct?xo.singletonList(t):gr.getPoints(t,new x)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return e instanceof Ct?n.add(e):e instanceof lt&&e.apply(new gr(n)),n}},io(dr.prototype,{filter:function(t){(t instanceof Ct||t instanceof It||t instanceof Lt)&&this.locations.add(new fr(t,0,t.getCoordinate()))},interfaces_:function(){return[at]},getClass:function(){return dr}}),dr.getLocations=function(t){var e=new x;return t.apply(new dr(e)),e},io(pr.prototype,{computeContainmentDistance:function(){if(0===arguments.length){var t=new Array(2).fill(null);if(this.computeContainmentDistance(0,t),this.minDistance<=this.terminateDistance)return null;this.computeContainmentDistance(1,t)}else if(2===arguments.length){var e=arguments[0],n=arguments[1],i=1-e,r=cr.getPolygons(this.geom[e]);if(r.size()>0){var s=dr.getLocations(this.geom[i]);if(this.computeContainmentDistance(s,r,n),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[i]=n[0],this.minDistanceLocation[e]=n[1],null}}else if(3===arguments.length)if(arguments[2]instanceof Array&&oo(arguments[0],m)&&oo(arguments[1],m)){for(var o=arguments[0],a=arguments[1],u=arguments[2],l=0;lthis.minDistance)return null;for(var i=t.getCoordinates(),r=e.getCoordinate(),s=0;sthis.minDistance)return null;for(var i=l.getCoordinates(),f=h.getCoordinates(),s=0;st&&Y.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 mr}}),io(vr.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 vr}}),vr.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if(n.isVisited()===e)return n}return null},vr.setVisited=function(t,e){for(;t.hasNext();){t.next().setVisited(e)}},vr.setMarked=function(t,e){for(;t.hasNext();){t.next().setMarked(e)}},ro(yr,vr),io(yr.prototype,{isRemoved:function(){return null===this.parentEdge},compareDirection:function(t){return this.quadrant>t.quadrant?1:this.quadrant=t.getNumPoints()&&null===i)return null;var s=t.getCoordinate(r);null!==i&&i.segmentIndex===n.segmentIndex&&(s=i.coord);var o=new mn(t,n.coord,s,new ln(t.getLabel()));e.add(o)},createEdgeEndForPrev:function(t,e,n,i){var r=n.segmentIndex;if(0===n.dist){if(0===r)return null;r--}var s=t.getCoordinate(r);null!==i&&i.segmentIndex>=r&&(s=i.coord);var o=new ln(t.getLabel());o.flip();var a=new mn(t,n.coord,s,o);e.add(a)},computeEdgeEnds:function(){if(1===arguments.length){for(var t=arguments[0],e=new x,n=t;n.hasNext();){var i=n.next();this.computeEdgeEnds(i,e)}return e}if(2===arguments.length){var r=arguments[0],s=arguments[1],o=r.getEdgeIntersectionList();o.addEndpoints();var a=o.iterator(),u=null,l=null;if(!a.hasNext())return null;var h=a.next();do{u=l,l=h,h=null,a.hasNext()&&(h=a.next()),null!==l&&(this.createEdgeEndForPrev(r,s,l,u),this.createEdgeEndForNext(r,s,l,h))}while(null!==l)}},interfaces_:function(){return[]},getClass:function(){return br}}),ro(_r,mn),io(_r.prototype,{insert:function(t){this.edgeEnds.add(t)},print:function(t){t.println("EdgeEndBundle--\x3e Label: "+this.label);for(var e=this.iterator();e.hasNext();){e.next().print(t),t.println()}},iterator:function(){return this.edgeEnds.iterator()},getEdgeEnds:function(){return this.edgeEnds},computeLabelOn:function(t,e){for(var n=0,i=!1,r=this.iterator();r.hasNext();){var s=r.next(),o=s.getLabel().getLocation(t);o===S.BOUNDARY&&n++,o===S.INTERIOR&&(i=!0)}var o=S.NONE;i&&(o=S.INTERIOR),n>0&&(o=Kn.determineBoundary(e,n)),this.label.setLocation(t,o)},computeLabelSide:function(t,e){for(var n=this.iterator();n.hasNext();){var i=n.next();if(i.getLabel().isArea()){var r=i.getLabel().getLocation(t,e);if(r===S.INTERIOR)return this.label.setLocation(t,e,S.INTERIOR),null;r===S.EXTERIOR&&this.label.setLocation(t,e,S.EXTERIOR)}}},getLabel:function(){return this.label},computeLabelSides:function(t){this.computeLabelSide(t,an.LEFT),this.computeLabelSide(t,an.RIGHT)},updateIM:function(t){jn.updateIM(this.label,t)},computeLabel:function(t){for(var e=!1,n=this.iterator();n.hasNext();){n.next().getLabel().isArea()&&(e=!0)}this.label=e?new ln(S.NONE,S.NONE,S.NONE):new ln(S.NONE);for(var i=0;i<2;i++)this.computeLabelOn(i,t),e&&this.computeLabelSides(i)},interfaces_:function(){return[]},getClass:function(){return _r}}),ro(Mr,Ln),io(Mr.prototype,{updateIM:function(t){for(var e=this.iterator();e.hasNext();){e.next().updateIM(t)}},insert:function(t){var e=this.edgeMap.get(t);null===e?(e=new _r(t),this.insertEdgeEnd(t,e)):e.insert(t)},interfaces_:function(){return[]},getClass:function(){return Mr}}),ro(Dr,dn),io(Dr.prototype,{updateIMFromEdges:function(t){this.edges.updateIM(t)},computeIM:function(t){t.setAtLeastIfValid(this.label.getLocation(0),this.label.getLocation(1),0)},interfaces_:function(){return[]},getClass:function(){return Dr}}),ro(Ar,yn),io(Ar.prototype,{createNode:function(t){return new Dr(t,new Mr)},interfaces_:function(){return[]},getClass:function(){return Ar}}),io(Fr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},getNodeIterator:function(){return this.nodes.iterator()},copyNodesAndLabels:function(t,e){for(var n=t.getNodeIterator();n.hasNext();){var i=n.next();this.nodes.addNode(i.getCoordinate()).setLabel(e,i.getLabel().getLocation(e))}},build:function(t){this.computeIntersectionNodes(t,0),this.copyNodesAndLabels(t,0);var e=new br,n=e.computeEdgeEnds(t.getEdgeIterator());this.insertEdgeEnds(n)},computeIntersectionNodes:function(t,e){for(var n=t.getEdgeIterator();n.hasNext();)for(var i=n.next(),r=i.getLabel().getLocation(e),s=i.getEdgeIntersectionList().iterator();s.hasNext();){var o=s.next(),a=this.nodes.addNode(o.coord);r===S.BOUNDARY?a.setLabelBoundary(e):a.getLabel().isNull(e)&&a.setLabel(e,S.INTERIOR)}},interfaces_:function(){return[]},getClass:function(){return Fr}}),io(Gr.prototype,{isNodeEdgeAreaLabelsConsistent:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();){var e=t.next();if(!e.getEdges().isAreaLabelsConsistent(this.geomGraph))return this.invalidPoint=e.getCoordinate().copy(),!1}return!0},getInvalidPoint:function(){return this.invalidPoint},hasDuplicateRings:function(){for(var t=this.nodeGraph.getNodeIterator();t.hasNext();)for(var e=t.next(),n=e.getEdges().iterator();n.hasNext();){var i=n.next();if(i.getEdgeEnds().size()>1)return this.invalidPoint=i.getEdge().getCoordinate(0),!0}return!1},isNodeConsistentArea:function(){var t=this.geomGraph.computeSelfNodes(this.li,!0,!0);return t.hasProperIntersection()?(this.invalidPoint=t.getProperIntersectionPoint(),!1):(this.nodeGraph.build(this.geomGraph),this.isNodeEdgeAreaLabelsConsistent())},interfaces_:function(){return[]},getClass:function(){return Gr}}),io(qr.prototype,{buildIndex:function(){this.index=new qe;for(var t=0;t=1&&(e=t.getCoordinateN(0)),this.validErr=new Br(Br.RING_NOT_CLOSED,e)}},checkShellsNotNested:function(t,e){for(var n=0;n=0;i--)n.add(t[i],!1)},zr.findEdgeRingContaining=function(t,e){for(var n=t.getRing(),i=n.getEnvelopeInternal(),r=n.getCoordinateN(0),s=null,o=null,a=e.iterator();a.hasNext();){var u=a.next(),l=u.getRing(),h=l.getEnvelopeInternal();if(!h.equals(i)&&h.contains(i)){r=Y.ptNotInList(n.getCoordinates(),l.getCoordinates());var c=!1;oe.isPointInRing(r,l.getCoordinates())&&(c=!0),c&&(null===s||o.contains(h))&&(s=u,o=s.getRing().getEnvelopeInternal())}}return s},io(kr.prototype,{compare:function(t,e){var n=t,i=e;return n.getRing().getEnvelope().compareTo(i.getRing().getEnvelope())},interfaces_:function(){return[o]},getClass:function(){return kr}}),zr.EnvelopeComparator=kr,ro(Yr,Lr),io(Yr.prototype,{findEdgeRing:function(t){var e=new zr(this.factory);return e.build(t),e},computeDepthParity:function(){if(0===arguments.length)for(;;){return null}else if(1===arguments.length){arguments[0]}},computeNextCWEdges:function(){for(var t=this.nodeIterator();t.hasNext();){var e=t.next();Yr.computeNextCWEdges(e)}},addEdge:function(t){if(t.isEmpty())return null;var e=Y.removeRepeatedPoints(t.getCoordinates());if(e.length<2)return null;var n=e[0],i=e[e.length-1],r=this.getNode(n),s=this.getNode(i),o=new Tr(r,s,e[1],!0),a=new Tr(s,r,e[e.length-2],!1),u=new Or(t);u.setDirectedEdges(o,a),this.add(u)},deleteCutEdges:function(){this.computeNextCWEdges(),Yr.findLabeledEdgeRings(this.dirEdges);for(var t=new x,e=this.dirEdges.iterator();e.hasNext();){var n=e.next();if(!n.isMarked()){var i=n.getSym();if(n.getLabel()===i.getLabel()){n.setMarked(!0),i.setMarked(!0);var r=n.getEdge();t.add(r.getLine())}}}return t},getEdgeRings:function(){this.computeNextCWEdges(),Yr.label(this.dirEdges,-1);var t=Yr.findLabeledEdgeRings(this.dirEdges);this.convertMaximalToMinimalEdgeRings(t);for(var e=new x,n=this.dirEdges.iterator();n.hasNext();){var i=n.next();if(!i.isMarked()&&!i.isInRing()){var r=this.findEdgeRing(i);e.add(r)}}return e},getNode:function(t){var e=this.findNode(t);return null===e&&(e=new Nr(t),this.add(e)),e},convertMaximalToMinimalEdgeRings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next(),i=n.getLabel(),r=Yr.findIntersectionNodes(n,i);if(null!==r)for(var s=r.iterator();s.hasNext();){var o=s.next();Yr.computeNextCCWEdges(o,i)}}},deleteDangles:function(){for(var t=this.findNodesOfDegree(1),e=new K,n=new ce,i=t.iterator();i.hasNext();)n.push(i.next());for(;!n.isEmpty();){var r=n.pop();Yr.deleteAllEdges(r);for(var s=r.getOutEdges().getEdges(),i=s.iterator();i.hasNext();){var o=i.next();o.setMarked(!0);var a=o.getSym();null!==a&&a.setMarked(!0);var u=o.getEdge();e.add(u.getLine());var l=o.getToNode();1===Yr.getDegreeNonDeleted(l)&&n.push(l)}}return e},interfaces_:function(){return[]},getClass:function(){return Yr}}),Yr.findLabeledEdgeRings=function(t){for(var e=new x,n=1,i=t.iterator();i.hasNext();){var r=i.next();if(!r.isMarked()&&!(r.getLabel()>=0)){e.add(r);var s=zr.findDirEdgesInRing(r);Yr.label(s,n),n++}}return e},Yr.getDegreeNonDeleted=function(t){for(var e=t.getOutEdges().getEdges(),n=0,i=e.iterator();i.hasNext();){i.next().isMarked()||n++}return n},Yr.deleteAllEdges=function(t){for(var e=t.getOutEdges().getEdges(),n=e.iterator();n.hasNext();){var i=n.next();i.setMarked(!0);var r=i.getSym();null!==r&&r.setMarked(!0)}},Yr.label=function(t,e){for(var n=t.iterator();n.hasNext();){n.next().setLabel(e)}},Yr.computeNextCWEdges=function(t){for(var e=t.getOutEdges(),n=null,i=null,r=e.getEdges().iterator();r.hasNext();){var s=r.next();if(!s.isMarked()){if(null===n&&(n=s),null!==i){var o=i.getSym();o.setNext(s)}i=s}}if(null!==i){var o=i.getSym();o.setNext(n)}},Yr.computeNextCCWEdges=function(t,e){for(var n=t.getOutEdges(),i=null,r=null,s=n.getEdges(),o=s.size()-1;o>=0;o--){var a=s.get(o),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&&(h.isTrue(null!==i),r.setNext(i))},Yr.getDegree=function(t,e){ for(var n=t.getOutEdges().getEdges(),i=0,r=n.iterator();r.hasNext();){r.next().getLabel()===e&&i++}return i},Yr.findIntersectionNodes=function(t,e){var n=t,i=null;do{var r=n.getFromNode();Yr.getDegree(r,e)>1&&(null===i&&(i=new x),i.add(r)),n=n.getNext(),h.isTrue(null!==n,"found null DE in ring"),h.isTrue(n===t||!n.isInRing(),"found DE already in ring")}while(n!==t);return i},io(Ur.prototype,{getGeometry:function(){return null===this.geomFactory&&(this.geomFactory=new $t),this.polygonize(),this.extractOnlyPolygonal?this.geomFactory.buildGeometry(this.polyList):this.geomFactory.createGeometryCollection($t.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 x,null===this.graph)return null;this.dangles=this.graph.deleteDangles(),this.cutEdges=this.graph.deleteCutEdges();var t=this.graph.getEdgeRings(),e=new x;this.invalidRingLines=new x,this.isCheckingRingsValid?this.findValidRings(t,e,this.invalidRingLines):e=t,this.findShellsAndHoles(e),Ur.assignHolesToShells(this.holeList,this.shellList),xo.sort(this.shellList,new zr.EnvelopeComparator);var n=!0;this.extractOnlyPolygonal&&(Ur.findDisjointShells(this.shellList),n=!1),this.polyList=Ur.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(oo(arguments[0],d))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.add(n)}else if(arguments[0]instanceof It){var i=arguments[0];this.geomFactory=i.getFactory(),null===this.graph&&(this.graph=new Yr(this.geomFactory)),this.graph.addEdge(i)}else if(arguments[0]instanceof F){var r=arguments[0];r.apply(this.lineStringAdder)}},setCheckRingsValid:function(t){this.isCheckingRingsValid=t},findShellsAndHoles:function(t){this.holeList=new x,this.shellList=new x;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 Ur}}),Ur.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))}},Ur.extractPolygons=function(t,e){for(var n=new x,i=t.iterator();i.hasNext();){var r=i.next();(e||r.isIncluded())&&n.add(r.getPolygon())}return n},Ur.assignHolesToShells=function(t,e){for(var n=t.iterator();n.hasNext();){var i=n.next();Ur.assignHoleToShell(i,e)}},Ur.assignHoleToShell=function(t,e){var n=zr.findEdgeRingContaining(t,e);null!==n&&n.addHole(t)},Ur.findDisjointShells=function(t){Ur.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)},io(Xr.prototype,{filter:function(t){t instanceof It&&this.p.add(t)},interfaces_:function(){return[A]},getClass:function(){return Xr}}),Ur.LineStringAdder=Xr;var Fo=Object.freeze({Polygonizer:Ur});io(Hr.prototype,{insertEdgeEnds:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.nodes.add(n)}},computeProperIntersectionIM:function(t,e){var n=this.arg[0].getGeometry().getDimension(),i=this.arg[1].getGeometry().getDimension(),r=t.hasProperIntersection(),s=t.hasProperInteriorIntersection();2===n&&2===i?r&&e.setAtLeast("212101212"):2===n&&1===i?(r&&e.setAtLeast("FFF0FFFF2"),s&&e.setAtLeast("1FFFFF1FF")):1===n&&2===i?(r&&e.setAtLeast("F0FFFFFF2"),s&&e.setAtLeast("1F1FFFFFF")):1===n&&1===i&&s&&e.setAtLeast("0FFFFFFFF")},labelIsolatedEdges:function(t,e){for(var n=this.arg[t].getEdgeIterator();n.hasNext();){var i=n.next();i.isIsolated()&&(this.labelIsolatedEdge(i,e,this.arg[e].getGeometry()),this.isolatedEdges.add(i))}},labelIsolatedEdge:function(t,e,n){if(n.getDimension()>0){var i=this.ptLocator.locate(t.getCoordinate(),n);t.getLabel().setAllLocations(e,i)}else t.getLabel().setAllLocations(e,S.EXTERIOR)},computeIM:function(){var t=new ue;if(t.set(S.EXTERIOR,S.EXTERIOR,2),!this.arg[0].getGeometry().getEnvelopeInternal().intersects(this.arg[1].getGeometry().getEnvelopeInternal()))return this.computeDisjointIM(t),t;this.arg[0].computeSelfNodes(this.li,!1),this.arg[1].computeSelfNodes(this.li,!1);var e=this.arg[0].computeEdgeIntersections(this.arg[1],this.li,!1);this.computeIntersectionNodes(0),this.computeIntersectionNodes(1),this.copyNodesAndLabels(0),this.copyNodesAndLabels(1),this.labelIsolatedNodes(),this.computeProperIntersectionIM(e,t);var n=new br,i=n.computeEdgeEnds(this.arg[0].getEdgeIterator());this.insertEdgeEnds(i);var r=n.computeEdgeEnds(this.arg[1].getEdgeIterator());return this.insertEdgeEnds(r),this.labelNodeEdges(),this.labelIsolatedEdges(0,1),this.labelIsolatedEdges(1,0),this.updateIM(t),t},labelNodeEdges:function(){for(var t=this.nodes.iterator();t.hasNext();){t.next().getEdges().computeLabelling(this.arg)}},copyNodesAndLabels:function(t){for(var e=this.arg[t].getNodeIterator();e.hasNext();){var n=e.next();this.nodes.addNode(n.getCoordinate()).setLabel(t,n.getLabel().getLocation(t))}},labelIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var s=r.next(),o=this.nodes.find(s.coord);o.getLabel().isNull(t)&&(i===S.BOUNDARY?o.setLabelBoundary(t):o.setLabel(t,S.INTERIOR))}},labelIsolatedNode:function(t,e){var n=this.ptLocator.locate(t.getCoordinate(),this.arg[e].getGeometry());t.getLabel().setAllLocations(e,n)},computeIntersectionNodes:function(t){for(var e=this.arg[t].getEdgeIterator();e.hasNext();)for(var n=e.next(),i=n.getLabel().getLocation(t),r=n.getEdgeIntersectionList().iterator();r.hasNext();){var s=r.next(),o=this.nodes.addNode(s.coord);i===S.BOUNDARY?o.setLabelBoundary(t):o.getLabel().isNull(t)&&o.setLabel(t,S.INTERIOR)}},labelIsolatedNodes:function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next(),n=e.getLabel();h.isTrue(n.getGeometryCount()>0,"node with empty label found"),e.isIsolated()&&(n.isNull(0)?this.labelIsolatedNode(e,0):this.labelIsolatedNode(e,1))}},updateIM:function(t){for(var e=this.isolatedEdges.iterator();e.hasNext();){e.next().updateIM(t)}for(var n=this.nodes.iterator();n.hasNext();){var i=n.next();i.updateIM(t),i.updateIMFromEdges(t)}},computeDisjointIM:function(t){var e=this.arg[0].getGeometry();e.isEmpty()||(t.set(S.INTERIOR,S.EXTERIOR,e.getDimension()),t.set(S.BOUNDARY,S.EXTERIOR,e.getBoundaryDimension()));var n=this.arg[1].getGeometry();n.isEmpty()||(t.set(S.EXTERIOR,S.INTERIOR,n.getDimension()),t.set(S.EXTERIOR,S.BOUNDARY,n.getBoundaryDimension()))},interfaces_:function(){return[]},getClass:function(){return Hr}}),io(Wr.prototype,{isContainedInBoundary:function(t){if(t instanceof Lt)return!1;if(t instanceof Ct)return this.isPointContainedInBoundary(t);if(t instanceof It)return this.isLineStringContainedInBoundary(t);for(var e=0;e0){var i=t;t=e,e=i}var r=!1;return e.y>t.y&&(r=!0),r?this.li.computeIntersection(t,e,this.diagDown0,this.diagDown1):this.li.computeIntersection(t,e,this.diagUp0,this.diagUp1),!!this.li.hasIntersection()},interfaces_:function(){return[]},getClass:function(){return jr}}),io(Kr.prototype,{applyTo:function(t){for(var e=0;e=this.rectEnv.getMinX()&&e.getMaxX()<=this.rectEnv.getMaxX()?(this._intersects=!0,null):e.getMinY()>=this.rectEnv.getMinY()&&e.getMaxY()<=this.rectEnv.getMaxY()?(this._intersects=!0,null):void 0:null},intersects:function(){return this._intersects},interfaces_:function(){return[]},getClass:function(){return Qr}}),ro(Jr,Kr),io(Jr.prototype,{isDone:function(){return!0===this._containsPoint},visit:function(t){if(!(t instanceof Lt))return null;var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;for(var n=new c,i=0;i<4;i++)if(this.rectSeq.getCoordinate(i,n),e.contains(n)&&Sn.containsPointInPolygon(n,t))return this._containsPoint=!0,null},containsPoint:function(){return this._containsPoint},interfaces_:function(){return[]},getClass:function(){return Jr}}),ro($r,Kr),io($r.prototype,{intersects:function(){return this.hasIntersection},isDone:function(){return!0===this.hasIntersection},visit:function(t){var e=t.getEnvelopeInternal();if(!this.rectEnv.intersects(e))return null;var n=qn.getLines(t);this.checkIntersectionWithLineStrings(n)},checkIntersectionWithLineStrings:function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();if(this.checkIntersectionWithSegments(n),this.hasIntersection)return null}},checkIntersectionWithSegments:function(t){for(var e=t.getCoordinateSequence(),n=1;n=t.size()?null:t.get(e)},rs.union=function(t){return new rs(t).union()},rs.STRTREE_NODE_CAPACITY=4,io(ss.prototype,{unionNoOpt:function(t){var e=this.geomFact.createPoint();return ei.overlayOp(t,e,$n.UNION)},unionWithNull:function(t,e){return null===t&&null===e?null:null===e?t:null===t?e:t.union(e)},extract:function(){if(oo(arguments[0],d))for(var t=arguments[0],e=t.iterator();e.hasNext();){var n=e.next();this.extract(n)}else if(arguments[0]instanceof F){var i=arguments[0];null===this.geomFact&&(this.geomFact=i.getFactory()),is.extract(i,F.SORTINDEX_POLYGON,this.polygons),is.extract(i,F.SORTINDEX_LINESTRING,this.lines),is.extract(i,F.SORTINDEX_POINT,this.points)}},union:function(){if(null===this.geomFact)return null;var t=null;if(this.points.size()>0){var e=this.geomFact.buildGeometry(this.points);t=this.unionNoOpt(e)}var n=null;if(this.lines.size()>0){var i=this.geomFact.buildGeometry(this.lines);n=this.unionNoOpt(i)}var r=null;this.polygons.size()>0&&(r=rs.union(this.polygons));var s=this.unionWithNull(n,r),o=null;return o=null===t?s:null===s?t:ns.union(t,s),null===o?this.geomFact.createGeometryCollection():o},interfaces_:function(){return[]},getClass:function(){return ss}}),ss.union=function(){if(1===arguments.length){if(oo(arguments[0],d)){var t=arguments[0],e=new ss(t);return e.union()}if(arguments[0]instanceof F){var n=arguments[0],e=new ss(n);return e.union()}}else if(2===arguments.length){var i=arguments[0],r=arguments[1],e=new ss(i,r);return e.union()}};var qo=Object.freeze({UnaryUnionOp:ss}),Bo=Object.freeze({IsValidOp:Vr,ConsistentAreaTester:Gr}),Vo=Object.freeze({BoundaryOp:ct,IsSimpleOp:Yi,buffer:_o,distance:Mo,linemerge:Do,overlay:Ao,polygonize:Fo,relate:Go,union:qo,valid:Bo});ro(os,Ot.CoordinateOperation),io(os.prototype,{editCoordinates:function(t,e){if(0===t.length)return null;for(var n=new Array(t.length).fill(null),i=0;i=2&&(n=!0),e.edit(t,new os(this.targetPM,n))},changePM:function(t,e){return this.createEditor(t.getFactory(),e).edit(t,new Ot.NoOpGeometryOperation)},setRemoveCollapsedComponents:function(t){this.removeCollapsed=t},createFactory:function(t,e){return new $t(e,t.getSRID(),t.getCoordinateSequenceFactory())},setChangePrecisionModel:function(t){this.changePrecisionModel=t},reduce:function(t){var e=this.reducePointwise(t);return this.isPointwise?e:oo(e,St)?e.isValid()?e:this.fixPolygonalTopology(e):e},setPointwise:function(t){this.isPointwise=t},createEditor:function(t,e){return t.getPrecisionModel()===e?new Ot:new Ot(this.createFactory(t,e))},interfaces_:function(){return[]},getClass:function(){return as}}),as.reduce=function(t,e){return new as(e).reduce(t)},as.reducePointwise=function(t,e){var n=new as(e);return n.setPointwise(!0),n.reduce(t)};var zo=Object.freeze({GeometryPrecisionReducer:as});io(us.prototype,{simplifySection:function(t,e){if(t+1===e)return null;this.seg.p0=this.pts[t],this.seg.p1=this.pts[e];for(var n=-1,i=t,r=t+1;rn&&(n=s,i=r)}if(n<=this.distanceTolerance)for(var r=t+1;rthis.distanceTolerance&&(s=!1);var u=new ae;if(u.p0=this.linePts[t],u.p1=this.linePts[e],i[0]=t,i[1]=e,this.hasBadIntersection(this.line,i,u)&&(s=!1),s){var r=this.flatten(t,e);return this.line.addToResult(r),null}this.simplifySection(t,a,n),this.simplifySection(a,e,n)},hasBadOutputIntersection:function(t){for(var e=this.outputIndex.query(t),n=e.iterator();n.hasNext();){var i=n.next();if(this.hasInteriorIntersection(i,t))return!0}return!1},findFurthestPoint:function(t,e,n,i){var r=new ae;r.p0=t[e],r.p1=t[n];for(var s=-1,o=e,a=e+1;as&&(s=l,o=a)}return i[0]=s,o},simplify:function(t){this.line=t,this.linePts=t.getParentCoordinates(),this.simplifySection(0,this.linePts.length-1,0)},remove:function(t,e,n){for(var i=e;i=e[0]&&ir&&(u=r),s.setMinimumLength(u),s.splitAt(o),s.getSplitPoint()},interfaces_:function(){return[Is]},getClass:function(){return Ns}}),Ns.projectedSplitPoint=function(t,e){return t.getLineSegment().project(e)},io(Cs.prototype,{interfaces_:function(){return[]},getClass:function(){return Cs}}),Cs.triArea=function(t,e,n){return(e.x-t.x)*(n.y-t.y)-(e.y-t.y)*(n.x-t.x)},Cs.isInCircleDDNormalized=function(t,e,n,i){var r=O.valueOf(t.x).selfSubtract(i.x),s=O.valueOf(t.y).selfSubtract(i.y),o=O.valueOf(e.x).selfSubtract(i.x),a=O.valueOf(e.y).selfSubtract(i.y),u=O.valueOf(n.x).selfSubtract(i.x),l=O.valueOf(n.y).selfSubtract(i.y),h=r.multiply(a).selfSubtract(o.multiply(s)),c=o.multiply(l).selfSubtract(u.multiply(a)),f=u.multiply(s).selfSubtract(r.multiply(l)),g=r.multiply(r).selfAdd(s.multiply(s)),d=o.multiply(o).selfAdd(a.multiply(a)),p=u.multiply(u).selfAdd(l.multiply(l));return g.selfMultiply(c).selfAdd(d.selfMultiply(f)).selfAdd(p.selfMultiply(h)).doubleValue()>0},Cs.checkRobustInCircle=function(t,e,n,i){var r=Cs.isInCircleNonRobust(t,e,n,i),s=Cs.isInCircleDDSlow(t,e,n,i),o=Cs.isInCircleCC(t,e,n,i),a=Ei.circumcentre(t,e,n);_.out.println("p radius diff a = "+Math.abs(i.distance(a)-t.distance(a))/t.distance(a)),r===s&&r===o||(_.out.println("inCircle robustness failure (double result = "+r+", DD result = "+s+", CC result = "+o+")"),_.out.println(ee.toLineString(new Dt([t,e,n,i]))),_.out.println("Circumcentre = "+ee.toPoint(a)+" radius = "+t.distance(a)),_.out.println("p radius diff a = "+Math.abs(i.distance(a)/t.distance(a)-1)), _.out.println("p radius diff b = "+Math.abs(i.distance(a)/e.distance(a)-1)),_.out.println("p radius diff c = "+Math.abs(i.distance(a)/n.distance(a)-1)),_.out.println())},Cs.isInCircleDDFast=function(t,e,n,i){var r=O.sqr(t.x).selfAdd(O.sqr(t.y)).selfMultiply(Cs.triAreaDDFast(e,n,i)),s=O.sqr(e.x).selfAdd(O.sqr(e.y)).selfMultiply(Cs.triAreaDDFast(t,n,i)),o=O.sqr(n.x).selfAdd(O.sqr(n.y)).selfMultiply(Cs.triAreaDDFast(t,e,i)),a=O.sqr(i.x).selfAdd(O.sqr(i.y)).selfMultiply(Cs.triAreaDDFast(t,e,n));return r.selfSubtract(s).selfAdd(o).selfSubtract(a).doubleValue()>0},Cs.isInCircleCC=function(t,e,n,i){var r=Ei.circumcentre(t,e,n),s=t.distance(r);return i.distance(r)-s<=0},Cs.isInCircleNormalized=function(t,e,n,i){var r=t.x-i.x,s=t.y-i.y,o=e.x-i.x,a=e.y-i.y,u=n.x-i.x,l=n.y-i.y;return(r*r+s*s)*(o*l-u*a)+(o*o+a*a)*(u*s-r*l)+(u*u+l*l)*(r*a-o*s)>0},Cs.isInCircleDDSlow=function(t,e,n,i){var r=O.valueOf(i.x),s=O.valueOf(i.y),o=O.valueOf(t.x),a=O.valueOf(t.y),u=O.valueOf(e.x),l=O.valueOf(e.y),h=O.valueOf(n.x),c=O.valueOf(n.y),f=o.multiply(o).add(a.multiply(a)).multiply(Cs.triAreaDDSlow(u,l,h,c,r,s)),g=u.multiply(u).add(l.multiply(l)).multiply(Cs.triAreaDDSlow(o,a,h,c,r,s)),d=h.multiply(h).add(c.multiply(c)).multiply(Cs.triAreaDDSlow(o,a,u,l,r,s)),p=r.multiply(r).add(s.multiply(s)).multiply(Cs.triAreaDDSlow(o,a,u,l,h,c));return f.subtract(g).add(d).subtract(p).doubleValue()>0},Cs.isInCircleNonRobust=function(t,e,n,i){return(t.x*t.x+t.y*t.y)*Cs.triArea(e,n,i)-(e.x*e.x+e.y*e.y)*Cs.triArea(t,n,i)+(n.x*n.x+n.y*n.y)*Cs.triArea(t,e,i)-(i.x*i.x+i.y*i.y)*Cs.triArea(t,e,n)>0},Cs.isInCircleRobust=function(t,e,n,i){return Cs.isInCircleNormalized(t,e,n,i)},Cs.triAreaDDSlow=function(t,e,n,i,r,s){return n.subtract(t).multiply(s.subtract(e)).subtract(i.subtract(e).multiply(r.subtract(t)))},Cs.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)},io(Ss.prototype,{circleCenter:function(t,e){var n=new Ss(this.getX(),this.getY()),i=this.bisector(n,t),r=this.bisector(t,e),s=new M(i,r),o=null;try{o=new Ss(s.getX(),s.getY())}catch(i){if(!(i instanceof C))throw i;_.err.println("a: "+n+" b: "+t+" c: "+e),_.err.println(i)}return o},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 M(new M(t.getX()+n/2,t.getY()+i/2,1),new M(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())0},getX:function(){return this.p.x},crossProduct:function(t){return this.p.x*t.getY()-this.p.y*t.getX()},setZ:function(t){this.p.z=t},times:function(t){return new Ss(t*this.p.x,t*this.p.y)},cross:function(){return new Ss(this.p.y,-this.p.x)},leftOf:function(t){return this.isCCW(t.orig(),t.dest())},toString:function(){return"POINT ("+this.p.x+" "+this.p.y+")"},sub:function(t){return new Ss(this.p.x-t.getX(),this.p.y-t.getY())},getY:function(){return this.p.y},classify:function(t,e){var n=this,i=e.sub(t),r=n.sub(t),s=i.crossProduct(r);return s>0?Ss.LEFT:s<0?Ss.RIGHT:i.getX()*r.getX()<0||i.getY()*r.getY()<0?Ss.BEHIND:i.magn()n?10*e:10*n,this.frameVertex[0]=new Ss((t.getMaxX()+t.getMinX())/2,t.getMaxY()+i),this.frameVertex[1]=new Ss(t.getMinX()-i,t.getMinY()-i),this.frameVertex[2]=new Ss(t.getMaxX()+i,t.getMinY()-i),this.frameEnv=new I(this.frameVertex[0].getCoordinate(),this.frameVertex[1].getCoordinate()),this.frameEnv.expandToInclude(this.frameVertex[2].getCoordinate())},getTriangleCoordinates:function(t){var e=new Fs;return this.visitTriangles(e,t),e.getTriangles()},getVertices:function(t){for(var e=new K,n=this.quadEdges.iterator();n.hasNext();){var i=n.next(),r=i.orig();!t&&this.isFrameVertex(r)||e.add(r);var s=i.dest();!t&&this.isFrameVertex(s)||e.add(s)}return e},fetchTriangleToVisit:function(t,e,n,i){var r=t,s=0,o=!1;do{this.triEdges[s]=r,this.isFrameEdge(r)&&(o=!0);var a=r.sym();i.contains(a)||e.push(a),i.add(r),s++,r=r.lNext()}while(r!==t);return o&&!n?null:this.triEdges},getEdges:function(){if(0===arguments.length)return this.quadEdges;if(1===arguments.length){for(var t=arguments[0],e=this.getPrimaryEdges(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var s=r.next();n[i++]=t.createLineString([s.orig().getCoordinate(),s.dest().getCoordinate()])}return t.createMultiLineString(n)}},getVertexUniqueEdges:function(t){for(var e=new x,n=new K,i=this.quadEdges.iterator();i.hasNext();){var r=i.next(),s=r.orig();n.contains(s)||(n.add(s),!t&&this.isFrameVertex(s)||e.add(r));var o=r.sym(),a=o.orig();n.contains(a)||(n.add(a),!t&&this.isFrameVertex(a)||e.add(o))}return e},getTriangleEdges:function(t){var e=new Ds;return this.visitTriangles(e,t),e.getTriangleEdges()},getPrimaryEdges:function(t){this.visitedKey++;var e=new x,n=new ce;n.push(this.startingEdge);for(var i=new K;!n.empty();){var r=n.pop();if(!i.contains(r)){var s=r.getPrimary();!t&&this.isFrameEdge(s)||e.add(s),n.push(r.oNext()),n.push(r.sym().oNext()),i.add(r),i.add(r.sym())}}return e},delete:function(t){ws.splice(t,t.oPrev()),ws.splice(t.sym(),t.sym().oPrev());var e=t.sym(),n=t.rot(),i=t.rot().sym();this.quadEdges.remove(t),this.quadEdges.remove(e),this.quadEdges.remove(n),this.quadEdges.remove(i),t.delete(),e.delete(),n.delete(),i.delete()},locateFromEdge:function(t,e){for(var n=0,i=this.quadEdges.size(),r=e;;){if(++n>i)throw new Ps(r.toLineSegment());if(t.equals(r.orig())||t.equals(r.dest()))break;if(t.rightOf(r))r=r.sym();else if(t.rightOf(r.oNext())){if(t.rightOf(r.dPrev()))break;r=r.dPrev()}else r=r.oNext()}return r},getTolerance:function(){return this.tolerance},getVoronoiCellPolygons:function(t){this.visitTriangles(new Ms,!0);for(var e=new x,n=this.getVertexUniqueEdges(!1),i=n.iterator();i.hasNext();){var r=i.next();e.add(this.getVoronoiCellPolygon(r,t))}return e},getVoronoiDiagram:function(t){var e=this.getVoronoiCellPolygons(t);return t.createGeometryCollection($t.toGeometryArray(e))},getTriangles:function(t){for(var e=this.getTriangleCoordinates(!1),n=new Array(e.size()).fill(null),i=0,r=e.iterator();r.hasNext();){var s=r.next();n[i++]=t.createPolygon(t.createLinearRing(s),null)}return t.createGeometryCollection(n)},insertSite:function(t){var e=this.locate(t);if(t.equals(e.orig(),this.tolerance)||t.equals(e.dest(),this.tolerance))return e;var n=this.makeEdge(e.orig(),t);ws.splice(n,e);var i=n;do{n=this.connect(e,n.sym()),e=n.oPrev()}while(e.lNext()!==i);return i},locate:function(){if(1===arguments.length){if(arguments[0]instanceof Ss){var t=arguments[0];return this.locator.locate(t)}if(arguments[0]instanceof c){var e=arguments[0];return this.locator.locate(new Ss(e))}}else if(2===arguments.length){var n=arguments[0],i=arguments[1],r=this.locator.locate(new Ss(n));if(null===r)return null;var s=r;r.dest().getCoordinate().equals2D(n)&&(s=r.sym());var o=s;do{if(o.dest().getCoordinate().equals2D(i))return o;o=o.oNext()}while(o!==s);return null}},interfaces_:function(){return[]},getClass:function(){return _s}}),_s.getTriangleEdges=function(t,e){if(e[0]=t,e[1]=e[0].lNext(),e[2]=e[1].lNext(),e[2].lNext()!==e[0])throw new n("Edges do not form a triangle")},io(Ms.prototype,{visit:function(t){for(var e=t[0].orig().getCoordinate(),n=t[1].orig().getCoordinate(),i=t[2].orig().getCoordinate(),r=Ei.circumcentre(e,n,i),s=new Ss(r),o=0;o<3;o++)t[o].rot().setOrig(s)},interfaces_:function(){return[bs]},getClass:function(){return Ms}}),io(Ds.prototype,{getTriangleEdges:function(){return this.triList},visit:function(t){this.triList.add(t.clone())},interfaces_:function(){return[bs]},getClass:function(){return Ds}}),io(As.prototype,{visit:function(t){this.triList.add([t[0].orig(),t[1].orig(),t[2].orig()])},getTriangleVertices:function(){return this.triList},interfaces_:function(){return[bs]},getClass:function(){return As}}),io(Fs.prototype,{checkTriangleSize:function(t){t.length>=2?ee.toLineString(t[0],t[1]):t.length>=1&&ee.toPoint(t[0])},visit:function(t){this.coordList.clear();for(var e=0;e<3;e++){var n=t[e].orig();this.coordList.add(n.getCoordinate())}if(this.coordList.size()>0){this.coordList.closeRing();var i=this.coordList.toCoordinateArray();if(4!==i.length)return null;this.triCoords.add(i)}},getTriangles:function(){return this.triCoords},interfaces_:function(){return[bs]},getClass:function(){return Fs}}),_s.TriangleCircumcentreVisitor=Ms,_s.TriangleEdgesListVisitor=Ds,_s.TriangleVertexListVisitor=As,_s.TriangleCoordinatesVisitor=Fs,_s.EDGE_COINCIDENCE_TOL_FACTOR=1e3,io(Gs.prototype,{getLineSegment:function(){return this.ls},getEndZ:function(){return this.ls.getCoordinate(1).z},getStartZ:function(){return this.ls.getCoordinate(0).z},intersection:function(t){return this.ls.intersection(t.getLineSegment())},getStart:function(){return this.ls.getCoordinate(0)},getEnd:function(){return this.ls.getCoordinate(1)},getEndY:function(){return this.ls.getCoordinate(1).y},getStartX:function(){return this.ls.getCoordinate(0).x},equalsTopo:function(t){return this.ls.equalsTopo(t.getLineSegment())},getStartY:function(){return this.ls.getCoordinate(0).y},setData:function(t){this.data=t},getData:function(){return this.data},getEndX:function(){return this.ls.getCoordinate(1).x},toString:function(){return this.ls.toString()},interfaces_:function(){return[]},getClass:function(){return Gs}}),io(qs.prototype,{visit:function(t){},interfaces_:function(){return[]},getClass:function(){return qs}}),io(Bs.prototype,{isRepeated:function(){return this.count>1},getRight:function(){return this.right},getCoordinate:function(){return this.p},setLeft:function(t){this.left=t},getX:function(){return this.p.x},getData:function(){return this.data},getCount:function(){return this.count},getLeft:function(){return this.left},getY:function(){return this.p.y},increment:function(){this.count=this.count+1},setRight:function(t){this.right=t},interfaces_:function(){return[]},getClass:function(){return Bs}}),io(Vs.prototype,{insert:function(){if(1===arguments.length){var t=arguments[0];return this.insert(t,null)}if(2===arguments.length){var e=arguments[0],n=arguments[1];if(null===this.root)return this.root=new Bs(e,n),this.root;if(this.tolerance>0){var i=this.findBestMatchNode(e);if(null!==i)return i.increment(),i}return this.insertExact(e,n)}},query:function(){if(1===arguments.length){var t=arguments[0],e=new x;return this.query(t,e),e}if(2===arguments.length)if(arguments[0]instanceof I&&oo(arguments[1],m)){var n=arguments[0],i=arguments[1];this.queryNode(this.root,n,!0,{interfaces_:function(){return[qs]},visit:function(t){i.add(t)}})}else if(arguments[0]instanceof I&&oo(arguments[1],qs)){var r=arguments[0],s=arguments[1];this.queryNode(this.root,r,!0,s)}},queryNode:function(t,e,n,i){if(null===t)return null;var r=null,s=null,o=null;n?(r=e.getMinX(),s=e.getMaxX(),o=t.getX()):(r=e.getMinY(),s=e.getMaxY(),o=t.getY());var a=r0&&t=n||this.segmentIndex===n&&this.segmentFraction>=1},isValid:function(t){if(this.componentIndex<0||this.componentIndex>=t.getNumGeometries())return!1;var e=t.getGeometryN(this.componentIndex);return!(this.segmentIndex<0||this.segmentIndex>e.getNumPoints())&&((this.segmentIndex!==e.getNumPoints()||0===this.segmentFraction)&&!(this.segmentFraction<0||this.segmentFraction>1))},normalize:function(){this.segmentFraction<0&&(this.segmentFraction=0),this.segmentFraction>1&&(this.segmentFraction=1),this.componentIndex<0&&(this.componentIndex=0,this.segmentIndex=0,this.segmentFraction=0),this.segmentIndex<0&&(this.segmentIndex=0,this.segmentFraction=0),1===this.segmentFraction&&(this.segmentFraction=0,this.segmentIndex+=1)},toLowest:function(t){var e=t.getGeometryN(this.componentIndex),n=e.getNumPoints()-1;return this.segmentIndex=e.getNumPoints()-1)return n;var i=e.getCoordinateN(this.segmentIndex+1);return Hs.pointAlongSegmentByFraction(n,i,this.segmentFraction)},getSegmentFraction:function(){return this.segmentFraction},getSegment:function(t){var e=t.getGeometryN(this.componentIndex),n=e.getCoordinateN(this.segmentIndex);if(this.segmentIndex>=e.getNumPoints()-1){return new ae(e.getCoordinateN(e.getNumPoints()-2),n)}return new ae(n,e.getCoordinateN(this.segmentIndex+1))},clamp:function(t){if(this.componentIndex>=t.getNumGeometries())return this.setToEnd(t),null;if(this.segmentIndex>=t.getNumPoints()){var e=t.getGeometryN(this.componentIndex);this.segmentIndex=e.getNumPoints()-1,this.segmentFraction=1}},setToEnd:function(t){this.componentIndex=t.getNumGeometries()-1;var e=t.getGeometryN(this.componentIndex);this.segmentIndex=e.getNumPoints()-1,this.segmentFraction=1},compareTo:function(t){var e=t;return this.componentIndexe.componentIndex?1:this.segmentIndexe.segmentIndex?1:this.segmentFractione.segmentFraction?1:0},clone:function(){return new Hs(this.componentIndex,this.segmentIndex,this.segmentFraction)},toString:function(){return"LinearLoc["+this.componentIndex+", "+this.segmentIndex+", "+this.segmentFraction+"]"},isOnSameSegment:function(t){return this.componentIndex===t.componentIndex&&(this.segmentIndex===t.segmentIndex||(t.segmentIndex-this.segmentIndex==1&&0===t.segmentFraction||this.segmentIndex-t.segmentIndex==1&&0===this.segmentFraction))},snapToVertex:function(t,e){if(this.segmentFraction<=0||this.segmentFraction>=1)return null;var n=this.getSegmentLength(t),i=this.segmentFraction*n,r=n-i;i<=r&&it?1:this.segmentIndexe?1:this.segmentFractionn?1:0},getSegmentLength:function(t){var e=t.getGeometryN(this.componentIndex),n=this.segmentIndex;this.segmentIndex>=e.getNumPoints()-1&&(n=e.getNumPoints()-2);var i=e.getCoordinateN(n),r=e.getCoordinateN(n+1);return i.distance(r)},isVertex:function(){return this.segmentFraction<=0||this.segmentFraction>=1},interfaces_:function(){return[r]},getClass:function(){return Hs}}),Hs.getEndLocation=function(t){var e=new Hs;return e.setToEnd(t),e},Hs.pointAlongSegmentByFraction=function(t,e,n){return n<=0?t:n>=1?e:new c((e.x-t.x)*n+t.x,(e.y-t.y)*n+t.y,(e.z-t.z)*n+t.z)},Hs.compareLocationValues=function(t,e,n,i,r,s){return ti?1:er?1:ns?1:0},io(Ws.prototype,{getComponentIndex:function(){ return this.componentIndex},getLine:function(){return this.currentLine},getVertexIndex:function(){return this.vertexIndex},getSegmentEnd:function(){return this.vertexIndex=this.currentLine.getNumPoints()&&(this.componentIndex++,this.loadCurrentLine(),this.vertexIndex=0)},loadCurrentLine:function(){if(this.componentIndex>=this.numLines)return this.currentLine=null,null;this.currentLine=this.linearGeom.getGeometryN(this.componentIndex)},getSegmentStart:function(){return this.currentLine.getCoordinateN(this.vertexIndex)},isEndOfLine:function(){return!(this.componentIndex>=this.numLines)&&!(this.vertexIndex=this.numLines)&&!(this.componentIndex===this.numLines-1&&this.vertexIndex>=this.currentLine.getNumPoints())},interfaces_:function(){return[]},getClass:function(){return Ws}}),Ws.segmentEndVertexIndex=function(t){return t.getSegmentFraction()>0?t.getSegmentIndex()+1:t.getSegmentIndex()},io(js.prototype,{indexOf:function(t){return this.indexOfFromStart(t,null)},indexOfFromStart:function(t,e){for(var n=i.MAX_VALUE,r=0,s=0,o=-1,a=new ae,u=new Ws(this.linearGeom);u.hasNext();u.next())if(!u.isEndOfLine()){a.p0=u.getSegmentStart(),a.p1=u.getSegmentEnd();var l=a.distance(t),h=a.segmentFraction(t),c=u.getComponentIndex(),f=u.getVertexIndex();l=0,"computed location is before specified minimum location"),i},interfaces_:function(){return[]},getClass:function(){return js}}),js.indexOf=function(t,e){return new js(t).indexOf(e)},js.indexOfAfter=function(t,e,n){return new js(t).indexOfAfter(e,n)},io(Ks.prototype,{indicesOf:function(t){var e=t.getGeometryN(0).getCoordinateN(0),n=t.getGeometryN(t.getNumGeometries()-1),i=n.getCoordinateN(n.getNumPoints()-1),r=new js(this.linearGeom),s=new Array(2).fill(null);return s[0]=r.indexOf(e),0===t.getLength()?s[1]=s[0].clone():s[1]=r.indexOfAfter(i,s[0]),s},interfaces_:function(){return[]},getClass:function(){return Ks}}),Ks.indicesOf=function(t,e){return new Ks(t).indicesOf(e)},io(Zs.prototype,{getGeometry:function(){return this.endLine(),this.geomFact.buildGeometry(this.lines)},getLastCoordinate:function(){return this.lastPt},endLine:function(){if(null===this.coordList)return null;if(this.ignoreInvalidLines&&this.coordList.size()<2)return this.coordList=null,null;var t=this.coordList.toCoordinateArray(),e=t;this.fixInvalidLines&&(e=this.validCoordinateSequence(t)),this.coordList=null;var i=null;try{i=this.geomFact.createLineString(e)}catch(t){if(!(t instanceof n))throw t;if(!this.ignoreInvalidLines)throw t}null!==i&&this.lines.add(i)},setFixInvalidLines:function(t){this.fixInvalidLines=t},add:function(){if(1===arguments.length){var t=arguments[0];this.add(t,!0)}else if(2===arguments.length){var e=arguments[0],n=arguments[1];null===this.coordList&&(this.coordList=new E),this.coordList.add(e,n),this.lastPt=e}},setIgnoreInvalidLines:function(t){this.ignoreInvalidLines=t},validCoordinateSequence:function(t){return t.length>=2?t:[t[0],t[0]]},interfaces_:function(){return[]},getClass:function(){return Zs}}),io(Qs.prototype,{computeLinear:function(t,e){var n=new Zs(this.line.getFactory());n.setFixInvalidLines(!0),t.isVertex()||n.add(t.getCoordinate(this.line));for(var i=new Ws(this.line,t);i.hasNext()&&!(e.compareLocationValues(i.getComponentIndex(),i.getVertexIndex(),0)<0);i.next()){var r=i.getSegmentStart();n.add(r),i.isEndOfLine()&&n.endLine()}return e.isVertex()||n.add(e.getCoordinate(this.line)),n.getGeometry()},computeLine:function(t,e){var n=this.line.getCoordinates(),i=new E,r=t.getSegmentIndex();t.getSegmentFraction()>0&&(r+=1);var s=e.getSegmentIndex();1===e.getSegmentFraction()&&(s+=1),s>=n.length&&(s=n.length-1),t.isVertex()||i.add(t.getCoordinate(this.line));for(var o=r;o<=s;o++)i.add(n[o]);e.isVertex()||i.add(e.getCoordinate(this.line)),i.size()<=0&&i.add(t.getCoordinate(this.line));var a=i.toCoordinateArray();return a.length<=1&&(a=[a[0],a[0]]),this.line.getFactory().createLineString(a)},extract:function(t,e){return e.compareTo(t)<0?this.reverse(this.computeLinear(e,t)):this.computeLinear(t,e)},reverse:function(t){return t instanceof It?t.reverse():t instanceof ht?t.reverse():(h.shouldNeverReachHere("non-linear geometry encountered"),null)},interfaces_:function(){return[]},getClass:function(){return Qs}}),Qs.extract=function(t,e,n){return new Qs(t).extract(e,n)},io(Js.prototype,{clampIndex:function(t){var e=t.clone();return e.clamp(this.linearGeom),e},project:function(t){return js.indexOf(this.linearGeom,t)},checkGeometryType:function(){if(!(this.linearGeom instanceof It||this.linearGeom instanceof ht))throw new n("Input geometry must be linear")},extractPoint:function(){if(1===arguments.length){return arguments[0].getCoordinate(this.linearGeom)}if(2===arguments.length){var t=arguments[0],e=arguments[1],n=t.toLowest(this.linearGeom);return n.getSegment(this.linearGeom).pointAlongOffset(n.getSegmentFraction(),e)}},isValidIndex:function(t){return t.isValid(this.linearGeom)},getEndIndex:function(){return Hs.getEndLocation(this.linearGeom)},getStartIndex:function(){return new Hs},indexOfAfter:function(t,e){return js.indexOfAfter(this.linearGeom,t,e)},extractLine:function(t,e){return Qs.extract(this.linearGeom,t,e)},indexOf:function(t){return js.indexOf(this.linearGeom,t)},indicesOf:function(t){return Ks.indicesOf(this.linearGeom,t)},interfaces_:function(){return[]},getClass:function(){return Js}}),io($s.prototype,{indexOf:function(t){return this.indexOfFromStart(t,-1)},indexOfFromStart:function(t,e){for(var n=i.MAX_VALUE,r=e,s=0,o=new ae,a=new Ws(this.linearGeom);a.hasNext();){if(!a.isEndOfLine()){o.p0=a.getSegmentStart(),o.p1=a.getSegmentEnd();var u=o.distance(t),l=this.segmentNearestMeasure(o,t,s);ue&&(r=l,n=u),s+=o.getLength()}a.next()}return r},indexOfAfter:function(t,e){if(e<0)return this.indexOf(t);var n=this.linearGeom.getLength();if(n=e,"computed index is before specified minimum index"),i},segmentNearestMeasure:function(t,e,n){var i=t.projectionFactor(e);return i<=0?n:i<=1?n+i*t.getLength():n+t.getLength()},interfaces_:function(){return[]},getClass:function(){return $s}}),$s.indexOf=function(t,e){return new $s(t).indexOf(e)},$s.indexOfAfter=function(t,e,n){return new $s(t).indexOfAfter(e,n)},io(to.prototype,{getLength:function(t){for(var e=0,n=new Ws(this.linearGeom);n.hasNext();){if(!n.isEndOfLine()){var i=n.getSegmentStart(),r=n.getSegmentEnd(),s=r.distance(i);if(t.getComponentIndex()===n.getComponentIndex()&&t.getSegmentIndex()===n.getVertexIndex())return e+s*t.getSegmentFraction();e+=s}n.next()}return e},resolveHigher:function(t){if(!t.isEndpoint(this.linearGeom))return t;var e=t.getComponentIndex();if(e>=this.linearGeom.getNumGeometries()-1)return t;do{e++}while(et){var u=(t-e)/a,i=n.getComponentIndex(),r=n.getVertexIndex();return new Hs(i,r,u)}e+=a}n.next()}return Hs.getEndLocation(this.linearGeom)},interfaces_:function(){return[]},getClass:function(){return to}}),to.getLength=function(t,e){return new to(t).getLength(e)},to.getLocation=function(){if(2===arguments.length){var t=arguments[0],e=arguments[1],n=new to(t);return n.getLocation(e)}if(3===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2],n=new to(i);return n.getLocation(r,s)}},io(eo.prototype,{clampIndex:function(t){var e=this.positiveIndex(t),n=this.getStartIndex();if(ei?i:e},locationOf:function(){if(1===arguments.length){var t=arguments[0];return to.getLocation(this.linearGeom,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return to.getLocation(this.linearGeom,e,n)}},project:function(t){return $s.indexOf(this.linearGeom,t)},positiveIndex:function(t){return t>=0?t:this.linearGeom.getLength()+t},extractPoint:function(){if(1===arguments.length){var t=arguments[0],e=to.getLocation(this.linearGeom,t);return e.getCoordinate(this.linearGeom)}if(2===arguments.length){var n=arguments[0],i=arguments[1],e=to.getLocation(this.linearGeom,n),r=e.toLowest(this.linearGeom);return r.getSegment(this.linearGeom).pointAlongOffset(r.getSegmentFraction(),i)}},isValidIndex:function(t){return t>=this.getStartIndex()&&t<=this.getEndIndex()},getEndIndex:function(){return this.linearGeom.getLength()},getStartIndex:function(){return 0},indexOfAfter:function(t,e){return $s.indexOfAfter(this.linearGeom,t,e)},extractLine:function(t,e){var n=(new Js(this.linearGeom),this.clampIndex(t)),i=this.clampIndex(e),r=n===i,s=this.locationOf(n,r),o=this.locationOf(i);return Qs.extract(this.linearGeom,s,o)},indexOf:function(t){return $s.indexOf(this.linearGeom,t)},indicesOf:function(t){var e=Ks.indicesOf(this.linearGeom,t);return[to.getLength(this.linearGeom,e[0]),to.getLength(this.linearGeom,e[1])]},interfaces_:function(){return[]},getClass:function(){return eo}});var Xo=Object.freeze({LengthIndexedLine:eo,LengthLocationMap:to,LinearGeometryBuilder:Zs,LinearIterator:Ws,LinearLocation:Hs,LocationIndexedLine:Js});io(no.prototype,{interfaces_:function(){return[]},getClass:function(){return no}}),no.union=function(t,e){if(t.isEmpty()||e.isEmpty()){if(t.isEmpty()&&e.isEmpty())return $n.createEmptyResult($n.UNION,t,e,t.getFactory());if(t.isEmpty())return e.copy();if(e.isEmpty())return t.copy()}return t.checkNotGeometryCollection(t),t.checkNotGeometryCollection(e),ei.overlayOp(t,e,$n.UNION)},io(F.prototype,{equalsTopo:function(t){return!!this.getEnvelopeInternal().equals(t.getEnvelopeInternal())&&ts.relate(this,t).isEquals(this.getDimension(),t.getDimension())},union:function(){if(0===arguments.length)return ss.union(this);if(1===arguments.length){var t=arguments[0];return no.union(this,t)}},isValid:function(){return Vr.isValid(this)},intersection:function(t){if(this.isEmpty()||t.isEmpty())return $n.createEmptyResult($n.INTERSECTION,this,t,this.factory);if(this.isGeometryCollection()){var e=t;return on.map(this,{interfaces_:function(){return[MapOp]},map:function(t){return t.intersection(e)}})}return this.checkNotGeometryCollection(this),this.checkNotGeometryCollection(t),ei.overlayOp(this,t,$n.INTERSECTION)},covers:function(t){return ts.covers(this,t)},coveredBy:function(t){return ts.coveredBy(this,t)},touches:function(t){return ts.touches(this,t)},intersects:function(t){return ts.intersects(this,t)},within:function(t){return ts.within(this,t)},overlaps:function(t){return ts.overlaps(this,t)},disjoint:function(t){return ts.disjoint(this,t)},crosses:function(t){return ts.crosses(this,t)},buffer:function(){if(1===arguments.length){var t=arguments[0];return hr.bufferOp(this,t)}if(2===arguments.length){var e=arguments[0],n=arguments[1];return hr.bufferOp(this,e,n)}if(3===arguments.length){var i=arguments[0],r=arguments[1],s=arguments[2];return hr.bufferOp(this,i,r,s)}},convexHull:function(){return new ge(this).getConvexHull()},relate:function(){for(var t=arguments.length,e=Array(t),n=0;ne)&&pr.isWithinDistance(this,t,e)},distance:function(t){return pr.distance(this,t)},isEquivalentClass:function(t){return this.getClass()===t.getClass()}});t.version="1.4.0 (93f117d)",t.algorithm=Eo,t.densify=Io,t.dissolve=No,t.geom=yo,t.geomgraph=Co,t.index=wo,t.io=Po,t.noding=bo,t.operation=Vo,t.precision=zo,t.simplify=ko,t.triangulate=Uo,t.linearref=Xo,Object.defineProperty(t,"__esModule",{value:!0})}); //# sourceMappingURL=jsts.min.js.map