18 lines
546 KiB
JavaScript
18 lines
546 KiB
JavaScript
|
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.turf=t()}}(function(){var t;return function e(t,n,o){function r(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(i)return i(s,!0);var p=new Error("Cannot find module '"+s+"'");throw p.code="MODULE_NOT_FOUND",p}var g=n[s]={exports:{}};t[s][0].call(g.exports,function(e){var n=t[s][1][e];return r(n?n:e)},g,g.exports,e,t,n,o)}return n[s].exports}for(var i="function"==typeof require&&require,s=0;s<o.length;s++)r(o[s]);return r}({1:[function(t,e){e.exports={isolines:t("turf-isolines"),merge:t("turf-merge"),convex:t("turf-convex"),within:t("turf-within"),concave:t("turf-concave"),count:t("turf-count"),erase:t("turf-erase"),variance:t("turf-variance"),deviation:t("turf-deviation"),median:t("turf-median"),min:t("turf-min"),max:t("turf-max"),aggregate:t("turf-aggregate"),flip:t("turf-flip"),simplify:t("turf-simplify"),sum:t("turf-sum"),average:t("turf-average"),bezier:t("turf-bezier"),tag:t("turf-tag"),size:t("turf-size"),sample:t("turf-sample"),jenks:t("turf-jenks"),quantile:t("turf-quantile"),envelope:t("turf-envelope"),square:t("turf-square"),midpoint:t("turf-midpoint"),buffer:t("turf-buffer"),center:t("turf-center"),centroid:t("turf-centroid"),combine:t("turf-combine"),distance:t("turf-distance"),explode:t("turf-explode"),extent:t("turf-extent"),bboxPolygon:t("turf-bbox-polygon"),featurecollection:t("turf-featurecollection"),filter:t("turf-filter"),inside:t("turf-inside"),intersect:t("turf-intersect"),linestring:t("turf-linestring"),nearest:t("turf-nearest"),planepoint:t("turf-planepoint"),point:t("turf-point"),polygon:t("turf-polygon"),random:t("turf-random"),reclass:t("turf-reclass"),remove:t("turf-remove"),tin:t("turf-tin"),union:t("turf-union"),bearing:t("turf-bearing"),destination:t("turf-destination"),kinks:t("turf-kinks"),pointOnSurface:t("turf-point-on-surface"),area:t("turf-area"),along:t("turf-along"),lineDistance:t("turf-line-distance"),lineSlice:t("turf-line-slice"),pointOnLine:t("turf-point-on-line"),pointGrid:t("turf-point-grid"),squareGrid:t("turf-square-grid"),triangleGrid:t("turf-triangle-grid"),hexGrid:t("turf-hex-grid")}},{"turf-aggregate":6,"turf-along":7,"turf-area":8,"turf-average":11,"turf-bbox-polygon":12,"turf-bearing":13,"turf-bezier":14,"turf-buffer":16,"turf-center":21,"turf-centroid":22,"turf-combine":24,"turf-concave":25,"turf-convex":26,"turf-count":56,"turf-destination":57,"turf-deviation":58,"turf-distance":60,"turf-envelope":62,"turf-erase":63,"turf-explode":68,"turf-extent":70,"turf-featurecollection":72,"turf-filter":73,"turf-flip":74,"turf-hex-grid":75,"turf-inside":76,"turf-intersect":77,"turf-isolines":83,"turf-jenks":85,"turf-kinks":87,"turf-line-distance":88,"turf-line-slice":89,"turf-linestring":90,"turf-max":91,"turf-median":92,"turf-merge":93,"turf-midpoint":95,"turf-min":96,"turf-nearest":97,"turf-planepoint":98,"turf-point":102,"turf-point-grid":99,"turf-point-on-line":100,"turf-point-on-surface":101,"turf-polygon":103,"turf-quantile":104,"turf-random":106,"turf-reclass":108,"turf-remove":109,"turf-sample":110,"turf-simplify":111,"turf-size":113,"turf-square":115,"turf-square-grid":114,"turf-sum":116,"turf-tag":117,"turf-tin":118,"turf-triangle-grid":119,"turf-union":120,"turf-variance":125,"turf-within":127}],2:[function(t,e,n){function o(t,e,n){if(!(this instanceof o))return new o(t,e,n);var r,i=typeof t;if("number"===i)r=+t;else if("string"===i)r=o.byteLength(t,e);else{if("object"!==i||null===t)throw new TypeError("must start with number, buffer, array or string");"Buffer"===t.type&&G(t.data)&&(t=t.data),r=+t.length}if(r>F)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+F.toString(16)+" bytes");0>r?r=0:r>>>=0;var s=this;o.TYPED_ARRAY_SUPPORT?s=o._augment(new Uint8Array(r)):(s.length=r,s._isBuffer=!0);var a;if(o.TYPED_ARRAY_SUPPORT&&"number"==t
|
||
|
if(!this.extract[e])return null;var n,o=e.toUpperCase();return n=t.isEmpty()?o+" EMPTY":o+"("+this.extract[e].apply(this,[t])+")"},jsts.io.WKTParser.prototype.extract={coordinate:function(t){return t.x+" "+t.y},point:function(t){return t.coordinate.x+" "+t.coordinate.y},multipoint:function(t){for(var e=[],n=0,o=t.geometries.length;o>n;++n)e.push("("+this.extract.point.apply(this,[t.geometries[n]])+")");return e.join(",")},linestring:function(t){for(var e=[],n=0,o=t.points.length;o>n;++n)e.push(this.extract.coordinate.apply(this,[t.points[n]]));return e.join(",")},multilinestring:function(t){for(var e=[],n=0,o=t.geometries.length;o>n;++n)e.push("("+this.extract.linestring.apply(this,[t.geometries[n]])+")");return e.join(",")},polygon:function(t){var e=[];e.push("("+this.extract.linestring.apply(this,[t.shell])+")");for(var n=0,o=t.holes.length;o>n;++n)e.push("("+this.extract.linestring.apply(this,[t.holes[n]])+")");return e.join(",")},multipolygon:function(t){for(var e=[],n=0,o=t.geometries.length;o>n;++n)e.push("("+this.extract.polygon.apply(this,[t.geometries[n]])+")");return e.join(",")},geometrycollection:function(t){for(var e=[],n=0,o=t.geometries.length;o>n;++n)e.push(this.extractGeometry.apply(this,[t.geometries[n]]));return e.join(",")}},jsts.io.WKTParser.prototype.parse={point:function(t){if(void 0===t)return this.geometryFactory.createPoint(null);var e=t.trim().split(this.regExes.spaces);return this.geometryFactory.createPoint(new jsts.geom.Coordinate(e[0],e[1]))},multipoint:function(t){if(void 0===t)return this.geometryFactory.createMultiPoint(null);for(var e,n=t.trim().split(","),o=[],r=0,i=n.length;i>r;++r)e=n[r].replace(this.regExes.trimParens,"$1"),o.push(this.parse.point.apply(this,[e]));return this.geometryFactory.createMultiPoint(o)},linestring:function(t){if(void 0===t)return this.geometryFactory.createLineString(null);for(var e,n=t.trim().split(","),o=[],r=0,i=n.length;i>r;++r)e=n[r].trim().split(this.regExes.spaces),o.push(new jsts.geom.Coordinate(e[0],e[1]));return this.geometryFactory.createLineString(o)},linearring:function(t){if(void 0===t)return this.geometryFactory.createLinearRing(null);for(var e,n=t.trim().split(","),o=[],r=0,i=n.length;i>r;++r)e=n[r].trim().split(this.regExes.spaces),o.push(new jsts.geom.Coordinate(e[0],e[1]));return this.geometryFactory.createLinearRing(o)},multilinestring:function(t){if(void 0===t)return this.geometryFactory.createMultiLineString(null);for(var e,n=t.trim().split(this.regExes.parenComma),o=[],r=0,i=n.length;i>r;++r)e=n[r].replace(this.regExes.trimParens,"$1"),o.push(this.parse.linestring.apply(this,[e]));return this.geometryFactory.createMultiLineString(o)},polygon:function(t){if(void 0===t)return this.geometryFactory.createPolygon(null);for(var e,n,o,r,i=t.trim().split(this.regExes.parenComma),s=[],a=0,u=i.length;u>a;++a)e=i[a].replace(this.regExes.trimParens,"$1"),n=this.parse.linestring.apply(this,[e]),o=this.geometryFactory.createLinearRing(n.points),0===a?r=o:s.push(o);return this.geometryFactory.createPolygon(r,s)},multipolygon:function(t){if(void 0===t)return this.geometryFactory.createMultiPolygon(null);for(var e,n=t.trim().split(this.regExes.doubleParenComma),o=[],r=0,i=n.length;i>r;++r)e=n[r].replace(this.regExes.trimParens,"$1"),o.push(this.parse.polygon.apply(this,[e]));return this.geometryFactory.createMultiPolygon(o)},geometrycollection:function(t){if(void 0===t)return this.geometryFactory.createGeometryCollection(null);t=t.replace(/,\s*([A-Za-z])/g,"|$1");for(var e=t.trim().split("|"),n=[],o=0,r=e.length;r>o;++o)n.push(jsts.io.WKTParser.prototype.read.apply(this,[e[o]]));return this.geometryFactory.createGeometryCollection(n)}},jsts.index.ItemVisitor=function(){},jsts.index.ItemVisitor.prototype.visitItem=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.algorithm.CGAlgorithms=function(){},jsts.algorithm.CGAlgorithms.CLOCKWISE=-1,jsts.algorithm.CGAlgorithms.RIGHT=jsts.algorithm.CGAlgorithms.CLOCKWISE,jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE=1,jsts.algorithm.CGAlgorithms.LEFT=jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE,j
|
||
|
},jsts.geom.Envelope.intersects=function(t,e,n){if(4===arguments.length)return jsts.geom.Envelope.intersectsEnvelope(arguments[0],arguments[1],arguments[2],arguments[3]);var o=t.x<e.x?t.x:e.x,r=t.x>e.x?t.x:e.x,i=t.y<e.y?t.y:e.y,s=t.y>e.y?t.y:e.y;return n.x>=o&&n.x<=r&&n.y>=i&&n.y<=s?!0:!1},jsts.geom.Envelope.intersectsEnvelope=function(t,e,n,o){var r=Math.min(n.x,o.x),i=Math.max(n.x,o.x),s=Math.min(t.x,e.x),a=Math.max(t.x,e.x);return s>i?!1:r>a?!1:(r=Math.min(n.y,o.y),i=Math.max(n.y,o.y),s=Math.min(t.y,e.y),a=Math.max(t.y,e.y),s>i?!1:r>a?!1:!0)},jsts.geom.Envelope.prototype.clone=function(){return new jsts.geom.Envelope(this.minx,this.maxx,this.miny,this.maxy)},jsts.geom.util.GeometryCombiner=function(t){this.geomFactory=jsts.geom.util.GeometryCombiner.extractFactory(t),this.inputGeoms=t},jsts.geom.util.GeometryCombiner.combine=function(t){if(arguments.length>1)return this.combine2.apply(this,arguments);var e=new jsts.geom.util.GeometryCombiner(t);return e.combine()},jsts.geom.util.GeometryCombiner.combine2=function(){var t=new javascript.util.ArrayList;Array.prototype.slice.call(arguments).forEach(function(e){t.add(e)});var e=new jsts.geom.util.GeometryCombiner(t);return e.combine()},jsts.geom.util.GeometryCombiner.prototype.geomFactory=null,jsts.geom.util.GeometryCombiner.prototype.skipEmpty=!1,jsts.geom.util.GeometryCombiner.prototype.inputGeoms,jsts.geom.util.GeometryCombiner.extractFactory=function(t){return t.isEmpty()?null:t.iterator().next().getFactory()},jsts.geom.util.GeometryCombiner.prototype.combine=function(){var t,e=new javascript.util.ArrayList;for(t=this.inputGeoms.iterator();t.hasNext();){var n=t.next();this.extractElements(n,e)}return 0===e.size()?null!==this.geomFactory?this.geomFactory.createGeometryCollection(null):null:this.geomFactory.buildGeometry(e)},jsts.geom.util.GeometryCombiner.prototype.extractElements=function(t,e){if(null!==t)for(var n=0;n<t.getNumGeometries();n++){var o=t.getGeometryN(n);this.skipEmpty&&o.isEmpty()||e.add(o)}},jsts.geom.PrecisionModel=function(t){return"number"==typeof t?(this.modelType=jsts.geom.PrecisionModel.FIXED,void(this.scale=t)):(this.modelType=t||jsts.geom.PrecisionModel.FLOATING,void(this.modelType===jsts.geom.PrecisionModel.FIXED&&(this.scale=1)))},jsts.geom.PrecisionModel.FLOATING="FLOATING",jsts.geom.PrecisionModel.FIXED="FIXED",jsts.geom.PrecisionModel.FLOATING_SINGLE="FLOATING_SINGLE",jsts.geom.PrecisionModel.prototype.scale=null,jsts.geom.PrecisionModel.prototype.modelType=null,jsts.geom.PrecisionModel.prototype.isFloating=function(){return this.modelType===jsts.geom.PrecisionModel.FLOATING||this.modelType===jsts.geom.PrecisionModel.FLOATING_SINLGE},jsts.geom.PrecisionModel.prototype.getScale=function(){return this.scale},jsts.geom.PrecisionModel.prototype.getType=function(){return this.modelType},jsts.geom.PrecisionModel.prototype.equals=function(t){return!0},jsts.geom.PrecisionModel.prototype.makePrecise=function(t){return t instanceof jsts.geom.Coordinate?void this.makePrecise2(t):isNaN(t)?t:this.modelType===jsts.geom.PrecisionModel.FIXED?Math.round(t*this.scale)/this.scale:t},jsts.geom.PrecisionModel.prototype.makePrecise2=function(t){this.modelType!==jsts.geom.PrecisionModel.FLOATING&&(t.x=this.makePrecise(t.x),t.y=this.makePrecise(t.y))},jsts.geom.PrecisionModel.prototype.compareTo=function(t){return 0},jsts.geom.CoordinateFilter=function(){},jsts.geom.CoordinateFilter.prototype.filter=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.simplify.DouglasPeuckerLineSimplifier=function(t){this.pts=t,this.seg=new jsts.geom.LineSegment},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.pts=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.usePt=null,jsts.simplify.DouglasPeuckerLineSimplifier.prototype.distanceTolerance=null,jsts.simplify.DouglasPeuckerLineSimplifier.simplify=function(t,e){var n=new jsts.simplify.DouglasPeuckerLineSimplifier(t);return n.setDistanceTolerance(e),n.simplify()},jsts.simplify.DouglasPeuckerLineSimplifier.prototype.setDistanceTolerance=function(t){this.distanceTolerance=t},jsts.simplify.DouglasPeucke
|
||
|
else{if(!(this.ptCount>0))return null;t.x=this.ptCentSum.x/this.ptCount,t.y=this.ptCentSum.y/this.ptCount}return t},jsts.algorithm.Centroid.prototype.setBasePoint=function(t){null===this.areaBasePt&&(this.areaBasePt=t)},jsts.algorithm.Centroid.prototype.addPolygon=function(t){this.addShell(t.getExteriorRing().getCoordinates());for(var e=0;e<t.getNumInteriorRing();e++)this.addHole(t.getInteriorRingN(e).getCoordinates())},jsts.algorithm.Centroid.prototype.addShell=function(t){t.length>0&&this.setBasePoint(t[0]);for(var e=!jsts.algorithm.CGAlgorithms.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this.areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},jsts.algorithm.Centroid.prototype.addHole=function(t){for(var e=jsts.algorithm.CGAlgorithms.isCCW(t),n=0;n<t.length-1;n++)this.addTriangle(this.areaBasePt,t[n],t[n+1],e);this.addLineSegments(t)},jsts.algorithm.Centroid.prototype.addTriangle=function(t,e,n,o){var r=o?1:-1;jsts.algorithm.Centroid.centroid3(t,e,n,this.triangleCent3);var i=jsts.algorithm.Centroid.area2(t,e,n);this.cg3.x+=r*i*this.triangleCent3.x,this.cg3.y+=r*i*this.triangleCent3.y,this.areasum2+=r*i},jsts.algorithm.Centroid.prototype.addLineSegments=function(t){for(var e=0,n=0;n<t.length-1;n++){var o=t[n].distance(t[n+1]);if(0!==o){e+=o;var r=(t[n].x+t[n+1].x)/2;this.lineCentSum.x+=o*r;var i=(t[n].y+t[n+1].y)/2;this.lineCentSum.y+=o*i}}this.totalLength+=e,0===e&&t.length>0&&this.addPoint(t[0])},jsts.algorithm.Centroid.prototype.addPoint=function(t){this.ptCount+=1,this.ptCentSum.x+=t.x,this.ptCentSum.y+=t.y},function(){var t=function(t){this.deList=new javascript.util.ArrayList,this.factory=t};t.findEdgeRingContaining=function(t,e){for(var n=t.getRing(),o=n.getEnvelopeInternal(),r=n.getCoordinateN(0),i=null,s=null,a=e.iterator();a.hasNext();){var u=a.next(),p=u.getRing(),g=p.getEnvelopeInternal();null!=i&&(s=i.getRing().getEnvelopeInternal());var l=!1;g.equals(o)||(r=jsts.geom.CoordinateArrays.ptNotInList(n.getCoordinates(),p.getCoordinates()),g.contains(o)&&jsts.algorithm.CGAlgorithms.isPointInRing(r,p.getCoordinates())&&(l=!0),l&&(null==i||s.contains(g))&&(i=u))}return i},t.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(!isInList(o,e))return o}return null},t.isInList=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return!0;return!1},t.prototype.factory=null,t.prototype.deList=null,t.prototype.ring=null,t.prototype.ringPts=null,t.prototype.holes=null,t.prototype.add=function(t){this.deList.add(t)},t.prototype.isHole=function(){var t=this.getRing();return jsts.algorithm.CGAlgorithms.isCCW(t.getCoordinates())},t.prototype.addHole=function(t){null==this.holes&&(this.holes=new javascript.util.ArrayList),this.holes.add(t)},t.prototype.getPolygon=function(){var t=null;if(null!=this.holes){t=[];for(var e=0;e<this.holes.size();e++)t[e]=this.holes.get(e)}var n=this.factory.createPolygon(this.ring,t);return n},t.prototype.isValid=function(){return this.getCoordinates(),this.ringPts.length<=3?!1:(this.getRing(),this.ring.isValid())},t.prototype.getCoordinates=function(){if(null==this.ringPts){for(var e=new jsts.geom.CoordinateList,n=this.deList.iterator();n.hasNext();){var o=n.next(),r=o.getEdge();t.addEdge(r.getLine().getCoordinates(),o.getEdgeDirection(),e)}this.ringPts=e.toCoordinateArray()}return this.ringPts},t.prototype.getLineString=function(){return this.getCoordinates(),this.factory.createLineString(this.ringPts)},t.prototype.getRing=function(){if(null!=this.ring)return this.ring;this.getCoordinates(),this.ringPts.length<3&&console.log(this.ringPts);try{this.ring=this.factory.createLinearRing(this.ringPts)}catch(t){console.log(this.ringPts)}return this.ring},t.addEdge=function(t,e,n){if(e)for(var o=0;o<t.length;o++)n.add(t[o],!1);else for(var o=t.length-1;o>=0;o--)n.add(t[o],!1)},jsts.operation.polygonize.EdgeRing=t}(),function(){var t=function(){};t.setVisited=function(t,e){for(;t.hasNext();){var n=t.next();n.setVisited(e)}},t.setMarked=function(t,e){for(;t.hasNext();){var n=t.next();n.setMarked(e)}},t.getComponentWithVisitedState=function(t,e){for(;t.hasNext();){var n=t.next();if
|
||
|
if(!n.contains(t))return!1;if(!jsts.algorithm.CGAlgorithms.isPointInRing(t,e.getCoordinates()))return!1;for(var o=0;o<this.holes.length;o++){var r=this.holes[o];if(r.containsPoint(t))return!1}return!0},function(){jsts.geom.LinearRing=function(){jsts.geom.LineString.apply(this,arguments)},jsts.geom.LinearRing.prototype=new jsts.geom.LineString,jsts.geom.LinearRing.constructor=jsts.geom.LinearRing,jsts.geom.LinearRing.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE},jsts.geom.LinearRing.prototype.isSimple=function(){return!0},jsts.geom.LinearRing.prototype.getGeometryType=function(){return"LinearRing"},jsts.geom.LinearRing.MINIMUM_VALID_SIZE=4,jsts.geom.LinearRing.prototype.CLASS_NAME="jsts.geom.LinearRing"}(),jsts.index.strtree.Boundable=function(){},jsts.index.strtree.Boundable.prototype.getBounds=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractNode=function(t){this.level=t,this.childBoundables=[]},jsts.index.strtree.AbstractNode.prototype=new jsts.index.strtree.Boundable,jsts.index.strtree.AbstractNode.constructor=jsts.index.strtree.AbstractNode,jsts.index.strtree.AbstractNode.prototype.childBoundables=null,jsts.index.strtree.AbstractNode.prototype.bounds=null,jsts.index.strtree.AbstractNode.prototype.level=null,jsts.index.strtree.AbstractNode.prototype.getChildBoundables=function(){return this.childBoundables},jsts.index.strtree.AbstractNode.prototype.computeBounds=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractNode.prototype.getBounds=function(){return null===this.bounds&&(this.bounds=this.computeBounds()),this.bounds},jsts.index.strtree.AbstractNode.prototype.getLevel=function(){return this.level},jsts.index.strtree.AbstractNode.prototype.addChildBoundable=function(t){this.childBoundables.push(t)},function(){jsts.noding.Noder=function(){},jsts.noding.Noder.prototype.computeNodes=jsts.abstractFunc,jsts.noding.Noder.prototype.getNodedSubstrings=jsts.abstractFunc}(),function(){var t=jsts.noding.Noder;jsts.noding.SinglePassNoder=function(){},jsts.noding.SinglePassNoder.prototype=new t,jsts.noding.SinglePassNoder.constructor=jsts.noding.SinglePassNoder,jsts.noding.SinglePassNoder.prototype.segInt=null,jsts.noding.SinglePassNoder.prototype.setSegmentIntersector=function(t){this.segInt=t}}(),jsts.index.SpatialIndex=function(){},jsts.index.SpatialIndex.prototype.insert=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.SpatialIndex.prototype.query=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.SpatialIndex.prototype.remove=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree=function(t){void 0!==t&&(this.itemBoundables=[],jsts.util.Assert.isTrue(t>1,"Node capacity must be greater than 1"),this.nodeCapacity=t)},jsts.index.strtree.AbstractSTRtree.IntersectsOp=function(){},jsts.index.strtree.AbstractSTRtree.IntersectsOp.prototype.intersects=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.root=null,jsts.index.strtree.AbstractSTRtree.prototype.built=!1,jsts.index.strtree.AbstractSTRtree.prototype.itemBoundables=null,jsts.index.strtree.AbstractSTRtree.prototype.nodeCapacity=null,jsts.index.strtree.AbstractSTRtree.prototype.build=function(){jsts.util.Assert.isTrue(!this.built),this.root=0===this.itemBoundables.length?this.createNode(0):this.createHigherLevels(this.itemBoundables,-1),this.built=!0},jsts.index.strtree.AbstractSTRtree.prototype.createNode=function(){throw new jsts.error.AbstractMethodInvocationError},jsts.index.strtree.AbstractSTRtree.prototype.createParentBoundables=function(t,e){jsts.util.Assert.isTrue(!(0===t.length));var n=[];n.push(this.createNode(e));for(var o=[],r=0;r<t.length;r++)o.push(t[r]);o.sort(this.getComparator());for(var r=0;r<o.length;r++){var i=o[r];this.lastNode(n).getChildBoundables().length===this.getNodeCapacity()&&n.push(this.createNode(e)),this.lastNode(n).addChildBoundable(i)}return n},jsts.index.strtree.AbstractSTRtree.prototype.
|
||
|
},jsts.geom.LineSegment.prototype.pointAlong=function(t){var e=new jsts.geom.Coordinate;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},jsts.geom.LineSegment.prototype.pointAlongOffset=function(t,e){var n=this.p0.x+t*(this.p1.x-this.p0.x),o=this.p0.y+t*(this.p1.y-this.p0.y),r=this.p1.x-this.p0.x,i=this.p1.y-this.p0.y,s=Math.sqrt(r*r+i*i),a=0,u=0;if(0!==e){if(0>=s)throw"Cannot compute offset from zero-length line segment";a=e*r/s,u=e*i/s}var p=n-u,g=o+a,l=new jsts.geom.Coordinate(p,g);return l},jsts.geom.LineSegment.prototype.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,o=e*e+n*n,r=((t.x-this.p0.x)*e+(t.y-this.p0.y)*n)/o;return r},jsts.geom.LineSegment.prototype.segmentFraction=function(t){var e=this.projectionFactor(t);return 0>e?e=0:(e>1||isNaN(e))&&(e=1),e},jsts.geom.LineSegment.prototype.project=function(t){return t instanceof jsts.geom.Coordinate?this.project1(t):t instanceof jsts.geom.LineSegment?this.project2(t):void 0},jsts.geom.LineSegment.prototype.project1=function(t){if(t.equals(this.p0)||t.equals(this.p1))return new jsts.geom.Coordinate(t);var e=this.projectionFactor(t),n=new jsts.geom.Coordinate;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},jsts.geom.LineSegment.prototype.project2=function(t){var e=this.projectionFactor(t.p0),n=this.projectionFactor(t.p1);if(e>=1&&n>=1)return null;if(0>=e&&0>=n)return null;var o=this.project(t.p0);0>e&&(o=p0),e>1&&(o=p1);var r=this.project(t.p1);return 0>n&&(r=p0),n>1&&(r=p1),new jsts.geom.LineSegment(o,r)},jsts.geom.LineSegment.prototype.closestPoint=function(t){var e=this.projectionFactor(t);if(e>0&&1>e)return this.project(t);var n=this.p0.distance(t),o=this.p1.distance(t);return o>n?this.p0:this.p1},jsts.geom.LineSegment.prototype.closestPoints=function(t){var e=this.intersection(t);if(null!==e)return[e,e];var n,o=[],r=Number.MAX_VALUE,i=this.closestPoint(t.p0);r=i.distance(t.p0),o[0]=i,o[1]=t.p0;var s=this.closestPoint(t.p1);n=s.distance(t.p1),r>n&&(r=n,o[0]=s,o[1]=t.p1);var a=t.closestPoint(this.p0);n=a.distance(this.p0),r>n&&(r=n,o[0]=this.p0,o[1]=a);var u=t.closestPoint(this.p1);return n=u.distance(this.p1),r>n&&(r=n,o[0]=this.p1,o[1]=u),o},jsts.geom.LineSegment.prototype.intersection=function(t){var e=new jsts.algorithm.RobustLineIntersector;return e.computeIntersection(this.p0,this.p1,t.p0,t.p1),e.hasIntersection()?e.getIntersection(0):null},jsts.geom.LineSegment.prototype.setCoordinates=function(t){return t instanceof jsts.geom.Coordinate?void this.setCoordinates2.apply(this,arguments):void this.setCoordinates2(t.p0,t.p1)},jsts.geom.LineSegment.prototype.setCoordinates2=function(t,e){this.p0.x=t.x,this.p0.y=t.y,this.p1.x=e.x,this.p1.y=e.y},jsts.geom.LineSegment.prototype.distancePerpendicular=function(t){return jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular(t,this.p0,this.p1)},jsts.geom.LineSegment.prototype.lineIntersection=function(t){try{var e=jsts.algorithm.HCoordinate.intersection(this.p0,this.p1,t.p0,t.p1);return e}catch(n){}return null},jsts.geom.LineSegment.prototype.toGeometry=function(t){return t.createLineString([this.p0,this.p1])},jsts.geom.LineSegment.prototype.equals=function(t){return t instanceof jsts.geom.LineSegment?this.p0.equals(t.p0)&&this.p1.equals(t.p1):!1},jsts.geom.LineSegment.prototype.compareTo=function(t){var e=this.p0.compareTo(t.p0);return 0!==e?e:this.p1.compareTo(t.p1)},jsts.geom.LineSegment.prototype.equalsTopo=function(t){return this.p0.equals(t.p0)&&this.p1.equals(t.p1)||this.p0.equals(t.p1)&&this.p1.equals(t.p0)},jsts.geom.LineSegment.prototype.toString=function(){return"LINESTRING("+this.p0.x+" "+this.p0.y+", "+this.p1.x+" "+this.p1.y+")"},jsts.index.chain.MonotoneChainOverlapAction=function(){this.tempEnv1=new jsts.geom.Envelope,this.tempEnv2=new jsts.geom.Envelope,this.overlapSeg1=new jsts.geom.LineSegment,this.overlapSeg2=new jsts.geom.LineSegment},jsts.index.chain.MonotoneChainOverlapAction.prototype.tempEnv1=null,jsts.index.chain.MonotoneChainO
|
||
|
},jsts.geomgraph.NodeMap.prototype.getBoundaryNodes=function(n){for(var o=new e,r=this.iterator();r.hasNext();){var i=r.next();i.getLabel().getLocation(n)===t.BOUNDARY&&o.add(i)}return o}}(),function(){var t=javascript.util.ArrayList;jsts.geomgraph.PlanarGraph=function(e){this.edges=new t,this.edgeEndList=new t,this.nodes=new jsts.geomgraph.NodeMap(e||new jsts.geomgraph.NodeFactory)},jsts.geomgraph.PlanarGraph.prototype.edges=null,jsts.geomgraph.PlanarGraph.prototype.nodes=null,jsts.geomgraph.PlanarGraph.prototype.edgeEndList=null,jsts.geomgraph.PlanarGraph.linkResultDirectedEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.getEdges().linkResultDirectedEdges()}},jsts.geomgraph.PlanarGraph.prototype.getEdgeIterator=function(){return this.edges.iterator()},jsts.geomgraph.PlanarGraph.prototype.getEdgeEnds=function(){return this.edgeEndList},jsts.geomgraph.PlanarGraph.prototype.isBoundaryNode=function(t,e){var n=this.nodes.find(e);if(null===n)return!1;var o=n.getLabel();return null!==o&&o.getLocation(t)===jsts.geom.Location.BOUNDARY?!0:!1},jsts.geomgraph.PlanarGraph.prototype.insertEdge=function(t){this.edges.add(t)},jsts.geomgraph.PlanarGraph.prototype.add=function(t){this.nodes.add(t),this.edgeEndList.add(t)},jsts.geomgraph.PlanarGraph.prototype.getNodeIterator=function(){return this.nodes.iterator()},jsts.geomgraph.PlanarGraph.prototype.getNodes=function(){return this.nodes.values()},jsts.geomgraph.PlanarGraph.prototype.addNode=function(t){return this.nodes.addNode(t)},jsts.geomgraph.PlanarGraph.prototype.addEdges=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();this.edges.add(n);var o=new jsts.geomgraph.DirectedEdge(n,!0),r=new jsts.geomgraph.DirectedEdge(n,!1);o.setSym(r),r.setSym(o),this.add(o),this.add(r)}},jsts.geomgraph.PlanarGraph.prototype.linkResultDirectedEdges=function(){for(var t=this.nodes.iterator();t.hasNext();){var e=t.next();e.getEdges().linkResultDirectedEdges()}},jsts.geomgraph.PlanarGraph.prototype.findEdgeInSameDirection=function(t,e){var n,o,r=0,i=this.edges.size();for(r;i>r;r++){if(n=this.edges.get(r),o=n.getCoordinates(),this.matchInSameDirection(t,e,o[0],o[1]))return n;if(this.matchInSameDirection(t,e,o[o.length-1],o[o.length-2]))return n}return null},jsts.geomgraph.PlanarGraph.prototype.matchInSameDirection=function(t,e,n,o){return t.equals(n)&&jsts.algorithm.CGAlgorithms.computeOrientation(t,e,o)===jsts.algorithm.CGAlgorithms.COLLINEAR&&jsts.geomgraph.Quadrant.quadrant(t,e)===jsts.geomgraph.Quadrant.quadrant(n,o)?!0:!1},jsts.geomgraph.PlanarGraph.prototype.findEdgeEnd=function(t){for(var e=this.getEdgeEnds().iterator();e.hasNext();){var n=e.next();if(n.getEdge()===t)return n}return null}}(),jsts.noding.SegmentIntersector=function(){},jsts.noding.SegmentIntersector.prototype.processIntersections=jsts.abstractFunc,jsts.noding.SegmentIntersector.prototype.isDone=jsts.abstractFunc,function(){var t=jsts.noding.SegmentIntersector,e=javascript.util.ArrayList;jsts.noding.InteriorIntersectionFinder=function(t){this.li=t,this.intersections=new e,this.interiorIntersection=null},jsts.noding.InteriorIntersectionFinder.prototype=new t,jsts.noding.InteriorIntersectionFinder.constructor=jsts.noding.InteriorIntersectionFinder,jsts.noding.InteriorIntersectionFinder.prototype.findAllIntersections=!1,jsts.noding.InteriorIntersectionFinder.prototype.isCheckEndSegmentsOnly=!1,jsts.noding.InteriorIntersectionFinder.prototype.li=null,jsts.noding.InteriorIntersectionFinder.prototype.interiorIntersection=null,jsts.noding.InteriorIntersectionFinder.prototype.intSegments=null,jsts.noding.InteriorIntersectionFinder.prototype.intersections=null,jsts.noding.InteriorIntersectionFinder.prototype.setFindAllIntersections=function(t){this.findAllIntersections=t},jsts.noding.InteriorIntersectionFinder.prototype.getIntersections=function(){return intersections},jsts.noding.InteriorIntersectionFinder.prototype.setCheckEndSegmentsOnly=function(t){this.isCheckEndSegmentsOnly=t},jsts.noding.InteriorIntersectionFinder.prototype.hasIntersection=function(){return null!=this.interiorIntersection},jsts.n
|
||
|
this.resultAreaEdgeList=new javascript.util.ArrayList;for(var t=this.iterator();t.hasNext();){var e=t.next();(e.isInResult()||e.getSym().isInResult())&&this.resultAreaEdgeList.add(e)}return this.resultAreaEdgeList},jsts.geomgraph.DirectedEdgeStar.prototype.SCANNING_FOR_INCOMING=1,jsts.geomgraph.DirectedEdgeStar.prototype.LINKING_TO_OUTGOING=2,jsts.geomgraph.DirectedEdgeStar.prototype.linkResultDirectedEdges=function(){this.getResultAreaEdges();for(var t=null,e=null,n=this.SCANNING_FOR_INCOMING,r=0;r<this.resultAreaEdgeList.size();r++){var i=this.resultAreaEdgeList.get(r),s=i.getSym();if(i.getLabel().isArea())switch(null===t&&i.isInResult()&&(t=i),n){case this.SCANNING_FOR_INCOMING:if(!s.isInResult())continue;e=s,n=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(!i.isInResult())continue;e.setNext(i),n=this.SCANNING_FOR_INCOMING}}if(n===this.LINKING_TO_OUTGOING){if(null===t)throw new jsts.error.TopologyError("no outgoing dirEdge found",this.getCoordinate());o.isTrue(t.isInResult(),"unable to link last incoming dirEdge"),e.setNext(t)}},jsts.geomgraph.DirectedEdgeStar.prototype.linkMinimalDirectedEdges=function(t){for(var e=null,n=null,r=this.SCANNING_FOR_INCOMING,i=this.resultAreaEdgeList.size()-1;i>=0;i--){var s=this.resultAreaEdgeList.get(i),a=s.getSym();switch(null===e&&s.getEdgeRing()===t&&(e=s),r){case this.SCANNING_FOR_INCOMING:if(a.getEdgeRing()!=t)continue;n=a,r=this.LINKING_TO_OUTGOING;break;case this.LINKING_TO_OUTGOING:if(s.getEdgeRing()!==t)continue;n.setNextMin(s),r=this.SCANNING_FOR_INCOMING}}r===this.LINKING_TO_OUTGOING&&(o.isTrue(null!==e,"found null for first outgoing dirEdge"),o.isTrue(e.getEdgeRing()===t,"unable to link last incoming dirEdge"),n.setNextMin(e))},jsts.geomgraph.DirectedEdgeStar.prototype.linkAllDirectedEdges=function(){this.getEdges();for(var t=null,e=null,n=this.edgeList.size()-1;n>=0;n--){var o=this.edgeList.get(n),r=o.getSym();null===e&&(e=r),null!==t&&r.setNext(t),t=o}e.setNext(t)},jsts.geomgraph.DirectedEdgeStar.prototype.findCoveredLineEdges=function(){for(var e=t.NONE,n=this.iterator();n.hasNext();){var o=n.next(),r=o.getSym();if(!o.isLineEdge()){if(o.isInResult()){e=t.INTERIOR;break}if(r.isInResult()){e=t.EXTERIOR;break}}}if(e!==t.NONE)for(var i=e,n=this.iterator();n.hasNext();){var o=n.next(),r=o.getSym();o.isLineEdge()?o.getEdge().setCovered(i===t.INTERIOR):(o.isInResult()&&(i=t.EXTERIOR),r.isInResult()&&(i=t.INTERIOR))}},jsts.geomgraph.DirectedEdgeStar.prototype.computeDepths=function(t){if(2===arguments.length)return void this.computeDepths2.apply(this,arguments);var n=this.findIndex(t),o=(t.getLabel(),t.getDepth(e.LEFT)),r=t.getDepth(e.RIGHT),i=this.computeDepths2(n+1,this.edgeList.size(),o),s=this.computeDepths2(0,n,i);if(s!=r)throw new jsts.error.TopologyError("depth mismatch at "+t.getCoordinate())},jsts.geomgraph.DirectedEdgeStar.prototype.computeDepths2=function(t,n,o){for(var r=o,i=t;n>i;i++){{var s=this.edgeList.get(i);s.getLabel()}s.setEdgeDepths(e.RIGHT,r),r=s.getDepth(e.LEFT)}return r}}(),jsts.algorithm.CentroidLine=function(){this.centSum=new jsts.geom.Coordinate},jsts.algorithm.CentroidLine.prototype.centSum=null,jsts.algorithm.CentroidLine.prototype.totalLength=0,jsts.algorithm.CentroidLine.prototype.add=function(t){if(t instanceof Array)return void this.add2.apply(this,arguments);if(t instanceof jsts.geom.LineString)this.add(t.getCoordinates());else if(t instanceof jsts.geom.Polygon){var e=t;this.add(e.getExteriorRing().getCoordinates());for(var n=0;n<e.getNumInteriorRing();n++)this.add(e.getInteriorRingN(n).getCoordinates())}else if(t instanceof jsts.geom.GeometryCollection||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.MultiPolygon)for(var o=t,n=0;n<o.getNumGeometries();n++)this.add(o.getGeometryN(n))},jsts.algorithm.CentroidLine.prototype.getCentroid=function(){var t=new jsts.geom.Coordinate;return t.x=this.centSum.x/this.totalLength,t.y=this.centSum.y/this.totalLength,t},jsts.algorithm.CentroidLine.prototype.add2=function(t){for(var e=0;e<t.length-1;e++){var n=t[e].distance(t[e+1]);this.total
|
||
|
t.y<r.getMinY()||t.y>r.getMaxY()||this.findStabbedSegments2(t,o.getDirectedEdges(),e)}return e},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments2=function(t,e,n){if(arguments[1]instanceof jsts.geomgraph.DirectedEdge)return void this.findStabbedSegments3(t,e,n);for(var o=e.iterator();o.hasNext();){var r=o.next();r.isForward()&&this.findStabbedSegments3(t,r,n)}},jsts.operation.buffer.SubgraphDepthLocater.prototype.findStabbedSegments3=function(t,e,n){for(var o=e.getEdge().getCoordinates(),r=0;r<o.length-1;r++){this.seg.p0=o[r],this.seg.p1=o[r+1],this.seg.p0.y>this.seg.p1.y&&this.seg.reverse();var i=Math.max(this.seg.p0.x,this.seg.p1.x);if(!(i<t.x||this.seg.isHorizontal()||t.y<this.seg.p0.y||t.y>this.seg.p1.y||jsts.algorithm.CGAlgorithms.computeOrientation(this.seg.p0,this.seg.p1,t)===jsts.algorithm.CGAlgorithms.RIGHT)){var s=e.getDepth(jsts.geomgraph.Position.LEFT);this.seg.p0.equals(o[r])||(s=e.getDepth(jsts.geomgraph.Position.RIGHT));var a=new jsts.operation.buffer.SubgraphDepthLocater.DepthSegment(this.seg,s);n.push(a)}}},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment=function(t,e){this.upwardSeg=new jsts.geom.LineSegment(t),this.leftDepth=e},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.upwardSeg=null,jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.leftDepth=null,jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.compareTo=function(t){var e=t,n=this.upwardSeg.orientationIndex(e.upwardSeg);return 0===n&&(n=-1*e.upwardSeg.orientationIndex(upwardSeg)),0!==n?n:this.compareX(this.upwardSeg,e.upwardSeg)},jsts.operation.buffer.SubgraphDepthLocater.DepthSegment.prototype.compareX=function(t,e){var n=t.p0.compareTo(e.p0);return 0!==n?n:t.p1.compareTo(e.p1)},jsts.noding.snapround.HotPixel=function(t,e,n){this.corner=[],this.originalPt=t,this.pt=t,this.scaleFactor=e,this.li=n,1!==this.scaleFactor&&(this.pt=new jsts.geom.Coordinate(this.scale(t.x),this.scale(t.y)),this.p0Scaled=new jsts.geom.Coordinate,this.p1Scaled=new jsts.geom.Coordinate),this.initCorners(this.pt)},jsts.noding.snapround.HotPixel.prototype.li=null,jsts.noding.snapround.HotPixel.prototype.pt=null,jsts.noding.snapround.HotPixel.prototype.originalPt=null,jsts.noding.snapround.HotPixel.prototype.ptScaled=null,jsts.noding.snapround.HotPixel.prototype.p0Scaled=null,jsts.noding.snapround.HotPixel.prototype.p1Scaled=null,jsts.noding.snapround.HotPixel.prototype.scaleFactor=void 0,jsts.noding.snapround.HotPixel.prototype.minx=void 0,jsts.noding.snapround.HotPixel.prototype.maxx=void 0,jsts.noding.snapround.HotPixel.prototype.miny=void 0,jsts.noding.snapround.HotPixel.prototype.maxy=void 0,jsts.noding.snapround.HotPixel.prototype.corner=null,jsts.noding.snapround.HotPixel.prototype.safeEnv=null,jsts.noding.snapround.HotPixel.prototype.getCoordinate=function(){return this.originalPt},jsts.noding.snapround.HotPixel.SAFE_ENV_EXPANSION_FACTOR=.75,jsts.noding.snapround.HotPixel.prototype.getSafeEnvelope=function(){if(null===this.safeEnv){var t=jsts.noding.snapround.HotPixel.SAFE_ENV_EXPANSION_FACTOR/this.scaleFactor;this.safeEnv=new jsts.geom.Envelope(this.originalPt.x-t,this.originalPt.x+t,this.originalPt.y-t,this.originalPt.y+t)}return this.safeEnv},jsts.noding.snapround.HotPixel.prototype.initCorners=function(t){var e=.5;this.minx=t.x-e,this.maxx=t.x+e,this.miny=t.y-e,this.maxy=t.y+e,this.corner[0]=new jsts.geom.Coordinate(this.maxx,this.maxy),this.corner[1]=new jsts.geom.Coordinate(this.minx,this.maxy),this.corner[2]=new jsts.geom.Coordinate(this.minx,this.miny),this.corner[3]=new jsts.geom.Coordinate(this.maxx,this.miny)},jsts.noding.snapround.HotPixel.prototype.scale=function(t){return Math.round(t*this.scaleFactor)},jsts.noding.snapround.HotPixel.prototype.intersects=function(t,e){return 1===this.scaleFactor?this.intersectsScaled(t,e):(this.copyScaled(t,this.p0Scaled),this.copyScaled(e,this.p1Scaled),this.intersectsScaled(this.p0Scaled,this.p1Scaled))},jsts.noding.snapround.HotPixel.prototype.copyScaled=function(t,e){e.x=this.scale(t.x),e.y=this.scale(t.y)},jsts.noding.snapround.HotPi
|
||
|
return e},jsts.algorithm.ConvexHull.prototype.lineOrPolygon=function(t){if(t=this.cleanRing(t),3==t.length)return this.geomFactory.createLineString([t[0],t[1]]);var e=this.geomFactory.createLinearRing(t);return this.geomFactory.createPolygon(e,null)},jsts.algorithm.ConvexHull.prototype.cleanRing=function(t){n.equals(t[0],t[t.length-1]);for(var e=new r,o=null,i=0;i<=t.length-2;i++){var s=t[i],a=t[i+1];s.equals(a)||null!=o&&this.isBetween(o,s,a)||(e.add(s),o=s)}e.add(t[t.length-1]);var u=[];return e.toArray(u)}}(),jsts.algorithm.MinimumDiameter=function(t,e){this.convexHullPts=null,this.minBaseSeg=new jsts.geom.LineSegment,this.minWidthPt=null,this.minPtIndex=0,this.minWidth=0,jsts.algorithm.MinimumDiameter.inputGeom=t,jsts.algorithm.MinimumDiameter.isConvex=e||!1},jsts.algorithm.MinimumDiameter.inputGeom=null,jsts.algorithm.MinimumDiameter.isConvex=!1,jsts.algorithm.MinimumDiameter.nextIndex=function(t,e){return e++,e>=t.length&&(e=0),e},jsts.algorithm.MinimumDiameter.computeC=function(t,e,n){return t*n.y-e*n.x},jsts.algorithm.MinimumDiameter.computeSegmentForLine=function(t,e,n){var o,r;return Math.abs(e)>Math.abs(t)?(o=new jsts.geom.Coordinate(0,n/e),r=new jsts.geom.Coordinate(1,n/e-t/e)):(o=new jsts.geom.Coordinate(n/t,0),r=new jsts.geom.Coordinate(n/t-e/t,1)),new jsts.geom.LineSegment(o,r)},jsts.algorithm.MinimumDiameter.prototype.getLength=function(){return this.computeMinimumDiameter(),this.minWidth},jsts.algorithm.MinimumDiameter.prototype.getWidthCoordinate=function(){return this.computeMinimumDiameter(),this.minWidthPt},jsts.algorithm.MinimumDiameter.prototype.getSupportingSegment=function(){this.computeMinimumDiameter();var t=[this.minBaseSeg.p0,this.minBaseSeg.p1];return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString(t)},jsts.algorithm.MinimumDiameter.prototype.getDiameter=function(){if(this.computeMinimumDiameter(),null===this.minWidthPt)return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString(null);var t=this.minBaseSeg.project(this.minWidthPt);return jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createLineString([t,this.minWidthPt])},jsts.algorithm.MinimumDiameter.prototype.computeMinimumDiameter=function(){if(null===this.minWidthPt)if(jsts.algorithm.MinimumDiameter.isConvex)this.computeWidthConvex(jsts.algorithm.MinimumDiameter.inputGeom);else{var t=new jsts.algorithm.ConvexHull(jsts.algorithm.MinimumDiameter.inputGeom).getConvexHull();this.computeWidthConvex(t)}},jsts.algorithm.MinimumDiameter.prototype.computeWidthConvex=function(t){this.convexHullPts=t instanceof jsts.geom.Polygon?t.getExteriorRing().getCoordinates():t.getCoordinates(),0===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=null,this.minBaseSeg=null):1===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[0]):2===this.convexHullPts.length||3===this.convexHullPts.length?(this.minWidth=0,this.minWidthPt=this.convexHullPts[0],this.minBaseSeg.p0=this.convexHullPts[0],this.minBaseSeg.p1=this.convexHullPts[1]):this.computeConvexRingMinDiameter(this.convexHullPts)},jsts.algorithm.MinimumDiameter.prototype.computeConvexRingMinDiameter=function(t){this.minWidth=Number.MAX_VALUE;for(var e=1,n=new jsts.geom.LineSegment,o=0;o<t.length-1;o++)n.p0=t[o],n.p1=t[o+1],e=this.findMaxPerpDistance(t,n,e)},jsts.algorithm.MinimumDiameter.prototype.findMaxPerpDistance=function(t,e,n){for(var o=e.distancePerpendicular(t[n]),r=o,i=n,s=i;r>=o;)o=r,i=s,s=jsts.algorithm.MinimumDiameter.nextIndex(t,i),r=e.distancePerpendicular(t[s]);return o<this.minWidth&&(this.minPtIndex=i,this.minWidth=o,this.minWidthPt=t[this.minPtIndex],this.minBaseSeg=new jsts.geom.LineSegment(e)),i},jsts.algorithm.MinimumDiameter.prototype.getMinimumRectangle=function(){if(this.computeMinimumDiameter(),0===this.minWidth)return this.minBaseSeg.p0.equals2D(this.minBaseSeg.p1)?jsts.algorithm.MinimumDiameter.inputGeom.getFactory().createPoint(this.minBaseSeg.p0):this.minBaseSeg.toGeometry(jsts.algorithm.MinimumDiameter.inputGeom.ge
|
||
|
},jsts.triangulate.quadedge.QuadEdge.prototype.toString=function(){var t,e;return t=this.vertex.getCoordinate(),e=this.dest().getCoordinate(),jsts.io.WKTWriter.toLineString(t,e)}}(),function(){var t=jsts.util.Assert;jsts.geomgraph.EdgeEnd=function(t,e,n,o){this.edge=t,e&&n&&this.init(e,n),o&&(this.label=o||null)},jsts.geomgraph.EdgeEnd.prototype.edge=null,jsts.geomgraph.EdgeEnd.prototype.label=null,jsts.geomgraph.EdgeEnd.prototype.node=null,jsts.geomgraph.EdgeEnd.prototype.p0=null,jsts.geomgraph.EdgeEnd.prototype.p1=null,jsts.geomgraph.EdgeEnd.prototype.dx=null,jsts.geomgraph.EdgeEnd.prototype.dy=null,jsts.geomgraph.EdgeEnd.prototype.quadrant=null,jsts.geomgraph.EdgeEnd.prototype.init=function(e,n){this.p0=e,this.p1=n,this.dx=n.x-e.x,this.dy=n.y-e.y,this.quadrant=jsts.geomgraph.Quadrant.quadrant(this.dx,this.dy),t.isTrue(!(0===this.dx&&0===this.dy),"EdgeEnd with identical endpoints found")},jsts.geomgraph.EdgeEnd.prototype.getEdge=function(){return this.edge},jsts.geomgraph.EdgeEnd.prototype.getLabel=function(){return this.label},jsts.geomgraph.EdgeEnd.prototype.getCoordinate=function(){return this.p0},jsts.geomgraph.EdgeEnd.prototype.getDirectedCoordinate=function(){return this.p1},jsts.geomgraph.EdgeEnd.prototype.getQuadrant=function(){return this.quadrant},jsts.geomgraph.EdgeEnd.prototype.getDx=function(){return this.dx},jsts.geomgraph.EdgeEnd.prototype.getDy=function(){return this.dy},jsts.geomgraph.EdgeEnd.prototype.setNode=function(t){this.node=t},jsts.geomgraph.EdgeEnd.prototype.getNode=function(){return this.node},jsts.geomgraph.EdgeEnd.prototype.compareTo=function(t){return this.compareDirection(t)},jsts.geomgraph.EdgeEnd.prototype.compareDirection=function(t){return this.dx===t.dx&&this.dy===t.dy?0:this.quadrant>t.quadrant?1:this.quadrant<t.quadrant?-1:jsts.algorithm.CGAlgorithms.computeOrientation(t.p0,t.p1,this.p1)},jsts.geomgraph.EdgeEnd.prototype.computeLabel=function(){}}(),jsts.operation.buffer.RightmostEdgeFinder=function(){},jsts.operation.buffer.RightmostEdgeFinder.prototype.minIndex=-1,jsts.operation.buffer.RightmostEdgeFinder.prototype.minCoord=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.minDe=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.orientedDe=null,jsts.operation.buffer.RightmostEdgeFinder.prototype.getEdge=function(){return this.orientedDe},jsts.operation.buffer.RightmostEdgeFinder.prototype.getCoordinate=function(){return this.minCoord},jsts.operation.buffer.RightmostEdgeFinder.prototype.findEdge=function(t){for(var e=t.iterator();e.hasNext();){var n=e.next();n.isForward()&&this.checkForRightmostCoordinate(n)}jsts.util.Assert.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;var o=this.getRightmostSide(this.minDe,this.minIndex);o==jsts.geomgraph.Position.LEFT&&(this.orientedDe=this.minDe.getSym())},jsts.operation.buffer.RightmostEdgeFinder.prototype.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)},jsts.operation.buffer.RightmostEdgeFinder.prototype.findRightmostEdgeAtVertex=function(){var t=this.minDe.getEdge().getCoordinates();jsts.util.Assert.isTrue(this.minIndex>0&&this.minIndex<t.length,"rightmost point expected to be interior vertex of edge");var e=t[this.minIndex-1],n=t[this.minIndex+1],o=jsts.algorithm.CGAlgorithms.computeOrientation(this.minCoord,n,e),r=!1;e.y<this.minCoord.y&&n.y<this.minCoord.y&&o===jsts.algorithm.CGAlgorithms.COUNTERCLOCKWISE?r=!0:e.y>this.minCoord.y&&n.y>this.minCoord.y&&o===jsts.algorithm.CGAlgorithms.CLOCKWISE&&(r=!0),r&&(this.minIndex=this.minIndex-1)},jsts.operation.buffer.RightmostEdgeFinder.prototype.checkForRightmostCoordinate=function(t){for(var e=t.getEdge().getCoordinates(),n=0;n<e.length-1;n++)(null===this.minCoord||e[n].x>this.minCoord.x)&&(this.minDe=t,this.minIndex=n,this.minCoo
|
||
|
return n},jsts.geomgraph.DirectedEdge.prototype.computeDirectedLabel=function(){this.label=new jsts.geomgraph.Label(this.edge.getLabel()),this._isForward||this.label.flip()},jsts.geomgraph.DirectedEdge.prototype.setEdgeDepths=function(t,n){var o=this.getEdge().getDepthDelta();this._isForward||(o=-o);var r=1;t===e.LEFT&&(r=-1);var i=e.opposite(t),s=o*r,a=n+s;this.setDepth(t,n),this.setDepth(i,a)}}(),jsts.operation.distance.DistanceOp=function(t,e,n){this.ptLocator=new jsts.algorithm.PointLocator,this.geom=[],this.geom[0]=t,this.geom[1]=e,this.terminateDistance=n},jsts.operation.distance.DistanceOp.prototype.geom=null,jsts.operation.distance.DistanceOp.prototype.terminateDistance=0,jsts.operation.distance.DistanceOp.prototype.ptLocator=null,jsts.operation.distance.DistanceOp.prototype.minDistanceLocation=null,jsts.operation.distance.DistanceOp.prototype.minDistance=Number.MAX_VALUE,jsts.operation.distance.DistanceOp.distance=function(t,e){var n=new jsts.operation.distance.DistanceOp(t,e,0);return n.distance()},jsts.operation.distance.DistanceOp.isWithinDistance=function(t,e,n){var o=new jsts.operation.distance.DistanceOp(t,e,n);return o.distance()<=n},jsts.operation.distance.DistanceOp.nearestPoints=function(t,e){var n=new jsts.operation.distance.DistanceOp(t,e,0);return n.nearestPoints()},jsts.operation.distance.DistanceOp.prototype.distance=function(){if(null===this.geom[0]||null===this.geom[1])throw new jsts.error.IllegalArgumentError("null geometries are not supported");return this.geom[0].isEmpty()||this.geom[1].isEmpty()?0:(this.computeMinDistance(),this.minDistance)},jsts.operation.distance.DistanceOp.prototype.nearestPoints=function(){this.computeMinDistance();var t=[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()];return t},jsts.operation.distance.DistanceOp.prototype.nearestLocations=function(){return this.computeMinDistance(),this.minDistanceLocation},jsts.operation.distance.DistanceOp.prototype.updateMinDistance=function(t,e){null!==t[0]&&(e?(this.minDistanceLocation[0]=t[1],this.minDistanceLocation[1]=t[0]):(this.minDistanceLocation[0]=t[0],this.minDistanceLocation[1]=t[1]))},jsts.operation.distance.DistanceOp.prototype.computeMinDistance=function(){return arguments.length>0?void this.computeMinDistance2.apply(this,arguments):void(null===this.minDistanceLocation&&(this.minDistanceLocation=[],this.computeContainmentDistance(),this.minDistance<=this.terminateDistance||this.computeFacetDistance()))},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance=function(){if(2===arguments.length)return void this.computeContainmentDistance2.apply(this,arguments);if(3===arguments.length&&!arguments[0]instanceof jsts.operation.distance.GeometryLocation)return void this.computeContainmentDistance3.apply(this,arguments);if(3===arguments.length)return void this.computeContainmentDistance4.apply(this,arguments);var t=[];this.computeContainmentDistance2(0,t),this.minDistance<=this.terminateDistance||this.computeContainmentDistance2(1,t)},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance2=function(t,e){var n=1-t,o=jsts.geom.util.PolygonExtracter.getPolygons(this.geom[t]);if(o.length>0){var r=jsts.operation.distance.ConnectedElementLocationFilter.getLocations(this.geom[n]);if(this.computeContainmentDistance3(r,o,e),this.minDistance<=this.terminateDistance)return this.minDistanceLocation[n]=e[0],void(this.minDistanceLocation[t]=e[1])}},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance3=function(t,e,n){for(var o=0;o<t.length;o++)for(var r=t[o],i=0;i<e.length;i++)if(this.computeContainmentDistance4(r,e[i],n),this.minDistance<=this.terminateDistance)return},jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance4=function(t,e,n){var o=t.getCoordinate();return jsts.geom.Location.EXTERIOR!==this.ptLocator.locate(o,e)?(this.minDistance=0,n[0]=t,void(n[1]=new jsts.operation.distance.GeometryLocation(e,o))):void 0},jsts.operation.distance.DistanceOp.prototype.computeFacetDistance=function(){var t=[],e=jsts.geom.util.LinearC
|
||
|
return e},jsts.geom.CoordinateArrays.copyDeep2=function(t,e,n,o,r){for(var i=0;r>i;i++)n[o+i]=new jsts.geom.Coordinate(t[e+i])},jsts.geom.CoordinateArrays.removeRepeatedPoints=function(t){var e;return this.hasRepeatedPoints(t)?(e=new jsts.geom.CoordinateList(t,!1),e.toCoordinateArray()):t},jsts.geom.CoordinateArrays.hasRepeatedPoints=function(t){var e;for(e=1;e<t.length;e++)if(t[e-1].equals(t[e]))return!0;return!1},jsts.geom.CoordinateArrays.ptNotInList=function(t,e){for(var n=0;n<t.length;n++){var o=t[n];if(jsts.geom.CoordinateArrays.indexOf(o,e)<0)return o}return null},jsts.geom.CoordinateArrays.increasingDirection=function(t){for(var e=0;e<parseInt(t.length/2);e++){var n=t.length-1-e,o=t[e].compareTo(t[n]);if(0!=o)return o}return 1},jsts.geom.CoordinateArrays.minCoordinate=function(t){for(var e=null,n=0;n<t.length;n++)(null===e||e.compareTo(t[n])>0)&&(e=t[n]);return e},jsts.geom.CoordinateArrays.scroll=function(t,e){var n=jsts.geom.CoordinateArrays.indexOf(e,t);if(!(0>n)){var o=t.slice(n).concat(t.slice(0,n));for(n=0;n<o.length;n++)t[n]=o[n]}},jsts.geom.CoordinateArrays.indexOf=function(t,e){for(var n=0;n<e.length;n++)if(t.equals(e[n]))return n;return-1},jsts.operation.overlay.MinimalEdgeRing=function(t,e){jsts.geomgraph.EdgeRing.call(this,t,e)},jsts.operation.overlay.MinimalEdgeRing.prototype=new jsts.geomgraph.EdgeRing,jsts.operation.overlay.MinimalEdgeRing.constructor=jsts.operation.overlay.MinimalEdgeRing,jsts.operation.overlay.MinimalEdgeRing.prototype.getNext=function(t){return t.getNextMin()},jsts.operation.overlay.MinimalEdgeRing.prototype.setEdgeRing=function(t,e){t.setMinEdgeRing(e)},jsts.triangulate.DelaunayTriangulationBuilder=function(){this.siteCoords=null,this.tolerance=0,this.subdiv=null},jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates=function(t){if(void 0===t||null===t)return new jsts.geom.CoordinateList([],!1).toArray();var e=t.getCoordinates();return jsts.triangulate.DelaunayTriangulationBuilder.unique(e)},jsts.triangulate.DelaunayTriangulationBuilder.unique=function(t){t.sort(function(t,e){return t.compareTo(e)});var e=new jsts.geom.CoordinateList(t,!1);return e.toArray()},jsts.triangulate.DelaunayTriangulationBuilder.toVertices=function(t){var e,n=new Array(t.length),o=0,r=t.length;for(o;r>o;o++)e=t[o],n[o]=new jsts.triangulate.quadedge.Vertex(e);return n},jsts.triangulate.DelaunayTriangulationBuilder.envelope=function(t){var e=new jsts.geom.Envelope,n=0,o=t.length;for(n;o>n;n++)e.expandToInclude(t[n]);return e},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSites=function(){var t=arguments[0];t instanceof jsts.geom.Geometry||t instanceof jsts.geom.Coordinate||t instanceof jsts.geom.Point||t instanceof jsts.geom.MultiPoint||t instanceof jsts.geom.LineString||t instanceof jsts.geom.MultiLineString||t instanceof jsts.geom.LinearRing||t instanceof jsts.geom.Polygon||t instanceof jsts.geom.MultiPolygon?this.setSitesFromGeometry(t):this.setSitesFromCollection(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSitesFromGeometry=function(t){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.extractUniqueCoordinates(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setSitesFromCollection=function(t){this.siteCoords=jsts.triangulate.DelaunayTriangulationBuilder.unique(t)},jsts.triangulate.DelaunayTriangulationBuilder.prototype.setTolerance=function(t){this.tolerance=t},jsts.triangulate.DelaunayTriangulationBuilder.prototype.create=function(){if(null===this.subdiv){var t,e,n;t=jsts.triangulate.DelaunayTriangulationBuilder.envelope(this.siteCoords),e=jsts.triangulate.DelaunayTriangulationBuilder.toVertices(this.siteCoords),this.subdiv=new jsts.triangulate.quadedge.QuadEdgeSubdivision(t,this.tolerance),n=new jsts.triangulate.IncrementalDelaunayTriangulator(this.subdiv),n.insertSites(e)}},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getSubdivision=function(){return this.create(),this.subdiv},jsts.triangulate.DelaunayTriangulationBuilder.prototype.getEdges=function(t){return this.create(),this.subdiv.getEdges(t)},jsts.triangulate.D
|
||
|
},jsts.operation.predicate.RectangleIntersects.intersects=function(t,e){var n=new jsts.operation.predicate.RectangleIntersects(t);return n.intersects(e)},jsts.operation.predicate.RectangleIntersects.prototype.rectangle=null,jsts.operation.predicate.RectangleIntersects.prototype.rectEnv=null,jsts.operation.predicate.RectangleIntersects.prototype.intersects=function(o){if(!this.rectEnv.intersects(o.getEnvelopeInternal()))return!1;var r=new t(this.rectEnv);if(r.applyTo(o),r.intersects())return!0;var i=new e(rectangle);if(i.applyTo(o),i.containsPoint())return!0;var s=new n(rectangle);return s.applyTo(o),s.intersects()?!0:!1}}(),jsts.operation.buffer.BufferBuilder=function(t){this.bufParams=t,this.edgeList=new jsts.geomgraph.EdgeList},jsts.operation.buffer.BufferBuilder.depthDelta=function(t){var e=t.getLocation(0,jsts.geomgraph.Position.LEFT),n=t.getLocation(0,jsts.geomgraph.Position.RIGHT);return e===jsts.geom.Location.INTERIOR&&n===jsts.geom.Location.EXTERIOR?1:e===jsts.geom.Location.EXTERIOR&&n===jsts.geom.Location.INTERIOR?-1:0},jsts.operation.buffer.BufferBuilder.prototype.bufParams=null,jsts.operation.buffer.BufferBuilder.prototype.workingPrecisionModel=null,jsts.operation.buffer.BufferBuilder.prototype.workingNoder=null,jsts.operation.buffer.BufferBuilder.prototype.geomFact=null,jsts.operation.buffer.BufferBuilder.prototype.graph=null,jsts.operation.buffer.BufferBuilder.prototype.edgeList=null,jsts.operation.buffer.BufferBuilder.prototype.setWorkingPrecisionModel=function(t){this.workingPrecisionModel=t},jsts.operation.buffer.BufferBuilder.prototype.setNoder=function(t){this.workingNoder=t},jsts.operation.buffer.BufferBuilder.prototype.buffer=function(t,e){var n=this.workingPrecisionModel;null===n&&(n=t.getPrecisionModel()),this.geomFact=t.getFactory();var o=new jsts.operation.buffer.OffsetCurveBuilder(n,this.bufParams),r=new jsts.operation.buffer.OffsetCurveSetBuilder(t,e,o),i=r.getCurves();if(i.size()<=0)return this.createEmptyResultGeometry();this.computeNodedEdges(i,n),this.graph=new jsts.geomgraph.PlanarGraph(new jsts.operation.overlay.OverlayNodeFactory),this.graph.addEdges(this.edgeList.getEdges());var s=this.createSubgraphs(this.graph),a=new jsts.operation.overlay.PolygonBuilder(this.geomFact);this.buildSubgraphs(s,a);var u=a.getPolygons();if(u.size()<=0)return this.createEmptyResultGeometry();var p=this.geomFact.buildGeometry(u);return p},jsts.operation.buffer.BufferBuilder.prototype.getNoder=function(t){if(null!==this.workingNoder)return this.workingNoder;var e=new jsts.noding.MCIndexNoder,n=new jsts.algorithm.RobustLineIntersector;return n.setPrecisionModel(t),e.setSegmentIntersector(new jsts.noding.IntersectionAdder(n)),e},jsts.operation.buffer.BufferBuilder.prototype.computeNodedEdges=function(t,e){var n=this.getNoder(e);n.computeNodes(t);for(var o=n.getNodedSubstrings(),r=o.iterator();r.hasNext();){var i=r.next(),s=i.getData(),a=new jsts.geomgraph.Edge(i.getCoordinates(),new jsts.geomgraph.Label(s));this.insertUniqueEdge(a)}},jsts.operation.buffer.BufferBuilder.prototype.insertUniqueEdge=function(t){var e=this.edgeList.findEqualEdge(t);if(null!=e){var n=e.getLabel(),o=t.getLabel();e.isPointwiseEqual(t)||(o=new jsts.geomgraph.Label(t.getLabel()),o.flip()),n.merge(o);var r=jsts.operation.buffer.BufferBuilder.depthDelta(o),i=e.getDepthDelta(),s=i+r;e.setDepthDelta(s)}else this.edgeList.add(t),t.setDepthDelta(jsts.operation.buffer.BufferBuilder.depthDelta(t.getLabel()))},jsts.operation.buffer.BufferBuilder.prototype.createSubgraphs=function(t){for(var e=[],n=t.getNodes().iterator();n.hasNext();){var o=n.next();if(!o.isVisited()){var r=new jsts.operation.buffer.BufferSubgraph;r.create(o),e.push(r)}}var i=function(t,e){return t.compareTo(e)};return e.sort(i),e.reverse(),e},jsts.operation.buffer.BufferBuilder.prototype.buildSubgraphs=function(t,e){for(var n=[],o=0;o<t.length;o++){var r=t[o],i=r.getRightmostCoordinate(),s=new jsts.operation.buffer.SubgraphDepthLocater(n),a=s.getDepth(i);r.computeDepth(a),r.findResultEdges(),n.push(r),e.add(r.getDirectedEdges(),r.getNodes())}},jsts.operation.buffer.BufferBuilder
|
||
|
},jsts.operation.relate.EdgeEndBundle.prototype.computeLabelSide=function(t,e){for(var n=0;n<this.edgeEnds.length;n++){var o=this.edgeEnds[n];if(o.getLabel().isArea()){var r=o.getLabel().getLocation(t,e);if(r===jsts.geom.Location.INTERIOR)return void this.label.setLocation(t,e,jsts.geom.Location.INTERIOR);r===jsts.geom.Location.EXTERIOR&&this.label.setLocation(t,e,jsts.geom.Location.EXTERIOR)}}},jsts.operation.relate.EdgeEndBundle.prototype.updateIM=function(t){jsts.geomgraph.Edge.updateIM(this.label,t)},jsts.index.kdtree.KdTree=function(t){var e=0;void 0!==t&&(e=t),this.root=null,this.last=null,this.numberOfNodes=0,this.tolerance=e},jsts.index.kdtree.KdTree.prototype.insert=function(){return 1===arguments.length?this.insertCoordinate.apply(this,arguments[0]):this.insertWithData.apply(this,arguments[0],arguments[1])},jsts.index.kdtree.KdTree.prototype.insertCoordinate=function(t){return this.insertWithData(t,null)},jsts.index.kdtree.KdTree.prototype.insertWithData=function(t,e){if(null===this.root)return this.root=new jsts.index.kdtree.KdNode(t,e),this.root;for(var n=this.root,o=this.root,r=!0,i=!0;n!==last;){if(i=r?t.x<n.getX():t.y<n.getY(),o=n,n=i?n.getLeft():n.getRight(),null!==n){var s=t.distance(n.getCoordinate())<=this.tolerance;if(s)return n.increment(),n}r=!r}this.numberOfNodes=numberOfNodes+1;var a=new jsts.index.kdtree.KdNode(t,e);return a.setLeft(this.last),a.setRight(this.last),i?o.setLeft(a):o.setRight(a),a},jsts.index.kdtree.KdTree.prototype.queryNode=function(t,e,n,o,r){if(t!==e){var i,s,a;o?(i=n.getMinX(),s=n.getMaxX(),a=t.getX()):(i=n.getMinY(),s=n.getMaxY(),a=t.getY());var u=a>i,p=s>=a;u&&this.queryNode(t.getLeft(),e,n,!o,r),n.contains(t.getCoordinate())&&r.add(t),p&&this.queryNode(t.getRight(),e,n,!o,r)}},jsts.index.kdtree.KdTree.prototype.query=function(){return 1===arguments.length?this.queryByEnvelope.apply(this,arguments[0]):this.queryWithArray.apply(this,arguments[0],arguments[1])},jsts.index.kdtree.KdTree.prototype.queryByEnvelope=function(t){var e=[];return this.queryNode(this.root,this.last,t,!0,e),e},jsts.index.kdtree.KdTree.prototype.queryWithArray=function(t,e){this.queryNode(this.root,this.last,t,!0,e)},jsts.geom.Triangle=function(t,e,n){this.p0=t,this.p1=e,this.p2=n},jsts.geom.Triangle.isAcute=function(t,e,n){return jsts.algorithm.Angle.isAcute(t,e,n)&&jsts.algorithm.Angle.isAcute(e,n,t)&&jsts.algorithm.Angle.isAcute(n,t,e)?!0:!1},jsts.geom.Triangle.perpendicularBisector=function(t,e){var n,o,r,i;return n=e.x-t.x,o=e.y-t.y,r=new jsts.algorithm.HCoordinate(t.x+n/2,t.y+o/2,1),i=new jsts.algorithm.HCoordinate(t.x-o+n/2,t.y+n+o/2,1),new jsts.algorithm.HCoordinate(r,i)},jsts.geom.Triangle.circumcentre=function(t,e,n){var o,r,i,s,a,u,p,g,l,h,d;return o=n.x,r=n.y,i=t.x-o,s=t.y-r,a=e.x-o,u=e.y-r,p=2*jsts.geom.Triangle.det(i,s,a,u),g=jsts.geom.Triangle.det(s,i*i+s*s,u,a*a+u*u),l=jsts.geom.Triangle.det(i,i*i+s*s,a,a*a+u*u),h=o-g/p,d=r+l/p,new jsts.geom.Coordinate(h,d)},jsts.geom.Triangle.det=function(t,e,n,o){return t*o-e*n},jsts.geom.Triangle.inCentre=function(t,e,n){var o,r,i,s,a,u;return o=e.distance(n),r=t.distance(n),i=t.distance(e),s=o+r+i,a=(o*t.x+r*e.x+i*n.x)/s,u=(o*t.y+r*e.y+i*n.y)/s,new jsts.geom.Coordinate(a,u)},jsts.geom.Triangle.centroid=function(t,e,n){var o,r;return o=(t.x+e.x+n.x)/3,r=(t.y+e.y+n.y)/3,new jsts.geom.Coordinate(o,r)},jsts.geom.Triangle.longestSideLength=function(t,e,n){var o,r,i,s;return o=t.distance(e),r=e.distance(n),i=n.distance(t),s=o,r>s&&(s=r),i>s&&(s=i),s},jsts.geom.Triangle.angleBisector=function(t,e,n){var o,r,i,s,a,u;return o=e.distance(t),r=e.distance(n),i=o/(o+r),s=n.x-t.x,a=n.y-t.y,u=new jsts.geom.Coordinate(t.x+i*s,t.y+i*a)},jsts.geom.Triangle.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)},jsts.geom.Triangle.signedArea=function(t,e,n){return((n.x-t.x)*(e.y-t.y)-(e.x-t.x)*(n.y-t.y))/2},jsts.geom.Triangle.prototype.inCentre=function(){return jsts.geom.Triangle.inCentre(this.p0,this.p1,this.p2)},jsts.noding.OrientedCoordinateArray=function(t){this.pts=t,this._orientation=jsts.noding.OrientedCoordinateArray.orientation(t)},
|
||
|
},l.prototype.isEmpty=l.prototype.g,l.prototype.size=function(){return this.a.length},l.prototype.size=l.prototype.size,l.prototype.h=function(){for(var t=[],e=0,n=this.a.length;n>e;e++)t.push(this.a[e]);return t},l.prototype.toArray=l.prototype.h,l.prototype.remove=function(t){for(var e=!1,n=0,o=this.a.length;o>n;n++)if(this.a[n]===t){this.a.splice(n,1),e=!0;break}return e},l.prototype.remove=l.prototype.remove,e("$jscomp.scope.Iterator_",h),h.prototype.j=null,h.prototype.b=0,h.prototype.next=function(){if(this.b===this.j.size())throw new p;return this.j.get(this.b++)},h.prototype.next=h.prototype.next,h.prototype.c=function(){return this.b<this.j.size()?!0:!1},h.prototype.hasNext=h.prototype.c,h.prototype.remove=function(){throw new g},h.prototype.remove=h.prototype.remove,e("javascript.util.Arrays",d),d.sort=function(){var t,e,n,o=arguments[0];if(1===arguments.length)o.sort();else if(2===arguments.length)e=arguments[1],n=function(t,n){return e.compare(t,n)},o.sort(n);else if(3===arguments.length)for(t=o.slice(arguments[1],arguments[2]),t.sort(),n=o.slice(0,arguments[1]).concat(t,o.slice(arguments[2],o.length)),o.splice(0,o.length),t=0;t<n.length;t++)o.push(n[t]);else if(4===arguments.length)for(t=o.slice(arguments[1],arguments[2]),e=arguments[3],n=function(t,n){return e.compare(t,n)},t.sort(n),n=o.slice(0,arguments[1]).concat(t,o.slice(arguments[2],o.length)),o.splice(0,o.length),t=0;t<n.length;t++)o.push(n[t])},d.asList=function(t){for(var e=new l,n=0,o=t.length;o>n;n++)e.add(t[n]);return e},n(c,u),e("javascript.util.HashMap",c),c.prototype.i=null,c.prototype.get=function(t){return this.i[t]||null},c.prototype.get=c.prototype.get,c.prototype.put=function(t,e){return this.i[t]=e},c.prototype.put=c.prototype.put,c.prototype.m=function(){var t,e=new l;for(t in this.i)this.i.hasOwnProperty(t)&&e.add(this.i[t]);return e},c.prototype.values=c.prototype.m,c.prototype.size=function(){return this.m().size()},c.prototype.size=c.prototype.size,n(f,s),e("javascript.util.Set",f),n(m,f),e("javascript.util.HashSet",m),m.prototype.a=null,m.prototype.contains=function(t){for(var e=0,n=this.a.length;n>e;e++)if(this.a[e]===t)return!0;return!1},m.prototype.contains=m.prototype.contains,m.prototype.add=function(t){return this.contains(t)?!1:(this.a.push(t),!0)},m.prototype.add=m.prototype.add,m.prototype.e=function(t){for(t=t.f();t.c();)this.add(t.next());return!0},m.prototype.addAll=m.prototype.e,m.prototype.remove=function(){throw new g},m.prototype.remove=m.prototype.remove,m.prototype.size=function(){return this.a.length},m.prototype.g=function(){return 0===this.a.length},m.prototype.isEmpty=m.prototype.g,m.prototype.h=function(){for(var t=[],e=0,n=this.a.length;n>e;e++)t.push(this.a[e]);return t},m.prototype.toArray=m.prototype.h,m.prototype.f=function(){return new y(this)},m.prototype.iterator=m.prototype.f,e("$jscomp.scope.Iterator_$1",y),y.prototype.k=null,y.prototype.b=0,y.prototype.next=function(){if(this.b===this.k.size())throw new p;return this.k.a[this.b++]},y.prototype.next=y.prototype.next,y.prototype.c=function(){return this.b<this.k.size()?!0:!1},y.prototype.hasNext=y.prototype.c,y.prototype.remove=function(){throw new g},y.prototype.remove=y.prototype.remove,n(j,u),e("javascript.util.SortedMap",j),n(v,f),e("javascript.util.SortedSet",v),n(E,a),e("javascript.util.Stack",E),E.prototype.a=null,E.prototype.push=function(t){return this.a.push(t),t},E.prototype.push=E.prototype.push,E.prototype.pop=function(){if(0===this.a.length)throw new o;return this.a.pop()},E.prototype.pop=E.prototype.pop,E.prototype.o=function(){if(0===this.a.length)throw new o;return this.a[this.a.length-1]},E.prototype.peek=E.prototype.o,E.prototype.empty=function(){return 0===this.a.length?!0:!1},E.prototype.empty=E.prototype.empty,E.prototype.g=function(){return this.empty()},E.prototype.isEmpty=E.prototype.g,E.prototype.search=function(t){return this.a.indexOf(t)},E.prototype.search=E.prototype.search,E.prototype.size=function(){return this.a.length},E.prototype.size=E.prototype.size,E.prototype.h=function(){for(var t=[],e=0,n=this.a.length;n>e;e+
|
||
|
void 0===n[o][r]&&(n[o][r]={}),void 0===n[o][r][i]&&(n[o][r][i]=0),n[o][r][t[r]]++}e++},t.score=function(t){var o,r={};for(var i in t){var s=t[i];for(o in n)void 0===r[o]&&(r[o]={}),r[o][i+"_"+s]=n[o][i]?(n[o][i][s]||0)/e:0}var a={};for(o in r)for(var u in r[o])void 0===a[o]&&(a[o]=0),a[o]+=r[o][u];return a},t}function r(t){for(var e=0,n=0;n<t.length;n++)e+=t[n];return e}function i(t){return 0===t.length?null:r(t)/t.length}function s(t){if(0===t.length)return null;for(var e=1,n=0;n<t.length;n++){if(t[n]<=0)return null;e*=t[n]}return Math.pow(e,1/t.length)}function a(t){if(0===t.length)return null;for(var e=0,n=0;n<t.length;n++){if(t[n]<=0)return null;e+=1/t[n]}return t.length/e}function u(t){for(var e,n=0;n<t.length;n++)(t[n]<e||void 0===e)&&(e=t[n]);return e}function p(t){for(var e,n=0;n<t.length;n++)(t[n]>e||void 0===e)&&(e=t[n]);return e}function g(t){if(0===t.length)return null;for(var e=i(t),n=[],o=0;o<t.length;o++)n.push(Math.pow(t[o]-e,2));return i(n)}function l(t){return 0===t.length?null:Math.sqrt(g(t))}function h(t,e){for(var n=i(t),o=0,r=0;r<t.length;r++)o+=Math.pow(t[r]-n,e);return o}function d(t){if(t.length<=1)return null;var e=h(t,2);return e/(t.length-1)}function c(t){return t.length<=1?null:Math.sqrt(d(t))}function f(t,e){if(t.length<=1||t.length!=e.length)return null;for(var n=i(t),o=i(e),r=0,s=0;s<t.length;s++)r+=(t[s]-n)*(e[s]-o);return r/(t.length-1)}function m(t,e){var n=f(t,e),o=c(t),r=c(e);return null===n||null===o||null===r?null:n/o/r}function y(t){if(0===t.length)return null;var e=t.slice().sort(function(t,e){return t-e});if(e.length%2===1)return e[(e.length-1)/2];var n=e[e.length/2-1],o=e[e.length/2];return(n+o)/2}function j(t){if(0===t.length)return null;if(1===t.length)return t[0];for(var e,n=t.slice().sort(function(t,e){return t-e}),o=n[0],r=0,i=1,s=1;s<n.length+1;s++)n[s]!==o?(i>r&&(r=i,e=o),i=1,o=n[s]):i++;return e}function v(t,e){var n=i(t),o=l(t),r=Math.sqrt(t.length);return(n-e)/(o/r)}function E(t,e,n){var o=t.length,r=e.length;if(!o||!r)return null;n||(n=0);var s=i(t),a=i(e),u=((o-1)*d(t)+(r-1)*d(e))/(o+r-2);return(s-a-n)/Math.sqrt(u*(1/o+1/r))}function x(t,e){var n=[];if(0>=e)return null;for(var o=0;o<t.length;o+=e)n.push(t.slice(o,o+e));return n}function I(t,e){e=e||Math.random;for(var n,o,r=t.length;r>0;)o=Math.floor(e()*r--),n=t[r],t[r]=t[o],t[o]=n;return t}function S(t,e){return t=t.slice(),I(t.slice(),e)}function L(t,e,n){var o=S(t,n);return o.slice(0,e)}function C(t,e){if(0===t.length)return null;var n=t.slice().sort(function(t,e){return t-e});if(e.length){for(var o=[],r=0;r<e.length;r++)o[r]=N(n,e[r]);return o}return N(n,e)}function N(t,e){var n=t.length*e;return 0>e||e>1?null:1===e?t[t.length-1]:0===e?t[0]:n%1!==0?t[Math.ceil(n)-1]:t.length%2===0?(t[n-1]+t[n])/2:t[n]}function b(t){return 0===t.length?null:C(t,.75)-C(t,.25)}function P(t){if(!t||0===t.length)return null;for(var e=y(t),n=[],o=0;o<t.length;o++)n.push(Math.abs(t[o]-e));return y(n)}function R(t,e){var n,o,r=[],i=[],s=0;for(n=0;n<t.length+1;n++){var a=[],u=[];for(o=0;e+1>o;o++)a.push(0),u.push(0);r.push(a),i.push(u)}for(n=1;e+1>n;n++)for(r[1][n]=1,i[1][n]=0,o=2;o<t.length+1;o++)i[o][n]=1/0;for(var p=2;p<t.length+1;p++){for(var g=0,l=0,h=0,d=0,c=1;p+1>c;c++){var f=p-c+1,m=t[f-1];if(h++,g+=m,l+=m*m,s=l-g*g/h,d=f-1,0!==d)for(o=2;e+1>o;o++)i[p][o]>=s+i[d][o-1]&&(r[p][o]=f,i[p][o]=s+i[d][o-1])}r[p][1]=1,i[p][1]=s}return{lower_class_limits:r,variance_combinations:i}}function w(t,e,n){var o=t.length-1,r=[],i=n;for(r[n]=t[t.length-1],r[0]=t[0];i>1;)r[i-1]=t[e[o][i]-2],o=e[o][i]-1,i--;return r}function O(t,e){if(e>t.length)return null;t=t.slice().sort(function(t,e){return t-e});var n=R(t,e),o=n.lower_class_limits;return w(t,o,e)}function M(t){if(t.length<3)return null;var e=t.length,n=Math.pow(c(t),3),o=h(t,3);return e*o/((e-1)*(e-2)*n)}function A(t){var e=Math.abs(t),n=Math.floor(10*e),o=10*(Math.floor(100*e)/10-Math.floor(100*e/10)),r=Math.min(10*n+o,k.length-1);return t>=0?k[r]:+(1-k[r]).toFixed(4)}function T(t,e,n){return(t-e)/n}function D(t){if(0>t)return null;for(var e=1,n=2;t>=n;n++)e*=n;return e}function G(t){return
|
||
|
var f;if(c){var f=i(c);f.properties.dist=r(t,f,n)}g.properties.dist<u.properties.dist&&(u=g,u.properties.index=p),l.properties.dist<u.properties.dist&&(u=l,u.properties.index=p),f&&f.properties.dist<u.properties.dist&&(u=f,u.properties.index=p)}return u}function o(t,e,n,o,r,i,s,a){var u,p,g,l,h,d={x:null,y:null,onLine1:!1,onLine2:!1};return u=(a-i)*(n-t)-(s-r)*(o-e),0==u?null!=d.x&&null!=d.y?d:!1:(p=e-i,g=t-r,l=(s-r)*p-(a-i)*g,h=(n-t)*p-(o-e)*g,p=l/u,g=h/u,d.x=t+p*(n-t),d.y=e+p*(o-e),p>0&&1>p&&(d.onLine1=!0),g>0&&1>g&&(d.onLine2=!0),d.onLine1&&d.onLine2?[d.x,d.y]:!1)}var r=t("turf-distance"),i=t("turf-point"),s=(t("turf-linestring"),t("turf-bearing")),a=t("turf-destination");e.exports=function(t,e){var o;if("Feature"===t.type)o=t.geometry.coordinates;else{if("LineString"!==t.type)throw new Error("input must be a LineString Feature or Geometry");o=t.geometry.coordinates}return n(e,o)}},{"turf-bearing":13,"turf-destination":57,"turf-distance":60,"turf-linestring":90,"turf-point":102}],101:[function(t,e){function n(t,e,n,o,r,i){var s=Math.sqrt((r-n)*(r-n)+(i-o)*(i-o)),a=Math.sqrt((t-n)*(t-n)+(e-o)*(e-o)),u=Math.sqrt((r-t)*(r-t)+(i-e)*(i-e));return s===a+u?!0:void 0}var o=t("turf-featurecollection"),r=t("turf-center"),i=t("turf-distance"),s=t("turf-inside"),a=t("turf-explode");e.exports=function(t){"FeatureCollection"!=t.type&&("Feature"!=t.type&&(t={type:"Feature",geometry:t,properties:{}}),t=o([t]));for(var e=r(t),u=!1,p=0;!u&&p<t.features.length;){var g=t.features[p].geometry;if("Point"===g.type)e.geometry.coordinates[0]===g.coordinates[0]&&e.geometry.coordinates[1]===g.coordinates[1]&&(u=!0);else if("MultiPoint"===g.type)for(var l=!1,h=0;!l&&h<g.coordinates.length;)e.geometry.coordinates[0]===g.coordinates[h][0]&&e.geometry.coordinates[1]===g.coordinates[h][1]&&(u=!0,l=!0),h++;else if("LineString"===g.type)for(var d=!1,h=0;!d&&h<g.coordinates.length-1;){var c=e.geometry.coordinates[0],f=e.geometry.coordinates[1],m=g.coordinates[h][0],y=g.coordinates[h][1],j=g.coordinates[h+1][0],v=g.coordinates[h+1][1];n(c,f,m,y,j,v)&&(d=!0,u=!0),h++}else if("MultiLineString"===g.type)for(var E=!1,x=0;!E&&x<g.coordinates.length;){for(var d=!1,h=0,I=g.coordinates[x];!d&&h<I.length-1;){var c=e.geometry.coordinates[0],f=e.geometry.coordinates[1],m=I[h][0],y=I[h][1],j=I[h+1][0],v=I[h+1][1];n(c,f,m,y,j,v)&&(d=!0,u=!0),h++}x++}else if("Polygon"===g.type||"MultiPolygon"===g.type){var S={type:"Feature",geometry:g,properties:{}};s(e,S)&&(u=!0)}p++}if(u)return e;for(var L=o([]),p=0;p<t.features.length;p++)L.features=L.features.concat(a(t.features[p]).features);for(var C,N=1/0,p=0;p<L.features.length;p++){var b=i(e,L.features[p],"miles");N>b&&(N=b,C=L.features[p])}return C}},{"turf-center":21,"turf-distance":60,"turf-explode":68,"turf-featurecollection":72,"turf-inside":76}],102:[function(t,e){var n=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};e.exports=function(t,e){if(!n(t))throw new Error("Coordinates must be an array");if(t.length<2)throw new Error("Coordinates must be at least 2 numbers long");return{type:"Feature",geometry:{type:"Point",coordinates:t},properties:e||{}}}},{}],103:[function(t,e){e.exports=function(t,e){if(null===t)throw new Error("No coordinates passed");for(var n=0;n<t.length;n++)for(var o=t[n],r=0;r<o[o.length-1].length;r++){if(o.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");if(o[o.length-1][r]!==o[0][r])throw new Error("First and last Position are not equivalent.")}var i={type:"Feature",geometry:{type:"Polygon",coordinates:t},properties:e};return i.properties||(i.properties={}),i}},{}],104:[function(t,e){var n=t("simple-statistics");e.exports=function(t,e,o){var r=[],i=[];return t.features.forEach(function(t){r.push(t.properties[e])}),o.forEach(function(t){i.push(n.quantile(r,.01*t))}),i}},{"simple-statistics":105}],105:[function(t,e,n){arguments[4][59][0].apply(n,arguments)},{dup:59}],106:[function(t,e){var n=t("geojson-random");e.exports=function(t,e,o){switch(o=o||{},e=e||1,t){case"point":case"points":case void 0:return n.point(e,o.bbox);
|