Commit e01e290248f20cde47910d8435bf7e39540f724a

Authored by Edmar Moretti
1 parent 67ddb62b

--no commit message

pacotes/jsts/compactajs.php
1 1 <?php
2 2 error_reporting(E_ALL);
3 3 include ('../packer/class.JavaScriptPacker.php');
4   -$lista = Array("src/jsts.js","src/jsts/geom.js","src/jsts/geom/Coordinate.js","src/jsts/planargraph.js","src/jsts/geomgraph.js","src/jsts/index.js","src/jsts/operation.js","src/jsts/triangulate.js","src/jsts/algorithm.js","src/jsts/io.js","src/jsts/Hashtable.js","src/jsts/index/index.js","src/jsts/planargraph/PlanarGraph.js","src/jsts/geomgraph/NodeMap.js","src/jsts/geomgraph/PlanarGraph.js","src/jsts/geomgraph/GeometryGraph.js","src/jsts/algorithm/CGAlgorithms.js","src/jsts/algorithm/LineIntersector.js","src/jsts/algorithm/CentroidArea.js","src/jsts/algorithm/HCoordinate.js","src/jsts/algorithm/Angle.js","src/jsts/algorithm/RayCrossingCounter.js","src/jsts/algorithm/BoundaryNodeRule.js","src/jsts/algorithm/RobustDeterminant.js","src/jsts/algorithm/CentroidLine.js","src/jsts/algorithm/CentralEndpointIntersector.js","src/jsts/algorithm/locate/PointOnGeometryLocator.js","src/jsts/algorithm/CentroidPoint.js","src/jsts/algorithm/RobustLineIntersector.js","src/jsts/algorithm/PointLocator.js","src/jsts/index/quadtree.js","src/jsts/index/quadtree/Quadtree.js","src/jsts/index/quadtree/NodeBase.js","src/jsts/index/quadtree/Node.js","src/jsts/index/quadtree/Key.js","src/jsts/index/quadtree/Root.js","src/jsts/index/ArrayListVisitor.js","src/jsts/index/kdtree.js","src/jsts/index/DoubleBits.js","src/jsts/index/IntervalSize.js","src/jsts/index/kdtree/KdTree.js","src/jsts/index/kdtree/KdNode.js","src/jsts/io/WKTWriter.js","src/jsts/io/WKTReader.js","src/jsts/geom/Location.js","src/jsts/geom/Polygon.js","src/jsts/geom/util.js","src/jsts/geom/Point.js","src/jsts/geom/Envelope.js","src/jsts/geom/LineString.js","src/jsts/geom/MultiPoint.js","src/jsts/geom/Triangle.js","src/jsts/geom/GeometryComponentFilter.js","src/jsts/geom/Dimension.js","src/jsts/geom/CoordinateList.js","src/jsts/geom/GeometryFilter.js","src/jsts/geom/MultiLineString.js","src/jsts/geom/LineSegment.js","src/jsts/geom/IntersectionMatrix.js","src/jsts/geom/util/LinearComponentExtracter.js","src/jsts/geom/util/PolygonExtracter.js","src/jsts/geom/util/PointExtracter.js","src/jsts/geom/LinearRing.js","src/jsts/geom/MultiPolygon.js","src/jsts/geom/Geometry.js","src/jsts/geom/PrecisionModel.js","src/jsts/geom/CoordinateArrays.js","src/jsts/geom/GeometryFactory.js","src/jsts/geom/GeometryCollection.js","src/jsts/operation/distance.js","src/jsts/operation/GeometryGraphOperation.js","src/jsts/operation/distance/DistanceOp.js","src/jsts/operation/distance/ConnectedElementLocationFilter.js","src/jsts/operation/distance/GeometryLocation.js","src/jsts/operation/valid.js","src/jsts/operation/relate.js","src/jsts/operation/buffer.js","src/jsts/operation/relate/RelateOp.js","src/jsts/operation/buffer/BufferParameters.js","src/jsts/operation/buffer/BufferOp.js","src/jsts/operation/buffer/BufferBuilder.js","src/jsts/operation/IsSimpleOp.js","src/jsts/operation/valid/IsValidOp.js","src/jsts/triangulate/DelauneyTriangulationBuilder.js","src/jsts/triangulate/quadedge.js","src/jsts/triangulate/quadedge/Vertex.js","src/jsts/triangulate/quadedge/TrianglePredicate.js","src/jsts/HashSet.js","src/jsts/geomgraph/index.js","src/jsts/geomgraph/Quadrant.js","src/jsts/geomgraph/EdgeIntersectionList.js","src/jsts/geomgraph/EdgeIntersection.js","src/jsts/geomgraph/GraphComponent.js","src/jsts/geomgraph/Node.js","src/jsts/geomgraph/Edge.js","src/jsts/geomgraph/Position.js","src/jsts/geomgraph/Label.js","src/jsts/geomgraph/EdgeEndStar.js","src/jsts/geomgraph/EdgeEnd.js","src/jsts/geomgraph/TopologyLocation.js","src/jsts/geomgraph/index/SegmentIntersector.js","src/jsts/geomgraph/index/EdgeSetIntersector.js","src/jsts/geomgraph/index/SimpleEdgeSetIntersector.js","src/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js");
  4 +//$lista = Array("src/jsts.js","src/jsts/geom.js","src/jsts/geom/Coordinate.js","src/jsts/planargraph.js","src/jsts/geomgraph.js","src/jsts/index.js","src/jsts/operation.js","src/jsts/triangulate.js","src/jsts/algorithm.js","src/jsts/io.js","src/jsts/Hashtable.js","src/jsts/index/index.js","src/jsts/planargraph/PlanarGraph.js","src/jsts/geomgraph/NodeMap.js","src/jsts/geomgraph/PlanarGraph.js","src/jsts/geomgraph/GeometryGraph.js","src/jsts/algorithm/CGAlgorithms.js","src/jsts/algorithm/LineIntersector.js","src/jsts/algorithm/CentroidArea.js","src/jsts/algorithm/HCoordinate.js","src/jsts/algorithm/Angle.js","src/jsts/algorithm/RayCrossingCounter.js","src/jsts/algorithm/BoundaryNodeRule.js","src/jsts/algorithm/RobustDeterminant.js","src/jsts/algorithm/CentroidLine.js","src/jsts/algorithm/CentralEndpointIntersector.js","src/jsts/algorithm/locate/PointOnGeometryLocator.js","src/jsts/algorithm/CentroidPoint.js","src/jsts/algorithm/RobustLineIntersector.js","src/jsts/algorithm/PointLocator.js","src/jsts/index/quadtree.js","src/jsts/index/quadtree/Quadtree.js","src/jsts/index/quadtree/NodeBase.js","src/jsts/index/quadtree/Node.js","src/jsts/index/quadtree/Key.js","src/jsts/index/quadtree/Root.js","src/jsts/index/ArrayListVisitor.js","src/jsts/index/kdtree.js","src/jsts/index/DoubleBits.js","src/jsts/index/IntervalSize.js","src/jsts/index/kdtree/KdTree.js","src/jsts/index/kdtree/KdNode.js","src/jsts/io/WKTWriter.js","src/jsts/io/WKTReader.js","src/jsts/geom/Location.js","src/jsts/geom/Polygon.js","src/jsts/geom/util.js","src/jsts/geom/Point.js","src/jsts/geom/Envelope.js","src/jsts/geom/LineString.js","src/jsts/geom/MultiPoint.js","src/jsts/geom/Triangle.js","src/jsts/geom/GeometryComponentFilter.js","src/jsts/geom/Dimension.js","src/jsts/geom/CoordinateList.js","src/jsts/geom/GeometryFilter.js","src/jsts/geom/MultiLineString.js","src/jsts/geom/LineSegment.js","src/jsts/geom/IntersectionMatrix.js","src/jsts/geom/util/LinearComponentExtracter.js","src/jsts/geom/util/PolygonExtracter.js","src/jsts/geom/util/PointExtracter.js","src/jsts/geom/LinearRing.js","src/jsts/geom/MultiPolygon.js","src/jsts/geom/Geometry.js","src/jsts/geom/PrecisionModel.js","src/jsts/geom/CoordinateArrays.js","src/jsts/geom/GeometryFactory.js","src/jsts/geom/GeometryCollection.js","src/jsts/operation/distance.js","src/jsts/operation/GeometryGraphOperation.js","src/jsts/operation/distance/DistanceOp.js","src/jsts/operation/distance/ConnectedElementLocationFilter.js","src/jsts/operation/distance/GeometryLocation.js","src/jsts/operation/valid.js","src/jsts/operation/relate.js","src/jsts/operation/buffer.js","src/jsts/operation/relate/RelateOp.js","src/jsts/operation/buffer/BufferParameters.js","src/jsts/operation/buffer/BufferOp.js","src/jsts/operation/buffer/BufferBuilder.js","src/jsts/operation/IsSimpleOp.js","src/jsts/operation/valid/IsValidOp.js","src/jsts/triangulate/DelauneyTriangulationBuilder.js","src/jsts/triangulate/quadedge.js","src/jsts/triangulate/quadedge/Vertex.js","src/jsts/triangulate/quadedge/TrianglePredicate.js","src/jsts/HashSet.js","src/jsts/geomgraph/index.js","src/jsts/geomgraph/Quadrant.js","src/jsts/geomgraph/EdgeIntersectionList.js","src/jsts/geomgraph/EdgeIntersection.js","src/jsts/geomgraph/GraphComponent.js","src/jsts/geomgraph/Node.js","src/jsts/geomgraph/Edge.js","src/jsts/geomgraph/Position.js","src/jsts/geomgraph/Label.js","src/jsts/geomgraph/EdgeEndStar.js","src/jsts/geomgraph/EdgeEnd.js","src/jsts/geomgraph/TopologyLocation.js","src/jsts/geomgraph/index/SegmentIntersector.js","src/jsts/geomgraph/index/EdgeSetIntersector.js","src/jsts/geomgraph/index/SimpleEdgeSetIntersector.js","src/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js");
  5 +$lista = Array( "src/jsts.js", "src/jsts/Hashtable.js", "src/jsts/HashSet.js", "src/jsts/geom.js", "src/jsts/geom/CoordinateArrays.js", "src/jsts/geom/CoordinateList.js", "src/jsts/geom/Dimension.js", "src/jsts/geom/Location.js", "src/jsts/geom/Geometry.js", "src/jsts/geom/GeometryCollection.js", "src/jsts/geom/GeometryFilter.js", "src/jsts/geom/GeometryComponentFilter.js", "src/jsts/geom/Coordinate.js", "src/jsts/geom/Envelope.js", "src/jsts/geom/GeometryFactory.js", "src/jsts/geom/LineString.js", "src/jsts/geom/MultiLineString.js", "src/jsts/geom/LinearRing.js", "src/jsts/geom/LineSegment.js", "src/jsts/geom/Point.js", "src/jsts/geom/MultiPoint.js", "src/jsts/geom/Polygon.js", "src/jsts/geom/MultiPolygon.js", "src/jsts/geom/util.js", "src/jsts/geom/util/LinearComponentExtracter.js", "src/jsts/geom/util/PointExtracter.js", "src/jsts/geom/util/PolygonExtracter.js", "src/jsts/algorithm.js", "src/jsts/algorithm/BoundaryNodeRule.js", "src/jsts/algorithm/CentralEndpointIntersector.js", "src/jsts/algorithm/CentroidArea.js", "src/jsts/algorithm/CentroidLine.js", "src/jsts/algorithm/CentroidPoint.js", "src/jsts/algorithm/CGAlgorithms.js", "src/jsts/algorithm/HCoordinate.js", "src/jsts/algorithm/LineIntersector.js", "src/jsts/algorithm/PointLocator.js", "src/jsts/algorithm/RayCrossingCounter.js", "src/jsts/algorithm/RobustDeterminant.js", "src/jsts/algorithm/RobustLineIntersector.js", "src/jsts/planargraph.js", "src/jsts/planargraph/PlanarGraph.js", "src/jsts/geomgraph.js", "src/jsts/geomgraph/GraphComponent.js", "src/jsts/geomgraph/Node.js", "src/jsts/geomgraph/NodeMap.js", "src/jsts/geomgraph/Edge.js", "src/jsts/geomgraph/EdgeEndStar.js", "src/jsts/geomgraph/EdgeIntersection.js", "src/jsts/geomgraph/EdgeIntersectionList.js", "src/jsts/geomgraph/PlanarGraph.js", "src/jsts/geomgraph/GeometryGraph.js", "src/jsts/geomgraph/Label.js", "src/jsts/geomgraph/Position.js", "src/jsts/geomgraph/TopologyLocation.js", "src/jsts/geomgraph/index.js", "src/jsts/geomgraph/index/EdgeSetIntersector.js", "src/jsts/geomgraph/index/SegmentIntersector.js", "src/jsts/geomgraph/index/SimpleEdgeSetIntersector.js", "src/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js", "src/jsts/index.js", "src/jsts/index/ArrayListVisitor.js", "src/jsts/index/DoubleBits.js", "src/jsts/index/IntervalSize.js", "src/jsts/index/quadtree.js", "src/jsts/index/quadtree/Key.js", "src/jsts/index/quadtree/NodeBase.js", "src/jsts/index/quadtree/Node.js", "src/jsts/index/quadtree/Quadtree.js", "src/jsts/index/quadtree/Root.js", "src/jsts/io.js", "src/jsts/io/WKTReader.js", "src/jsts/io/WKTWriter.js", "src/jsts/operation.js", "src/jsts/operation/IsSimpleOp.js", "src/jsts/operation/buffer.js","src/jsts/operation/buffer/BufferBuilder.js","src/jsts/operation/buffer/BufferOp.js","src/jsts/operation/buffer/BufferParameters.js","src/jsts/operation/distance.js","src/jsts/operation/distance/ConnectedElementLocationFilter.js","src/jsts/operation/distance/DistanceOp.js","src/jsts/operation/distance/GeometryLocation.js");
5 6 $buffer = "";
6 7 foreach($lista as $arq){
7 8 if(file_exists("tempjs/temp.js"))
... ...
pacotes/jsts/compactajs.php~
... ... @@ -1,37 +0,0 @@
1   -<?php
2   -error_reporting(E_ALL);
3   -include ('../packer/class.JavaScriptPacker.php');
4   -$lista = Array("src/jsts.js","src/jsts/geom.js","src/jsts/geom/Coordinate.js","src/jsts/planargraph.js","src/jsts/geomgraph.js","src/jsts/index.js","src/jsts/operation.js","src/jsts/triangulate.js","src/jsts/algorithm.js","src/jsts/io.js","src/jsts/Hashtable.js","src/jsts/index/index.js","src/jsts/planargraph/PlanarGraph.js","src/jsts/geomgraph/NodeMap.js","src/jsts/geomgraph/PlanarGraph.js","src/jsts/geomgraph/GeometryGraph.js","src/jsts/algorithm/CGAlgorithms.js","src/jsts/algorithm/LineIntersector.js","src/jsts/algorithm/CentroidArea.js","src/jsts/algorithm/HCoordinate.js","src/jsts/algorithm/Angle.js","src/jsts/algorithm/RayCrossingCounter.js","src/jsts/algorithm/BoundaryNodeRule.js","src/jsts/algorithm/RobustDeterminant.js","src/jsts/algorithm/CentroidLine.js","src/jsts/algorithm/CentralEndpointIntersector.js","src/jsts/algorithm/locate/PointOnGeometryLocator.js","src/jsts/algorithm/CentroidPoint.js","src/jsts/algorithm/RobustLineIntersector.js","src/jsts/algorithm/PointLocator.js","src/jsts/index/quadtree.js","src/jsts/index/quadtree/Quadtree.js","src/jsts/index/quadtree/NodeBase.js","src/jsts/index/quadtree/Node.js","src/jsts/index/quadtree/Key.js","src/jsts/index/quadtree/Root.js","src/jsts/index/ArrayListVisitor.js","src/jsts/index/kdtree.js","src/jsts/index/DoubleBits.js","src/jsts/index/IntervalSize.js","src/jsts/index/kdtree/KdTree.js","src/jsts/index/kdtree/KdNode.js","src/jsts/io/WKTWriter.js","src/jsts/io/WKTReader.js","src/jsts/geom/Location.js","src/jsts/geom/Polygon.js","src/jsts/geom/util.js","src/jsts/geom/Point.js","src/jsts/geom/Envelope.js","src/jsts/geom/LineString.js","src/jsts/geom/MultiPoint.js","src/jsts/geom/Triangle.js","src/jsts/geom/GeometryComponentFilter.js","src/jsts/geom/Dimension.js","src/jsts/geom/CoordinateList.js","src/jsts/geom/GeometryFilter.js","src/jsts/geom/MultiLineString.js","src/jsts/geom/LineSegment.js","src/jsts/geom/IntersectionMatrix.js","src/jsts/geom/util/LinearComponentExtracter.js","src/jsts/geom/util/PolygonExtracter.js","src/jsts/geom/util/PointExtracter.js","src/jsts/geom/LinearRing.js","src/jsts/geom/MultiPolygon.js","src/jsts/geom/Geometry.js","src/jsts/geom/PrecisionModel.js","src/jsts/geom/CoordinateArrays.js","src/jsts/geom/GeometryFactory.js","src/jsts/geom/GeometryCollection.js","src/jsts/operation/distance.js","src/jsts/operation/GeometryGraphOperation.js","src/jsts/operation/distance/DistanceOp.js","src/jsts/operation/distance/ConnectedElementLocationFilter.js","src/jsts/operation/distance/GeometryLocation.js","src/jsts/operation/valid.js","src/jsts/operation/relate.js","src/jsts/operation/buffer.js","src/jsts/operation/relate/RelateOp.js","src/jsts/operation/buffer/BufferParameters.js","src/jsts/operation/buffer/BufferOp.js","src/jsts/operation/buffer/BufferBuilder.js","src/jsts/operation/IsSimpleOp.js","src/jsts/operation/valid/IsValidOp.js","src/jsts/triangulate/DelauneyTriangulationBuilder.js","src/jsts/triangulate/quadedge.js","src/jsts/triangulate/quadedge/Vertex.js","src/jsts/triangulate/quadedge/TrianglePredicate.js","src/jsts/HashSet.js","src/jsts/geomgraph/index.js","src/jsts/geomgraph/Quadrant.js","src/jsts/geomgraph/EdgeIntersectionList.js","src/jsts/geomgraph/EdgeIntersection.js","src/jsts/geomgraph/GraphComponent.js","src/jsts/geomgraph/Node.js","src/jsts/geomgraph/Edge.js","src/jsts/geomgraph/Position.js","src/jsts/geomgraph/Label.js","src/jsts/geomgraph/EdgeEndStar.js","src/jsts/geomgraph/EdgeEnd.js","src/jsts/geomgraph/TopologyLocation.js","src/jsts/geomgraph/index/SegmentIntersector.js","src/jsts/geomgraph/index/SimpleEdgeSetIntersector.js","src/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js","src/jsts/geomgraph/index/EdgeSetIntersector.js");
5   -$buffer = "";
6   -foreach($lista as $arq){
7   - if(file_exists("tempjs/temp.js"))
8   - {unlink("tempjs/temp.js");}
9   - packer($arq,"tempjs/temp.js","Normal");
10   - $abre = fopen("tempjs/temp.js", "r");
11   -//$abre = fopen($arq, "r");
12   - while (!feof($abre))
13   - {$buffer .= fgets($abre);}
14   - fclose($abre);
15   - $buffer .= "\n";
16   -}
17   -if(file_exists("jstsi3geo.js"))
18   -{unlink("jstsi3geo.js");}
19   -$abre = fopen("jstsi3geo.js", "wt");
20   -$escreve = fwrite ($abre,$buffer);
21   -$fecha = fclose ($abre);
22   -chmod("jstsi3geo.js",0777);
23   -function packer($src,$out,$tipo="None")
24   -{
25   - $script = file_get_contents($src);
26   - $script = str_replace("if(typeof(console)","//if(typeof(console)",$script);
27   - $t1 = microtime(true);
28   - $packer = new JavaScriptPacker($script, 0, true, false);
29   - $packed = $packer->pack();
30   - $t2 = microtime(true);
31   - $time = sprintf('%.4f', ($t2 - $t1) );
32   - echo 'script ', $src, ' packed in ' , $out, ', in ', $time, ' s.', "\n<br>";
33   - file_put_contents($out, $packed);
34   - chmod($out,0777);
35   -}
36   -
37   -?>
38 0 \ No newline at end of file
pacotes/jsts/examples/ol.html~
... ... @@ -1,152 +0,0 @@
1   -
2   -<html xmlns="http://www.w3.org/1999/xhtml">
3   - <head>
4   - <title>OpenLayers: Vector Features</title>
5   - <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
6   - <link rel="stylesheet" href="style.css" type="text/css" />
7   - <script src="../../openlayers/OpenLayers29.js.php" type="text/javascript"></script>
8   -
9   - <script type="text/javascript" src="../src/jsts.js"></script>
10   - <script type="text/javascript" src="../src/jsts/geom.js"></script>
11   - <script type="text/javascript" src="../src/jsts/geom/Geometry.js"></script>
12   - <script type="text/javascript" src="../src/jsts/geom/Coordinate.js"></script>
13   - <script type="text/javascript" src="../src/jsts/geom/Envelope.js"></script>
14   - <script type="text/javascript" src="../src/jsts/geom/GeometryFactory.js"></script>
15   - <script type="text/javascript" src="../src/jsts/geom/LineString.js"></script>
16   - <script type="text/javascript" src="../src/jsts/geom/LinearRing.js"></script>
17   - <script type="text/javascript" src="../src/jsts/geom/Point.js"></script>
18   - <script type="text/javascript" src="../src/jsts/geom/Polygon.js"></script>
19   -
20   - <script type="text/javascript" src="../src/jsts/geom/mixin.js"></script>
21   -
22   - <script type="text/javascript">
23   - var map;
24   -
25   - function init(){
26   - map = new OpenLayers.Map('map');
27   - var layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
28   - "http://vmap0.tiles.osgeo.org/wms/vmap0", {layers: 'basic'} );
29   - map.addLayer(layer);
30   -
31   - /*
32   - * Layer style
33   - */
34   - // we want opaque external graphics and non-opaque internal graphics
35   - var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
36   - layer_style.fillOpacity = 0.2;
37   - layer_style.graphicOpacity = 1;
38   -
39   - /*
40   - * Blue style
41   - */
42   - var style_blue = OpenLayers.Util.extend({}, layer_style);
43   - style_blue.strokeColor = "blue";
44   - style_blue.fillColor = "blue";
45   - style_blue.graphicName = "star";
46   - style_blue.pointRadius = 10;
47   - style_blue.strokeWidth = 3;
48   - style_blue.rotation = 45;
49   - style_blue.strokeLinecap = "butt";
50   -
51   - /*
52   - * Green style
53   - */
54   - var style_green = {
55   - strokeColor: "#00FF00",
56   - strokeWidth: 3,
57   - strokeDashstyle: "dashdot",
58   - pointRadius: 6,
59   - pointerEvents: "visiblePainted"
60   - };
61   -
62   - /*
63   - * Mark style
64   - */
65   - var style_mark = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
66   - // each of the three lines below means the same, if only one of
67   - // them is active: the image will have a size of 24px, and the
68   - // aspect ratio will be kept
69   - // style_mark.pointRadius = 12;
70   - // style_mark.graphicHeight = 24;
71   - // style_mark.graphicWidth = 24;
72   -
73   - // if graphicWidth and graphicHeight are both set, the aspect ratio
74   - // of the image will be ignored
75   - style_mark.graphicWidth = 24;
76   - style_mark.graphicHeight = 20;
77   - style_mark.graphicXOffset = 10; // default is -(style_mark.graphicWidth/2);
78   - style_mark.graphicYOffset = -style_mark.graphicHeight;
79   - style_mark.externalGraphic = "../img/marker.png";
80   - // graphicTitle only works in Firefox and Internet Explorer
81   - style_mark.graphicTitle = "this is a test tooltip";
82   -
83   - var vectorLayer = new OpenLayers.Layer.Vector("Simple Geometry", {style: layer_style});
84   -
85   - // create a point feature
86   - var point = new jsts.geom.Coordinate(-111.04, 45.68);
87   - var pointFeature = new OpenLayers.Feature.Vector(point,null,style_blue);
88   - var point2 = new jsts.geom.Coordinate(-105.04, 49.68);
89   - var pointFeature2 = new OpenLayers.Feature.Vector(point2,null,style_green);
90   - var point3 = new jsts.geom.Coordinate(-105.04, 49.68);
91   - var pointFeature3 = new OpenLayers.Feature.Vector(point3,null,style_mark);
92   -
93   -
94   - // create a line feature from a list of points
95   - var pointList = [];
96   - var newPoint = point;
97   - for(var p=0; p<15; ++p) {
98   - newPoint = new jsts.geom.Coordinate(newPoint.x + Math.random(1),
99   - newPoint.y + Math.random(1));
100   - pointList.push(newPoint);
101   - }
102   - var lineFeature = new OpenLayers.Feature.Vector(
103   - new jsts.geom.LineString(pointList),null,style_green);
104   -
105   -
106   - // create a polygon feature from a linear ring of points
107   - var pointList = [];
108   - for(var p=0; p<6; ++p) {
109   - var a = p * (2 * Math.PI) / 7;
110   - var r = Math.random(1) + 1;
111   - var newPoint = new jsts.geom.Coordinate(point.x + (r * Math.cos(a)),
112   - point.y + (r * Math.sin(a)));
113   - pointList.push(newPoint);
114   - }
115   - pointList.push(pointList[0]);
116   -
117   - var linearRing = new jsts.geom.LinearRing(pointList);
118   - var polygon = new jsts.geom.Polygon([linearRing]);
119   - var polygonFeature = new OpenLayers.Feature.Vector(polygon);
120   -
121   - map.addLayer(vectorLayer);
122   - map.setCenter(new OpenLayers.LonLat(point.x, point.y), 5);
123   - vectorLayer.addFeatures([pointFeature, pointFeature3, pointFeature2, lineFeature, polygonFeature]);
124   - }
125   - </script>
126   - </head>
127   - <body onload="init()">
128   -<h1 id="title">Drawing Simple Vector Features Example</h1>
129   -
130   -<div id="tags">
131   -</div>
132   -<p id="shortdesc">
133   - Shows the use of the shows drawing simple vector features, in different styles.
134   -</p>
135   -<div id="map" class="smallmap"></div>
136   -<div id="docs">
137   - <p>This example shows drawing simple vector features -- point, line, polygon
138   - in different styles, created 'manually', by constructing the entire style
139   - object, via 'copy', extending the default style object, and by
140   - inheriting the default style from the layer.</p>
141   - <p>It also shows how to use external graphic files for point features
142   - and how to set their size: If either graphicWidth or graphicHeight is set,
143   - the aspect ratio of the image will be respected. If both graphicWidth and
144   - graphicHeight are set, it will be ignored. Alternatively, if graphicWidth
145   - and graphicHeight are omitted, pointRadius will be used to set the size
146   - of the image, which will then be twice the value of pointRadius with the
147   - original aspect ratio.</p>
148   -</div>
149   -
150   - </body>
151   -</html>
152   -
153 0 \ No newline at end of file
pacotes/jsts/examples/test.html
... ... @@ -4,91 +4,9 @@
4 4 <title>OpenLayers: Vector Features</title>
5 5 <link rel="stylesheet" href="../OpenLayers-2.10/theme/default/style.css" type="text/css" />
6 6 <link rel="stylesheet" href="style.css" type="text/css" />
7   - <script src="../OpenLayers-2.10/OpenLayers.js" type="text/javascript"></script>
  7 + <script src="../../openlayers/OpenLayers29.js.php" type="text/javascript"></script>
8 8  
9   - <script type="text/javascript" src="../src/jsts.js"></script>
10   - <script type="text/javascript" src="../src/jsts/Hashtable.js"></script>
11   - <script type="text/javascript" src="../src/jsts/HashSet.js"></script>
12   - <script type="text/javascript" src="../src/jsts/geom.js"></script>
13   - <script type="text/javascript" src="../src/jsts/geom/CoordinateArrays.js"></script>
14   - <script type="text/javascript" src="../src/jsts/geom/CoordinateList.js"></script>
15   - <script type="text/javascript" src="../src/jsts/geom/Dimension.js"></script>
16   - <script type="text/javascript" src="../src/jsts/geom/Location.js"></script>
17   - <script type="text/javascript" src="../src/jsts/geom/Geometry.js"></script>
18   - <script type="text/javascript" src="../src/jsts/geom/GeometryCollection.js"></script>
19   - <script type="text/javascript" src="../src/jsts/geom/GeometryFilter.js"></script>
20   - <script type="text/javascript" src="../src/jsts/geom/GeometryComponentFilter.js"></script>
21   - <script type="text/javascript" src="../src/jsts/geom/Coordinate.js"></script>
22   - <script type="text/javascript" src="../src/jsts/geom/Envelope.js"></script>
23   - <script type="text/javascript" src="../src/jsts/geom/GeometryFactory.js"></script>
24   - <script type="text/javascript" src="../src/jsts/geom/LineString.js"></script>
25   - <script type="text/javascript" src="../src/jsts/geom/MultiLineString.js"></script>
26   - <script type="text/javascript" src="../src/jsts/geom/LinearRing.js"></script>
27   - <script type="text/javascript" src="../src/jsts/geom/LineSegment.js"></script>
28   - <script type="text/javascript" src="../src/jsts/geom/Point.js"></script>
29   - <script type="text/javascript" src="../src/jsts/geom/MultiPoint.js"></script>
30   - <script type="text/javascript" src="../src/jsts/geom/Polygon.js"></script>
31   - <script type="text/javascript" src="../src/jsts/geom/MultiPolygon.js"></script>
32   - <script type="text/javascript" src="../src/jsts/geom/util.js"></script>
33   - <script type="text/javascript" src="../src/jsts/geom/util/LinearComponentExtracter.js"></script>
34   - <script type="text/javascript" src="../src/jsts/geom/util/PointExtracter.js"></script>
35   - <script type="text/javascript" src="../src/jsts/geom/util/PolygonExtracter.js"></script>
36   - <script type="text/javascript" src="../src/jsts/algorithm.js"></script>
37   - <script type="text/javascript" src="../src/jsts/algorithm/BoundaryNodeRule.js"></script>
38   - <script type="text/javascript" src="../src/jsts/algorithm/CentralEndpointIntersector.js"></script>
39   - <script type="text/javascript" src="../src/jsts/algorithm/CentroidArea.js"></script>
40   - <script type="text/javascript" src="../src/jsts/algorithm/CentroidLine.js"></script>
41   - <script type="text/javascript" src="../src/jsts/algorithm/CentroidPoint.js"></script>
42   - <script type="text/javascript" src="../src/jsts/algorithm/CGAlgorithms.js"></script>
43   - <script type="text/javascript" src="../src/jsts/algorithm/HCoordinate.js"></script>
44   - <script type="text/javascript" src="../src/jsts/algorithm/LineIntersector.js"></script>
45   - <script type="text/javascript" src="../src/jsts/algorithm/PointLocator.js"></script>
46   - <script type="text/javascript" src="../src/jsts/algorithm/RayCrossingCounter.js"></script>
47   - <script type="text/javascript" src="../src/jsts/algorithm/RobustDeterminant.js"></script>
48   - <script type="text/javascript" src="../src/jsts/algorithm/RobustLineIntersector.js"></script>
49   - <script type="text/javascript" src="../src/jsts/planargraph.js"></script>
50   - <script type="text/javascript" src="../src/jsts/planargraph/PlanarGraph.js"></script>
51   - <script type="text/javascript" src="../src/jsts/geomgraph.js"></script>
52   - <script type="text/javascript" src="../src/jsts/geomgraph/GraphComponent.js"></script>
53   - <script type="text/javascript" src="../src/jsts/geomgraph/Node.js"></script>
54   - <script type="text/javascript" src="../src/jsts/geomgraph/NodeMap.js"></script>
55   - <script type="text/javascript" src="../src/jsts/geomgraph/Edge.js"></script>
56   - <script type="text/javascript" src="../src/jsts/geomgraph/EdgeEndStar.js"></script>
57   - <script type="text/javascript" src="../src/jsts/geomgraph/EdgeIntersection.js"></script>
58   - <script type="text/javascript" src="../src/jsts/geomgraph/EdgeIntersectionList.js"></script>
59   - <script type="text/javascript" src="../src/jsts/geomgraph/PlanarGraph.js"></script>
60   - <script type="text/javascript" src="../src/jsts/geomgraph/GeometryGraph.js"></script>
61   - <script type="text/javascript" src="../src/jsts/geomgraph/Label.js"></script>
62   - <script type="text/javascript" src="../src/jsts/geomgraph/Position.js"></script>
63   - <script type="text/javascript" src="../src/jsts/geomgraph/TopologyLocation.js"></script>
64   - <script type="text/javascript" src="../src/jsts/geomgraph/index.js"></script>
65   - <script type="text/javascript" src="../src/jsts/geomgraph/index/EdgeSetIntersector.js"></script>
66   - <script type="text/javascript" src="../src/jsts/geomgraph/index/SegmentIntersector.js"></script>
67   - <script type="text/javascript" src="../src/jsts/geomgraph/index/SimpleEdgeSetIntersector.js"></script>
68   - <script type="text/javascript" src="../src/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js"></script>
69   - <script type="text/javascript" src="../src/jsts/index.js"></script>
70   - <script type="text/javascript" src="../src/jsts/index/ArrayListVisitor.js"></script>
71   - <script type="text/javascript" src="../src/jsts/index/DoubleBits.js"></script>
72   - <script type="text/javascript" src="../src/jsts/index/IntervalSize.js"></script>
73   - <script type="text/javascript" src="../src/jsts/index/quadtree.js"></script>
74   - <script type="text/javascript" src="../src/jsts/index/quadtree/Key.js"></script>
75   - <script type="text/javascript" src="../src/jsts/index/quadtree/NodeBase.js"></script>
76   - <script type="text/javascript" src="../src/jsts/index/quadtree/Node.js"></script>
77   - <script type="text/javascript" src="../src/jsts/index/quadtree/Quadtree.js"></script>
78   - <script type="text/javascript" src="../src/jsts/index/quadtree/Root.js"></script>
79   - <script type="text/javascript" src="../src/jsts/io.js"></script>
80   - <script type="text/javascript" src="../src/jsts/io/WKTReader.js"></script>
81   - <script type="text/javascript" src="../src/jsts/io/WKTWriter.js"></script>
82   - <script type="text/javascript" src="../src/jsts/operation.js"></script>
83   - <script type="text/javascript" src="../src/jsts/operation/IsSimpleOp.js"></script>
84   - <script type="text/javascript" src="../src/jsts/operation/buffer.js"></script>
85   - <script type="text/javascript" src="../src/jsts/operation/buffer/BufferBuilder.js"></script>
86   - <script type="text/javascript" src="../src/jsts/operation/buffer/BufferOp.js"></script>
87   - <script type="text/javascript" src="../src/jsts/operation/buffer/BufferParameters.js"></script>
88   - <script type="text/javascript" src="../src/jsts/operation/distance.js"></script>
89   - <script type="text/javascript" src="../src/jsts/operation/distance/ConnectedElementLocationFilter.js"></script>
90   - <script type="text/javascript" src="../src/jsts/operation/distance/DistanceOp.js"></script>
91   - <script type="text/javascript" src="../src/jsts/operation/distance/GeometryLocation.js"></script>
  9 +<script type="text/javascript" src="../jstsi3geo.js"></script>
92 10  
93 11 <script type="text/javascript">
94 12 var map;
... ...
pacotes/jsts/jstsi3geo.js
1   -jsts={version:'1.11-SNAPSHOT'};jsts.error={};jsts.error.IllegalArgumentError=function(message){this.name='IllegalArgumentError';this.message=(message||'')};jsts.error.IllegalArgumentError.prototype=new Error();jsts.error.AbstractMethodInvocationError=function(){this.name='AbstractMethodInvocationError';this.message='Abstract method called, should be implemented in subclass.'};jsts.error.AbstractMethodInvocationError.prototype=new Error();jsts.error.NotImplementedError=function(){this.name='NotImplementedError';this.message='This method has not yet been implemented.'};jsts.error.NotImplementedError.prototype=new Error();jsts.error.NotRepresentableError=function(message){this.name='NotRepresentableError';this.message=(message||'')};jsts.error.NotRepresentableError.prototype=new Error();
2   -jsts.geom={};
3   -jsts.geom.Coordinate=function(){};jsts.geom.Coordinate=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.Coordinate.prototype.setCoordinate=function(other){this.x=other.x;this.y=other.y};jsts.geom.Coordinate.prototype.clone=function(){return new jsts.geom.Coordinate(this.x,this.y)};jsts.geom.Coordinate.prototype.distance=function(p){var dx=this.x-p.x;var dy=this.y-p.y;return Math.sqrt(dx*dx+dy*dy)};jsts.geom.Coordinate.prototype.equals2D=function(other){if(this.x!==other.x){return false}if(this.y!==other.y){return false}return true};jsts.geom.Coordinate.prototype.jsts_equals=function(other){if(other.CLASS_NAME!==this.CLASS_NAME){return false}return this.equals2D(other)};jsts.geom.Coordinate.prototype.compareTo=function(other){if(this.x<other.x){return-1}if(this.x>other.x){return 1}if(this.y<other.y){return-1}if(this.y>other.y){return 1}return 0};jsts.geom.Coordinate.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.coordinate]};jsts.geom.Coordinate.prototype.getNumPoints=function(){return this.isEmpty()?0:1};jsts.geom.Coordinate.prototype.isEmpty=function(){return this.x===null};jsts.geom.Coordinate.prototype.isSimple=function(){return true};jsts.geom.Coordinate.prototype.isValid=function(){if(!IsValidOp.isValid(getCoordinate())){return false}return true};jsts.geom.Coordinate.prototype.getDimension=function(){return 0};jsts.geom.Coordinate.prototype.getBoundaryDimension=function(){return Dimension.FALSE};jsts.geom.Coordinate.prototype.getX=function(){return this.x};jsts.geom.Coordinate.prototype.getY=function(){return this.y};jsts.geom.Coordinate.prototype.getCoordinate=function(){return this};jsts.geom.Coordinate.prototype.getGeometryType=function(){return'Coordinate'};jsts.geom.Coordinate.prototype.computeEnvelopeInternal=function(){if(this.isEmpty()){return new jsts.geom.Envelope()}return new jsts.geom.Envelope(this)};jsts.geom.Coordinate.prototype.equalsExact=function(other,tolerance){if(this.CLASS_NAME!==other.CLASS_NAME){return false}if(this.isEmpty()&&other.isEmpty()){return true}return jsts.geom.Geometry.prototype.equal(other,this,tolerance)};jsts.geom.Coordinate.prototype.reverse=function(){return this.clone()};jsts.geom.Coordinate.prototype.normalize=function(){};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry.Point,jsts.geom.Coordinate,{initialize:function(x,y){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);if(x===undefined||x===null){}else if(typeof x==='number'||typeof x==='string'){this.x=parseFloat(x);this.y=parseFloat(y)}else if(x instanceof jsts.geom.Coordinate){y=x.y;x=x.x;this.x=parseFloat(x);this.y=parseFloat(y)}}});jsts.geom.Coordinate=OpenLayers.Geometry.Point;
4   -jsts.planargraph={};
5   -jsts.geomgraph={};
6   -jsts.index={};
7   -jsts.operation={};
8   -jsts.triangulate={};
9   -jsts.algorithm={};
10   -jsts.io={};
11   -jsts.Hashtable=(function(){var FUNCTION='function';var arrayRemoveAt=(typeof Array.prototype.splice==FUNCTION)?function(arr,idx){arr.splice(idx,1)}:function(arr,idx){var itemsAfterDeleted,i,len;if(idx===arr.length-1){arr.length=idx}else{itemsAfterDeleted=arr.slice(idx+1);arr.length=idx;for(i=0,len=itemsAfterDeleted.length;i<len;++i){arr[idx+i]=itemsAfterDeleted[i]}}};function hashObject(obj){var hashCode;if(typeof obj=='string'){return obj}else if(typeof obj.hashCode==FUNCTION){hashCode=obj.hashCode();return(typeof hashCode=='string')?hashCode:hashObject(hashCode)}else if(typeof obj.toString==FUNCTION){return obj.toString()}else{try{return String(obj)}catch(ex){return Object.prototype.toString.call(obj)}}}function equals_fixedValueHasEquals(fixedValue,variableValue){return fixedValue.equals(variableValue)}function equals_fixedValueNoEquals(fixedValue,variableValue){return(typeof variableValue.equals==FUNCTION)?variableValue.equals(fixedValue):(fixedValue===variableValue)}function createKeyValCheck(kvStr){return function(kv){if(kv===null){throw new Error('null is not a valid '+kvStr)}else if(typeof kv=='undefined'){throw new Error(kvStr+' must not be undefined')}}}var checkKey=createKeyValCheck('key'),checkValue=createKeyValCheck('value');function Bucket(hash,firstKey,firstValue,equalityFunction){this[0]=hash;this.entries=[];this.addEntry(firstKey,firstValue);if(equalityFunction!==null){this.getEqualityFunction=function(){return equalityFunction}}}var EXISTENCE=0,ENTRY=1,ENTRY_INDEX_AND_VALUE=2;function createBucketSearcher(mode){return function(key){var i=this.entries.length,entry,equals=this.getEqualityFunction(key);while(i--){entry=this.entries[i];if(equals(key,entry[0])){switch(mode){case EXISTENCE:return true;case ENTRY:return entry;case ENTRY_INDEX_AND_VALUE:return[i,entry[1]]}}}return false}}function createBucketLister(entryProperty){return function(aggregatedArr){var startIndex=aggregatedArr.length;for(var i=0,len=this.entries.length;i<len;++i){aggregatedArr[startIndex+i]=this.entries[i][entryProperty]}}}Bucket.prototype={getEqualityFunction:function(searchValue){return(typeof searchValue.equals==FUNCTION)?equals_fixedValueHasEquals:equals_fixedValueNoEquals},getEntryForKey:createBucketSearcher(ENTRY),getEntryAndIndexForKey:createBucketSearcher(ENTRY_INDEX_AND_VALUE),removeEntryForKey:function(key){var result=this.getEntryAndIndexForKey(key);if(result){arrayRemoveAt(this.entries,result[0]);return result[1]}return null},addEntry:function(key,value){this.entries[this.entries.length]=[key,value]},keys:createBucketLister(0),values:createBucketLister(1),getEntries:function(entries){var startIndex=entries.length;for(var i=0,len=this.entries.length;i<len;++i){entries[startIndex+i]=this.entries[i].slice(0)}},containsKey:createBucketSearcher(EXISTENCE),containsValue:function(value){var i=this.entries.length;while(i--){if(value===this.entries[i][1]){return true}}return false}};function searchBuckets(buckets,hash){var i=buckets.length,bucket;while(i--){bucket=buckets[i];if(hash===bucket[0]){return i}}return null}function getBucketForHash(bucketsByHash,hash){var bucket=bucketsByHash[hash];return(bucket&&(bucket instanceof Bucket))?bucket:null}function Hashtable(hashingFunctionParam,equalityFunctionParam){var that=this;var buckets=[];var bucketsByHash={};var hashingFunction=(typeof hashingFunctionParam==FUNCTION)?hashingFunctionParam:hashObject;var equalityFunction=(typeof equalityFunctionParam==FUNCTION)?equalityFunctionParam:null;this.put=function(key,value){checkKey(key);checkValue(value);var hash=hashingFunction(key),bucket,bucketEntry,oldValue=null;bucket=getBucketForHash(bucketsByHash,hash);if(bucket){bucketEntry=bucket.getEntryForKey(key);if(bucketEntry){oldValue=bucketEntry[1];bucketEntry[1]=value}else{bucket.addEntry(key,value)}}else{bucket=new Bucket(hash,key,value,equalityFunction);buckets[buckets.length]=bucket;bucketsByHash[hash]=bucket}return oldValue};this.get=function(key){checkKey(key);var hash=hashingFunction(key);var bucket=getBucketForHash(bucketsByHash,hash);if(bucket){var bucketEntry=bucket.getEntryForKey(key);if(bucketEntry){return bucketEntry[1]}}return null};this.containsKey=function(key){checkKey(key);var bucketKey=hashingFunction(key);var bucket=getBucketForHash(bucketsByHash,bucketKey);return bucket?bucket.containsKey(key):false};this.containsValue=function(value){checkValue(value);var i=buckets.length;while(i--){if(buckets[i].containsValue(value)){return true}}return false};this.clear=function(){buckets.length=0;bucketsByHash={}};this.isEmpty=function(){return!buckets.length};var createBucketAggregator=function(bucketFuncName){return function(){var aggregated=[],i=buckets.length;while(i--){buckets[i][bucketFuncName](aggregated)}return aggregated}};this.keys=createBucketAggregator('keys');this.values=createBucketAggregator('values');this.entries=createBucketAggregator('getEntries');this.remove=function(key){checkKey(key);var hash=hashingFunction(key),bucketIndex,oldValue=null;var bucket=getBucketForHash(bucketsByHash,hash);if(bucket){oldValue=bucket.removeEntryForKey(key);if(oldValue!==null){if(!bucket.entries.length){bucketIndex=searchBuckets(buckets,hash);arrayRemoveAt(buckets,bucketIndex);delete bucketsByHash[hash]}}}return oldValue};this.size=function(){var total=0,i=buckets.length;while(i--){total+=buckets[i].entries.length}return total};this.each=function(callback){var entries=that.entries(),i=entries.length,entry;while(i--){entry=entries[i];callback(entry[0],entry[1])}};this.putAll=function(hashtable,conflictCallback){var entries=hashtable.entries();var entry,key,value,thisValue,i=entries.length;var hasConflictCallback=(typeof conflictCallback==FUNCTION);while(i--){entry=entries[i];key=entry[0];value=entry[1];if(hasConflictCallback&&(thisValue=that.get(key))){value=conflictCallback(key,thisValue,value)}that.put(key,value)}};this.clone=function(){var clone=new jsts.Hashtable(hashingFunctionParam,equalityFunctionParam);clone.putAll(that);return clone}}return Hashtable})();
12   -
13   -jsts.planargraph.PlanarGraph=function(){this.edges=new jsts.HashSet();this.dirEdges=new jsts.HashSet()};jsts.planargraph.PlanarGraph.prototype.edges=null;jsts.planargraph.PlanarGraph.prototype.dirEdges=null;jsts.planargraph.PlanarGraph.prototype.nodeMap=null;
14   -jsts.geomgraph.NodeMap=function(){this.nodeMap=new jsts.Hashtable()};jsts.geomgraph.NodeMap.prototype.nodeMap=null;jsts.geomgraph.NodeMap.prototype.addNode=function(arg){var node,coord;if(arg instanceof jsts.geom.Coordinate){coord=arg;node=this.nodeMap.get(coord);if(node==null){node=new jsts.geomgraph.Node(coord,null);this.nodeMap.put(coord,node)}return node}else if(arg instanceof jsts.geomgraph.Node){node=arg;node=nodeMap.get(n.getCoordinate());if(node===null){this.nodeMap.put(n.getCoordinate(),n);return n}node.mergeLabel(n);return node}};jsts.geomgraph.NodeMap.prototype.add=function(e){var p=e.getCoordinate();var n=addNode(p);n.add(e)};jsts.geomgraph.NodeMap.prototype.find=function(coord){return nodeMap.get(coord)};jsts.geomgraph.NodeMap.prototype.values=function(){return this.nodeMap.values()};jsts.geomgraph.NodeMap.prototype.getBoundaryNodes=function(geomIndex){var bdyNodes=[];var i,values=this.values();for(i=0;i<values.length;i++){var node=values[i];if(node.getLabel().getLocation(geomIndex)===jsts.geom.Location.BOUNDARY)bdyNodes.add(node)}return bdyNodes};
15   -jsts.geomgraph.PlanarGraph=function(){this.nodes=new jsts.geomgraph.NodeMap()};jsts.geomgraph.PlanarGraph.prototype.edges=[];jsts.geomgraph.PlanarGraph.prototype.nodes=null;jsts.geomgraph.PlanarGraph.prototype.insertEdge=function(e){this.edges.push(e)};
16   -jsts.geomgraph.GeometryGraph=function(argIndex,parentGeom,boundaryNodeRule){jsts.geomgraph.GeometryGraph.prototype.constructor.call(this);this.lineEdgeMap=new jsts.Hashtable();this.ptLocator=new jsts.algorithm.PointLocator();this.argIndex=argIndex;this.parentGeom=parentGeom;this.boundaryNodeRule=boundaryNodeRule||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE;if(parentGeom!=null){this.add(parentGeom)}};jsts.geomgraph.GeometryGraph.prototype=new jsts.geomgraph.PlanarGraph();jsts.geomgraph.GeometryGraph.determineBoundary=function(boundaryNodeRule,boundaryCount){return boundaryNodeRule.isInBoundary(boundaryCount)?jsts.geom.Location.BOUNDARY:jsts.geom.Location.INTERIOR};jsts.geomgraph.GeometryGraph.prototype.parentGeom=null;jsts.geomgraph.GeometryGraph.prototype.lineEdgeMap=null;jsts.geomgraph.GeometryGraph.prototype.boundaryNodeRule=null;jsts.geomgraph.GeometryGraph.prototype.useBoundaryDeterminationRule=true;jsts.geomgraph.GeometryGraph.prototype.argIndex=null;jsts.geomgraph.GeometryGraph.prototype.boundaryNodes=[];jsts.geomgraph.GeometryGraph.prototype.hasTooFewPoints=false;jsts.geomgraph.GeometryGraph.prototype.invalidPoint=null;jsts.geomgraph.GeometryGraph.prototype.areaPtLocator=null;jsts.geomgraph.GeometryGraph.prototype.ptLocator=null;jsts.geomgraph.GeometryGraph.prototype.createEdgeSetIntersector=function(){return new jsts.geomgraph.index.SimpleEdgeSetIntersector()};jsts.geomgraph.GeometryGraph.prototype.add=function(g){if(g.isEmpty()){return}if(g instanceof jsts.geom.MultiPolygon)this.useBoundaryDeterminationRule=false;if(g instanceof jsts.geom.Polygon)this.addPolygon(g);else if(g instanceof jsts.geom.LineString)this.addLineString(g);else if(g instanceof jsts.geom.Point)this.addPoint(g);else if(g instanceof jsts.geom.MultiPoint)this.addCollection(g);else if(g instanceof jsts.geom.MultiLineString)this.addCollection(g);else if(g instanceof jsts.geom.MultiPolygon)this.addCollection(g);else if(g instanceof jsts.geom.GeometryCollection)this.addCollection(g);else throw new jsts.error.IllegalArgumentError('Geometry type not supported.')};jsts.geomgraph.GeometryGraph.prototype.addPoint=function(p){var coord=p.getCoordinate();this.insertPoint(this.argIndex,coord,jsts.geom.Location.INTERIOR)};jsts.geomgraph.GeometryGraph.prototype.addLineString=function(line){var coords=jsts.geom.CoordinateArrays.removeRepeatedPoints(line.getCoordinates());if(coords.length<2){this.hasTooFewPoints=true;this.invalidPoint=coords[0];return}var e=new jsts.geomgraph.Edge(coords,new jsts.geomgraph.Label(this.argIndex,jsts.geom.Location.INTERIOR));this.lineEdgeMap.put(line,e);this.insertEdge(e);if(coords.length>=2===false){throw new jsts.error.IllegalArgumentError('found LineString with single point')}this.insertBoundaryPoint(this.argIndex,coords[0]);this.insertBoundaryPoint(this.argIndex,coords[coords.length-1])};jsts.geomgraph.GeometryGraph.prototype.computeSelfNodes=function(li,computeRingSelfNodes){var si=new jsts.geomgraph.index.SegmentIntersector(li,true,false);var esi=this.createEdgeSetIntersector();if(!computeRingSelfNodes&&(parentGeom instanceof jsts.geom.LinearRing||parentGeom instanceof jsts.geom.Polygon||parentGeom instanceof jsts.geom.MultiPolygon)){esi.computeIntersections(this.edges,si,false)}else{esi.computeIntersections(this.edges,si,true)}this.addSelfIntersectionNodes(this.argIndex);return si};jsts.geomgraph.GeometryGraph.prototype.insertPoint=function(argIndex,coord,onLocation){var n=this.nodes.addNode(coord);var lbl=n.getLabel();if(lbl==null){n.label=new jsts.geomgraph.Label(this.argIndex,this.onLocation)}else lbl.setLocation(this.argIndex,this.onLocation)};jsts.geomgraph.GeometryGraph.prototype.insertBoundaryPoint=function(argIndex,coord){var n=this.nodes.addNode(coord);var lbl=n.getLabel();var boundaryCount=1;var loc=jsts.geom.Location.NONE;if(lbl!==null)loc=lbl.getLocation(argIndex,jsts.geomgraph.Position.ON);if(loc===jsts.geom.Location.BOUNDARY)boundaryCount++;var newLoc=jsts.geomgraph.GeometryGraph.determineBoundary(this.boundaryNodeRule,boundaryCount);lbl.setLocation(argIndex,newLoc)};jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNodes=function(argIndex){var i,e,eLoc,j,ei;for(i=0;i<this.edges.length;i++){e=this.edges[i];eLoc=e.getLabel().getLocation(argIndex);for(j=0;j<e.eiList.length;j++){ei=e.eiList[j];this.addSelfIntersectionNode(argIndex,ei.coord,eLoc)}}};jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNode=function(argIndex,coord,loc){if(this.isBoundaryNode(argIndex,coord))return;if(loc===jsts.geom.Location.BOUNDARY&&this.useBoundaryDeterminationRule)this.insertBoundaryPoint(argIndex,coord);else this.insertPoint(argIndex,coord,loc)};
17   -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;jsts.algorithm.CGAlgorithms.COLLINEAR=0;jsts.algorithm.CGAlgorithms.STRAIGHT=jsts.algorithm.CGAlgorithms.COLLINEAR;jsts.algorithm.CGAlgorithms.orientationIndex=function(p1,p2,q){var dx1,dy1,dx2,dy2;dx1=p2.x-p1.x;dy1=p2.y-p1.y;dx2=q.x-p2.x;dy2=q.y-p2.y;return jsts.algorithm.RobustDeterminant.signOfDet2x2(dx1,dy1,dx2,dy2)};jsts.algorithm.CGAlgorithms.isPointInRing=function(p,ring){return jsts.algorithm.CGAlgorithms.locatePointInRing(p,ring)!==jsts.geom.Location.EXTERIOR};jsts.algorithm.CGAlgorithms.locatePointInRing=function(p,ring){return jsts.algorithm.RayCrossingCounter.locatePointInRing(p,ring)};jsts.algorithm.CGAlgorithms.isOnLine=function(p,pt){var lineIntersector,i,il,p0,p1;lineIntersector=new jsts.algorithm.RobustLineIntersector();for(i=1,il=pt.length;i<il;i++){p0=pt[i-1];p1=pt[i];lineIntersector.computeIntersection(p,p0,p1);if(lineIntersector.hasIntersection()){return true}}return false};jsts.algorithm.CGAlgorithms.isCCW=function(ring){var nPts,hiPt,hiIndex,p,iPrev,iNext,prev,next,i,disc,isCCW;nPts=ring.length-1;if(nPts<3){throw new jsts.IllegalArgumentError('Ring has fewer than 3 points, so orientation cannot be determined')}hiPt=ring[0];hiIndex=0;i=1;for(i;i<=nPts;i++){p=ring[i];if(p.y>hiPt.y){hiPt=p;hiIndex=i}}iPrev=hiIndex;do{iPrev=iPrev-1;if(iPrev<0){iPrev=nPts}}while(ring[iPrev].equals2D(hiPt)&&iPrev!==hiIndex);iNext=hiIndex;do{iNext=(iNext+1)%nPts}while(ring[iNext].equals2D(hiPt)&&iNext!==hiIndex);prev=ring[iPrev];next=ring[iNext];if(prev.equals2D(hiPt)||next.equals2D(hiPt)||prev.equals2D(next)){return false}disc=jsts.algorithm.CGAlgorithms.computeOrientation(prev,hiPt,next);isCCW=false;if(disc===0){isCCW=(prev.x>next.x)}else{isCCW=(disc>0)}return isCCW};jsts.algorithm.CGAlgorithms.computeOrientation=function(p1,p2,q){return jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,q)};jsts.algorithm.CGAlgorithms.distancePointLine=function(p,A,B){if(!(A instanceof jsts.geom.Coordinate)){jsts.algorithm.CGAlgorithms.distancePointLine2.apply(this,arguments)}if(A.x===B.x&&A.y===B.y){return p.distance(A)}var r,s;r=((p.x-A.x)*(B.x-A.x)+(p.y-A.y)*(B.y-A.y))/((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y));if(r<=0.0){return p.distance(A)}if(r>=1.0){return p.distance(B)}s=((A.y-p.y)*(B.x-A.x)-(A.x-p.x)*(B.y-A.y))/((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y));return Math.abs(s)*Math.sqrt(((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y)))};jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular=function(p,A,B){var s=((A.y-p.y)*(B.x-A.x)-(A.x-p.x)*(B.y-A.y))/((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y));return Math.abs(s)*Math.sqrt(((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y)))};jsts.algorithm.CGAlgorithms.distancePointLine2=function(p,line){var minDistance,i,il,dist;if(line.length===0){throw new jsts.error.IllegalArgumentError('Line array must contain at least one vertex')}minDistance=p.distance(line[0]);for(i=0,il=line.length-1;i<il;i++){dist=jsts.algorithm.CGAlgorithms.distancePointLine(p,line[i],line[i+1]);if(dist<minDistance){minDistance=dist}}return minDistance};jsts.algorithm.CGAlgorithms.distanceLineLine=function(A,B,C,D){if(A.equals(B)){return jsts.algorithm.CGAlgorithms.distancePointLine(A,C,D)}if(C.equals(D)){return jsts.algorithm.CGAlgorithms.distancePointLine(D,A,B)}var r_top,r_bot,s_top,s_bot,s,r;r_top=(A.y-C.y)*(D.x-C.x)-(A.x-C.x)*(D.y-C.y);r_bot=(B.x-A.x)*(D.y-C.y)-(B.y-A.y)*(D.x-C.x);s_top=(A.y-C.y)*(B.x-A.x)-(A.x-C.x)*(B.y-A.y);s_bot=(B.x-A.x)*(D.y-C.y)-(B.y-A.y)*(D.x-C.x);if((r_bot===0)||(s_bot===0)){return Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(A,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(B,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(C,A,B),jsts.algorithm.CGAlgorithms.distancePointLine(D,A,B))))}s=s_top/s_bot;r=r_top/r_bot;if((r<0)||(r>1)||(s<0)||(s>1)){return Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(A,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(B,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(C,A,B),jsts.algorithm.CGAlgorithms.distancePointLine(D,A,B))))}return 0.0};jsts.algorithm.CGAlgorithms.signedArea=function(ring){if(ring.length<3){return 0.0}var sum,i,il,bx,by,cx,cy;sum=0.0;for(i=0,il=ring.length-1;i<il;i++){bx=ring[i].x;by=ring[i].y;cx=ring[i+1].x;cy=ring[i+1].y;sum+=(bx+cx)*(cy-by)}return-sum/2.0};jsts.algorithm.CGAlgorithms.signedArea=function(ring){var n,sum,p,bx,by,i,cx,cy;n=ring.length;if(n<3){return 0.0}sum=0.0;p=ring[0];bx=p.x;by=p.y;for(i=1;i<n;i++){p=ring[i];cx=p.x;cy=p.y;sum+=(bx+cx)*(cy-by);bx=cx;by=cy}return-sum/2.0};
18   -jsts.algorithm.LineIntersector=function(){this.inputLines=[[],[]];this.intPt=[];this.intPt[0]=new jsts.geom.Coordinate();this.intPt[1]=new jsts.geom.Coordinate();this.pa=this.intPt[0];this.pb=this.intPt[1];this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.LineIntersector.NO_INTERSECTION=0;jsts.algorithm.LineIntersector.POINT_INTERSECTION=1;jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION=2;jsts.algorithm.LineIntersector.prototype.setPrecisionModel=function(precisionModel){this.precisionModel=precisionModel};jsts.algorithm.LineIntersector.prototype.getEndpoint=function(segmentIndex,ptIndex){return this.inputLines[segmentIndex][ptIndex]};jsts.algorithm.LineIntersector.computeEdgeDistance=function(p,p0,p1){var dx=Math.abs(p1.x-p0.x);var dy=Math.abs(p1.y-p0.y);var dist=-1.0;if(p.equals(p0)){dist=0.0}else if(p.equals(p1)){if(dx>dy){dist=dx}else{dist=dy}}else{var pdx=Math.abs(p.x-p0.x);var pdy=Math.abs(p.y-p0.y);if(dx>dy){dist=pdx}else{dist=pdy}if(dist===0.0&&!p.equals(p0)){dist=Math.max(pdx,pdy)}}if(dist===0.0&&!p.equals(p0)){throw new jsts.error.IllegalArgumentError('Bad distance calculation')}return dist};jsts.algorithm.LineIntersector.nonRobustComputeEdgeDistance=function(p,p1,p2){var dx=p.x-p1.x;var dy=p.y-p1.y;var dist=Math.sqrt(dx*dx+dy*dy);if(!(dist===0.0&&!p.equals(p1))){throw new jsts.error.IllegalArgumentError('Invalid distance calculation')}return dist};jsts.algorithm.LineIntersector.prototype.result=null;jsts.algorithm.LineIntersector.prototype.inputLines=null;jsts.algorithm.LineIntersector.prototype.intPt=null;jsts.algorithm.LineIntersector.prototype.intLineIndex=null;jsts.algorithm.LineIntersector.prototype._isProper=null;jsts.algorithm.LineIntersector.prototype.pa=null;jsts.algorithm.LineIntersector.prototype.pb=null;jsts.algorithm.LineIntersector.prototype.precisionModel=null;jsts.algorithm.LineIntersector.prototype.computeIntersection=function(p,p1,p2){throw new jsts.error.AbstractMethodInvocationError()};jsts.algorithm.LineIntersector.prototype.isCollinear=function(){return this.result===jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION};jsts.algorithm.LineIntersector.prototype.computeIntersection=function(p1,p2,p3,p4){this.inputLines[0][0]=p1;this.inputLines[0][1]=p2;this.inputLines[1][0]=p3;this.inputLines[1][1]=p4;this.result=this.computeIntersect(p1,p2,p3,p4)};jsts.algorithm.LineIntersector.prototype.computeIntersect=function(p1,p2,q1,q2){throw new jsts.error.AbstractMethodInvocationError()};jsts.algorithm.LineIntersector.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};jsts.algorithm.LineIntersector.prototype.hasIntersection=function(){return this.result!==jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.LineIntersector.prototype.getIntersectionNum=function(){return this.result};jsts.algorithm.LineIntersector.prototype.getIntersection=function(intIndex){return this.intPt[intIndex]};jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(){if(this.intLineIndex===null){this.intLineIndex=[[],[]];this.computeIntLineIndex(0);this.computeIntLineIndex(1)}};jsts.algorithm.LineIntersector.prototype.isIntersection=function(pt){var i;for(i=0;i<this.result;i++){if(this.intPt[i].equals2D(pt)){return true}}return false};jsts.algorithm.LineIntersector.prototype.isInteriorIntersection=function(){if(this.isInteriorIntersection(0)){return true}if(this.isInteriorIntersection(1)){return true}return false};jsts.algorithm.LineIntersector.prototype.isInteriorIntersection=function(inputLineIndex){var i;for(i=0;i<this.result;i++){if(!(this.intPt[i].equals2D(this.inputLines[inputLineIndex][0])||this.intPt[i].equals2D(this.inputLines[inputLineIndex][1]))){return true}}return false};jsts.algorithm.LineIntersector.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};jsts.algorithm.LineIntersector.prototype.getIntersectionAlongSegment=function(segmentIndex,intIndex){this.computeIntLineIndex();return this.intPt[intLineIndex[segmentIndex][intIndex]]};jsts.algorithm.LineIntersector.prototype.getIndexAlongSegment=function(segmentIndex,intIndex){this.computeIntLineIndex();return this.intLineIndex[segmentIndex][intIndex]};jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(segmentIndex){var dist0=this.getEdgeDistance(segmentIndex,0);var dist1=this.getEdgeDistance(segmentIndex,1);if(dist0>dist1){this.intLineIndex[segmentIndex][0]=0;this.intLineIndex[segmentIndex][1]=1}else{this.intLineIndex[segmentIndex][0]=1;this.intLineIndex[segmentIndex][1]=0}};jsts.algorithm.LineIntersector.prototype.getEdgeDistance=function(segmentIndex,intIndex){var dist=jsts.algorithm.LineIntersector.computeEdgeDistance(this.intPt[intIndex],this.inputLines[segmentIndex][0],this.inputLines[segmentIndex][1]);return dist};
19   -
20   -jsts.algorithm.HCoordinate=function(){this.x=0.0;this.y=0.0;this.w=1.0;if(arguments.length===1){this.initFrom1Coordinate(arguments[0])}else if(arguments.length===2&&arguments[0]instanceof jsts.geom.Coordinate){this.initFrom2Coordinates(arguments[0],arguments[1])}else if(arguments.length===2&&arguments[0]instanceof jsts.algorithm.HCoordinate){this.initFrom2HCoordinates(arguments[0],arguments[1])}else if(arguments.length===2){this.initFromXY(arguments[0],arguments[1])}else if(arguments.length===3){this.initFromXYW(arguments[0],arguments[1],arguments[2])}else if(arguments.length===4){this.initFromXYW(arguments[0],arguments[1],arguments[2],arguments[3])}};jsts.algorithm.HCoordinate.intersection=function(p1,p2,q1,q2){var px,py,pw,qx,qy,qw,x,y,w,xInt,yInt;px=p1.y-p2.y;py=p2.x-p1.x;pw=p1.x*p2.y-p2.x*p1.y;qx=q1.y-q2.y;qy=q2.x-q1.x;qw=q1.x*q2.y-q2.x*q1.y;x=py*qw-qy*pw;y=qx*pw-px*qw;w=px*qy-qx*py;xInt=x/w;yInt=y/w;if(!isFinite(xInt)||!isFinite(yInt)){throw new jsts.error.NotRepresentableError()}return new jsts.geom.Coordinate(xInt,yInt)};jsts.algorithm.HCoordinate.prototype.initFrom1Coordinate=function(p){this.x=p.x;this.y=p.y;this.w=1.0};jsts.algorithm.HCoordinate.prototype.initFrom2Coordinates=function(p1,p2){this.x=p1.y-p2.y;this.y=p2.x-p1.x;this.w=p1.x*p2.y-p2.x*p1.y};jsts.algorithm.HCoordinate.prototype.initFrom2HCoordinates=function(p1,p2){this.x=p1.y*p2.w-p2.y*p1.w;this.y=p2.x*p1.w-p1.x*p2.w;this.w=p1.x*p2.y-p2.x*p1.y};jsts.algorithm.HCoordinate.prototype.initFromXYW=function(x,y,w){this.x=x;this.y=y;this.w=w};jsts.algorithm.HCoordinate.prototype.initFromXY=function(x,y){this.x=x;this.y=y;this.w=1.0};jsts.algorithm.HCoordinate.prototype.initFrom4Coordinates=function(p1,p2,q1,q2){var px,py,pw,qx,qy,qw;px=p1.y-p2.y;py=p2.x-p1.x;pw=p1.x*p2.y-p2.x*p1.y;qx=q1.y-q2.y;qy=q2.x-q1.x;qw=q1.x*q2.y-q2.x*q1.y;this.x=py*qw-qy*pw;this.y=qx*pw-px*qw;this.w=px*qy-qx*py};jsts.algorithm.HCoordinate.prototype.getX=function(){var a=this.x/this.w;if(!isFinite(a)){throw new jsts.error.NotRepresentableError()}return a};jsts.algorithm.HCoordinate.prototype.getY=function(){var a=this.y/this.w;if(!isFinite(a)){throw new jsts.error.NotRepresentableError()}return a};jsts.algorithm.HCoordinate.prototype.getCoordinate=function(){var p=new jsts.geom.Coordinate();p.x=this.getX();p.y=this.getY();return p};
21   -jsts.algorithm.Angle=function(){};jsts.algorithm.Angle.PI_TIMES_2=2.0*Math.PI;jsts.algorithm.Angle.PI_OVER_2=Math.PI/2.0;jsts.algorithm.Angle.PI_OVER_4=Math.PI/4.0;jsts.algorithm.Angle.COUNTERCLOCKWISE=jsts.algorithm.CGAlgorithms.prototype.COUNTERCLOCKWISE;jsts.algorithm.Angle.CLOCKWISE=jsts.algorithm.CGAlgorithms.prototype.CLOCKWISE;jsts.algorithm.Angle.NONE=jsts.algorithm.CGAlgorithms.prototype.COLLINEAR;jsts.algorithm.Angle.toDegrees=function(radians){return(radians*180)/Math.PI};jsts.algorithm.Angle.toRadians=function(angleDegrees){return(angleDegrees*Math.PI)/180.0};jsts.algorithm.Angle.angle=function(){if(arguments.length===1){return jsts.algorithm.Angle.angleFromOrigo(arguments[0])}else{return jsts.algorithm.Angle.angleBetweenCoords(arguments[0],arguments[1])}};jsts.algorithm.Angle.angleBetweenCoords=function(p0,p1){var dx,dy;dx=p1.x-p0.x;dy=p1.y-p0.y;return Math.atan2(dy,dx)};jsts.algorithm.Angle.angleFromOrigo=function(p){return Math.atan2(p.y,p.x)};jsts.algorithm.Angle.isAcute=function(p0,p1,p2){var dx0,dy0,dx1,dy1,dotprod;dx0=p0.x-p1.x;dy0=p0.y-p1.y;dx1=p2.x-p1.x;dy1=p2.y-p1.y;dotprod=dx0*dx1+dy0*dy1;return dotprod>0};jsts.algorithm.Angle.isObtuse=function(p0,p1,p2){var dx0,dy0,dx1,dy1,dotprod;dx0=p0.x-p1.x;dy0=p0.y-p1.y;dx1=p2.x-p1.x;dy1=p2.y-p1.y;dotprod=dx0*dx1+dy0*dy1;return dotprod<0};jsts.algorithm.Angle.angleBetween=function(tip1,tail,tip2){var a1,a2;a1=jsts.algorithm.Angle.angle(tail,tip1);a2=jsts.algorithm.Angle.angle(tail,tip2);return jsts.algorithm.Angle.diff(a1,a2)};jsts.algorithm.Angle.angleBetweenOriented=function(tip1,tail,tip2){var a1,a2,angDel;a1=jsts.algorithm.Angle.angle(tail,tip1);a2=jsts.algorithm.Angle.angle(tail,tip2);angDel=a2-a1;if(angDel<=-Math.PI){return angDel+jsts.algorithm.Angle.PI_TIMES_2}if(angDel>Math.PI){return angDel-jsts.algorithm.Angle.PI_TIMES_2}return angDel};jsts.algorithm.Angle.interiorAngle=function(p0,p1,p2){var anglePrev,angleNext;anglePrev=jsts.algorithm.Angle.angle(p1,p0);angleNext=jsts.algorithm.Angle.angle(p1,p2);return Math.abs(angleNext-anglePrev)};jsts.algorithm.Angle.getTurn=function(ang1,ang2){var crossproduct=Math.sin(ang2-ang1);if(crossproduct>0){return jsts.algorithm.Angle.COUNTERCLOCKWISE}if(crossproduct<0){return jsts.algorithm.Angle.CLOCKWISE}return jsts.algorithm.Angle.NONE};jsts.algorithm.Angle.normalize=function(angle){while(angle>Math.PI){angle-=jsts.algorithm.Angle.PI_TIMES_2}while(angle<=-Math.PI){angle+=jsts.algorithm.Angle.PI_TIMES_2}return angle};jsts.algorithm.Angle.normalizePositive=function(angle){if(angle<0.0){while(angle<0.0){angle+=jsts.algorithm.Angle.PI_TIMES_2}if(angle>=jsts.algorithm.Angle.PI_TIMES_2){angle=0.0}}else{while(angle>=jsts.algorithm.Angle.PI_TIMES_2){angle-=jsts.algorithm.Angle.PI_TIMES_2}if(angle<0.0){angle=0.0}}return angle};jsts.algorithm.Angle.diff=function(ang1,ang2){var delAngle;if(ang1<ang2){delAngle=ang2-ang1}else{delAngle=ang1-ang2}if(delAngle>Math.PI){delAngle=(2*Math.PI)-delAngle}return delAngle};
22   -jsts.algorithm.RayCrossingCounter=function(p){this.p=p};jsts.algorithm.RayCrossingCounter.locatePointInRing=function(p,ring){var counter=new jsts.algorithm.RayCrossingCounter(p);for(var i=1;i<ring.length;i++){var p1=ring[i];var p2=ring[i-1];counter.countSegment(p1,p2);if(counter.isOnSegment())return counter.getLocation()}return counter.getLocation()};jsts.algorithm.RayCrossingCounter.prototype.p=null;jsts.algorithm.RayCrossingCounter.prototype.crossingCount=0;jsts.algorithm.RayCrossingCounter.prototype.isPointOnSegment=false;jsts.algorithm.RayCrossingCounter.prototype.countSegment=function(p1,p2){if(p1.x<this.p.x&&p2.x<this.p.x)return;if(this.p.x==p2.x&&this.p.y===p2.y){this.isPointOnSegment=true;return}if(p1.y===this.p.y&&p2.y===this.p.y){var minx=p1.x;var maxx=p2.x;if(minx>maxx){minx=p2.x;maxx=p1.x}if(this.p.x>=minx&&this.p.x<=maxx){this.isPointOnSegment=true}return}if(((p1.y>this.p.y)&&(p2.y<=this.p.y))||((p2.y>this.p.y)&&(p1.y<=this.p.y))){var x1=p1.x-this.p.x;var y1=p1.y-this.p.y;var x2=p2.x-this.p.x;var y2=p2.y-this.p.y;var xIntSign=jsts.algorithm.RobustDeterminant.signOfDet2x2(x1,y1,x2,y2);if(xIntSign===0.0){this.isPointOnSegment=true;return}if(y2<y1)xIntSign=-xIntSign;if(xIntSign>0.0){this.crossingCount++}}};jsts.algorithm.RayCrossingCounter.prototype.isOnSegment=function(){return jsts.geom.isPointOnSegment};jsts.algorithm.RayCrossingCounter.prototype.getLocation=function(){if(this.isPointOnSegment)return jsts.geom.Location.BOUNDARY;if((this.crossingCount%2)===1){return jsts.geom.Location.INTERIOR}return jsts.geom.Location.EXTERIOR};jsts.algorithm.RayCrossingCounter.prototype.isPointInPolygon=function(){return this.getLocation()!==jsts.geom.Location.EXTERIOR};
23   -jsts.algorithm.BoundaryNodeRule=function(){};jsts.algorithm.BoundaryNodeRule.prototype.isInBoundary=function(boundaryCount){throw new jsts.error.AbstractMethodInvocationError()};jsts.algorithm.Mod2BoundaryNodeRule=function(){};jsts.algorithm.Mod2BoundaryNodeRule.prototype=new jsts.algorithm.BoundaryNodeRule();jsts.algorithm.Mod2BoundaryNodeRule.prototype.isInBoundary=function(boundaryCount){return boundaryCount%2===1};jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE=new jsts.algorithm.Mod2BoundaryNodeRule();jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE=jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE;
24   -jsts.algorithm.RobustDeterminant=function(){};jsts.algorithm.RobustDeterminant.signOfDet2x2=function(x1,y1,x2,y2){var sign,swap,k,count;count=0;sign=1;if((x1===0.0)||(y2===0.0)){if((y1===0.0)||(x2===0.0)){return 0}else if(y1>0){if(x2>0){return-sign}else{return sign}}else{if(x2>0){return sign}else{return-sign}}}if((y1===0.0)||(x2===0.0)){if(y2>0){if(x1>0){return sign}else{return-sign}}else{if(x1>0){return-sign}else{return sign}}}if(0.0<y1){if(0.0<y2){if(y1>=y2){sign=-sign;swap=x1;x1=x2;x2=swap;swap=y1;y1=y2;y2=swap}}else{if(y1<=-y2){sign=-sign;x2=-x2;y2=-y2}else{swap=x1;x1=-x2;x2=swap;swap=y1;y1=-y2;y2=swap}}}else{if(0.0<y2){if(-y1<=y2){sign=-sign;x1=-x1;y1=-y1}else{swap=-x1;x1=x2;x2=swap;swap=-y1;y1=y2;y2=swap}}else{if(y1>=y2){x1=-x1;y1=-y1;x2=-x2;y2=-y2}else{sign=-sign;swap=-x1;x1=-x2;x2=swap;swap=-y1;y1=-y2;y2=swap}}}if(0.0<x1){if(0.0<x2){if(x1>=x2){return sign}}else{return sign}}else{if(0.0<x2){return-sign}else{if(x1>=x2){sign=-sign;x1=-x1;x2=-x2}else{return-sign}}}while(true){count=count+1;k=Math.floor(x2/x1);x2=x2-k*x1;y2=y2-k*y1;if(y2<0.0){return-sign}if(y2>y1){return sign}if(x1>x2+x2){if(y1<y2+y2){return sign}}else{if(y1>y2+y2){return-sign}else{x2=x1-x2;y2=y1-y2;sign=-sign}}if(y2===0.0){if(x2===0.0){return 0}else{return-sign}}if(x2===0.0){return sign}k=Math.floor(x1/x2);x1=x1-k*x2;y1=y1-k*y2;if(y1<0.0){return sign}if(y1>y2){return-sign}if(x2>x1+x1){if(y2<y1+y1){return-sign}}else{if(y2>y1+y1){return sign}else{x1=x2-x1;y1=y2-y1;sign=-sign}}if(y1===0.0){if(x1===0.0){return 0}else{return sign}}if(x1===0.0){return-sign}}};
25   -
26   -jsts.algorithm.CentralEndpointIntersector=function(p00,p01,p10,p11){this.pts=[p00,p01,p10,p11];this.compute()};jsts.algorithm.CentralEndpointIntersector.getIntersection=function(p00,p01,p10,p11){var intor=new jsts.algorithm.CentralEndpointIntersector(p00,p01,p10,p11);return intor.getIntersection()};jsts.algorithm.CentralEndpointIntersector.prototype.pts=null;jsts.algorithm.CentralEndpointIntersector.prototype.intPt=null;jsts.algorithm.CentralEndpointIntersector.prototype.compute=function(){var centroid=jsts.algorithm.CentralEndpointIntersector.average(this.pts);this.intPt=this.findNearestPoint(centroid,this.pts)};jsts.algorithm.CentralEndpointIntersector.prototype.getIntersection=function(){return this.intPt};jsts.algorithm.CentralEndpointIntersector.average=function(pts){var avg=new jsts.geom.Coordinate();var i,n=pts.length;for(i=0;i<n;i++){avg.x+=pts[i].x;avg.y+=pts[i].y}if(n>0){avg.x/=n;avg.y/=n}return avg};jsts.algorithm.CentralEndpointIntersector.prototype.findNearestPoint=function(p,pts){var minDist=Number.MAX_VALUE;var i,result=null,dist;for(i=0;i<pts.length;i++){dist=p.distance(pts[i]);if(dist<minDist){minDist=dist;result=pts[i]}}return result};
27   -
28   -
29   -jsts.algorithm.RobustLineIntersector=function(){jsts.algorithm.RobustLineIntersector.prototype.constructor.call(this)};jsts.algorithm.RobustLineIntersector.prototype=new jsts.algorithm.LineIntersector();jsts.algorithm.RobustLineIntersector.prototype.computeIntersection=function(p,p1,p2){if(arguments.length===4){jsts.algorithm.LineIntersector.prototype.computeIntersection.apply(this,arguments);return}this._isProper=false;if(jsts.geom.Envelope.intersects(p1,p2,p)){if((jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,p)===0)&&(jsts.algorithm.CGAlgorithms.orientationIndex(p2,p1,p)===0)){this._isProper=true;if(p.equals(p1)||p.equals(p2)){this._isProper=false}this.result=jsts.algorithm.LineIntersector.POINT_INTERSECTION;return}}this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.RobustLineIntersector.prototype.computeIntersect=function(p1,p2,q1,q2){this._isProper=false;if(!jsts.geom.Envelope.intersects(p1,p2,q1,q2)){return jsts.algorithm.LineIntersector.NO_INTERSECTION}var Pq1=jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,q1);var Pq2=jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,q2);if((Pq1>0&&Pq2>0)||(Pq1<0&&Pq2<0)){return jsts.algorithm.LineIntersector.NO_INTERSECTION}var Qp1=jsts.algorithm.CGAlgorithms.orientationIndex(q1,q2,p1);var Qp2=jsts.algorithm.CGAlgorithms.orientationIndex(q1,q2,p2);if((Qp1>0&&Qp2>0)||(Qp1<0&&Qp2<0)){return jsts.algorithm.LineIntersector.NO_INTERSECTION}var collinear=Pq1===0&&Pq2===0&&Qp1===0&&Qp2===0;if(collinear){return this.computeCollinearIntersection(p1,p2,q1,q2)}if(Pq1===0||Pq2===0||Qp1===0||Qp2===0){this._isProper=false;if(p1.equals2D(q1)||p1.equals2D(q2)){this.intPt[0]=p1}else if(p2.equals2D(q1)||p2.equals2D(q2)){this.intPt[0]=p2}else if(Pq1===0){this.intPt[0]=new jsts.geom.Coordinate(q1)}else if(Pq2===0){this.intPt[0]=new jsts.geom.Coordinate(q2)}else if(Qp1===0){this.intPt[0]=new jsts.geom.Coordinate(p1)}else if(Qp2===0){this.intPt[0]=new jsts.geom.Coordinate(p2)}}else{this._isProper=true;this.intPt[0]=this.intersection(p1,p2,q1,q2)}return jsts.algorithm.LineIntersector.POINT_INTERSECTION};jsts.algorithm.RobustLineIntersector.prototype.computeCollinearIntersection=function(p1,p2,q1,q2){var p1q1p2=jsts.geom.Envelope.intersects(p1,p2,q1);var p1q2p2=jsts.geom.Envelope.intersects(p1,p2,q2);var q1p1q2=jsts.geom.Envelope.intersects(q1,q2,p1);var q1p2q2=jsts.geom.Envelope.intersects(q1,q2,p2);if(p1q1p2&&p1q2p2){this.intPt[0]=q1;this.intPt[1]=q2;return jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(q1p1q2&&q1p2q2){this.intPt[0]=p1;this.intPt[1]=p2;return jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q1p2&&q1p1q2){this.intPt[0]=q1;this.intPt[1]=p1;return q1.equals(p1)&&!p1q2p2&&!q1p2q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q1p2&&q1p2q2){this.intPt[0]=q1;this.intPt[1]=p2;return q1.equals(p2)&&!p1q2p2&&!q1p1q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q2p2&&q1p1q2){this.intPt[0]=q2;this.intPt[1]=p1;return q2.equals(p1)&&!p1q1p2&&!q1p2q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q2p2&&q1p2q2){this.intPt[0]=q2;this.intPt[1]=p2;return q2.equals(p2)&&!p1q1p2&&!q1p1q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}return jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.RobustLineIntersector.prototype.intersection=function(p1,p2,q1,q2){var intPt=this.intersectionWithNormalization(p1,p2,q1,q2);if(!this.isInSegmentEnvelopes(intPt)){intPt=jsts.algorithm.CentralEndpointIntersector.getIntersection(p1,p2,q1,q2)}if(this.precisionModel!==null){this.precisionModel.makePrecise(intPt)}return intPt};jsts.algorithm.RobustLineIntersector.prototype.intersectionWithNormalization=function(p1,p2,q1,q2){var n1=new jsts.geom.Coordinate(p1);var n2=new jsts.geom.Coordinate(p2);var n3=new jsts.geom.Coordinate(q1);var n4=new jsts.geom.Coordinate(q2);var normPt=new jsts.geom.Coordinate();this.normalizeToEnvCentre(n1,n2,n3,n4,normPt);var intPt=this.safeHCoordinateIntersection(n1,n2,n3,n4);intPt.x+=normPt.x;intPt.y+=normPt.y;return intPt};jsts.algorithm.RobustLineIntersector.prototype.safeHCoordinateIntersection=function(p1,p2,q1,q2){var intPt=null;try{intPt=jsts.algorithm.HCoordinate.intersection(p1,p2,q1,q2)}catch(e){if(e instanceof jsts.error.NotRepresentableError){intPt=jsts.algorithm.CentralEndpointIntersector.getIntersection(p1,p2,q1,q2)}else{throw e}}return intPt};jsts.algorithm.RobustLineIntersector.prototype.normalizeToMinimum=function(n1,n2,n3,n4,normPt){normPt.x=this.smallestInAbsValue(n1.x,n2.x,n3.x,n4.x);normPt.y=this.smallestInAbsValue(n1.y,n2.y,n3.y,n4.y);n1.x-=normPt.x;n1.y-=normPt.y;n2.x-=normPt.x;n2.y-=normPt.y;n3.x-=normPt.x;n3.y-=normPt.y;n4.x-=normPt.x;n4.y-=normPt.y};jsts.algorithm.RobustLineIntersector.prototype.normalizeToEnvCentre=function(n00,n01,n10,n11,normPt){var minX0=n00.x<n01.x?n00.x:n01.x;var minY0=n00.y<n01.y?n00.y:n01.y;var maxX0=n00.x>n01.x?n00.x:n01.x;var maxY0=n00.y>n01.y?n00.y:n01.y;var minX1=n10.x<n11.x?n10.x:n11.x;var minY1=n10.y<n11.y?n10.y:n11.y;var maxX1=n10.x>n11.x?n10.x:n11.x;var maxY1=n10.y>n11.y?n10.y:n11.y;var intMinX=minX0>minX1?minX0:minX1;var intMaxX=maxX0<maxX1?maxX0:maxX1;var intMinY=minY0>minY1?minY0:minY1;var intMaxY=maxY0<maxY1?maxY0:maxY1;var intMidX=(intMinX+intMaxX)/2.0;var intMidY=(intMinY+intMaxY)/2.0;normPt.x=intMidX;normPt.y=intMidY;n00.x-=normPt.x;n00.y-=normPt.y;n01.x-=normPt.x;n01.y-=normPt.y;n10.x-=normPt.x;n10.y-=normPt.y;n11.x-=normPt.x;n11.y-=normPt.y};jsts.algorithm.RobustLineIntersector.prototype.smallestInAbsValue=function(x1,x2,x3,x4){var x=x1;var xabs=Math.abs(x);if(Math.abs(x2)<xabs){x=x2;xabs=Math.abs(x2)}if(Math.abs(x3)<xabs){x=x3;xabs=Math.abs(x3)}if(Math.abs(x4)<xabs){x=x4}return x};jsts.algorithm.RobustLineIntersector.prototype.isInSegmentEnvelopes=function(intPt){var env0=new jsts.geom.Envelope(this.inputLines[0][0],this.inputLines[0][1]);var env1=new jsts.geom.Envelope(this.inputLines[1][0],this.inputLines[1][1]);return env0.contains(intPt)&&env1.contains(intPt)};
30   -jsts.algorithm.PointLocator=function(boundaryRule){this.boundaryRule=boundaryRule?boundaryRule:jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE};jsts.algorithm.PointLocator.prototype.boundaryRule=null;jsts.algorithm.PointLocator.prototype.isIn=null;jsts.algorithm.PointLocator.prototype.numBoundaries=null;jsts.algorithm.PointLocator.prototype.intersects=function(p,geom){return this.locate(p,geom)!==jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.locate=function(p,geom){if(geom.isEmpty())return jsts.geom.Location.EXTERIOR;if(geom instanceof jsts.geom.LineString){return this.locate3(p,geom)}else if(geom instanceof jsts.geom.Polygon){return this.locate4(p,geom)}this.isIn=false;this.numBoundaries=0;this.computeLocation(p,geom);if(this.boundaryRule.isInBoundary(this.numBoundaries))return jsts.geom.Location.BOUNDARY;if(this.numBoundaries>0||this.isIn)return jsts.geom.Location.INTERIOR;return jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.computeLocation=function(p,geom){if(geom instanceof jsts.geom.Point||geom instanceof jsts.geom.LineString||geom instanceof jsts.geom.Polygon){this.updateLocationInfo(this.locate(p,geom))}else if(geom instanceof jsts.geom.MultiLineString){var ml=geom;for(var i=0;i<ml.getNumGeometries();i++){var l=ml.getGeometryN(i);this.updateLocationInfo(this.locate(p,l))}}else if(geom instanceof jsts.geom.MultiPolygon){var mpoly=geom;for(var i=0;i<mpoly.getNumGeometries();i++){var poly=mpoly.getGeometryN(i);this.updateLocationInfo(this.locate(p,poly))}}else if(geom instanceof jsts.geom.GeometryCollection){throw new jsts.error.NotImplementedError();var geomi=new GeometryCollectionIterator(geom);while(geomi.hasNext()){var g2=geomi.next();if(g2!=geom)this.computeLocation(p,g2)}}};jsts.algorithm.PointLocator.prototype.updateLocationInfo=function(loc){if(loc===jsts.geom.Location.INTERIOR)this.isIn=true;if(loc===jsts.geom.Location.BOUNDARY)this.numBoundaries++};jsts.algorithm.PointLocator.prototype.locate2=function(p,pt){var ptCoord=pt.getCoordinate();if(ptCoord.equals2D(p))return jsts.geom.Location.INTERIOR;return jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.locate3=function(p,l){if(!l.getEnvelopeInternal().intersects(p))return jsts.geom.Location.EXTERIOR;var pt=l.getCoordinates();if(!l.isClosed()){if(p.equals(pt[0])||p.equals(pt[pt.length-1])){return jsts.geom.Location.BOUNDARY}}if(jsts.algorithm.CGAlgorithms.isOnLine(p,pt))return jsts.geom.Location.INTERIOR;return jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.locateInPolygonRing=function(p,ring){if(!ring.getEnvelopeInternal().intersects(p))return jsts.geom.Location.EXTERIOR;return jsts.algorithm.CGAlgorithms.locatePointInRing(p,ring.getCoordinates())};jsts.algorithm.PointLocator.prototype.locate4=function(p,poly){if(poly.isEmpty())return jsts.geom.Location.EXTERIOR;var shell=poly.getExteriorRing();var shellLoc=this.locateInPolygonRing(p,shell);if(shellLoc===jsts.geom.Location.EXTERIOR)return jsts.geom.Location.EXTERIOR;if(shellLoc===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY;for(var i=0;i<poly.getNumInteriorRing();i++){var hole=poly.getInteriorRingN(i);var holeLoc=this.locateInPolygonRing(p,hole);if(holeLoc===jsts.geom.Location.INTERIOR)return jsts.geom.Location.EXTERIOR;if(holeLoc===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY}return jsts.geom.Location.INTERIOR};
31   -jsts.index.quadtree={};
32   -jsts.index.quadtree.Quadtree=function(){this.root=new jsts.index.quadtree.Root();this.minExtent=1.0};jsts.index.quadtree.Quadtree.ensureExtent=function(itemEnv,minExtent){var minx,maxx,miny,maxy;minx=itemEnv.getMinX();maxx=itemEnv.getMaxX();miny=itemEnv.getMinY();maxy=itemEnv.getMaxY();if(minx!==maxx&&miny!==maxy){return itemEnv}if(minx===maxx){minx=minx-(minExtent/2.0);maxx=minx+(minExtent/2.0)}if(miny===maxy){miny=miny-(minExtent/2.0);maxy=miny+(minExtent/2.0)}return new jsts.geom.Envelope(minx,maxx,miny,maxy)};jsts.index.quadtree.Quadtree.prototype.depth=function(){return this.root.depth()};jsts.index.quadtree.Quadtree.prototype.size=function(){return this.root.size()};jsts.index.quadtree.Quadtree.prototype.insert=function(itemEnv,item){this.collectStats(itemEnv);var insertEnv=jsts.index.quadtree.Quadtree.ensureExtent(itemEnv,this.minExtent);this.root.insert(insertEnv,item)};jsts.index.quadtree.Quadtree.prototype.remove=function(itemEnv,item){var posEnv=jsts.index.quadtree.Quadtree.ensureExtent(itemEnv,this.minExtent);return this.root.remove(posEnv,item)};jsts.index.quadtree.Quadtree.prototype.query=function(){if(arguments.length===1){return jsts.index.quadtree.Quadtree.prototype.queryByEnvelope.apply(this,arguments)}else{jsts.index.quadtree.Quadtree.prototype.queryWithVisitor.apply(this,arguments)}};jsts.index.quadtree.Quadtree.prototype.queryByEnvelope=function(searchEnv){var visitor=new jsts.index.ArrayListVisitor();this.query(searchEnv,visitor);return visitor.getItems()};jsts.index.quadtree.Quadtree.prototype.queryWithVisitor=function(searchEnv,visitor){this.root.visit(searchEnv,visitor)};jsts.index.quadtree.Quadtree.prototype.queryAll=function(){var foundItems=[];foundItems=this.root.addAllItems(foundItems);return foundItems};jsts.index.quadtree.Quadtree.prototype.collectStats=function(itemEnv){var delX=itemEnv.getWidth();if(delX<this.minExtent&&delX>0.0){this.minExtent=delX}var delY=itemEnv.getHeight();if(delY<this.minExtent&&delY>0.0){this.minExtent=delY}};
33   -jsts.index.quadtree.NodeBase=function(){this.subnode=new Array(4);this.subnode[0]=null;this.subnode[1]=null;this.subnode[2]=null;this.subnode[3]=null;this.items=[]};jsts.index.quadtree.NodeBase.prototype.getSubnodeIndex=function(env,centre){var subnodeIndex=-1;if(env.getMinX()>=centre.x){if(env.getMinY()>=centre.y){subnodeIndex=3}if(env.getMaxY()<=centre.y){subnodeIndex=1}}if(env.getMaxX()<=centre.x){if(env.getMinY()>=centre.y){subnodeIndex=2}if(env.getMaxY()<=centre.y){subnodeIndex=0}}return subnodeIndex};jsts.index.quadtree.NodeBase.prototype.getItems=function(){return this.items};jsts.index.quadtree.NodeBase.prototype.hasItems=function(){return(this.items.length>0)};jsts.index.quadtree.NodeBase.prototype.add=function(item){this.items.push(item)};jsts.index.quadtree.NodeBase.prototype.remove=function(itemEnv,item){if(!this.isSearchMatch(itemEnv)){return false}var found=false,i=0;for(i;i<4;i++){if(this.subnode[i]!==null){found=this.subnode[i].remove(itemEnv,item);if(found){if(this.subnode[i].isPrunable()){this.subnode[i]=null}break}}}if(found){return found}if(OpenLayers.Util.indexOf(this.items,item)!==-1){OpenLayers.Util.removeItem(this.items,item);found=true}return found};jsts.index.quadtree.NodeBase.prototype.isPrunable=function(){return!(this.hasChildren()||this.hasItems())};jsts.index.quadtree.NodeBase.prototype.hasChildren=function(){var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){return true}}return false};jsts.index.quadtree.NodeBase.prototype.isEmpty=function(){var isEmpty=true;if(this.items.length>0){isEmpty=false}var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){if(!this.subnode[i].isEmpty()){isEmpty=false}}}return isEmpty};jsts.index.quadtree.NodeBase.prototype.addAllItems=function(resultItems){resultItems=resultItems.concat(this.items);var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){resultItems=this.subnode[i].addAllItems(resultItems)}}return resultItems};jsts.index.quadtree.NodeBase.prototype.addAllItemsFromOverlapping=function(searchEnv,resultItems){if(!this.isSearchMatch(searchEnv)){return}resultItems=resultItems.concat(this.items);var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){resultItems=this.subnode[i].addAllItemsFromOverlapping(searchEnv,resultItems)}}};jsts.index.quadtree.NodeBase.prototype.visit=function(searchEnv,visitor){if(!this.isSearchMatch(searchEnv)){return}this.visitItems(searchEnv,visitor);var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){this.subnode[i].visit(searchEnv,visitor)}}};jsts.index.quadtree.NodeBase.prototype.visitItems=function(env,visitor){var i=0,il=this.items.length;for(i;i<il;i++){visitor.visitItem(this.items[i])}};jsts.index.quadtree.NodeBase.prototype.depth=function(){var maxSubDepth=0,i=0,sqd;for(i;i<4;i++){if(this.subnode[i]!==null){sqd=this.subnode[i].depth();if(sqd>maxSubDepth){maxSubDepth=sqd}}}return maxSubDepth+1};jsts.index.quadtree.NodeBase.prototype.size=function(){var subSize=0,i=0;for(i;i<4;i++){if(this.subnode[i]!==null){subSize+=this.subnode[i].size()}}return subSize+this.items.length};jsts.index.quadtree.NodeBase.prototype.getNodeCount=function(){var subSize=0,i=0;for(i;i<4;i++){if(this.subnode[i]!==null){subSize+=this.subnode[i].size()}}return subSize+1};
34   -jsts.index.quadtree.Node=function(env,level){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments);this.env=env;this.level=level;this.centre=new jsts.geom.Coordinate();this.centre.x=(env.getMinX()+env.getMaxX())/2;this.centre.y=(env.getMinY()+env.getMaxY())/2};jsts.index.quadtree.Node.prototype=new jsts.index.quadtree.NodeBase();jsts.index.quadtree.Node.createNode=function(env){var key,node;key=new jsts.index.quadtree.Key(env);node=new jsts.index.quadtree.Node(key.getEnvelope(),key.getLevel());return node};jsts.index.quadtree.Node.createExpanded=function(node,addEnv){var expandEnv=new jsts.geom.Envelope(addEnv),largerNode;if(node!==null){expandEnv.expandToInclude(node.env)}largerNode=jsts.index.quadtree.Node.createNode(expandEnv);if(node!==null){largerNode.insertNode(node)}return largerNode};jsts.index.quadtree.Node.prototype.getEnvelope=function(){return this.env};jsts.index.quadtree.Node.prototype.isSearchMatch=function(searchEnv){return this.env.intersects(searchEnv)};jsts.index.quadtree.Node.prototype.getNode=function(searchEnv){var subnodeIndex=this.getSubnodeIndex(searchEnv,this.centre),node;if(subnodeIndex!==-1){node=this.getSubnode(subnodeIndex);return node.getNode(searchEnv)}else{return this}};jsts.index.quadtree.Node.prototype.find=function(searchEnv){var subnodeIndex=this.getSubnodeIndex(searchEnv,this.centre),node;if(subnodeIndex===-1){return this}if(this.subnode[subnodeIndex]!==null){node=this.subnode[subnodeIndex];return node.find(searchEnv)}return this};jsts.index.quadtree.Node.prototype.insertNode=function(node){var index=this.getSubnodeIndex(node.env,this.centre),childNode;if(node.level===this.level-1){this.subnode[index]=node}else{childNode=this.createSubnode(index);childNode.insertNode(node);this.subnode[index]=childNode}};jsts.index.quadtree.Node.prototype.getSubnode=function(index){if(this.subnode[index]===null){this.subnode[index]=this.createSubnode(index)}return this.subnode[index]};jsts.index.quadtree.Node.prototype.createSubnode=function(index){var minx=0.0,maxx=0.0,miny=0.0,maxy=0.0,sqEnv,node;switch(index){case 0:minx=this.env.getMinX();maxx=this.centre.x;miny=this.env.getMinY();maxy=this.centre.y;break;case 1:minx=this.centre.x;maxx=this.env.getMaxX();miny=this.env.getMinY();maxy=this.centre.y;break;case 2:minx=this.env.getMinX();maxx=this.centre.x;miny=this.centre.y;maxy=this.env.getMaxY();break;case 3:minx=this.centre.x;maxx=this.env.getMaxX();miny=this.centre.y;maxy=this.env.getMaxY();break}sqEnv=new jsts.geom.Envelope(minx,maxx,miny,maxy);node=new jsts.index.quadtree.Node(sqEnv,this.level-1);return node};
35   -jsts.index.quadtree.Key=function(itemEnv){this.pt=new jsts.geom.Coordinate();this.level=0;this.env=null;this.computeKey(itemEnv)};jsts.index.quadtree.Key.computeQuadLevel=function(env){var dx,dy,dMax,level;dx=env.getWidth();dy=env.getHeight();dMax=dx>dy?dx:dy;level=jsts.index.DoubleBits.exponent(dMax)+1;return level};jsts.index.quadtree.Key.prototype.getPoint=function(){return this.pt};jsts.index.quadtree.Key.prototype.getLevel=function(){return this.level};jsts.index.quadtree.Key.prototype.getEnvelope=function(){return this.env};jsts.index.quadtree.Key.prototype.getCentre=function(){var x,y;x=(this.env.getMinX()+this.env.getMaxX())/2;y=(this.env.getMinY()+this.env.getMaxY())/2;return new jsts.geom.Coordinate(x,y)};jsts.index.quadtree.Key.prototype.computeKey=function(){if(arguments[0]instanceof jsts.geom.Envelope){this.computeKeyFromEnvelope(arguments[0])}else{this.computeKeyFromLevel(arguments[0],arguments[1])}};jsts.index.quadtree.Key.prototype.computeKeyFromEnvelope=function(env){this.level=jsts.index.quadtree.Key.computeQuadLevel(env);this.env=new jsts.geom.Envelope();this.computeKey(this.level,env);while(!this.env.contains(env)){this.level+=1;this.computeKey(this.level,env)}};jsts.index.quadtree.Key.prototype.computeKeyFromLevel=function(level,env){var quadSize=jsts.index.DoubleBits.powerOf2(level);this.pt.x=Math.floor(env.getMinX()/quadSize)*quadSize;this.pt.y=Math.floor(env.getMinY()/quadSize)*quadSize;this.env.init(this.pt.x,this.pt.x+quadSize,this.pt.y,this.pt.y+quadSize)};
36   -jsts.index.quadtree.Root=function(){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments);this.origin=new jsts.geom.Coordinate(0.0,0.0)};jsts.index.quadtree.Root.prototype=new jsts.index.quadtree.NodeBase();jsts.index.quadtree.Root.prototype.insert=function(itemEnv,item){var index=this.getSubnodeIndex(itemEnv,this.origin);if(index===-1){this.add(item);return}var node=this.subnode[index];if(node===null||!node.getEnvelope().contains(itemEnv)){var largerNode=jsts.index.quadtree.Node.createExpanded(node,itemEnv);this.subnode[index]=largerNode}this.insertContained(this.subnode[index],itemEnv,item)};jsts.index.quadtree.Root.prototype.insertContained=function(tree,itemEnv,item){var isZeroX,isZeroY,node;isZeroX=jsts.index.IntervalSize.isZeroWidth(itemEnv.getMinX(),itemEnv.getMaxX());isZeroY=jsts.index.IntervalSize.isZeroWidth(itemEnv.getMinY(),itemEnv.getMaxY());if(isZeroX||isZeroY){node=tree.find(itemEnv)}else{node=tree.getNode(itemEnv)}node.add(item)};jsts.index.quadtree.Root.prototype.isSearchMatch=function(searchEnv){return true};
37   -jsts.index.ArrayListVisitor=function(){this.items=[]};jsts.index.ArrayListVisitor.prototype.visitItem=function(item){this.items.push(item)};jsts.index.ArrayListVisitor.prototype.getItems=function(){return this.items};
38   -jsts.index.kdtree={};
39   -jsts.index.DoubleBits=function(){};jsts.index.DoubleBits.powerOf2=function(exp){return Math.pow(2,exp)};jsts.index.DoubleBits.exponent=function(d){return jsts.index.DoubleBits.CVTFWD(64,d)-1023};jsts.index.DoubleBits.CVTFWD=function(NumW,Qty){var Sign,Expo,Mant,Bin,nb01='';var Inf={32:{d:0x7F,c:0x80,b:0,a:0},64:{d:0x7FF0,c:0,b:0,a:0}};var ExW={32:8,64:11}[NumW],MtW=NumW-ExW-1;if(!Bin){Sign=Qty<0||1/Qty<0; if(!isFinite(Qty)){Bin=Inf[NumW];if(Sign){Bin.d+=1<<(NumW/4-1)}Expo=Math.pow(2,ExW)-1;Mant=0}}if(!Bin){Expo={32:127,64:1023}[NumW];Mant=Math.abs(Qty);while(Mant>=2){Expo++;Mant/=2}while(Mant<1&&Expo>0){Expo--;Mant*=2}if(Expo<=0){Mant/=2;nb01='Zero or Denormal'}if(NumW===32&&Expo>254){nb01='Too big for Single';Bin={d:Sign?0xFF:0x7F,c:0x80,b:0,a:0};Expo=Math.pow(2,ExW)-1;Mant=0}}return Expo};
40   -jsts.index.IntervalSize=function(){};jsts.index.IntervalSize.MIN_BINARY_EXPONENT=-50;jsts.index.IntervalSize.isZeroWidth=function(min,max){var width=max-min;if(width===0.0){return true}var maxAbs,scaledInterval,level;maxAbs=Math.max(Math.abs(min),Math.abs(max));scaledInterval=width/maxAbs;level=jsts.index.DoubleBits.exponent(scaledInterval);return level<=jsts.index.IntervalSize.MIN_BINARY_EXPONENT};
41   -jsts.index.kdtree.KdTree=function(tolerance){var tol=0.0;if(tolerance!==undefined){tol=tolerance}this.root=null;this.last=null;this.numberOfNodes=0;this.tolerance=tol};jsts.index.kdtree.KdTree.prototype.insert=function(){if(arguments.length===1){return this.insertCoordinate.apply(this,arguments[0])}else{return this.insertWithData.apply(this,arguments[0],arguments[1])}};jsts.index.kdtree.KdTree.prototype.insertCoordinate=function(p){return this.insertWithData(p,null)};jsts.index.kdtree.KdTree.prototype.insertWithData=function(p,data){if(this.root===null){this.root=new jsts.index.kdtree.KdNode(p,data);return this.root}var currentNode=this.root,leafNode=this.root,isOddLevel=true,isLessThan=true;while(currentNode!==last){if(isOddLevel){isLessThan=p.x<currentNode.getX()}else{isLessThan=p.y<currentNode.getY()}leafNode=currentNode;if(isLessThan){currentNode=currentNode.getLeft()}else{currentNode=currentNode.getRight()}if(currentNode!==null){var isInTolerance=p.distance(currentNode.getCoordinate())<=this.tolerance;if(isInTolerance){currentNode.increment();return currentNode}}isOddLevel=!isOddLevel}this.numberOfNodes=numberOfNodes+1;var node=new jsts.index.kdtree.KdNode(p,data);node.setLeft(this.last);node.setRight(this.last);if(isLessThan){leafNode.setLeft(node)}else{leafNode.setRight(node)}return node};jsts.index.kdtree.KdTree.prototype.queryNode=function(currentNode,bottomNode,queryEnv,odd,result){if(currentNode===bottomNode){return}var min,max,discriminant;if(odd){min=queryEnv.getMinX();max=queryEnv.getMaxX();discriminant=currentNode.getX()}else{min=queryEnv.getMinY();max=queryEnv.getMaxY();discriminant=currentNode.getY()}var searchLeft=min<discriminant;var searchRight=discriminant<=max;if(searchLeft){this.queryNode(currentNode.getLeft(),bottomNode,queryEnv,!odd,result)}if(queryEnv.contains(currentNode.getCoordinate())){result.add(currentNode)}if(searchRight){this.queryNode(currentNode.getRight(),bottomNode,queryEnv,!odd,result)}};jsts.index.kdtree.KdTree.prototype.query=function(){if(arguments.length===1){return this.queryByEnvelope.apply(this,arguments[0])}else{return this.queryWithArray.apply(this,arguments[0],arguments[1])}};jsts.index.kdtree.KdTree.prototype.queryByEnvelope=function(queryEnv){var result=[];this.queryNode(this.root,this.last,queryEnv,true,result);return result};jsts.index.kdtree.KdTree.prototype.queryWithArray=function(queryEnv,result){this.queryNode(this.root,this.last,queryEnv,true,result)};
42   -jsts.index.kdtree.KdNode=function(){this.left=null;this.right=null;this.count=1;if(arguments.length===2){this.initializeFromCoordinate.apply(this,arguments[0],arguments[1])}else if(arguments.length===3){this.initializeFromXY.apply(this,arguments[0],arguments[1],arguments[2])}};jsts.index.kdtree.KdNode.prototype.initializeFromXY=function(x,y,data){this.p=new jsts.geom.Coordinate(x,y);this.data=data};jsts.index.kdtree.KdNode.prototype.initializeFromCoordinate=function(p,data){this.p=p;this.data=data};jsts.index.kdtree.KdNode.prototype.getX=function(){return this.p.x};jsts.index.kdtree.KdNode.prototype.getY=function(){return this.p.y};jsts.index.kdtree.KdNode.prototype.getCoordinate=function(){return this.p};jsts.index.kdtree.KdNode.prototype.getData=function(){return this.data};jsts.index.kdtree.KdNode.prototype.getLeft=function(){return this.left};jsts.index.kdtree.KdNode.prototype.getRight=function(){return this.right};jsts.index.kdtree.KdNode.prototype.increment=function(){this.count+=1};jsts.index.kdtree.KdNode.prototype.getCount=function(){return this.count};jsts.index.kdtree.KdNode.prototype.isRepeated=function(){return count>1};jsts.index.kdtree.KdNode.prototype.setLeft=function(left){this.left=left};jsts.index.kdtree.KdNode.prototype.setRight=function(right){this.right=right};
43   -jsts.io.WKTWriter=function(){};jsts.io.WKTWriter.prototype.write=function(geometry){var format=new OpenLayers.Format.WKT();var feature=new OpenLayers.Feature.Vector(geometry);var wkt=format.write(feature);return wkt};
44   -jsts.io.WKTReader=function(){};jsts.io.WKTReader.prototype.read=function(wkt){var geometry=OpenLayers.Geometry.fromWKT(wkt);if(geometry instanceof jsts.geom.Coordinate){geometry=new jsts.geom.Point(geometry)}if(geometry===undefined){var type=wkt.split(' ')[0].toLowerCase();switch(type){case'point':geometry=new OpenLayers.Geometry.Point();break;case'multipoint':geometry=new OpenLayers.Geometry.MultiPoint();break;case'linestring':geometry=new OpenLayers.Geometry.LineString();break;case'multilinestring':geometry=new OpenLayers.Geometry.MultiLineString();break;case'polygon':geometry=new OpenLayers.Geometry.Polygon();break;case'multipolygon':geometry=new OpenLayers.Geometry.MultiPolygon();break}}return geometry};
45   -jsts.geom.Location=function(){};jsts.geom.Location.INTERIOR=0;jsts.geom.Location.BOUNDARY=1;jsts.geom.Location.EXTERIOR=2;jsts.geom.Location.NONE=-1;jsts.geom.Location.toLocationSymbol=function(locationValue){switch(locationValue){case jsts.geom.Location.EXTERIOR:return'e';case jsts.geom.Location.BOUNDARY:return'b';case jsts.geom.Location.INTERIOR:return'i';case jsts.geom.Location.NONE:return'-'}throw new jsts.IllegalArgumentError('Unknown location value: '+locationValue)};
46   -jsts.geom.Polygon=function(){};jsts.geom.Polygon=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.Polygon.prototype.getCoordinate=function(){return this.components[0].getCoordinate()};jsts.geom.Polygon.prototype.isEmpty=function(){for(var i=0;i<this.geometries.length;i++){if(!this.geometries[i].isEmpty()){return false}}return true};jsts.geom.Polygon.prototype.getExteriorRing=function(){return this.components[0]};jsts.geom.Polygon.prototype.getNumInteriorRing=function(){return this.components.slice(1).length};jsts.geom.Polygon.prototype.getBoundary=function(){if(this.isEmpty()){return this.getFactory().createMultiLineString(null)}var rings=[];var shell=this.components[0];rings[0]=shell;var holes=this.components.slice(1);for(var i=0;i<holes.length;i++){rings[i+1]=holes[i]}if(rings.length<=1)return this.getFactory().createLinearRing(rings[0].getCoordinateSequence());return this.getFactory().createMultiLineString(rings)};jsts.geom.Polygon.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}if(this.isEmpty()&&other.isEmpty()){return true}var holes=this.components.slice(1);var otherPolygon=other;var thisShell=this.components[0];var otherPolygonShell=otherPolygon.components[0];var otherPolygonHoles=otherPolygon.components.slice(1);if(!thisShell.equalsExact(otherPolygonShell,tolerance)){return false}if(holes.length!==otherPolygonHoles.length){return false}if(holes.length!==otherPolygonHoles.length){return false}for(var i=0;i<holes.length;i++){if(!(holes[i]).equalsExact(otherPolygonHoles[i],tolerance)){return false}}return true};jsts.geom.Polygon.prototype.apply=function(filter){filter.filter(this);if(filter instanceof jsts.geom.GeometryComponentFilter){var shell=this.components[0];shell.apply(filter);var holes=this.components.slice(1);for(var i=0;i<holes.length;i++){holes[i].apply(filter)}}};OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Polygon,jsts.geom.Polygon);jsts.geom.Polygon=OpenLayers.Geometry.Polygon;
47   -jsts.geom.util={};
48   -jsts.geom.Point=function(){};jsts.geom.Point=OpenLayers.Class(jsts.geom.Geometry,{initialize:function(coordinate){if(coordinate===undefined)return;this.coordinate=coordinate}});jsts.geom.Point.prototype.coordinate=null;jsts.geom.Point.prototype.getCoordinate=function(){return this.coordinate};jsts.geom.Point.prototype.isEmpty=function(){return this.coordinate===null};jsts.geom.Point.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}if(this.isEmpty()&&other.isEmpty()){return true}return this.equal(other.getCoordinate(),this.getCoordinate(),tolerance)};jsts.geom.Point.prototype.getBoundary=function(){return new jsts.geom.GeometryCollection(null)};jsts.geom.Point.prototype.apply=function(filter){filter.filter(this)};jsts.geom.Point.prototype.clone=function(){return new jsts.geom.Point(this.coordinate.clone())};jsts.geom.Point.prototype.getGeometryType=function(){return'Point'};
49   -jsts.geom.Envelope=function(){jsts.geom.Envelope.prototype.init.apply(this,arguments)};jsts.geom.Envelope.prototype.minx=null;jsts.geom.Envelope.prototype.maxx=null;jsts.geom.Envelope.prototype.miny=null;jsts.geom.Envelope.prototype.maxy=null;jsts.geom.Envelope.prototype.init=function(){if(typeof arguments[0]==='number'&&arguments.length===4){this.initFromValues(arguments[0],arguments[1],arguments[2],arguments[3])}else if(arguments[0]instanceof jsts.geom.Coordinate&&arguments.length===1){this.initFromCoordinate(arguments[0])}else if(arguments[0]instanceof jsts.geom.Coordinate&&arguments.length===2){this.initFromCoordinates(arguments[0],arguments[1])}else if(arguments[0]instanceof jsts.geom.Envelope&&arguments.length===1){this.initFromEnvelope(arguments[0])}};jsts.geom.Envelope.prototype.initFromValues=function(x1,x2,y1,y2){if(x1<x2){this.minx=x1;this.maxx=x2}else{this.minx=x2;this.maxx=x1}if(y1<y2){this.miny=y1;this.maxy=y2}else{this.miny=y2;this.maxy=y1}};jsts.geom.Envelope.prototype.initFromCoordinates=function(p1,p2){this.initFromValues(p1.x,p2.x,p1.y,p2.y)};jsts.geom.Envelope.prototype.initFromCoordinate=function(p){this.initFromCoordinates(p.x,p.x,p.y,p.y)};jsts.geom.Envelope.prototype.initFromEnvelope=function(env){this.minx=env.minx;this.maxx=env.maxx;this.miny=env.miny;this.maxy=env.maxy};jsts.geom.Envelope.prototype.setToNull=function(){this.minx=0;this.maxx=-1;this.miny=0;this.maxy=-1};jsts.geom.Envelope.prototype.isNull=function(){return this.maxx<this.minx};jsts.geom.Envelope.prototype.getHeight=function(){if(this.isNull()){return 0}return this.maxy-this.miny};jsts.geom.Envelope.prototype.getWidth=function(){if(this.isNull()){return 0}return this.maxx-this.minx};jsts.geom.Envelope.prototype.getMinX=function(){return this.minx};jsts.geom.Envelope.prototype.getMaxX=function(){return this.maxx};jsts.geom.Envelope.prototype.getMinY=function(){return this.miny};jsts.geom.Envelope.prototype.getMaxY=function(){return this.maxy};jsts.geom.Envelope.prototype.getArea=function(){return getWidth()*getHeight()};jsts.geom.Envelope.prototype.expandToInclude=function(){if(arguments[0]instanceof jsts.geom.Coordinate){this.expandToIncludeCoordinate(arguments[0])}else if(arguments[0]instanceof jsts.geom.Envelope){this.expandToIncludeEnvelope(arguments[0])}else{this.expandToIncludeValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.expandToIncludeCoordinate=function(p){this.expandToIncludeValues(p.x,p.y)};jsts.geom.Envelope.prototype.expandToIncludeValues=function(x,y){if(this.isNull()){this.minx=x;this.maxx=x;this.miny=y;this.maxy=y}else{if(x<this.minx){this.minx=x}if(x>this.maxx){this.maxx=x}if(y<this.miny){this.miny=y}if(y>this.maxy){this.maxy=y}}};jsts.geom.Envelope.prototype.expandToIncludeEnvelope=function(other){if(other.isNull()){return}if(this.isNull()){this.minx=other.getMinX();this.maxx=other.getMaxX();this.miny=other.getMinY();this.maxy=other.getMaxY()}else{if(other.minx<this.minx){this.minx=other.minx}if(other.maxx>this.maxx){this.maxx=other.maxx}if(other.miny<this.miny){this.miny=other.miny}if(other.maxy>this.maxy){this.maxy=other.maxy}}};jsts.geom.Envelope.prototype.expandBy=function(){if(arguments.length===1){this.expandByDistance(arguments[0])}else{this.expandByDistances(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.expandByDistance=function(distance){this.expandByDistances(distance,distance)};jsts.geom.Envelope.prototype.expandByDistances=function(deltaX,deltaY){if(this.isNull()){return}this.minx-=deltaX;this.maxx+=deltaX;this.miny-=deltaY;this.maxy+=deltaY;if(this.minx>this.maxx||this.miny>this.maxy){this.setToNull()}};jsts.geom.Envelope.prototype.translate=function(transX,transY){if(this.isNull()){return}this.init(this.minx+transX,this.maxx+transX,this.miny+transY,this.maxy+transY)};jsts.geom.Envelope.prototype.centre=function(){if(this.isNull()){return null}return new jsts.geom.Coordinate((this.minx+this.maxx)/2.0,(this.miny+this.maxy)/2.0)};jsts.geom.Envelope.prototype.intersection=function(env){if(this.isNull()||env.isNull()||!this.intersects(env)){return new jsts.geom.Envelope()}var intMinX=this.minx>env.minx?this.minx:env.minx;var intMinY=this.miny>env.miny?this.miny:env.miny;var intMaxX=this.maxx<env.maxx?this.maxx:env.maxx;var intMaxY=this.maxy<env.maxy?this.maxy:env.maxy;return new jsts.geom.Envelope(intMinX,intMaxX,intMinY,intMaxY)};jsts.geom.Envelope.prototype.intersects=function(){if(arguments[0]instanceof jsts.geom.Envelope){return this.intersectsEnvelope(arguments[0])}else if(arguments[0]instanceof jsts.geom.Coordinate){return this.intersectsCoordinate(arguments[0])}else{return this.intersectsValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.intersectsEnvelope=function(other){if(this.isNull()||other.isNull()){return false}var result=!(other.minx>this.maxx||other.maxx<this.minx||other.miny>this.maxy||other.maxy<this.miny);return result};jsts.geom.Envelope.prototype.intersectsCoordinate=function(p){return this.intersectsValues(p.x,p.y)};jsts.geom.Envelope.prototype.intersectsValues=function(x,y){if(this.isNull()){return false}return!(x>this.maxx||x<this.minx||y>this.maxy||y<this.miny)};jsts.geom.Envelope.prototype.contains=function(){if(arguments[0]instanceof jsts.geom.Envelope){return this.containsEnvelope(arguments[0])}else if(arguments[0]instanceof jsts.geom.Coordinate){return this.containsCoordinate(arguments[0])}else{return this.containsValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.containsEnvelope=function(other){return this.coversEnvelope(other)};jsts.geom.Envelope.prototype.containsCoordinate=function(p){return this.coversCoordinate(p)};jsts.geom.Envelope.prototype.containsValues=function(x,y){return this.coversValues(x,y)};jsts.geom.Envelope.prototype.covers=function(){if(p instanceof jsts.geom.Envelope){this.coversEnvelope(arguments[0])}else if(p instanceof jsts.geom.Coordinate){this.coversCoordinate(arguments[0])}else{this.coversValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.coversValues=function(x,y){if(this.isNull()){return false}return x>=this.minx&&x<=this.maxx&&y>=this.miny&&y<=this.maxy};jsts.geom.Envelope.prototype.coversCoordinate=function(p){return this.coversValues(p.x,p.y)};jsts.geom.Envelope.prototype.coversEnvelope=function(other){if(this.isNull()||other.isNull()){return false}return other.minx>=this.minx&&other.maxx<=this.maxx&&other.miny>=this.miny&&other.maxy<=this.maxy};jsts.geom.Envelope.prototype.distance=function(env){if(this.intersects(env)){return 0}var dx=0.0;if(this.maxx<env.minx){dx=env.minx-this.maxx}if(this.minx>env.maxx){dx=this.minx-env.maxx}var dy=0.0;if(this.maxy<env.miny){dy=env.miny-this.maxy}if(this.miny>env.maxy){dy=this.miny-env.maxy}if(dx===0.0){return dy}if(dy===0.0){return dx}return Math.sqrt(dx*dx+dy*dy)};jsts.geom.Envelope.prototype.equals=function(other){if(this.isNull()){return other.isNull()}return this.maxx===other.maxx&&this.maxy===other.maxy&&this.minx===other.minx&&this.miny===other.miny};jsts.geom.Envelope.prototype.toString=function(){return'Env['+this.minx+' : '+this.maxx+', '+this.miny+' : '+this.maxy+']'};jsts.geom.Envelope.intersects=function(p1,p2,q){if(arguments.length===4){return jsts.geom.Envelope.intersectsEnvelope(arguments[0],arguments[1],arguments[2],arguments[3])}var xc1=p1.x<p2.x?p1.x:p2.x;var xc2=p1.x>p2.x?p1.x:p2.x;var yc1=p1.y<p2.y?p1.y:p2.y;var yc2=p1.y>p2.y?p1.y:p2.y;if(((q.x>=xc1)&&(q.x<=xc2))&&((q.y>=yc1)&&(q.y<=yc2))){return true}return false};jsts.geom.Envelope.intersectsEnvelope=function(p1,p2,q1,q2){var minq=Math.min(q1.x,q2.x);var maxq=Math.max(q1.x,q2.x);var minp=Math.min(p1.x,p2.x);var maxp=Math.max(p1.x,p2.x);if(minp>maxq){return false}if(maxp<minq){return false}minq=Math.min(q1.y,q2.y);maxq=Math.max(q1.y,q2.y);minp=Math.min(p1.y,p2.y);maxp=Math.max(p1.y,p2.y);if(minp>maxq){return false}if(maxp<minq){return false}return true};jsts.geom.Envelope.prototype.clone=function(){return new jsts.geom.Envelope(this.minx,this.miny,this.maxx,this.maxy)};
50   -jsts.geom.LineString=function(){};jsts.geom.LineString=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.LineString.prototype.getCoordinates=function(){return this.components};jsts.geom.LineString.prototype.getCoordinateN=function(n){return this.components[n]};jsts.geom.LineString.prototype.getCoordinate=function(){if(this.isEmpty()){return null}return this.getCoordinateN(0)};jsts.geom.LineString.prototype.getDimension=function(){return 1};jsts.geom.LineString.prototype.getBoundaryDimension=function(){if(this.isClosed()){return Dimension.FALSE}return 0};jsts.geom.LineString.prototype.isEmpty=function(){return this.components.length===0};jsts.geom.LineString.prototype.isClosed=function(){if(this.isEmpty()){return false}return this.getCoordinateN(0).equals2D(this.getCoordinateN(this.components.length-1))};jsts.geom.LineString.prototype.isRing=function(){return this.isClosed()&&this.isSimple()};jsts.geom.LineString.prototype.getGeometryType=function(){return'LineString'};jsts.geom.LineString.prototype.getBoundary=function(){return(new jsts.operation.BoundaryOp(this)).getBoundary()};jsts.geom.LineString.prototype.computeEnvelopeInternal=function(){if(this.isEmpty()){return new jsts.geom.Envelope()}var env=new jsts.geom.Envelope();for(var i=0;i<this.components.length;i++){var point=this.components[i];env.expandToInclude(point)}return env};jsts.geom.LineString.prototype.equalsExact=function(other,tolerance){var i;if(!this.isEquivalentClass(other)){return false}if(this.components.length!==other.components.length){return false}for(i=0;i<this.components.length;i++){if(!jsts.geom.Geometry.prototype.equal(this.components[i],other.components[i],tolerance)){return false}}return true};jsts.geom.LineString.prototype.clone=function(){var key,coordinate;var points=[];for(key in this.components){if(this.components.hasOwnProperty(key)){coordinate=this.components[key];points.push(coordinate.clone())}}var clone=new jsts.geom.LineString(points);return clone};jsts.geom.LineString.prototype.apply=function(filter){filter.filter(this)};
51   -jsts.geom.MultiPoint=function(){};jsts.geom.MultiPoint=OpenLayers.Class(jsts.geom.GeometryCollection);jsts.geom.MultiPoint.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)};jsts.geom.MultiPoint.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}return jsts.geom.GeometryCollection.prototype.equalsExact.call(this,other,tolerance)};OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,jsts.geom.MultiPoint);jsts.geom.MultiPoint=OpenLayers.Geometry.MultiPoint;
52   -jsts.geom.Triangle=function(){};jsts.geom.Triangle.isAcute=function(a,b,c){if(!jsts.algorithm.Angle.isAcute(a,b,c)){return false}if(!jsts.algorithm.Angle.isAcute(b,c,a)){return false}if(!jsts.algorithm.Angle.isAcute(c,a,b)){return false}return true};jsts.geom.Triangle.perpendicularBisector=function(a,b){var dx,dy,l1,l2;dx=b.x-a.x;dy=b.y-a.y;l1=new jsts.algorithm.HCoordinate(a.x+dx/2.0,a.y+dy/2.0,1.0);l2=new jsts.algorithm.HCoordinate(a.x-dy+dx/2.0,a.y+dx+dy/2.0,1.0);return new jsts.algorithm.HCoordinate(l1,l2)};jsts.geom.Triangle.circumcentre=function(a,b,c){var cx,cy,ax,ay,bx,by,denom,numx,numy,ccx,ccy;cx=c.x;cy=c.y;ax=a.x-cx;ay=a.y-cy;bx=b.x-cx;by=b.y-cy;denom=2*jsts.geom.Triangle.det(ax,ay,bx,by);numx=jsts.geom.Triangle.det(ay,ax*ax+ay*ay,by,bx*bx+by*by);numy=jsts.geom.Triangle.det(ax,ax*ax+ay*ay,bx,bx*bx+by*by);ccx=cx-numx/denom;ccy=cy+numy/denom;return new jsts.geom.Coordinate(ccx,ccy)};jsts.geom.Triangle.det=function(m00,m01,m10,m11){return m00*m11-m01*m10};jsts.geom.Triangle.inCentre=function(a,b,c){var len0,len1,len2,circum,inCentreX,inCentreY;len0=b.distance(c);len1=a.distance(c);len2=a.distance(b);circum=len0+len1+len2;inCentreX=(len0*a.x+len1*b.x+len2*c.x)/circum;inCentreY=(len0*a.y+len1*b.y+len2*c.y)/circum;return new jsts.geom.Coordinate(inCentreX,inCentreY)};jsts.geom.Triangle.centroid=function(a,b,c){var x,y;x=(a.x+b.x+c.x)/3;y=(a.y+b.y+c.y)/3;return new jsts.geom.Coordinate(x,y)};jsts.geom.Triangle.longestSideLength=function(a,b,c){var lenAB,lenBC,lenCA,maxLen;lenAB=a.distance(b);lenBC=b.distance(c);lenCA=c.distance(a);maxLen=lenAB;if(lenBC>maxLen){maxLen=lenBC}if(lenCA>maxLen){maxLen=lenCA}return maxLen};jsts.geom.Triangle.angleBisector=function(a,b,c){var len0,len2,frac,dx,dy,splitPt;len0=b.distance(a);len2=b.distance(c);frac=len0/(len0+len2);dx=c.x-a.x;dy=c.y-a.y;splitPt=new jsts.geom.Coordinate(a.x+frac*dx,a.y+frac*dy);return splitPt};jsts.geom.Triangle.area=function(a,b,c){return Math.abs(((c.x-a.x)*(b.y-a.y)-(b.x-a.x)*(c.y-a.y))/2.0)};jsts.geom.Triangle.signedArea=function(a,b,c){return((c.x-a.x)*(b.y-a.y)-(b.x-a.x)*(c.y-a.y))/2.0};jsts.geom.Triangle.prototype.initialize=function(p0,p1,p2){this.p0=p0;this.p1=p1;this.p2=p2};jsts.geom.Triangle.prototype.inCentre=function(){return jsts.geom.Triangle.inCentre(this.p0,this.p1,this.p2)};
53   -jsts.geom.GeometryComponentFilter=function(){};jsts.geom.GeometryComponentFilter.prototype.filter=function(geom){throw new jsts.error.AbstractMethodInvocationError()};
54   -jsts.geom.Dimension=function(){};jsts.geom.Dimension.P=0;jsts.geom.Dimension.L=1;jsts.geom.Dimension.A=2;jsts.geom.Dimension.FALSE=-1;jsts.geom.Dimension.TRUE=-2;jsts.geom.Dimension.DONTCARE=-3;jsts.geom.Dimension.toDimensionSymbol=function(dimensionValue){switch(dimensionValue){case FALSE:return'F';case TRUE:return'T';case DONTCARE:return'*';case P:return'0';case L:return'1';case A:return'2'}throw new jsts.IllegalArgumentError('Unknown dimension value: '+dimensionValue)};jsts.geom.Dimension.toDimensionValue=function(dimensionSymbol){switch(dimensionSymbol.toUpperCase()){case'F':return jsts.geom.Dimension.FALSE;case'T':return jsts.geom.Dimension.TRUE;case'*':return jsts.geom.Dimension.DONTCARE;case'0':return jsts.geom.Dimension.P;case'1':return jsts.geom.Dimension.L;case'2':return jsts.geom.Dimension.A}throw new jsts.error.IllegalArgumentError('Unknown dimension symbol: '+dimensionSymbol)};
55   -jsts.geom.CoordinateList=function(coord,allowRepeated){this.add(coord,allowRepeated)};jsts.geom.CoordinateList.prototype=new Array();jsts.geom.CoordinateList.prototype.add=function(coord,allowRepeated,direction){direction=direction||true;if(direction){for(var i=0;i<coord.length;i++){this.addCoordinate(coord[i],allowRepeated)}}else{for(var i=coord.length-1;i>=0;i--){this.addCoordinate(coord[i],allowRepeated)}}return true};jsts.geom.CoordinateList.prototype.addCoordinate=function(coord,allowRepeated){if(!allowRepeated){if(this.length>=1){var last=this[this.length-1];if(last.equals2D(coord))return}}this.push(coord)};
56   -jsts.geom.GeometryFilter=function(){};jsts.geom.GeometryFilter.prototype.filter=function(geom){throw new jsts.error.AbstractMethodInvocationError()};
57   -jsts.geom.MultiLineString=function(){};jsts.geom.MultiLineString=OpenLayers.Class(jsts.geom.GeometryCollection);jsts.geom.MultiLineString.prototype.getBoundary=function(){return(new jsts.operation.BoundaryOp(this)).getBoundary()};jsts.geom.MultiLineString.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}return jsts.geom.GeometryCollection.prototype.equalsExact.call(this,other,tolerance)};OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.MultiLineString,jsts.geom.MultiLineString);jsts.geom.MultiLineString=OpenLayers.Geometry.MultiLineString;
58   -jsts.geom.LineSegment=function(p0,p1){this.p0=p0;this.p1=p1};jsts.geom.LineSegment.prototype.p0=null;jsts.geom.LineSegment.prototype.p1=null;jsts.geom.LineSegment.prototype.projectionFactor=function(p){if(p.equals(this.p0))return 0.0;if(p.equals(this.p1))return 1.0;var dx=this.p1.x-this.p0.x;var dy=this.p1.y-this.p0.y;var len2=dx*dx+dy*dy;var r=((p.x-this.p0.x)*dx+(p.y-this.p0.y)*dy)/len2;return r};jsts.geom.LineSegment.prototype.closestPoint=function(p){var factor=this.projectionFactor(p);if(factor>0&&factor<1){return this.project(p)}var dist0=this.p0.distance(p);var dist1=this.p1.distance(p);if(dist0<dist1)return this.p0;return this.p1};jsts.geom.LineSegment.prototype.closestPoints=function(line){var intPt=this.intersection(line);if(intPt!==null){return[intPt,intPt]}var closestPt=[];var minDistance=Number.MAX_VALUE;var dist;var close00=this.closestPoint(line.p0);minDistance=close00.distance(line.p0);closestPt[0]=close00;closestPt[1]=line.p0;var close01=this.closestPoint(line.p1);dist=close01.distance(line.p1);if(dist<minDistance){minDistance=dist;closestPt[0]=close01;closestPt[1]=line.p1}var close10=line.closestPoint(this.p0);dist=close10.distance(this.p0);if(dist<minDistance){minDistance=dist;closestPt[0]=this.p0;closestPt[1]=close10}var close11=line.closestPoint(this.p1);dist=close11.distance(this.p1);if(dist<minDistance){minDistance=dist;closestPt[0]=this.p1;closestPt[1]=close11}return closestPt};jsts.geom.LineSegment.prototype.intersection=function(line){var li=new jsts.algorithm.RobustLineIntersector();li.computeIntersection(this.p0,this.p1,line.p0,line.p1);if(li.hasIntersection())return li.getIntersection(0);return null};jsts.geom.LineSegment.prototype.project=function(p){if(p.equals(this.p0)||p.equals(this.p1))return new jsts.geom.Coordinate(p);var r=this.projectionFactor(p);var coord=new jsts.geom.Coordinate();coord.x=this.p0.x+r*(this.p1.x-this.p0.x);coord.y=this.p0.y+r*(this.p1.y-this.p0.y);return coord};
59   -jsts.geom.IntersectionMatrix=function(elements){var other=elements;if(elements===undefined||elements===null){this.matrix=[[],[],[]];this.setAll(jsts.geom.Dimension.FALSE)}else if(typeof elements==='string'){this.set(elements)}else if(other instanceof jsts.geom.IntersectionMatrix){this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR]=other.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR];this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.BOUNDARY]=other.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.BOUNDARY];this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR]=other.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR];this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.INTERIOR]=other.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.INTERIOR];this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.BOUNDARY]=other.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.BOUNDARY];this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.EXTERIOR]=other.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.EXTERIOR];this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR]=other.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR];this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.BOUNDARY]=other.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.BOUNDARY];this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.EXTERIOR]=other.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.EXTERIOR]}throw new jsts.error.IllegalArgumentError()};jsts.geom.IntersectionMatrix.prototype.matrix=null;jsts.geom.IntersectionMatrix.prototype.add=function(im){var i,j;for(i=0;i<3;i++){for(j=0;j<3;j++){this.setAtLeast(i,j,im.get(i,j))}}};jsts.geom.IntersectionMatrix.matches=function(actualDimensionValue,requiredDimensionSymbol){if(typeof actualDimensioValue==='string'){return jsts.geom.IntersectionMatrix.matches2.call(this,arguments)}if(requiredDimensionSymbol==='*'){return true}if(requiredDimensionSymbol==='T'&&(actualDimensionValue>=0||actualDimensionValue===Dimension.TRUE)){return true}if(requiredDimensionSymbol==='F'&&actualDimensionValue===Dimension.FALSE){return true}if(requiredDimensionSymbol==='0'&&actualDimensionValue===Dimension.P){return true}if(requiredDimensionSymbol==='1'&&actualDimensionValue===Dimension.L){return true}if(requiredDimensionSymbol==='2'&&actualDimensionValue===Dimension.A){return true}return false};jsts.geom.IntersectionMatrix.matches2=function(actualDimensionSymbols,requiredDimensionSymbols){var m=new jsts.geom.IntersectionMatrix(actualDimensionSymbols);return m.matches(requiredDimensionSymbols)};jsts.geom.IntersectionMatrix.prototype.set=function(row,column,dimensionValue){if(typeof row==='string'){this.set2(row);return}this.matrix[row][column]=dimensionValue};jsts.geom.IntersectionMatrix.prototype.set2=function(dimensionSymbols){for(var i=0;i<dimensionSymbols.length();i++){var row=i/3;var col=i%3;this.matrix[row][col]=jsts.geom.Dimension.toDimensionValue(dimensionSymbols.charAt(i))}};jsts.geom.IntersectionMatrix.prototype.setAtLeast=function(row,column,minimumDimensionValue){if(this.matrix[row][column]<minimumDimensionValue){this.matrix[row][column]=minimumDimensionValue}};jsts.geom.IntersectionMatrix.prototype.setAtLeastIfValid=function(row,column,minimumDimensionValue){if(row>=0&&column>=0){this.setAtLeast(row,column,minimumDimensionValue)}};jsts.geom.IntersectionMatrix.prototype.setAtLeast=function(minimumDimensionSymbols){var i;for(i=0;i<minimumDimensionSymbols.length();i++){var row=i/3;var col=i%3;this.setAtLeast(row,col,Dimension.toDimensionValue(minimumDimensionSymbols.charAt(i)))}};jsts.geom.IntersectionMatrix.prototype.setAll=function(dimensionValue){var ai,bi;for(ai=0;ai<3;ai++){for(bi=0;bi<3;bi++){this.matrix[ai][bi]=dimensionValue}}};jsts.geom.IntersectionMatrix.prototype.get=function(row,column){return this.matrix[row][column]};jsts.geom.IntersectionMatrix.prototype.isDisjoint=function(){return this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.BOUNDARY]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.INTERIOR]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.BOUNDARY]===jsts.geom.Dimension.FALSE};jsts.geom.IntersectionMatrix.prototype.isIntersects=function(){return!this.isDisjoint()};jsts.geom.IntersectionMatrix.prototype.isTouches=function(dimensionOfGeometryA,dimensionOfGeometryB){if(dimensionOfGeometryA>dimensionOfGeometryB){return this.isTouches(dimensionOfGeometryB,dimensionOfGeometryA)}if((dimensionOfGeometryA==jsts.geom.Dimension.A&&dimensionOfGeometryB==jsts.geom.Dimension.A)||(dimensionOfGeometryA==jsts.geom.Dimension.L&&dimensionOfGeometryB==jsts.geom.Dimension.L)||(dimensionOfGeometryA==jsts.geom.Dimension.L&&dimensionOfGeometryB==jsts.geom.Dimension.A)||(dimensionOfGeometryA==jsts.geom.Dimension.P&&dimensionOfGeometryB==jsts.geom.Dimension.A)||(dimensionOfGeometryA==jsts.geom.Dimension.P&&dimensionOfGeometryB==jsts.geom.Dimension.L)){return this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR]===jsts.geom.Dimension.FALSE&&(jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.BOUNDARY],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.INTERIOR],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.BOUNDARY],'T'))}return false};jsts.geom.IntersectionMatrix.prototype.isCrosses=function(dimensionOfGeometryA,dimensionOfGeometryB){if((dimensionOfGeometryA==jsts.geom.Dimension.P&&dimensionOfGeometryB==jsts.geom.Dimension.L)||(dimensionOfGeometryA==jsts.geom.Dimension.P&&dimensionOfGeometryB==jsts.geom.Dimension.A)||(dimensionOfGeometryA==jsts.geom.Dimension.L&&dimensionOfGeometryB==jsts.geom.Dimension.A)){return jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')&&jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR],'T')}if((dimensionOfGeometryA==jsts.geom.Dimension.L&&dimensionOfGeometryB==jsts.geom.Dimension.P)||(dimensionOfGeometryA==jsts.geom.Dimension.A&&dimensionOfGeometryB==jsts.geom.Dimension.P)||(dimensionOfGeometryA==jsts.geom.Dimension.A&&dimensionOfGeometryB==jsts.geom.Dimension.L)){return jsts.geom.IntersectionMatrix.matches(matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')&&jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR],'T')}if(dimensionOfGeometryA===jsts.geom.Dimension.L&&dimensionOfGeometryB===jsts.geom.Dimension.L){return this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR]===0}return false};jsts.geom.IntersectionMatrix.prototype.isWithin=function(){return jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')&&this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR]==jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.EXTERIOR]==jsts.geom.Dimension.FALSE};jsts.geom.IntersectionMatrix.prototype.isContains=function(){return jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')&&this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR]==jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.BOUNDARY]==jsts.geom.Dimension.FALSE};jsts.geom.IntersectionMatrix.prototype.isCovers=function(){var hasPointInCommon=jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.BOUNDARY],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.INTERIOR],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.BOUNDARY],'T');return hasPointInCommon&&this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR]==jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.BOUNDARY]==jsts.geom.Dimension.FALSE};jsts.geom.IntersectionMatrix.prototype.isCoveredBy=function(){var hasPointInCommon=jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.BOUNDARY],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.INTERIOR],'T')||jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.BOUNDARY],'T');return hasPointInCommon&&this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.EXTERIOR]===jsts.geom.Dimension.FALSE};jsts.geom.IntersectionMatrix.prototype.isEquals=function(dimensionOfGeometryA,dimensionOfGeometryB){if(dimensionOfGeometryA!==dimensionOfGeometryB){return false}return jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')&&this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.BOUNDARY]===jsts.geom.Dimension.FALSE&&this.matrix[jsts.geom.Location.BOUNDARY][jsts.geom.Location.EXTERIOR]===jsts.geom.Dimension.FALSE};jsts.geom.IntersectionMatrix.prototype.isOverlaps=function(dimensionOfGeometryA,dimensionOfGeometryB){if((dimensionOfGeometryA==jsts.geom.Dimension.P&&dimensionOfGeometryB===Dimension.P)||(dimensionOfGeometryA==jsts.geom.Dimension.A&&dimensionOfGeometryB===Dimension.A)){return jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR],'T')&&jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR],'T')&&jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR],'T')}if(dimensionOfGeometryA===jsts.geom.Dimension.L&&dimensionOfGeometryB===jsts.geom.Dimension.L){return this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.INTERIOR]==1&&jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.INTERIOR][jsts.geom.Location.EXTERIOR],'T')&&jsts.geom.IntersectionMatrix.matches(this.matrix[jsts.geom.Location.EXTERIOR][jsts.geom.Location.INTERIOR],'T')}return false};jsts.geom.IntersectionMatrix.prototype.matches=function(requiredDimensionSymbols){if(requiredDimensionSymbols.length()!=9){throw new jsts.error.IllegalArgumentException('Should be length 9: '+requiredDimensionSymbols)}for(var ai=0;ai<3;ai++){for(var bi=0;bi<3;bi++){if(!jsts.geom.IntersectionMatrix.matches(this.matrix[ai][bi],requiredDimensionSymbols.charAt(3*ai+bi))){return false}}}return true};jsts.geom.IntersectionMatrix.prototype.transpose=function(){var temp=matrix[1][0];this.matrix[1][0]=this.matrix[0][1];this.matrix[0][1]=temp;temp=this.matrix[2][0];this.matrix[2][0]=this.matrix[0][2];this.matrix[0][2]=temp;temp=this.matrix[2][1];this.matrix[2][1]=this.matrix[1][2];this.matrix[1][2]=temp;return this};jsts.geom.IntersectionMatrix.prototype.toString=function(){var ai,bi,buf='123456789';for(ai=0;ai<3;ai++){for(bi=0;bi<3;bi++){buf.setCharAt(3*ai+bi,jsts.geom.Dimension.toDimensionSymbol(matrix[ai][bi]))}}return buf};
60   -jsts.geom.util.LinearComponentExtracter=function(lines,isForcedToLineString){this.lines=lines;this.isForcedToLineString=isForcedToLineString};jsts.geom.util.LinearComponentExtracter.prototype=new jsts.geom.GeometryComponentFilter();jsts.geom.util.LinearComponentExtracter.prototype.lines=null;jsts.geom.util.LinearComponentExtracter.prototype.isForcedToLineString=false;jsts.geom.util.LinearComponentExtracter.getLines=function(geoms,lines){if(arguments.length==1){return jsts.geom.util.LinearComponentExtracter.getLines5.apply(this,arguments)}else if(arguments.length==2&&typeof lines==='boolean'){return jsts.geom.util.LinearComponentExtracter.getLines6.apply(this,arguments)}else if(arguments.length==2&&geoms instanceof jsts.geom.Geometry){return jsts.geom.util.LinearComponentExtracter.getLines3.apply(this,arguments)}else if(arguments.length==3&&geoms instanceof jsts.geom.Geometry){return jsts.geom.util.LinearComponentExtracter.getLines4.apply(this,arguments)}else if(arguments.length==3){return jsts.geom.util.LinearComponentExtracter.getLines2.apply(this,arguments)}for(var i=0;i<geoms.length;i++){var g=geoms[i];jsts.geom.util.LinearComponentExtracter.getLines3(g,lines)}return lines};jsts.geom.util.LinearComponentExtracter.getLines2=function(geoms,lines,forceToLineString){for(var i=0;i<geoms.length;i++){var g=geoms[i];jsts.geom.util.LinearComponentExtracter.getLines4(g,lines,forceToLineString)}return lines};jsts.geom.util.LinearComponentExtracter.getLines3=function(geom,lines){if(geom instanceof LineString){lines.add(geom)}else{geom.apply(new jsts.geom.util.LinearComponentExtracter(lines))}return lines};jsts.geom.util.LinearComponentExtracter.getLines4=function(geom,lines,forceToLineString){geom.apply(new jsts.geom.util.LinearComponentExtracter(lines,forceToLineString));return lines};jsts.geom.util.LinearComponentExtracter.getLines5=function(geom){return jsts.geom.util.LinearComponentExtracter.getLines6(geom,false)};jsts.geom.util.LinearComponentExtracter.getLines6=function(geom,forceToLineString){var lines=[];geom.apply(new jsts.geom.util.LinearComponentExtracter(lines,forceToLineString));return lines};jsts.geom.util.LinearComponentExtracter.prototype.setForceToLineString=function(isForcedToLineString){this.isForcedToLineString=isForcedToLineString};jsts.geom.util.LinearComponentExtracter.prototype.filter=function(geom){if(this.isForcedToLineString&&geom instanceof jsts.geom.LinearRing){var line=geom.getFactory().createLineString(geom.getCoordinateSequence());this.lines.push(line);return}if(geom instanceof jsts.geom.LineString||geom instanceof jsts.geom.LinearRing)this.lines.push(geom)};
61   -jsts.geom.util.PolygonExtracter=function(comps){this.comps=comps};jsts.geom.util.PolygonExtracter.prototype=new jsts.geom.GeometryFilter();jsts.geom.util.PolygonExtracter.prototype.comps=null;jsts.geom.util.PolygonExtracter.getPolygons=function(geom,list){if(list===undefined){list=[]}if(geom instanceof jsts.geom.Polygon){list.push(geom)}else if(geom instanceof jsts.geom.GeometryCollection){geom.apply(new jsts.geom.util.PolygonExtracter(list))}return list};jsts.geom.util.PolygonExtracter.prototype.filter=function(geom){if(geom instanceof jsts.geom.Polygon)this.comps.push(geom)};
62   -jsts.geom.util.PointExtracter=function(pts){this.pts=pts};jsts.geom.util.PointExtracter.prototype=new jsts.geom.GeometryFilter();jsts.geom.util.PointExtracter.prototype.pts=null;jsts.geom.util.PointExtracter.getPoints=function(geom,list){if(list===undefined){list=[]}if(geom instanceof jsts.geom.Point){list.push(geom)}else if(geom instanceof jsts.geom.GeometryCollection){geom.apply(new jsts.geom.util.PointExtracter(list))}return list};jsts.geom.util.PointExtracter.prototype.filter=function(geom){if(geom instanceof jsts.geom.Point)this.pts.push(geom)};
63   -jsts.geom.LinearRing=function(){};jsts.geom.LinearRing=OpenLayers.Class(jsts.geom.LineString);jsts.geom.LinearRing.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE};jsts.geom.LinearRing.prototype.isSimple=function(){return true};jsts.geom.LinearRing.prototype.getGeometryType=function(){return'LinearRing'};OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LinearRing,jsts.geom.LinearRing);jsts.geom.LinearRing=OpenLayers.Geometry.LinearRing;OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.LineString,jsts.geom.LineString,{initialize:function(points){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments);this.geometries=this.components}});jsts.geom.LineString=OpenLayers.Geometry.LineString;
64   -jsts.geom.MultiPolygon=function(){};jsts.geom.MultiPolygon=OpenLayers.Class(jsts.geom.GeometryCollection);jsts.geom.MultiPolygon.prototype.getBoundary=function(){if(this.isEmpty()){return this.getFactory().createMultiLineString(null)}var allRings=[];for(var i=0;i<this.geometries.length;i++){var polygon=this.geometries[i];var rings=polygon.getBoundary();for(var j=0;j<rings.getNumGeometries();j++){allRings.push(rings.getGeometryN(j))}}return this.getFactory().createMultiLineString(allRings)};jsts.geom.MultiPolygon.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}return jsts.geom.GeometryCollection.prototype.equalsExact.call(this,other,tolerance)};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.MultiPolygon,jsts.geom.MultiPolygon);jsts.geom.MultiPolygon=OpenLayers.Geometry.MultiPolygon;
65   -jsts.geom.Geometry=function(){};jsts.geom.Geometry=OpenLayers.Class();jsts.geom.Geometry.prototype.envelope=null;jsts.geom.Geometry.prototype.precisionModel=null;jsts.geom.Geometry.prototype.getGeometryType=function(){return'Geometry'};jsts.geom.Geometry.hasNonEmptyElements=function(geometries){var i;for(i=0;i<geometries.length;i++){if(!geometries[i].isEmpty()){return true}}return false};jsts.geom.Geometry.hasNullElements=function(array){var i;for(i=0;i<array.length;i++){if(array[i]===null){return true}}return false};jsts.geom.Geometry.prototype.getFactory=function(){return new jsts.geom.GeometryFactory()};jsts.geom.Geometry.prototype.getNumGeometries=function(){return 1};jsts.geom.Geometry.prototype.getGeometryN=function(n){return this};jsts.geom.Geometry.prototype.getPrecisionModel=function(){if(this.precisionModel===null){this.precisionModel=new jsts.geom.PrecisionModel()}return this.precisionModel};jsts.geom.Geometry.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getCoordinates=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getNumPoints=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.isSimple=function(){this.checkNotGeometryCollection(this);var op=new jsts.operation.IsSimpleOp(this);return op.isSimple()};jsts.geom.Geometry.prototype.isValid=function(){var isValidOp=new IsValidOp(this);return isValidOp.isValid()};jsts.geom.Geometry.prototype.isEmpty=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.distance=function(g){return jsts.operation.distance.DistanceOp.distance(this,g)};jsts.geom.Geometry.prototype.isWithinDistance=function(geom,distance){var envDist=this.getEnvelopeInternal().distance(geom.getEnvelopeInternal());if(envDist>distance){return false}return DistanceOp.isWithinDistance(this,geom,distance)};jsts.geom.Geometry.prototype.getArea=function(){return 0.0};jsts.geom.Geometry.prototype.getLength=function(){return 0.0};jsts.geom.Geometry.prototype.getCentroid=function(){if(isEmpty()){return null}var cent;var centPt=null;var dim=this.getDimension();if(dim===0){cent=new CentroidPoint();cent.add(this);centPt=cent.getCentroid()}else if(dim===1){cent=new CentroidLine();cent.add(this);centPt=cent.getCentroid()}else{cent=new CentroidArea();cent.add(this);centPt=cent.getCentroid()}return this.createPointFromInternalCoord(centPt,this)};jsts.geom.Geometry.prototype.getInteriorPoint=function(){var intPt;var interiorPt=null;var dim=getDimension();if(dim===0){intPt=new InteriorPointPoint(this);interiorPt=intPt.getInteriorPoint()}else if(dim===1){intPt=new InteriorPointLine(this);interiorPt=intPt.getInteriorPoint()}else{intPt=new InteriorPointArea(this);interiorPt=intPt.getInteriorPoint()}return this.createPointFromInternalCoord(interiorPt,this)};jsts.geom.Geometry.prototype.getDimension=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getBoundary=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getBoundaryDimension=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};jsts.geom.Geometry.prototype.getEnvelopeInternal=function(){if(this.envelope===null){this.envelope=this.computeEnvelopeInternal()}return this.envelope};jsts.geom.Geometry.prototype.disjoint=function(g){return!this.intersects(g)};jsts.geom.Geometry.prototype.touches=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}return this.relate(g).isTouches(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.intersects=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}if(this.isRectangle()){return RectangleIntersects.intersects(this,g)}if(g.isRectangle()){return RectangleIntersects.intersects(g,this)}return this.relate(g).isIntersects()};jsts.geom.Geometry.prototype.crosses=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}return this.relate(g).isCrosses(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.within=function(g){return g.contains(this)};jsts.geom.Geometry.prototype.contains=function(g){if(!this.getEnvelopeInternal().contains(g.getEnvelopeInternal())){return false}if(this.isRectangle()){return RectangleContains.contains(this,g)}return this.relate(g).isContains()};jsts.geom.Geometry.prototype.overlaps=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}return this.relate(g).isOverlaps(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.covers=function(g){if(!this.getEnvelopeInternal().covers(g.getEnvelopeInternal())){return false}if(this.isRectangle()){return true}return this.relate(g).isCovers()};jsts.geom.Geometry.prototype.coveredBy=function(g){return g.covers(this)};jsts.geom.Geometry.prototype.relate=function(g,intersectionPattern){if(intersectionPattern===undefined){this.relate2.call(this,2)}return this.relate2(g).matches(intersectionPattern)};jsts.geom.Geometry.prototype.relate2=function(g){this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(g);return jsts.operation.relate.RelateOp.relate(this,g)};jsts.geom.Geometry.prototype.jsts_equals=function(g){if(!this.getEnvelopeInternal().equals(g.getEnvelopeInternal())){return false}return this.relate(g).isEquals(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.buffer=function(distance,quadrantSegments,endCapStyle){return jsts.operation.buffer.BufferOp.bufferOp(this,distance,quadrantSegments,endCapStyle)};jsts.geom.Geometry.prototype.convexHull=function(){return(new ConvexHull(this)).getConvexHull()};jsts.geom.Geometry.prototype.intersection=function(other){if(this.isEmpty()){return this.getFactory().createGeometryCollection(null)}if(other.isEmpty()){return this.getFactory().createGeometryCollection(null)}if(this.isGeometryCollection(this)){var g2=other}this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.INTERSECTION)};jsts.geom.Geometry.prototype.union=function(other){if(this.isEmpty()){return other.clone()}if(other.isEmpty()){return this.clone()}this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.UNION)};jsts.geom.Geometry.prototype.difference=function(other){if(this.isEmpty()){return this.getFactory().createGeometryCollection(null)}if(other.isEmpty()){return this.clone()}this.heckNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.DIFFERENCE)};jsts.geom.Geometry.prototype.symDifference=function(other){if(this.isEmpty()){return other.clone()}if(other.isEmpty()){return this.clone()}this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.SYMDIFFERENCE)};jsts.geom.Geometry.prototype.union=function(){return jsts.operation.union.UnaryUnionOp.union(this)};jsts.geom.Geometry.prototype.equalsExact=function(other,tolerance){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.apply=function(filter){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.clone=function(){var clone=new jsts.geom.Geometry(this.factory);if(clone.envelope!==null){clone.envelope=new jsts.geom.Envelope(clone.envelope)}return clone};jsts.geom.Geometry.prototype.normalize=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compareTo=function(other){if(this.getClassSortIndex()!==other.getClassSortIndex()){return this.getClassSortIndex()-other.getClassSortIndex()}if(this.isEmpty()&&other.isEmpty()){return 0}if(this.isEmpty()){return-1}if(other.isEmpty()){return 1}return this.compareToSameClass(o)};jsts.geom.Geometry.prototype.compareTo=function(other,comp){if(this.getClassSortIndex()!==other.getClassSortIndex()){return this.getClassSortIndex()-other.getClassSortIndex()}if(this.isEmpty()&&other.isEmpty()){return 0}if(this.isEmpty()){return-1}if(other.isEmpty()){return 1}return this.compareToSameClass(o,comp)};jsts.geom.Geometry.prototype.isEquivalentClass=function(other){return other instanceof this.constructor};jsts.geom.Geometry.prototype.checkNotGeometryCollection=function(g){if(g instanceof jsts.geom.GeometryCollection){throw new jsts.error.IllegalArgumentError('This method does not support GeometryCollection')}};jsts.geom.Geometry.prototype.isGeometryCollection=function(){return(this instanceof jsts.geom.GeometryCollection)};jsts.geom.Geometry.prototype.computeEnvelopeInternal=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compareToSameClass=function(o){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compareToSameClass=function(o,comp){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compare=function(a,b){var i=a.iterator();var j=b.iterator();while(i.hasNext()&&j.hasNext()){var aElement=i.next();var bElement=j.next();var comparison=aElement.compareTo(bElement);if(comparison!==0){return comparison}}if(i.hasNext()){return 1}if(j.hasNext()){return-1}return 0};jsts.geom.Geometry.prototype.equal=function(a,b,tolerance){if(tolerance===undefined||tolerance===null||tolerance===0){return a.equals(b)}return a.distance(b)<=tolerance};
66   -jsts.geom.PrecisionModel=function(){};jsts.geom.PrecisionModel.FLOATING=0;jsts.geom.PrecisionModel.FIXED=1;jsts.geom.PrecisionModel.prototype.isFloating=function(){return true};jsts.geom.PrecisionModel.prototype.getType=function(){return jsts.geom.PrecisionModel.FLOATING};jsts.geom.PrecisionModel.prototype.equals=function(other){return true};jsts.geom.PrecisionModel.prototype.compareTo=function(o){var other=o;return 0};
67   -jsts.geom.CoordinateArrays=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.CoordinateArrays.removeRepeatedPoints=function(coord){var coordList;if(!this.hasRepeatedPoints(coord)){return coord}coordList=new jsts.geom.CoordinateList(coord,false);return coordList};jsts.geom.CoordinateArrays.hasRepeatedPoints=function(coord){var i;for(i=1;i<coord.length;i++){if(coord[i-1].equals(coord[i])){return true}}return false};
68   -jsts.geom.GeometryFactory=function(){};jsts.geom.GeometryFactory.prototype.createPoint=function(coordinate){if(coordinate===null){return new jsts.geom.Point()}return new jsts.geom.Point(coordinate)};jsts.geom.GeometryFactory.prototype.createLineString=function(coordinates){return new jsts.geom.LineString(coordinates)};jsts.geom.GeometryFactory.prototype.createLinearRing=function(coordinates){return new jsts.geom.LinearRing(coordinates)};jsts.geom.GeometryFactory.prototype.createPolygon=function(shell,holes){var rings=[shell];if(holes!==undefined){rings=rings.concat(holes)}return new jsts.geom.Polygon(rings)};jsts.geom.GeometryFactory.prototype.createGeometryCollection=function(){return new jsts.geom.GeometryCollection()};
69   -jsts.geom.GeometryCollection=function(){};jsts.geom.GeometryCollection=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.GeometryCollection.prototype.isEmpty=function(){for(var i=0;i<this.geometries.length;i++){if(!this.geometries[i].isEmpty()){return false}}return true};jsts.geom.GeometryCollection.prototype.getNumGeometries=function(){return this.geometries.length};jsts.geom.GeometryCollection.prototype.getGeometryN=function(n){return this.geometries[n]};jsts.geom.GeometryCollection.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}if(this.geometries.length!==other.geometries.length){return false}for(var i=0;i<this.geometries.length;i++){if(!(this.geometries[i]).equalsExact(other.geometries[i],tolerance)){return false}}return true};jsts.geom.GeometryCollection.prototype.apply=function(filter){filter.filter(this);for(var i=0;i<this.geometries.length;i++){this.geometries[i].apply(filter)}};OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry.Collection,jsts.geom.GeometryCollection,{initialize:function(components){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(components!=null){this.addComponents(components)}this.geometries=this.components}});jsts.geom.GeometryCollection=OpenLayers.Geometry.Collection;
70   -jsts.operation.distance={};
71   -jsts.operation.GeometryGraphOperation=function(g0,g1,boundaryNodeRule){this.li=new jsts.algorithm.RobustLineIntersector();if(g0===undefined){return}if(g1===undefined){this.setComputationPrecision(g0.getPrecisionModel());arg[0]=new jsts.geomgraph.GeometryGraph(0,g0);return}boundaryNodeRule=boundaryNodeRule||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE;if(g0.getPrecisionModel().compareTo(g1.getPrecisionModel())>=0)this.setComputationPrecision(g0.getPrecisionModel());else this.setComputationPrecision(g1.getPrecisionModel());this.arg[0]=new jsts.geomgraph.GeometryGraph(0,g0,boundaryNodeRule);this.arg[1]=new jsts.geomgraph.GeometryGraph(1,g1,boundaryNodeRule)};jsts.operation.GeometryGraphOperation.prototype.li=null;jsts.operation.GeometryGraphOperation.prototype.resultPrecisionModel=null;jsts.operation.GeometryGraphOperation.prototype.arg=[];jsts.operation.GeometryGraphOperation.prototype.getArgGeometry=function(i){return arg[i].getGeometry()};jsts.operation.GeometryGraphOperation.prototype.setComputationPrecision=function(pm){this.resultPrecisionModel=pm;this.li.setPrecisionModel(this.resultPrecisionModel)};
72   -jsts.operation.distance.DistanceOp=function(g0,g1,terminateDistance){this.ptLocator=new jsts.algorithm.PointLocator();this.geom=[];this.geom[0]=g0;this.geom[1]=g1;this.terminateDistance=terminateDistance};jsts.operation.distance.DistanceOp.prototype.geom=null;jsts.operation.distance.DistanceOp.prototype.terminateDistance=0.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(g0,g1){var distOp=new jsts.operation.distance.DistanceOp(g0,g1,0.0);return distOp.distance()};jsts.operation.distance.DistanceOp.isWithinDistance=function(g0,g1,distance){var distOp=new jsts.operation.distance.DistanceOp(g0,g1,distance);return distOp.distance()<=distance};jsts.operation.distance.DistanceOp.nearestPoints=function(g0,g1){var distOp=new jsts.operation.distance.DistanceOp(g0,g1,0.0);return distOp.nearestPoints()};jsts.operation.distance.DistanceOp.prototype.distance=function(){if(this.geom[0]===null||this.geom[1]===null)throw new jsts.error.IllegalArgumentError('null geometries are not supported');if(this.geom[0].isEmpty()||this.geom[1].isEmpty())return 0.0;this.computeMinDistance();return this.minDistance};jsts.operation.distance.DistanceOp.prototype.nearestPoints=function(){this.computeMinDistance();var nearestPts=[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()];return nearestPts};jsts.operation.distance.DistanceOp.prototype.nearestLocations=function(){this.computeMinDistance();return this.minDistanceLocation};jsts.operation.distance.DistanceOp.prototype.updateMinDistance=function(locGeom,flip){if(locGeom[0]===null)return;if(flip){this.minDistanceLocation[0]=locGeom[1];this.minDistanceLocation[1]=locGeom[0]}else{this.minDistanceLocation[0]=locGeom[0];this.minDistanceLocation[1]=locGeom[1]}};jsts.operation.distance.DistanceOp.prototype.computeMinDistance=function(){if(arguments.length>0){this.computeMinDistance2.apply(this,arguments);return}if(this.minDistanceLocation!==null)return;this.minDistanceLocation=[];this.computeContainmentDistance();if(this.minDistance<=this.terminateDistance)return;this.computeFacetDistance()};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance=function(){if(arguments.length===2){this.computeContainmentDistance2.apply(this,arguments);return}else if(arguments.length===3&&(!arguments[0]instanceof jsts.operation.distance.GeometryLocation)){this.computeContainmentDistance3.apply(this,arguments);return}else if(arguments.length===3){this.computeContainmentDistance4.apply(this,arguments);return}var locPtPoly=[];this.computeContainmentDistance2(0,locPtPoly);if(this.minDistance<=this.terminateDistance)return;this.computeContainmentDistance2(1,locPtPoly)};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance2=function(polyGeomIndex,locPtPoly){var locationsIndex=1-polyGeomIndex;var polys=jsts.geom.util.PolygonExtracter.getPolygons(this.geom[polyGeomIndex]);if(polys.length>0){var insideLocs=jsts.operation.distance.ConnectedElementLocationFilter.getLocations(this.geom[locationsIndex]);this.computeContainmentDistance3(insideLocs,polys,locPtPoly);if(this.minDistance<=this.terminateDistance){this.minDistanceLocation[locationsIndex]=locPtPoly[0];this.minDistanceLocation[polyGeomIndex]=locPtPoly[1];return}}};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance3=function(locs,polys,locPtPoly){for(var i=0;i<locs.length;i++){var loc=locs[i];for(var j=0;j<polys.length;j++){this.computeContainmentDistance4(loc,polys[j],locPtPoly);if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance4=function(ptLoc,poly,locPtPoly){var pt=ptLoc.getCoordinate();if(jsts.geom.Location.EXTERIOR!==this.ptLocator.locate(pt,poly)){this.minDistance=0.0;locPtPoly[0]=ptLoc;locPtPoly[1]=new jsts.operation.distance.GeometryLocation(poly,pt);return}};jsts.operation.distance.DistanceOp.prototype.computeFacetDistance=function(){var locGeom=[];var lines0=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[0]);var lines1=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[1]);var pts0=jsts.geom.util.PointExtracter.getPoints(this.geom[0]);var pts1=jsts.geom.util.PointExtracter.getPoints(this.geom[1]);this.computeMinDistanceLines(lines0,lines1,locGeom);this.updateMinDistance(locGeom,false);if(this.minDistance<=this.terminateDistance)return;locGeom[0]=null;locGeom[1]=null;this.computeMinDistanceLinesPoints(lines0,pts1,locGeom);this.updateMinDistance(locGeom,false);if(this.minDistance<=this.terminateDistance)return;locGeom[0]=null;locGeom[1]=null;this.computeMinDistanceLinesPoints(lines1,pts0,locGeom);this.updateMinDistance(locGeom,true);if(this.minDistance<=this.terminateDistance)return;locGeom[0]=null;locGeom[1]=null;this.computeMinDistancePoints(pts0,pts1,locGeom);this.updateMinDistance(locGeom,false)};jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLines=function(lines0,lines1,locGeom){for(var i=0;i<lines0.length;i++){var line0=lines0[i];for(var j=0;j<lines1.length;j++){var line1=lines1[j];this.computeMinDistance(line0,line1,locGeom);if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistancePoints=function(points0,points1,locGeom){for(var i=0;i<points0.length;i++){var pt0=points0[i];for(var j=0;j<points1.length;j++){var pt1=points1[j];var dist=pt0.getCoordinate().distance(pt1.getCoordinate());if(dist<this.minDistance){this.minDistance=dist;locGeom[0]=new jsts.operation.distance.GeometryLocation(pt0,0,pt0.getCoordinate());locGeom[1]=new jsts.operation.distance.GeometryLocation(pt1,0,pt1.getCoordinate())}if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLinesPoints=function(lines,points,locGeom){for(var i=0;i<lines.length;i++){var line=lines[i];for(var j=0;j<points.length;j++){var pt=points[j];this.computeMinDistance(line,pt,locGeom);if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistance2=function(line0,line1,locGeom){if(line1 instanceof jsts.geom.Point){this.computeMinDistance3(line0,line1,locGeom);return}if(line0.getEnvelopeInternal().distance(line1.getEnvelopeInternal())>this.minDistance){return}var coord0=line0.getCoordinates();var coord1=line1.getCoordinates();for(var i=0;i<coord0.length-1;i++){for(var j=0;j<coord1.length-1;j++){var dist=jsts.algorithm.CGAlgorithms.distanceLineLine(coord0[i],coord0[i+1],coord1[j],coord1[j+1]);if(dist<this.minDistance){this.minDistance=dist;var seg0=new jsts.geom.LineSegment(coord0[i],coord0[i+1]);var seg1=new jsts.geom.LineSegment(coord1[j],coord1[j+1]);var closestPt=seg0.closestPoints(seg1);locGeom[0]=new jsts.operation.distance.GeometryLocation(line0,i,closestPt[0]);locGeom[1]=new jsts.operation.distance.GeometryLocation(line1,j,closestPt[1])}if(this.minDistance<=this.terminateDistance){return}}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistance3=function(line,pt,locGeom){if(line.getEnvelopeInternal().distance(pt.getEnvelopeInternal())>this.minDistance){return}var coord0=line.getCoordinates();var coord=pt.getCoordinate();for(var i=0;i<coord0.length-1;i++){var dist=jsts.algorithm.CGAlgorithms.distancePointLine(coord,coord0[i],coord0[i+1]);if(dist<this.minDistance){this.minDistance=dist;var seg=new jsts.geom.LineSegment(coord0[i],coord0[i+1]);var segClosestPoint=seg.closestPoint(coord);locGeom[0]=new jsts.operation.distance.GeometryLocation(line,i,segClosestPoint);locGeom[1]=new jsts.operation.distance.GeometryLocation(pt,0,coord)}if(this.minDistance<=this.terminateDistance){return}}};
73   -jsts.operation.distance.ConnectedElementLocationFilter=function(locations){this.locations=locations};jsts.operation.distance.ConnectedElementLocationFilter.prototype=new jsts.geom.GeometryFilter();jsts.operation.distance.ConnectedElementLocationFilter.prototype.locations=null;jsts.operation.distance.ConnectedElementLocationFilter.getLocations=function(geom){var locations=[];geom.apply(new jsts.operation.distance.ConnectedElementLocationFilter(locations));return locations};jsts.operation.distance.ConnectedElementLocationFilter.prototype.filter=function(geom){if(geom instanceof jsts.geom.Point||geom instanceof jsts.geom.LineString||geom instanceof jsts.geom.Polygon)this.locations.push(new jsts.operation.distance.GeometryLocation(geom,0,geom.getCoordinate()))};
74   -jsts.operation.distance.GeometryLocation=function(component,segIndex,pt){this.component=component;this.segIndex=segIndex;this.pt=pt};jsts.operation.distance.GeometryLocation.INSIDE_AREA=-1;jsts.operation.distance.GeometryLocation.prototype.component=null;jsts.operation.distance.GeometryLocation.prototype.segIndex=null;jsts.operation.distance.GeometryLocation.prototype.pt=null;jsts.operation.distance.GeometryLocation.prototype.getGeometryComponent=function(){return this.component};jsts.operation.distance.GeometryLocation.prototype.getSegmentIndex=function(){return this.segIndex};jsts.operation.distance.GeometryLocation.prototype.getCoordinate=function(){return this.pt};jsts.operation.distance.GeometryLocation.prototype.isInsideArea=function(){return this.segIndex===jsts.operation.distance.GeometryLocation.INSIDE_AREA};
75   -jsts.operation.valid={};
76   -jsts.operation.relate={};
77   -jsts.operation.buffer={};
78   -jsts.operation.relate.RelateOp=function(){jsts.operation.GeometryGraphOperation.prototype.constructor.apply(this,arguments);this._relate=new jsts.operation.relate.RelateComputer(this.arg)};jsts.operation.relate.RelateOp.prototype=new jsts.operation.GeometryGraphOperation();jsts.operation.relate.RelateOp.relate=function(a,b,boundaryNodeRule){var relOp=new jsts.operation.relate.RelateOp(a,b,boundaryNodeRule);var im=relOp.getIntersectionMatrix();return im};jsts.operation.relate.RelateOp.prototype._relate=null;jsts.operation.relate.RelateOp.prototype.getIntersectionMatrix=function(){return _relate.computeIM()};
79   -jsts.operation.buffer.BufferParameters=function(){};jsts.operation.buffer.BufferParameters.CAP_ROUND=1;jsts.operation.buffer.BufferParameters.CAP_FLAT=2;jsts.operation.buffer.BufferParameters.CAP_SQUARE=3;jsts.operation.buffer.BufferParameters.JOIN_ROUND=1;jsts.operation.buffer.BufferParameters.JOIN_MITRE=2;jsts.operation.buffer.BufferParameters.OIN_BEVEL=3;jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS=8;jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT=5.0;jsts.operation.buffer.BufferParameters.prototype.quadrantSegments=jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS;jsts.operation.buffer.BufferParameters.prototype.endCapStyle=jsts.operation.buffer.BufferParameters.CAP_ROUND;jsts.operation.buffer.BufferParameters.prototype.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_ROUND;jsts.operation.buffer.BufferParameters.prototype.mitreLimit=jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT;jsts.operation.buffer.BufferParameters.prototype.setEndCapStyle=function(endCapStyle){this.endCapStyle=endCapStyle};jsts.operation.buffer.BufferParameters.prototype.setQuadrantSegments=function(quadrantSegments){this.quadrantSegments=quadrantSegments};
80   -jsts.operation.buffer.BufferOp=function(g,bufParams){this.argGeom=g;this.bufParams=bufParams?bufParams:new jsts.operation.buffer.BufferParameters()};jsts.operation.buffer.BufferOp.MAX_PRECISION_DIGITS=12;jsts.operation.buffer.BufferOp.precisionScaleFactor=function(g,distance,maxPrecisionDigits){var env=g.getEnvelopeInternal();var envSize=Math.max(env.getHeight(),env.getWidth());var expandByDistance=distance>0.0?distance:0.0;var bufEnvSize=envSize+2*expandByDistance;var bufEnvLog10=(Math.log(bufEnvSize)/Math.log(10)+1.0);var minUnitLog10=bufEnvLog10-maxPrecisionDigits;var scaleFactor=Math.pow(10.0,-minUnitLog10);return scaleFactor};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance){var gBuf=new jsts.operation.buffer.BufferOp(g);var geomBuf=gBuf.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance,params){var bufOp=new jsts.operation.buffer.BufferOp(g,params);var geomBuf=bufOp.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance,quadrantSegments){var bufOp=new jsts.operation.buffer.BufferOp(g);bufOp.setQuadrantSegments(quadrantSegments);var geomBuf=bufOp.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance,quadrantSegments,endCapStyle){var bufOp=new jsts.operation.buffer.BufferOp(g);bufOp.setQuadrantSegments(quadrantSegments);bufOp.setEndCapStyle(endCapStyle);var geomBuf=bufOp.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.prototype.argGeom=null;jsts.operation.buffer.BufferOp.prototype.distance=null;jsts.operation.buffer.BufferOp.prototype.bufParams=null;jsts.operation.buffer.BufferOp.prototype.resultGeometry=null;jsts.operation.buffer.BufferOp.prototype.setEndCapStyle=function(endCapStyle){this.bufParams.setEndCapStyle(endCapStyle)};jsts.operation.buffer.BufferOp.prototype.setQuadrantSegments=function(quadrantSegments){this.bufParams.setQuadrantSegments(quadrantSegments)};jsts.operation.buffer.BufferOp.prototype.getResultGeometry=function(dist){this.distance=dist;this.computeGeometry();return resultGeometry};jsts.operation.buffer.BufferOp.prototype.computeGeometry=function(){this.bufferOriginalPrecision();if(resultGeometry!==null){return}var argPM=argGeom.getPrecisionModel();if(argPM.getType()===PrecisionModel.FIXED){this.bufferFixedPrecision(argPM)}else{this.bufferReducedPrecision()}};jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision=function(){var precDigits;for(precDigits=MAX_PRECISION_DIGITS;precDigits>=0;precDigits--){try{this.bufferReducedPrecision(precDigits)}catch(ex){saveException=ex}if(resultGeometry!==null){return}}throw saveException};jsts.operation.buffer.BufferOp.prototype.bufferOriginalPrecision=function(){var bufBuilder=new jsts.operation.buffer.BufferBuilder(this.bufParams);resultGeometry=bufBuilder.buffer(this.argGeom,this.distance)};jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision=function(precisionDigits){var sizeBasedScaleFactor=this.precisionScaleFactor(argGeom,distance,precisionDigits);var fixedPM=new jsts.geom.PrecisionModel(sizeBasedScaleFactor);this.bufferFixedPrecision(fixedPM)};jsts.operation.buffer.BufferOp.prototype.bufferFixedPrecision=function(fixedPM){var noder=new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),fixedPM.getScale());var bufBuilder=new jsts.operation.buffer.BufferBuilder(bufParams);bufBuilder.setWorkingPrecisionModel(fixedPM);bufBuilder.setNoder(noder);resultGeometry=bufBuilder.buffer(argGeom,distance)};
81   -jsts.operation.buffer.BufferBuilder=function(bufParams){this.bufParams=bufParams};jsts.operation.buffer.BufferBuilder.prototype.buffer=function(){throw new jsts.error.NotImplementedError()};
82   -jsts.operation.IsSimpleOp=function(geom){this.geom=geom};jsts.operation.IsSimpleOp.prototype.geom=null;jsts.operation.IsSimpleOp.prototype.isClosedEndpointsInInterior=true;jsts.operation.IsSimpleOp.prototype.nonSimpleLocation=null;jsts.operation.IsSimpleOp.prototype.IsSimpleOp=function(geom){this.geom=geom};jsts.operation.IsSimpleOp.prototype.isSimple=function(){this.nonSimpleLocation=null;if(this.geom instanceof jsts.geom.LineString){return this.isSimpleLinearGeometry(this.geom)}if(this.geom instanceof jsts.geom.MultiLineString){return this.isSimpleLinearGeometry(this.geom)}if(this.geom instanceof jsts.geom.MultiPoint){return this.isSimpleMultiPoint(this.geom)}return true};jsts.operation.IsSimpleOp.prototype.isSimpleMultiPoint=function(mp){if(mp.isEmpty())return true;var points=[];for(var i=0;i<mp.getNumGeometries();i++){var pt=mp.getGeometryN(i);var p=pt.getCoordinate();for(var j=0;j<points.length;j++){var point=points[j];if(p.equals2D(point)){this.nonSimpleLocation=p;return false}}points.push(p)}return true};jsts.operation.IsSimpleOp.prototype.isSimpleLinearGeometry=function(geom){if(geom.isEmpty())return true;var graph=new jsts.geomgraph.GeometryGraph(0,geom);var li=new jsts.algorithm.RobustLineIntersector();var si=graph.computeSelfNodes(li,true);if(!si.hasIntersection())return true;if(si.hasProperIntersection()){this.nonSimpleLocation=si.getProperIntersectionPoint();return false}if(this.hasNonEndpointIntersection(graph))return false;if(this.isClosedEndpointsInInterior){if(this.hasClosedEndpointIntersection(graph))return false}return true};jsts.operation.IsSimpleOp.prototype.hasNonEndpointIntersection=function(graph){for(var i=0;i<graph.edges.length;i++){var e=graph.edges[i];var maxSegmentIndex=e.getMaximumSegmentIndex();for(var j=0;j<e.eiList.length;j++){var ei=e.eiList[j];if(!ei.isEndPoint(maxSegmentIndex)){this.nonSimpleLocation=ei.getCoordinate();return true}}}return false};jsts.operation.IsSimpleOp.prototype.hasClosedEndpointIntersection=function(graph){var endPoints=[];for(var i=0;i<graph.edges.length;i++){var e=graph.edges[i];var maxSegmentIndex=e.getMaximumSegmentIndex();var isClosed=e.isClosed();var p0=e.getCoordinate(0);this.addEndpoint(endPoints,p0,isClosed);var p1=e.getCoordinate(e.getNumPoints()-1);this.addEndpoint(endPoints,p1,isClosed)}for(var i=0;i<endPoints.length;i++){var eiInfo=endPoints[i].ei;if(eiInfo.isClosed&&eiInfo.degree!=2){this.nonSimpleLocation=eiInfo.getCoordinate();return true}}return false};jsts.operation.IsSimpleOp.EndpointInfo=function(pt){this.pt=pt;this.isClosed=false;this.degree=0};jsts.operation.IsSimpleOp.EndpointInfo.prototype.pt=null;jsts.operation.IsSimpleOp.EndpointInfo.prototype.isClosed=null;jsts.operation.IsSimpleOp.EndpointInfo.prototype.degree=null;jsts.operation.IsSimpleOp.EndpointInfo.prototype.getCoordinate=function(){return this.pt};jsts.operation.IsSimpleOp.EndpointInfo.prototype.addEndpoint=function(isClosed){this.degree++;this.isClosed=this.isClosed||isClosed};jsts.operation.IsSimpleOp.prototype.addEndpoint=function(endPoints,p,isClosed){var eiInfo=null;for(var i=0;i<endPoints.length;i++){var endPoint=endPoints[i];if(endPoint.p.equals2D(p)){eiInfo=endPoint.ei}}if(eiInfo===null){eiInfo=new jsts.operation.IsSimpleOp.EndpointInfo(p);endPoints.push({p:p,ei:eiInfo})}eiInfo.addEndpoint(isClosed)};
83   -jsts.operation.valid.IsValidOp=function(){};
84   -jsts.triangulate.DelauneyTriangulationBuilder=function(){this.siteCoords=null;this.tolerance=0.0;this.subdiv=null};jsts.triangulate.DelauneyTriangulationBuilder.extractUniqueCoordinates=function(geom){if(geom===undefined||geom===null){return new jsts.geom.CoordinateList()}var coords=geom.getCoordinates();return jsts.triangulate.DelauneyTriangulationBuilder.unique(coords)};jsts.triangulate.DelauneyTriangulationBuilder.unique=function(coords){coords.sort(function(a,b){return a.compareTo(b)});coordList=new jsts.geom.CoordinateList(coords,false);return coordList};jsts.triangulate.DelauneyTriangulationBuilder.toVertices=function(coords){var verts=new Array(coords.length),i=0,il=coords.length,coord;for(i;i<il;i++){coord=coords[i];verts[i]=new jsts.triangulate.quadedge.Vertex(coord)}return verts};jsts.triangulate.DelauneyTriangulationBuilder.envelope=function(coords){var env=new jsts.geom.Envelope(),i=0,il=coords.length;for(i;i<il;i++){env.expandToInclude(coords[i])}return env};jsts.triangulate.DelauneyTriangulationBuilder.prototype.setSites=function(){var arg=arguments[0];if(arg instanceof jsts.geom.Geometry||arg instanceof jsts.geom.Coordinate||arg instanceof jsts.geom.Point||arg instanceof jsts.geom.MultiPoint||arg instanceof jsts.geom.LineString||arg instanceof jsts.geom.MultiLineString||arg instanceof jsts.geom.LinearRing||arg instanceof jsts.geom.Polygon||arg instanceof jsts.geom.MultiPolygon){this.setSitesFromGeometry(arg)}else{this.setSitesFromCollection(arg)}};jsts.triangulate.DelauneyTriangulationBuilder.prototype.setSitesFromGeometry=function(geom){this.siteCoords=jsts.triangulate.DelauneyTriangulationBuilder.extractUniqueCoordinates(geom)};jsts.triangulate.DelauneyTriangulationBuilder.prototype.setSitesFromCollection=function(coords){this.siteCoords=jsts.triangulate.DelauneyTriangulationBuilder.extractUniqueCoordinates.unique(coords)};jsts.triangulate.DelauneyTriangulationBuilder.prototype.setTolerance=function(tolerance){this.tolerance=tolerance};jsts.triangulate.DelauneyTriangulationBuilder.prototype.create=function(){if(this.subdiv===null){var siteEnv,vertices,triangulator;siteEnv=jsts.triangulate.DelauneyTriangulationBuilder.envelope(this.siteCoords);vertices=jsts.triangulate.DelauneyTriangulationBuilder.toVertices(this.siteCoords);this.subdiv=new jsts.triangulate.quadedge.QuadEdgeSubdivision(siteEnv,this.tolerance);triangulator=new jsts.triangulate.IncrementalDelauneyTriangulator(this.subdiv);triangulator.insertSites(vertices)}};jsts.triangulate.DelauneyTriangulationBuilder.prototype.getSubdivision=function(){this.create();return this.subdiv};jsts.triangulate.DelauneyTriangulationBuilder.prototype.getEdges=function(geomFact){this.create();return this.subdiv.getEdges(geomFact)};jsts.triangulate.DelauneyTriangulationBuilder.prototype.getTriangles=function(geomFact){this.create();return this.subdiv.getTriangles(geomFact)};
85   -jsts.triangulate.quadedge={};
86   -jsts.triangulate.quadedge.Vertex=function(){if(args.length===1){this.initFromCoordinate(arguments[0])}else{this.initFromXY(arguments[0],arguments[1])}};jsts.triangulate.quadedge.Vertex.LEFT=0;jsts.triangulate.quadedge.Vertex.RIGHT=1;jsts.triangulate.quadedge.Vertex.BEYOND=2;jsts.triangulate.quadedge.Vertex.BEHIND=3;jsts.triangulate.quadedge.Vertex.BETWEEN=4;jsts.triangulate.quadedge.Vertex.ORIGIN=5;jsts.triangulate.quadedge.Vertex.DESTINATION=6;jsts.triangulate.quadedge.Vertex.prototype.initFromXY=function(x,y){this.p=new jsts.geom.Coordinate(x,y)};jsts.triangulate.quadedge.Vertex.prototype.initFromCoordinate=function(_p){this.p=new jsts.geom.Coordinate(_p)};jsts.triangulate.quadedge.Vertex.prototype.getX=function(){return this.p.x};jsts.triangulate.quadedge.Vertex.prototype.getY=function(){return this.p.y};jsts.triangulate.quadedge.Vertex.prototype.getZ=function(){return this.p.z};jsts.triangulate.quadedge.Vertex.prototype.setZ=function(z){this.p.z=z};jsts.triangulate.quadedge.Vertex.prototype.getCoordinate=function(){return this.p};jsts.triangulate.quadedge.Vertex.prototype.toString=function(){return'POINT ('+this.p.x+' '+this.p.y+')'};jsts.triangulate.quadedge.Vertex.prototype.equals=function(){if(arguments.length===1){return this.equalsExact(arguments[0])}else{return this.equalsWithTolerance(arguments[0],arguments[1])}};jsts.triangulate.quadedge.Vertex.prototype.equalsExact=function(other){return(this.p.x===other.getX()&&this.p.y===other.getY())};jsts.triangulate.quadedge.Vertex.prototype.equalsExact=function(other,tolerance){return(this.p.distance(other.getCoordinate())<tolerance)};jsts.triangulate.quadedge.Vertex.prototype.classify=function(p0,p1){var p2,a,b,sa;p2=this;a=p1.sub(p0);b=p2.sub(p0);sa=a.crossProduct(b);if(sa>0.0){return jsts.triangulate.quadedge.Vertex.LEFT}if(sa<0.0){return jsts.triangulate.quadedge.Vertex.RIGHT}if((a.getX()*b.getX()<0.0)||(a.getY()*b.getY()<0.0)){return jsts.triangulate.quadedge.Vertex.BEHIND}if(a.magn()<b.magn()){return jsts.triangulate.quadedge.Vertex.BEYOND}if(p0.equals(p2)){return jsts.triangulate.quadedge.Vertex.ORIGIN}if(p1.equals(p2)){return jsts.triangulate.quadedge.Vertex.DESTINATION}return jsts.triangulate.quadedge.Vertex.BETWEEN};jsts.triangulate.quadedge.Vertex.prototype.crossProduct=function(v){return((this.p.x*v.getY())-(this.p.y*v.getX()))};jsts.triangulate.quadedge.Vertex.prototype.dot=function(v){return((this.p.x*v.getX())+(this.p.y*v.getY()))};jsts.triangulate.quadedge.Vertex.prototype.times=function(c){return new jsts.triangulate.quadedge.Vertex(c*this.p.x,c*this.p.y)};jsts.triangulate.quadedge.Vertex.prototype.sum=function(v){return new jsts.triangulate.quadedge.Vertex(this.p.x+v.getX(),this.p.y+v.getY())};jsts.triangulate.quadedge.Vertex.prototype.sub=function(v){return new jsts.triangulate.quadedge.Vertex(this.p.x-v.getX(),this.p.y-v.getY())};jsts.triangulate.quadedge.Vertex.prototype.magn=function(){return(Math.sqrt((this.p.x*this.p.x)+(this.p.y*this.p.y)))};jsts.triangulate.quadedge.Vertex.prototype.cross=function(){return new Vertex(this.p.y,-this.p.x)};jsts.triangulate.quadedge.Vertex.prototype.isInCircle=function(a,b,c){return jsts.triangulate.quadedge.TrianglePredicate.prototype.isInCircleRobust(a.p,b.p,c.p,this.p)};jsts.triangulate.quadedge.Vertex.prototype.isCCW=function(b,c){return((b.p.x-this.p.x)*(c.p.y-this.p.y)-(b.p.y-this.p.y)*(c.p.x-this.p.x)>0)};jsts.triangulate.quadedge.Vertex.prototype.rightOf=function(e){return this.isCCW(e.dest(),e.orig())};jsts.triangulate.quadedge.Vertex.prototype.leftOf=function(e){return this.isCCW(e.orig(),e.dest())};jsts.triangulate.quadedge.Vertex.prototype.bisector=function(a,b){var dx,dy,l1,l2;dx=b.getX()-a.getX();dy=b.getY()-a.getY();l1=new jsts.algorithm.HCoordinate(a.getX()+(dx/2.0),a.getY()+(dy/2.0),1.0);l1=new jsts.algorithm.HCoordinate(a.getX()-dy+(dx/2.0),a.getY()+dx+(dy/2.0),1.0);return new jsts.algorithm.HCoordinate(l1,l2)};jsts.triangulate.quadedge.Vertex.prototype.distance=function(v1,v2){return v1.p.distance(v2.p)};jsts.triangulate.quadedge.Vertex.prototype.circumRadiusRatio=function(b,c){var x,radius,edgeLength,el;x=this.circleCenter(b,c);radius=this.distance(x,b);edgeLength=this.distance(this,b);el=this.distance(b,c);if(el<edgeLength){edgeLength=el}el=this.distance(c,this);if(el<edgeLength){edgeLength=el}return radius/edgeLength};jsts.triangulate.quadedge.Vertex.prototype.midPoint=function(a){var xm,ym;xm=(this.p.x+a.getX())/2.0;ym=(this.p.y+a.getY())/2.0;return new jsts.triangulate.quadedge.Vertex(xm,ym)};jsts.triangulate.quadedge.Vertex.prototype.circleCenter=function(b,c){var a,cab,cbc,hcc,cc;a=new jsts.triangulate.quadedge.Vertex(this.getX(),this.getY());cab=this.bisector(a,b);cbc=this.bisector(b,c);hcc=new jsts.algorithm.HCoordinate(cab,cbc);cc=null;try{cc=new jsts.triangulate.quadedge.Vertex(hcc.getX(),hcc.getY())}catch(err){}return cc};
87   -jsts.triangulate.quadedge.TrianglePredicate=function(){};jsts.triangulate.quadedge.TrianglePredicate.isInCircleNonRobust=function(a,b,c,p){var isInCircle=(a.x*a.x+a.y*a.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(b,c,p)-(b.x*b.x+b.y*b.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(a,c,p)+(c.x*c.x+c.y*c.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(a,b,p)-(p.x*p.x+p.y*p.y)*jsts.triangulate.quadedge.TrianglePredicate.triArea(a,b,c)>0;return isInCircle};jsts.triangulate.quadedge.TrianglePredicate.isInCircleNormalized=function(a,b,c,p){var adx,ady,bdx,bdy,cdx,cdy,abdet,bcdet,cadet,alift,blift,clift,disc;adx=a.x-p.x;ady=a.y-p.y;bdx=b.x-p.x;bdy=b.y-p.y;cdx=c.x-p.x;cdy=c.y-p.y;abdet=adx*bdy-bdx*ady;bcdet=bdx*cdy-cdx*bdy;cadet=cdx*ady-adx*cdy;alift=adx*adx+ady*ady;blift=bdx*bdx+bdy*bdy;clift=cdx*cdx+cdy*cdy;disc=alift*bcdet+blift*cadet+clift*abdet;return disc>0};jsts.triangulate.quadedge.TrianglePredicate.triArea=function(a,b,c){return(b.x-a.x)*(c.y-a.y)-(b.y-a.y)*(c.x-a.x)};jsts.triangulate.quadedge.TrianglePredicate.isInCircleRobust=function(a,b,c,p){return jsts.triangulate.quadedge.TrianglePredicate.isInCircleNormalized(a,b,c,p)};jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDSlow=function(a,b,c,p){var px,py,ax,ay,bx,by,cx,cy,aTerm,bTerm,cTerm,pTerm,sum,isInCircle;px=jsts.math.DD.valueOf(p.x);py=jsts.math.DD.valueOf(p.y);ax=jsts.math.DD.valueOf(a.x);ay=jsts.math.DD.valueOf(a.y);bx=jsts.math.DD.valueOf(b.x);by=jsts.math.DD.valueOf(b.y);cx=jsts.math.DD.valueOf(c.x);cy=jsts.math.DD.valueOf(c.y);aTerm=(ax.multiply(ax).add(ay.multiply(ay))).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(bx,by,cx,cy,px,py));bTerm=(bx.multiply(bx).add(by.multiply(by))).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(ax,ay,cx,cy,px,py));cTerm=(cx.multiply(cx).add(cy.multiply(cy))).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(ax,ay,bx,by,px,py));pTerm=(px.multiply(px).add(py.multiply(py))).multiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow(ax,ay,bx,by,cx,cy));sum=aTerm.subtract(bTerm).add(cTerm).subtract(pTerm);isInCircle=sum.doubleValue()>0;return isInCircle};jsts.triangulate.quadedge.TrianglePredicate.triAreaDDSlow=function(ax,ay,bx,by,cx,cy){return(bx.subtract(ax).multiply(cy.subtract(ay)).subtract(by.subtract(ay).multiply(cx.subtract(ax))))};jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDFast=function(a,b,c,p){var aTerm,bTerm,cTerm,pTerm,sum,isInCircle;aTerm=(jsts.math.DD.sqr(a.x).selfAdd(jsts.math.DD.sqr(a.y))).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(b,c,p));bTerm=(jsts.math.DD.sqr(b.x).selfAdd(jsts.math.DD.sqr(b.y))).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(a,c,p));cTerm=(jsts.math.DD.sqr(c.x).selfAdd(jsts.math.DD.sqr(c.y))).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(a,b,p));pTerm=(jsts.math.DD.sqr(p.x).selfAdd(jsts.math.DD.sqr(p.y))).selfMultiply(jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast(a,b,c));sum=aTerm.selfSubtract(bTerm).selfAdd(cTerm).selfSubtract(pTerm);isInCircle=sum.doubleValue()>0;return isInCircle};jsts.triangulate.quadedge.TrianglePredicate.triAreaDDFast=function(a,b,c){var t1,t2;t1=jsts.math.DD.valueOf(b.x).selfSubtract(a.x).selfMultiply(jsts.math.DD.valueOf(c.y).selfSubtract(a.y));t2=jsts.math.DD.valueOf(b.y).selSubtract(a.y).selfMultiply(jsts.math.DD.valueOf(c.x).selfSubtract(a.x));return t1.selfSubtract(t2)};jsts.triangulate.quadedge.TrianglePredicate.isInCircleDDNormalized=function(a,b,c,p){var adx,ady,bdx,bdy,cdx,cdy,abdet,bcdet,cadet,alift,blift,clift,sum,isInCircle;adx=jsts.math.DD.valueOf(a.x).selfSubtract(p.x);ady=jsts.math.DD.valueOf(a.y).selfSubtract(p.y);bdx=jsts.math.DD.valueOf(b.x).selfSubtract(p.x);bdx=jsts.math.DD.valueOf(b.y).selfSubtract(p.y);cdx=jsts.math.DD.valueOf(c.x).selfSubtract(p.x);cdx=jsts.math.DD.valueOf(c.y).selfSubtract(p.y);abdet=adx.multiply(bdy).selfSubtract(bdx.multiply(ady));bcdet=bdx.multiply(cdy).selfSubtract(cdx.multiply(bdy));cadet=cdx.multiply(ady).selfSubtract(adx.multiply(cdy));alift=adx.multiply(adx).selfAdd(ady.multiply(ady));blift=bdx.multiply(bdx).selfAdd(bdy.multiply(bdy));clift=cdx.multiply(cdx).selfAdd(cdy.multiply(cdy));sum=alift.selfMultiply(bcdet).selfAdd(blift.selfMultiply(cadet)).selfAdd(clift.selfMultiply(abdet));isInCircle=sum.doubleValue()>0;return isInCircle};jsts.triangulate.quadedge.TrianglePredicate.isInCircleCC=function(a,b,c,p){var cc,ccRadius,pRadiusDiff;cc=jsts.geom.Triangle.circumcentre(a,b,c);ccRadius=a.distance(cc);pRadiusDiff=p.distance(cc)-ccRadius;return pRadiusDiff<=0};
88   -jsts.HashSet=function(hashingFunction,equalityFunction){var hashTable=new jsts.Hashtable(hashingFunction,equalityFunction);this.add=function(o){hashTable.put(o,true)};this.addAll=function(arr){var i=arr.length;while(i--){hashTable.put(arr[i],true)}};this.values=function(){return hashTable.keys()};this.remove=function(o){return hashTable.remove(o)?o:null};this.contains=function(o){return hashTable.containsKey(o)};this.clear=function(){hashTable.clear()};this.size=function(){return hashTable.size()};this.isEmpty=function(){return hashTable.isEmpty()};this.clone=function(){var h=new HashSet(hashingFunction,equalityFunction);h.addAll(hashTable.keys());return h};this.intersection=function(hashSet){var intersection=new jsts.HashSet(hashingFunction,equalityFunction);var values=hashSet.values(),i=values.length,val;while(i--){val=values[i];if(hashTable.containsKey(val)){intersection.add(val)}}return intersection};this.union=function(hashSet){var union=this.clone();var values=hashSet.values(),i=values.length,val;while(i--){val=values[i];if(!hashTable.containsKey(val)){union.add(val)}}return union};this.isSubsetOf=function(hashSet){var values=hashTable.keys(),i=values.length;while(i--){if(!hashSet.contains(values[i])){return false}}return true}};
89   -jsts.geomgraph.index={};
90   -jsts.geomgraph.Quadrant=function(){};jsts.geomgraph.Quadrant.NE=0;jsts.geomgraph.Quadrant.NW=1;jsts.geomgraph.Quadrant.SW=2;jsts.geomgraph.Quadrant.SE=3;jsts.geomgraph.Quadrant.quadrant=function(dx,dy){if(dx instanceof jsts.geom.Coordinate){return jsts.geomgraph.Quadrant.quadrant2.apply(this,arguments)}if(dx===0.0&&dy===0.0)throw new jsts.error.IllegalArgumentError('Cannot compute the quadrant for point ( '+dx+', '+dy+' )');if(dx>=0.0){if(dy>=0.0)return jsts.geomgraph.Quadrant.NE;else return jsts.geomgraph.Quadrant.SE}else{if(dy>=0.0)return jsts.geomgraph.Quadrant.NW;else return jsts.geomgraph.Quadrant.SW}};jsts.geomgraph.Quadrant.quadrant2=function(p0,p1){if(p1.x===p0.x&&p1.y===p0.y)throw new jsts.error.IllegalArgumentError('Cannot compute the quadrant for two identical points '+p0);if(p1.x>=p0.x){if(p1.y>=p0.y)return jsts.geomgraph.Quadrant.NE;else return jsts.geomgraph.Quadrant.SE}else{if(p1.y>=p0.y)return jsts.geomgraph.Quadrant.NW;else return jsts.geomgraph.Quadrant.SW}};jsts.geomgraph.Quadrant.isOpposite=function(quad1,quad2){if(quad1===quad2)return false;var diff=(quad1-quad2+4)%4;if(diff===2)return true;return false};jsts.geomgraph.Quadrant.commonHalfPlane=function(quad1,quad2){if(quad1===quad2)return quad1;var diff=(quad1-quad2+4)%4;if(diff===2)return-1;var min=(quad1<quad2)?quad1:quad2;var max=(quad1>quad2)?quad1:quad2;if(min===0&&max===3)return 3;return min};jsts.geomgraph.Quadrant.isInHalfPlane=function(quad,halfPlane){if(halfPlane===jsts.geomgraph.Quadrant.SE){return quad===jsts.geomgraph.Quadrant.SE||quad===jsts.geomgraph.Quadrant.SW}return quad===halfPlane||quad===halfPlane+1};jsts.geomgraph.Quadrant.isNorthern=function(quad){return quad===jsts.geomgraph.Quadrant.NE||quad===jsts.geomgraph.Quadrant.NW};
91   -jsts.geomgraph.EdgeIntersectionList=function(edge){this.edge=edge;this.nodeMap=new jsts.Hashtable()};jsts.geomgraph.EdgeIntersectionList.prototype.nodeMap=null;jsts.geomgraph.EdgeIntersectionList.prototype.edge=null;jsts.geomgraph.EdgeIntersectionList.prototype.add=function(intPt,segmentIndex,dist){var eiNew=new jsts.geomgraph.EdgeIntersection(intPt,segmentIndex,dist);var ei=this.nodeMap.get(eiNew);if(ei!==null){return ei}this.nodeMap.put(eiNew,eiNew);return eiNew};
92   -jsts.geomgraph.EdgeIntersection=function(coord,segmentIndex,dist){this.coord=new jsts.geom.Coordinate(coord);this.segmentIndex=segmentIndex;this.dist=dist};jsts.geomgraph.EdgeIntersection.prototype.coord=null;jsts.geomgraph.EdgeIntersection.prototype.segmentIndex=null;jsts.geomgraph.EdgeIntersection.prototype.dist=null;jsts.geomgraph.EdgeIntersection.prototype.getCoordinate=function(){return this.coord};jsts.geomgraph.EdgeIntersection.prototype.getSegmentIndex=function(){return this.segmentIndex};jsts.geomgraph.EdgeIntersection.prototype.getDistance=function(){return this.dist};jsts.geomgraph.EdgeIntersection.prototype.compareTo=function(other){return this.compare(other.segmentIndex,other.dist)};jsts.geomgraph.EdgeIntersection.prototype.compare=function(segmentIndex,dist){if(this.segmentIndex<segmentIndex)return-1;if(this.segmentIndex>segmentIndex)return 1;if(this.dist<dist)return-1;if(this.dist>dist)return 1;return 0};jsts.geomgraph.EdgeIntersection.prototype.isEndPoint=function(maxSegmentIndex){if(segmentIndex==0&&dist==0.0)return true;if(segmentIndex==maxSegmentIndex)return true;return false};
93   -jsts.geomgraph.GraphComponent=function(label){this.label=label};jsts.geomgraph.GraphComponent.prototype.label=null;jsts.geomgraph.GraphComponent.prototype.isInResult=false;jsts.geomgraph.GraphComponent.prototype.isCovered=false;jsts.geomgraph.GraphComponent.prototype.isCoveredSet=false;jsts.geomgraph.GraphComponent.prototype.isVisited=false;jsts.geomgraph.GraphComponent.prototype.getLabel=function(){return this.label};jsts.geomgraph.GraphComponent.prototype.setLabel=function(label){this.label=label};jsts.geomgraph.GraphComponent.prototype.setInResult=function(isInResult){this.isInResult=isInResult};jsts.geomgraph.GraphComponent.prototype.isInResult=function(){return this.isInResult};jsts.geomgraph.GraphComponent.prototype.setCovered=function(isCovered){this.isCovered=isCovered;this.isCoveredSet=true};jsts.geomgraph.GraphComponent.prototype.isCovered=function(){return isCovered};jsts.geomgraph.GraphComponent.prototype.isCoveredSet=function(){return isCoveredSet};jsts.geomgraph.GraphComponent.prototype.isVisited=function(){return isVisited};jsts.geomgraph.GraphComponent.prototype.setVisited=function(isVisited){this.isVisited=isVisited};jsts.geomgraph.GraphComponent.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.GraphComponent.prototype.computeIM=function(im){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.GraphComponent.prototype.isIsolated=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.GraphComponent.prototype.updateIM=function(im){if(this.label.getGeometryCount()>=2){throw new jsts.error.NotRepresentableError('found partial label')}this.computeIM(im)};
94   -jsts.geomgraph.Node=function(){};jsts.geomgraph.Node.prototype=new jsts.geomgraph.GraphComponent();jsts.geomgraph.Node.prototype.getLabel=function(){return new jsts.geomgraph.Label()};
95   -jsts.geomgraph.Edge=function(pts,label){this.pts=pts;this.label=label;this.eiList=new jsts.geomgraph.EdgeIntersectionList(this)};jsts.geomgraph.Edge.prototype=new jsts.geomgraph.GraphComponent();jsts.geomgraph.Edge.prototype.pts=null;jsts.geomgraph.Edge.prototype.eiList=null;jsts.geomgraph.Edge.prototype.getNumPoints=function(){return this.pts.length};jsts.geomgraph.Edge.prototype.getCoordinates=function(){return this.pts};jsts.geomgraph.Edge.prototype.getCoordinate=function(i){return this.pts[i]};jsts.geomgraph.Edge.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])};jsts.geomgraph.Edge.prototype.addIntersections=function(li,segmentIndex,geomIndex){for(var i=0;i<li.getIntersectionNum();i++){this.addIntersection(li,segmentIndex,geomIndex,i)}};jsts.geomgraph.Edge.prototype.addIntersection=function(li,segmentIndex,geomIndex,intIndex){var intPt=new jsts.geom.Coordinate(li.getIntersection(intIndex));var normalizedSegmentIndex=segmentIndex;var dist=li.getEdgeDistance(geomIndex,intIndex);var nextSegIndex=normalizedSegmentIndex+1;if(nextSegIndex<this.pts.length){var nextPt=this.pts[nextSegIndex];if(intPt.equals2D(nextPt)){normalizedSegmentIndex=nextSegIndex;dist=0.0}}var ei=this.eiList.add(intPt,normalizedSegmentIndex,dist)};jsts.geomgraph.Edge.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1};
96   -jsts.geomgraph.Position=function(){};jsts.geomgraph.Position.ON=0;jsts.geomgraph.Position.LEFT=1;jsts.geomgraph.Position.RIGHT=2;jsts.geomgraph.Position.opposite=function(position){if(position===jsts.geomgraph.Position.LEFT){return jsts.geomgraph.Position.RIGHT}if(position===jsts.geomgraph.Position.RIGHT){return jsts.geomgraph.Position.LEFT}return position};
97   -jsts.geomgraph.Label=function(){var geomIndex,onLoc,leftLoc,rightLoc;if(arguments.length===4){geomIndex=arguments[0];onLoc=arguments[1];leftLoc=arguments[2];rightLoc=arguments[3];this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE);this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE);this.elt[geomIndex].setLocations(onLoc,leftLoc,rightLoc)}else if(arguments.length===3){onLoc=arguments[0];leftLoc=arguments[1];rightLoc=arguments[2];this.elt[0]=new jsts.geomgraph.TopologyLocation(onLoc,leftLoc,rightLoc);this.elt[1]=new jsts.geomgraph.TopologyLocation(onLoc,leftLoc,rightLoc)}else if(arguments.length===2){geomIndex=arguments[0];onLoc=arguments[1];this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE);this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE);this.elt[geomIndex].setLocation(onLoc)}else if(arguments[0]instanceof jsts.geomgraph.Label){this.elt[0]=new jsts.geomgraph.TopologyLocation(lbl.elt[0]);this.elt[1]=new jsts.geomgraph.TopologyLocation(lbl.elt[1])}else if(arguments[0]instanceof Number){onLoc=arguments[0];this.elt[0]=new jsts.geomgraph.TopologyLocation(onLoc);this.elt[1]=new jsts.geomgraph.TopologyLocation(onLoc)}};jsts.geomgraph.Label.toLineLabel=function(label){var i,lineLabel=new jsts.geomgraph.Label(jsts.geom.Location.NONE);for(i=0;i<2;i++){lineLabel.setLocation(i,label.getLocation(i))}return lineLabel};jsts.geomgraph.Label.prototype.elt=[];jsts.geomgraph.Label.prototype.flip=function(){this.elt[0].flip();this.elt[1].flip()};jsts.geomgraph.Label.prototype.getLocation=function(geomIndex,posIndex){return this.elt[geomIndex].get(posIndex)};jsts.geomgraph.Label.prototype.getLocation=function(geomIndex){return this.elt[geomIndex].get(jsts.geomgraph.Position.ON)};jsts.geomgraph.Label.prototype.setLocation=function(geomIndex,posIndex,location){this.elt[geomIndex].setLocation(posIndex,location)};jsts.geomgraph.Label.prototype.setLocation=function(geomIndex,location){this.elt[geomIndex].setLocation(jsts.geomgraph.Position.ON,location)};jsts.geomgraph.Label.prototype.setAllLocations=function(geomIndex,location){this.elt[geomIndex].setAllLocations(location)};jsts.geomgraph.Label.prototype.setAllLocationsIfNull=function(geomIndex,location){this.elt[geomIndex].setAllLocationsIfNull(location)};jsts.geomgraph.Label.prototype.setAllLocationsIfNull=function(location){this.setAllLocationsIfNull(0,location);this.setAllLocationsIfNull(1,location)};jsts.geomgraph.Label.prototype.merge=function(lbl){var i;for(i=0;i<2;i++){if(this.elt[i]===null&&lbl.elt[i]!==null){this.elt[i]=new jsts.geomgraph.TopologyLocation(lbl.elt[i])}else{this.elt[i].merge(lbl.elt[i])}}};jsts.geomgraph.Label.prototype.getGeometryCount=function(){var count=0;if(!this.elt[0].isNull()){count++}if(!this.elt[1].isNull()){count++}return count};jsts.geomgraph.Label.prototype.isNull=function(geomIndex){return this.elt[geomIndex].isNull()};jsts.geomgraph.Label.prototype.isAnyNull=function(geomIndex){return this.elt[geomIndex].isAnyNull()};jsts.geomgraph.Label.prototype.isArea=function(){return this.elt[0].isArea()||elt[1].isArea()};jsts.geomgraph.Label.prototype.isArea=function(geomIndex){return this.elt[geomIndex].isArea()};jsts.geomgraph.Label.prototype.isLine=function(geomIndex){return this.elt[geomIndex].isLine()};jsts.geomgraph.Label.prototype.isEqualOnSide=function(lbl,side){return this.elt[0].isEqualOnSide(lbl.elt[0],side)&&this.elt[1].isEqualOnSide(lbl.elt[1],side)};jsts.geomgraph.Label.prototype.allPositionsEqual=function(geomIndex,loc){return this.elt[geomIndex].allPositionsEqual(loc)};jsts.geomgraph.Label.prototype.toLine=function(geomIndex){if(this.elt[geomIndex].isArea()){this.elt[geomIndex]=new jsts.geomgraph.TopologyLocation(this.elt[geomIndex].location[0])}};
98   -
99   -jsts.geomgraph.EdgeEnd=function(edge,p0,p1,label){this.edge=edge;if(p0!==undefined){this.init(p0,p1);this.label=label}};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(p0,p1){this.p0=p0;this.p1=p1;this.dx=p1.x-p0.x;this.dy=p1.y-p0.y;this.quadrant=jsts.geomgraph.Quadrant.quadrant(dx,dy)};jsts.geomgraph.EdgeEnd.prototype.getEdge=function(){return edge};jsts.geomgraph.EdgeEnd.prototype.getLabel=function(){return label};jsts.geomgraph.EdgeEnd.prototype.getCoordinate=function(){return p0};jsts.geomgraph.EdgeEnd.prototype.getDirectedCoordinate=function(){return p1};jsts.geomgraph.EdgeEnd.prototype.getQuadrant=function(){return quadrant};jsts.geomgraph.EdgeEnd.prototype.getDx=function(){return dx};jsts.geomgraph.EdgeEnd.prototype.getDy=function(){return dy};jsts.geomgraph.EdgeEnd.prototype.setNode=function(node){this.node=node};jsts.geomgraph.EdgeEnd.prototype.getNode=function(){return node};jsts.geomgraph.EdgeEnd.prototype.compareTo=function(e){return this.compareDirection(e)};jsts.geomgraph.EdgeEnd.prototype.compareDirection=function(e){if(dx===e.dx&&dy===e.dy)return 0;if(this.quadrant>e.quadrant)return 1;if(this.quadrant<e.quadrant)return-1;return jsts.algorithm.CGAlgorithms.computeOrientation(e.p0,e.p1,p1)};jsts.geomgraph.EdgeEnd.prototype.computeLabel=function(boundaryNodeRule){};
100   -jsts.geomgraph.TopologyLocation=function(){if(arguments.length===3){var on=arguments[0];var left=arguments[1];var right=arguments[2];this.init(3);this.location[jsts.geomgraph.Position.ON]=on;this.location[jsts.geomgraph.Position.LEFT]=left;this.location[jsts.geomgraph.Position.RIGHT]=right}else if(arguments[0]instanceof jsts.geomgraph.TopologyLocation){var gl=arguments[0];init(gl.location.length);if(gl!=null){for(var i=0;i<this.location.length;i++){this.location[i]=gl.location[i]}}}else if(arguments[0]instanceof Number){var on=arguments[0];init(1);this.location[Position.ON]=on}else if(arguments[0]instanceof Array){var location=arguments[0];init(location.length)}};jsts.geomgraph.TopologyLocation.prototype.location=[];jsts.geomgraph.TopologyLocation.prototype.init=function(size){this.location[size]=null;this.setAllLocations(jsts.geom.Location.NONE)};jsts.geomgraph.TopologyLocation.prototype.get=function(posIndex){if(posIndex<this.location.length)return this.location[posIndex];return jsts.geom.Location.NONE};jsts.geomgraph.TopologyLocation.prototype.isNull=function(){for(var i=0;i<this.location.length;i++){if(this.location[i]!==jsts.geom.Location.NONE)return false}return true};jsts.geomgraph.TopologyLocation.prototype.isAnyNull=function(){for(var i=0;i<this.location.length;i++){if(this.location[i]===jsts.geom.Location.NONE)return true}return false};jsts.geomgraph.TopologyLocation.prototype.isEqualOnSide=function(le,locIndex){return this.location[locIndex]==le.location[locIndex]};jsts.geomgraph.TopologyLocation.prototype.isArea=function(){return this.location.length>1};jsts.geomgraph.TopologyLocation.prototype.isLine=function(){return this.location.length==1};jsts.geomgraph.TopologyLocation.prototype.flip=function(){if(this.location.length<=1)return;var temp=this.location[jsts.geom.Position.LEFT];this.location[jsts.geomgraph.Position.LEFT]=this.location[jsts.geom.Position.RIGHT];this.location[jsts.geomgraph.Position.RIGHT]=temp};jsts.geomgraph.TopologyLocation.prototype.setAllLocations=function(locValue){for(var i=0;i<this.location.length;i++){this.location[i]=locValue}};jsts.geomgraph.TopologyLocation.prototype.setAllLocationsIfNull=function(locValue){for(var i=0;i<this.location.length;i++){if(this.location[i]===jsts.geom.Location.NONE)this.location[i]=locValue}};jsts.geomgraph.TopologyLocation.prototype.setLocation=function(locIndex,locValue){if(locValue!==undefined){this.location[locIndex]=locValue}else{this.setLocation(jsts.geomgraph.Position.ON,locIndex)}};jsts.geomgraph.TopologyLocation.prototype.getLocations=function(){return location};jsts.geomgraph.TopologyLocation.prototype.setLocations=function(on,left,right){this.location[jsts.geomgraph.Position.ON]=on;this.location[jsts.geomgraph.Position.LEFT]=left;this.location[jsts.geomgraph.Position.RIGHT]=right};jsts.geomgraph.TopologyLocation.prototype.allPositionsEqual=function(loc){for(var i=0;i<this.location.length;i++){if(this.location[i]!==loc)return false}return true};jsts.geomgraph.TopologyLocation.prototype.merge=function(gl){if(gl.location.length>this.location.length){var newLoc=[];newLoc[jsts.geomgraph.Position.ON]=this.location[jsts.geomgraph.Position.ON];newLoc[jsts.geomgraph.Position.LEFT]=jsts.geom.Location.NONE;newLoc[jsts.geomgraph.Position.RIGHT]=jsts.geom.Location.NONE;this.location=newLoc}for(var i=0;i<this.location.length;i++){if(this.location[i]==jsts.geom.Location.NONE&&i<gl.location.length)this.location[i]=gl.location[i]}};
101   -jsts.geomgraph.index.SegmentIntersector=function(li,includeProper,recordIsolated){this.li=li;this.includeProper=includeProper;this.recordIsolated=recordIsolated};jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments=function(i1,i2){return Math.abs(i1-i2)===1};jsts.geomgraph.index.SegmentIntersector.prototype._hasIntersection=false;jsts.geomgraph.index.SegmentIntersector.prototype.hasProper=false;jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInterior=false;jsts.geomgraph.index.SegmentIntersector.prototype.properIntersectionPoint=null;jsts.geomgraph.index.SegmentIntersector.prototype.li=null;jsts.geomgraph.index.SegmentIntersector.prototype.includeProper=null;jsts.geomgraph.index.SegmentIntersector.prototype.recordIsolated=null;jsts.geomgraph.index.SegmentIntersector.prototype.isSelfIntersection=null;jsts.geomgraph.index.SegmentIntersector.prototype.numIntersections=0;jsts.geomgraph.index.SegmentIntersector.prototype.numTests=0;jsts.geomgraph.index.SegmentIntersector.prototype.bdyNodes=null;jsts.geomgraph.index.SegmentIntersector.prototype.setBoundaryNodes=function(bdyNodes0,bdyNodes1){this.bdyNodes=[];this.bdyNodes[0]=bdyNodes0;this.bdyNodes[1]=bdyNodes1};jsts.geomgraph.index.SegmentIntersector.prototype.getProperIntersectionPoint=function(){return this.properIntersectionPoint};jsts.geomgraph.index.SegmentIntersector.prototype.hasIntersection=function(){return this._hasIntersection};jsts.geomgraph.index.SegmentIntersector.prototype.hasProperIntersection=function(){return this.hasProper};jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInteriorIntersection=function(){return this.hasProperInterior};jsts.geomgraph.index.SegmentIntersector.prototype.isTrivialIntersection=function(e0,segIndex0,e1,segIndex1){if(e0==e1){if(this.li.getIntersectionNum()==1){if(jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments(segIndex0,segIndex1))return true;if(e0.isClosed()){var maxSegIndex=e0.getNumPoints()-1;if((segIndex0==0&&segIndex1==maxSegIndex)||(segIndex1==0&&segIndex0==maxSegIndex)){return true}}}}return false};jsts.geomgraph.index.SegmentIntersector.prototype.addIntersections=function(e0,segIndex0,e1,segIndex1){if(e0===e1&&segIndex0===segIndex1)return;this.numTests++;var p00=e0.getCoordinates()[segIndex0];var p01=e0.getCoordinates()[segIndex0+1];var p10=e1.getCoordinates()[segIndex1];var p11=e1.getCoordinates()[segIndex1+1];this.li.computeIntersection(p00,p01,p10,p11);if(this.li.hasIntersection()){if(this.recordIsolated){e0.setIsolated(false);e1.setIsolated(false)}this.numIntersections++;if(!this.isTrivialIntersection(e0,segIndex0,e1,segIndex1)){this._hasIntersection=true;if(this.includeProper||!this.li.isProper()){e0.addIntersections(this.li,segIndex0,0);e1.addIntersections(this.li,segIndex1,1)}if(this.li.isProper()){this.properIntersectionPoint=this.li.getIntersection(0).clone();this.hasProper=true;if(!this.isBoundaryPoint(this.li,this.bdyNodes))this.hasProperInterior=true}}}};jsts.geomgraph.index.SegmentIntersector.prototype.isBoundaryPoint=function(li,bdyNodes){if(bdyNodes===null)return false;if(bdyNodes[0]instanceof Array){if(this.isBoundaryPoint(li,bdyNodes[0]))return true;if(this.isBoundaryPoint(li,bdyNodes[1]))return true;return false}else{for(var i=0;i<bdyNodes.length;i++){var node=bdyNodes[i];var pt=node.getCoordinate();if(li.isIntersection(pt))return true}return false}};
102   -jsts.geomgraph.index.EdgeSetIntersector=function(){};jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections=function(edges,si,testAllSegments){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections=function(edges0,edges1,si){throw new jsts.error.AbstractMethodInvocationError()};
103   -jsts.geomgraph.index.SimpleEdgeSetIntersector=function(){};jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector();jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.nOverlaps=0;jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersections=function(edges,si,testAllSegments){var i0,i1,edge0,edge1;this.nOverlaps=0;for(i0=0;i0<edges.length;i0++){edge0=edges[i0];for(i1=0;i1<edges.length;i1++){edge1=edges[i1];if(testAllSegments||edge0!==edge1){this.computeIntersects(edge0,edge1,si)}}}};jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersects=function(e0,e1,si){var pts0=e0.getCoordinates();var pts1=e1.getCoordinates();var i0,i1;for(i0=0;i0<pts0.length-1;i0++){for(i1=0;i1<pts1.length-1;i1++){si.addIntersections(e0,i0,e1,i1)}}};
104   -jsts.geomgraph.index.SimpleMCSweepLineIntersector=function(){};jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector();
  1 +jsts={version:'1.11-SNAPSHOT'};jsts.error={};jsts.error.IllegalArgumentError=function(message){this.name='IllegalArgumentError';this.message=(message||'')};jsts.error.IllegalArgumentError.prototype=new Error();jsts.error.AbstractMethodInvocationError=function(){this.name='AbstractMethodInvocationError';this.message='Abstract method called, should be implemented in subclass.'};jsts.error.AbstractMethodInvocationError.prototype=new Error();jsts.error.NotImplementedError=function(){this.name='NotImplementedError';this.message='This method has not yet been implemented.'};jsts.error.NotImplementedError.prototype=new Error();jsts.error.NotRepresentableError=function(message){this.name='NotRepresentableError';this.message=(message||'')};jsts.error.NotRepresentableError.prototype=new Error();
  2 +jsts.Hashtable=(function(){var FUNCTION='function';var arrayRemoveAt=(typeof Array.prototype.splice==FUNCTION)?function(arr,idx){arr.splice(idx,1)}:function(arr,idx){var itemsAfterDeleted,i,len;if(idx===arr.length-1){arr.length=idx}else{itemsAfterDeleted=arr.slice(idx+1);arr.length=idx;for(i=0,len=itemsAfterDeleted.length;i<len;++i){arr[idx+i]=itemsAfterDeleted[i]}}};function hashObject(obj){var hashCode;if(typeof obj=='string'){return obj}else if(typeof obj.hashCode==FUNCTION){hashCode=obj.hashCode();return(typeof hashCode=='string')?hashCode:hashObject(hashCode)}else if(typeof obj.toString==FUNCTION){return obj.toString()}else{try{return String(obj)}catch(ex){return Object.prototype.toString.call(obj)}}}function equals_fixedValueHasEquals(fixedValue,variableValue){return fixedValue.equals(variableValue)}function equals_fixedValueNoEquals(fixedValue,variableValue){return(typeof variableValue.equals==FUNCTION)?variableValue.equals(fixedValue):(fixedValue===variableValue)}function createKeyValCheck(kvStr){return function(kv){if(kv===null){throw new Error('null is not a valid '+kvStr)}else if(typeof kv=='undefined'){throw new Error(kvStr+' must not be undefined')}}}var checkKey=createKeyValCheck('key'),checkValue=createKeyValCheck('value');function Bucket(hash,firstKey,firstValue,equalityFunction){this[0]=hash;this.entries=[];this.addEntry(firstKey,firstValue);if(equalityFunction!==null){this.getEqualityFunction=function(){return equalityFunction}}}var EXISTENCE=0,ENTRY=1,ENTRY_INDEX_AND_VALUE=2;function createBucketSearcher(mode){return function(key){var i=this.entries.length,entry,equals=this.getEqualityFunction(key);while(i--){entry=this.entries[i];if(equals(key,entry[0])){switch(mode){case EXISTENCE:return true;case ENTRY:return entry;case ENTRY_INDEX_AND_VALUE:return[i,entry[1]]}}}return false}}function createBucketLister(entryProperty){return function(aggregatedArr){var startIndex=aggregatedArr.length;for(var i=0,len=this.entries.length;i<len;++i){aggregatedArr[startIndex+i]=this.entries[i][entryProperty]}}}Bucket.prototype={getEqualityFunction:function(searchValue){return(typeof searchValue.equals==FUNCTION)?equals_fixedValueHasEquals:equals_fixedValueNoEquals},getEntryForKey:createBucketSearcher(ENTRY),getEntryAndIndexForKey:createBucketSearcher(ENTRY_INDEX_AND_VALUE),removeEntryForKey:function(key){var result=this.getEntryAndIndexForKey(key);if(result){arrayRemoveAt(this.entries,result[0]);return result[1]}return null},addEntry:function(key,value){this.entries[this.entries.length]=[key,value]},keys:createBucketLister(0),values:createBucketLister(1),getEntries:function(entries){var startIndex=entries.length;for(var i=0,len=this.entries.length;i<len;++i){entries[startIndex+i]=this.entries[i].slice(0)}},containsKey:createBucketSearcher(EXISTENCE),containsValue:function(value){var i=this.entries.length;while(i--){if(value===this.entries[i][1]){return true}}return false}};function searchBuckets(buckets,hash){var i=buckets.length,bucket;while(i--){bucket=buckets[i];if(hash===bucket[0]){return i}}return null}function getBucketForHash(bucketsByHash,hash){var bucket=bucketsByHash[hash];return(bucket&&(bucket instanceof Bucket))?bucket:null}function Hashtable(hashingFunctionParam,equalityFunctionParam){var that=this;var buckets=[];var bucketsByHash={};var hashingFunction=(typeof hashingFunctionParam==FUNCTION)?hashingFunctionParam:hashObject;var equalityFunction=(typeof equalityFunctionParam==FUNCTION)?equalityFunctionParam:null;this.put=function(key,value){checkKey(key);checkValue(value);var hash=hashingFunction(key),bucket,bucketEntry,oldValue=null;bucket=getBucketForHash(bucketsByHash,hash);if(bucket){bucketEntry=bucket.getEntryForKey(key);if(bucketEntry){oldValue=bucketEntry[1];bucketEntry[1]=value}else{bucket.addEntry(key,value)}}else{bucket=new Bucket(hash,key,value,equalityFunction);buckets[buckets.length]=bucket;bucketsByHash[hash]=bucket}return oldValue};this.get=function(key){checkKey(key);var hash=hashingFunction(key);var bucket=getBucketForHash(bucketsByHash,hash);if(bucket){var bucketEntry=bucket.getEntryForKey(key);if(bucketEntry){return bucketEntry[1]}}return null};this.containsKey=function(key){checkKey(key);var bucketKey=hashingFunction(key);var bucket=getBucketForHash(bucketsByHash,bucketKey);return bucket?bucket.containsKey(key):false};this.containsValue=function(value){checkValue(value);var i=buckets.length;while(i--){if(buckets[i].containsValue(value)){return true}}return false};this.clear=function(){buckets.length=0;bucketsByHash={}};this.isEmpty=function(){return!buckets.length};var createBucketAggregator=function(bucketFuncName){return function(){var aggregated=[],i=buckets.length;while(i--){buckets[i][bucketFuncName](aggregated)}return aggregated}};this.keys=createBucketAggregator('keys');this.values=createBucketAggregator('values');this.entries=createBucketAggregator('getEntries');this.remove=function(key){checkKey(key);var hash=hashingFunction(key),bucketIndex,oldValue=null;var bucket=getBucketForHash(bucketsByHash,hash);if(bucket){oldValue=bucket.removeEntryForKey(key);if(oldValue!==null){if(!bucket.entries.length){bucketIndex=searchBuckets(buckets,hash);arrayRemoveAt(buckets,bucketIndex);delete bucketsByHash[hash]}}}return oldValue};this.size=function(){var total=0,i=buckets.length;while(i--){total+=buckets[i].entries.length}return total};this.each=function(callback){var entries=that.entries(),i=entries.length,entry;while(i--){entry=entries[i];callback(entry[0],entry[1])}};this.putAll=function(hashtable,conflictCallback){var entries=hashtable.entries();var entry,key,value,thisValue,i=entries.length;var hasConflictCallback=(typeof conflictCallback==FUNCTION);while(i--){entry=entries[i];key=entry[0];value=entry[1];if(hasConflictCallback&&(thisValue=that.get(key))){value=conflictCallback(key,thisValue,value)}that.put(key,value)}};this.clone=function(){var clone=new jsts.Hashtable(hashingFunctionParam,equalityFunctionParam);clone.putAll(that);return clone}}return Hashtable})();
  3 +jsts.HashSet=function(hashingFunction,equalityFunction){var hashTable=new jsts.Hashtable(hashingFunction,equalityFunction);this.add=function(o){hashTable.put(o,true)};this.addAll=function(arr){var i=arr.length;while(i--){hashTable.put(arr[i],true)}};this.values=function(){return hashTable.keys()};this.remove=function(o){return hashTable.remove(o)?o:null};this.contains=function(o){return hashTable.containsKey(o)};this.clear=function(){hashTable.clear()};this.size=function(){return hashTable.size()};this.isEmpty=function(){return hashTable.isEmpty()};this.clone=function(){var h=new HashSet(hashingFunction,equalityFunction);h.addAll(hashTable.keys());return h};this.intersection=function(hashSet){var intersection=new jsts.HashSet(hashingFunction,equalityFunction);var values=hashSet.values(),i=values.length,val;while(i--){val=values[i];if(hashTable.containsKey(val)){intersection.add(val)}}return intersection};this.union=function(hashSet){var union=this.clone();var values=hashSet.values(),i=values.length,val;while(i--){val=values[i];if(!hashTable.containsKey(val)){union.add(val)}}return union};this.isSubsetOf=function(hashSet){var values=hashTable.keys(),i=values.length;while(i--){if(!hashSet.contains(values[i])){return false}}return true}};
  4 +jsts.geom={};
  5 +jsts.geom.CoordinateArrays=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.CoordinateArrays.removeRepeatedPoints=function(coord){var coordList;if(!this.hasRepeatedPoints(coord)){return coord}coordList=new jsts.geom.CoordinateList(coord,false);return coordList};jsts.geom.CoordinateArrays.hasRepeatedPoints=function(coord){var i;for(i=1;i<coord.length;i++){if(coord[i-1].equals(coord[i])){return true}}return false};
  6 +jsts.geom.CoordinateList=function(coord,allowRepeated){this.add(coord,allowRepeated)};jsts.geom.CoordinateList.prototype=new Array();jsts.geom.CoordinateList.prototype.add=function(coord,allowRepeated,direction){direction=direction||true;if(direction){for(var i=0;i<coord.length;i++){this.addCoordinate(coord[i],allowRepeated)}}else{for(var i=coord.length-1;i>=0;i--){this.addCoordinate(coord[i],allowRepeated)}}return true};jsts.geom.CoordinateList.prototype.addCoordinate=function(coord,allowRepeated){if(!allowRepeated){if(this.length>=1){var last=this[this.length-1];if(last.equals2D(coord))return}}this.push(coord)};
  7 +jsts.geom.Dimension=function(){};jsts.geom.Dimension.P=0;jsts.geom.Dimension.L=1;jsts.geom.Dimension.A=2;jsts.geom.Dimension.FALSE=-1;jsts.geom.Dimension.TRUE=-2;jsts.geom.Dimension.DONTCARE=-3;jsts.geom.Dimension.toDimensionSymbol=function(dimensionValue){switch(dimensionValue){case FALSE:return'F';case TRUE:return'T';case DONTCARE:return'*';case P:return'0';case L:return'1';case A:return'2'}throw new jsts.IllegalArgumentError('Unknown dimension value: '+dimensionValue)};jsts.geom.Dimension.toDimensionValue=function(dimensionSymbol){switch(dimensionSymbol.toUpperCase()){case'F':return jsts.geom.Dimension.FALSE;case'T':return jsts.geom.Dimension.TRUE;case'*':return jsts.geom.Dimension.DONTCARE;case'0':return jsts.geom.Dimension.P;case'1':return jsts.geom.Dimension.L;case'2':return jsts.geom.Dimension.A}throw new jsts.error.IllegalArgumentError('Unknown dimension symbol: '+dimensionSymbol)};
  8 +jsts.geom.Location=function(){};jsts.geom.Location.INTERIOR=0;jsts.geom.Location.BOUNDARY=1;jsts.geom.Location.EXTERIOR=2;jsts.geom.Location.NONE=-1;jsts.geom.Location.toLocationSymbol=function(locationValue){switch(locationValue){case jsts.geom.Location.EXTERIOR:return'e';case jsts.geom.Location.BOUNDARY:return'b';case jsts.geom.Location.INTERIOR:return'i';case jsts.geom.Location.NONE:return'-'}throw new jsts.IllegalArgumentError('Unknown location value: '+locationValue)};
  9 +jsts.geom.Geometry=function(){};jsts.geom.Geometry=OpenLayers.Class();jsts.geom.Geometry.prototype.envelope=null;jsts.geom.Geometry.prototype.precisionModel=null;jsts.geom.Geometry.prototype.getGeometryType=function(){return'Geometry'};jsts.geom.Geometry.hasNonEmptyElements=function(geometries){var i;for(i=0;i<geometries.length;i++){if(!geometries[i].isEmpty()){return true}}return false};jsts.geom.Geometry.hasNullElements=function(array){var i;for(i=0;i<array.length;i++){if(array[i]===null){return true}}return false};jsts.geom.Geometry.prototype.getFactory=function(){return new jsts.geom.GeometryFactory()};jsts.geom.Geometry.prototype.getNumGeometries=function(){return 1};jsts.geom.Geometry.prototype.getGeometryN=function(n){return this};jsts.geom.Geometry.prototype.getPrecisionModel=function(){if(this.precisionModel===null){this.precisionModel=new jsts.geom.PrecisionModel()}return this.precisionModel};jsts.geom.Geometry.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getCoordinates=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getNumPoints=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.isSimple=function(){this.checkNotGeometryCollection(this);var op=new jsts.operation.IsSimpleOp(this);return op.isSimple()};jsts.geom.Geometry.prototype.isValid=function(){var isValidOp=new IsValidOp(this);return isValidOp.isValid()};jsts.geom.Geometry.prototype.isEmpty=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.distance=function(g){return jsts.operation.distance.DistanceOp.distance(this,g)};jsts.geom.Geometry.prototype.isWithinDistance=function(geom,distance){var envDist=this.getEnvelopeInternal().distance(geom.getEnvelopeInternal());if(envDist>distance){return false}return DistanceOp.isWithinDistance(this,geom,distance)};jsts.geom.Geometry.prototype.getArea=function(){return 0.0};jsts.geom.Geometry.prototype.getLength=function(){return 0.0};jsts.geom.Geometry.prototype.getCentroid=function(){if(isEmpty()){return null}var cent;var centPt=null;var dim=this.getDimension();if(dim===0){cent=new CentroidPoint();cent.add(this);centPt=cent.getCentroid()}else if(dim===1){cent=new CentroidLine();cent.add(this);centPt=cent.getCentroid()}else{cent=new CentroidArea();cent.add(this);centPt=cent.getCentroid()}return this.createPointFromInternalCoord(centPt,this)};jsts.geom.Geometry.prototype.getInteriorPoint=function(){var intPt;var interiorPt=null;var dim=getDimension();if(dim===0){intPt=new InteriorPointPoint(this);interiorPt=intPt.getInteriorPoint()}else if(dim===1){intPt=new InteriorPointLine(this);interiorPt=intPt.getInteriorPoint()}else{intPt=new InteriorPointArea(this);interiorPt=intPt.getInteriorPoint()}return this.createPointFromInternalCoord(interiorPt,this)};jsts.geom.Geometry.prototype.getDimension=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getBoundary=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getBoundaryDimension=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.getEnvelope=function(){return this.getFactory().toGeometry(this.getEnvelopeInternal())};jsts.geom.Geometry.prototype.getEnvelopeInternal=function(){if(this.envelope===null){this.envelope=this.computeEnvelopeInternal()}return this.envelope};jsts.geom.Geometry.prototype.disjoint=function(g){return!this.intersects(g)};jsts.geom.Geometry.prototype.touches=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}return this.relate(g).isTouches(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.intersects=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}if(this.isRectangle()){return RectangleIntersects.intersects(this,g)}if(g.isRectangle()){return RectangleIntersects.intersects(g,this)}return this.relate(g).isIntersects()};jsts.geom.Geometry.prototype.crosses=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}return this.relate(g).isCrosses(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.within=function(g){return g.contains(this)};jsts.geom.Geometry.prototype.contains=function(g){if(!this.getEnvelopeInternal().contains(g.getEnvelopeInternal())){return false}if(this.isRectangle()){return RectangleContains.contains(this,g)}return this.relate(g).isContains()};jsts.geom.Geometry.prototype.overlaps=function(g){if(!this.getEnvelopeInternal().intersects(g.getEnvelopeInternal())){return false}return this.relate(g).isOverlaps(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.covers=function(g){if(!this.getEnvelopeInternal().covers(g.getEnvelopeInternal())){return false}if(this.isRectangle()){return true}return this.relate(g).isCovers()};jsts.geom.Geometry.prototype.coveredBy=function(g){return g.covers(this)};jsts.geom.Geometry.prototype.relate=function(g,intersectionPattern){if(intersectionPattern===undefined){this.relate2.call(this,2)}return this.relate2(g).matches(intersectionPattern)};jsts.geom.Geometry.prototype.relate2=function(g){this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(g);return jsts.operation.relate.RelateOp.relate(this,g)};jsts.geom.Geometry.prototype.jsts_equals=function(g){if(!this.getEnvelopeInternal().equals(g.getEnvelopeInternal())){return false}return this.relate(g).isEquals(this.getDimension(),g.getDimension())};jsts.geom.Geometry.prototype.buffer=function(distance,quadrantSegments,endCapStyle){return jsts.operation.buffer.BufferOp.bufferOp(this,distance,quadrantSegments,endCapStyle)};jsts.geom.Geometry.prototype.convexHull=function(){return(new ConvexHull(this)).getConvexHull()};jsts.geom.Geometry.prototype.intersection=function(other){if(this.isEmpty()){return this.getFactory().createGeometryCollection(null)}if(other.isEmpty()){return this.getFactory().createGeometryCollection(null)}if(this.isGeometryCollection(this)){var g2=other}this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.INTERSECTION)};jsts.geom.Geometry.prototype.union=function(other){if(this.isEmpty()){return other.clone()}if(other.isEmpty()){return this.clone()}this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.UNION)};jsts.geom.Geometry.prototype.difference=function(other){if(this.isEmpty()){return this.getFactory().createGeometryCollection(null)}if(other.isEmpty()){return this.clone()}this.heckNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.DIFFERENCE)};jsts.geom.Geometry.prototype.symDifference=function(other){if(this.isEmpty()){return other.clone()}if(other.isEmpty()){return this.clone()}this.checkNotGeometryCollection(this);this.checkNotGeometryCollection(other);return SnapIfNeededOverlayOp.overlayOp(this,other,OverlayOp.SYMDIFFERENCE)};jsts.geom.Geometry.prototype.union=function(){return jsts.operation.union.UnaryUnionOp.union(this)};jsts.geom.Geometry.prototype.equalsExact=function(other,tolerance){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.apply=function(filter){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.clone=function(){var clone=new jsts.geom.Geometry(this.factory);if(clone.envelope!==null){clone.envelope=new jsts.geom.Envelope(clone.envelope)}return clone};jsts.geom.Geometry.prototype.normalize=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compareTo=function(other){if(this.getClassSortIndex()!==other.getClassSortIndex()){return this.getClassSortIndex()-other.getClassSortIndex()}if(this.isEmpty()&&other.isEmpty()){return 0}if(this.isEmpty()){return-1}if(other.isEmpty()){return 1}return this.compareToSameClass(o)};jsts.geom.Geometry.prototype.compareTo=function(other,comp){if(this.getClassSortIndex()!==other.getClassSortIndex()){return this.getClassSortIndex()-other.getClassSortIndex()}if(this.isEmpty()&&other.isEmpty()){return 0}if(this.isEmpty()){return-1}if(other.isEmpty()){return 1}return this.compareToSameClass(o,comp)};jsts.geom.Geometry.prototype.isEquivalentClass=function(other){return other instanceof this.constructor};jsts.geom.Geometry.prototype.checkNotGeometryCollection=function(g){if(g instanceof jsts.geom.GeometryCollection){throw new jsts.error.IllegalArgumentError('This method does not support GeometryCollection')}};jsts.geom.Geometry.prototype.isGeometryCollection=function(){return(this instanceof jsts.geom.GeometryCollection)};jsts.geom.Geometry.prototype.computeEnvelopeInternal=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compareToSameClass=function(o){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compareToSameClass=function(o,comp){throw new jsts.error.AbstractMethodInvocationError()};jsts.geom.Geometry.prototype.compare=function(a,b){var i=a.iterator();var j=b.iterator();while(i.hasNext()&&j.hasNext()){var aElement=i.next();var bElement=j.next();var comparison=aElement.compareTo(bElement);if(comparison!==0){return comparison}}if(i.hasNext()){return 1}if(j.hasNext()){return-1}return 0};jsts.geom.Geometry.prototype.equal=function(a,b,tolerance){if(tolerance===undefined||tolerance===null||tolerance===0){return a.equals(b)}return a.distance(b)<=tolerance};
  10 +jsts.geom.GeometryCollection=function(){};jsts.geom.GeometryCollection=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.GeometryCollection.prototype.isEmpty=function(){for(var i=0;i<this.geometries.length;i++){if(!this.geometries[i].isEmpty()){return false}}return true};jsts.geom.GeometryCollection.prototype.getNumGeometries=function(){return this.geometries.length};jsts.geom.GeometryCollection.prototype.getGeometryN=function(n){return this.geometries[n]};jsts.geom.GeometryCollection.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}if(this.geometries.length!==other.geometries.length){return false}for(var i=0;i<this.geometries.length;i++){if(!(this.geometries[i]).equalsExact(other.geometries[i],tolerance)){return false}}return true};jsts.geom.GeometryCollection.prototype.apply=function(filter){filter.filter(this);for(var i=0;i<this.geometries.length;i++){this.geometries[i].apply(filter)}};OpenLayers.Geometry.Collection=OpenLayers.Class(OpenLayers.Geometry.Collection,jsts.geom.GeometryCollection,{initialize:function(components){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);this.components=[];if(components!=null){this.addComponents(components)}this.geometries=this.components}});jsts.geom.GeometryCollection=OpenLayers.Geometry.Collection;
  11 +jsts.geom.GeometryFilter=function(){};jsts.geom.GeometryFilter.prototype.filter=function(geom){throw new jsts.error.AbstractMethodInvocationError()};
  12 +jsts.geom.GeometryComponentFilter=function(){};jsts.geom.GeometryComponentFilter.prototype.filter=function(geom){throw new jsts.error.AbstractMethodInvocationError()};
  13 +jsts.geom.Coordinate=function(){};jsts.geom.Coordinate=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.Coordinate.prototype.setCoordinate=function(other){this.x=other.x;this.y=other.y};jsts.geom.Coordinate.prototype.clone=function(){return new jsts.geom.Coordinate(this.x,this.y)};jsts.geom.Coordinate.prototype.distance=function(p){var dx=this.x-p.x;var dy=this.y-p.y;return Math.sqrt(dx*dx+dy*dy)};jsts.geom.Coordinate.prototype.equals2D=function(other){if(this.x!==other.x){return false}if(this.y!==other.y){return false}return true};jsts.geom.Coordinate.prototype.jsts_equals=function(other){if(other.CLASS_NAME!==this.CLASS_NAME){return false}return this.equals2D(other)};jsts.geom.Coordinate.prototype.compareTo=function(other){if(this.x<other.x){return-1}if(this.x>other.x){return 1}if(this.y<other.y){return-1}if(this.y>other.y){return 1}return 0};jsts.geom.Coordinate.prototype.getCoordinates=function(){return this.isEmpty()?[]:[this.coordinate]};jsts.geom.Coordinate.prototype.getNumPoints=function(){return this.isEmpty()?0:1};jsts.geom.Coordinate.prototype.isEmpty=function(){return this.x===null};jsts.geom.Coordinate.prototype.isSimple=function(){return true};jsts.geom.Coordinate.prototype.isValid=function(){if(!IsValidOp.isValid(getCoordinate())){return false}return true};jsts.geom.Coordinate.prototype.getDimension=function(){return 0};jsts.geom.Coordinate.prototype.getBoundaryDimension=function(){return Dimension.FALSE};jsts.geom.Coordinate.prototype.getX=function(){return this.x};jsts.geom.Coordinate.prototype.getY=function(){return this.y};jsts.geom.Coordinate.prototype.getCoordinate=function(){return this};jsts.geom.Coordinate.prototype.getGeometryType=function(){return'Coordinate'};jsts.geom.Coordinate.prototype.computeEnvelopeInternal=function(){if(this.isEmpty()){return new jsts.geom.Envelope()}return new jsts.geom.Envelope(this)};jsts.geom.Coordinate.prototype.equalsExact=function(other,tolerance){if(this.CLASS_NAME!==other.CLASS_NAME){return false}if(this.isEmpty()&&other.isEmpty()){return true}return jsts.geom.Geometry.prototype.equal(other,this,tolerance)};jsts.geom.Coordinate.prototype.reverse=function(){return this.clone()};jsts.geom.Coordinate.prototype.normalize=function(){};OpenLayers.Geometry.Point=OpenLayers.Class(OpenLayers.Geometry.Point,jsts.geom.Coordinate,{initialize:function(x,y){OpenLayers.Geometry.prototype.initialize.apply(this,arguments);if(x===undefined||x===null){}else if(typeof x==='number'||typeof x==='string'){this.x=parseFloat(x);this.y=parseFloat(y)}else if(x instanceof jsts.geom.Coordinate){y=x.y;x=x.x;this.x=parseFloat(x);this.y=parseFloat(y)}}});jsts.geom.Coordinate=OpenLayers.Geometry.Point;
  14 +jsts.geom.Envelope=function(){jsts.geom.Envelope.prototype.init.apply(this,arguments)};jsts.geom.Envelope.prototype.minx=null;jsts.geom.Envelope.prototype.maxx=null;jsts.geom.Envelope.prototype.miny=null;jsts.geom.Envelope.prototype.maxy=null;jsts.geom.Envelope.prototype.init=function(){if(typeof arguments[0]==='number'&&arguments.length===4){this.initFromValues(arguments[0],arguments[1],arguments[2],arguments[3])}else if(arguments[0]instanceof jsts.geom.Coordinate&&arguments.length===1){this.initFromCoordinate(arguments[0])}else if(arguments[0]instanceof jsts.geom.Coordinate&&arguments.length===2){this.initFromCoordinates(arguments[0],arguments[1])}else if(arguments[0]instanceof jsts.geom.Envelope&&arguments.length===1){this.initFromEnvelope(arguments[0])}};jsts.geom.Envelope.prototype.initFromValues=function(x1,x2,y1,y2){if(x1<x2){this.minx=x1;this.maxx=x2}else{this.minx=x2;this.maxx=x1}if(y1<y2){this.miny=y1;this.maxy=y2}else{this.miny=y2;this.maxy=y1}};jsts.geom.Envelope.prototype.initFromCoordinates=function(p1,p2){this.initFromValues(p1.x,p2.x,p1.y,p2.y)};jsts.geom.Envelope.prototype.initFromCoordinate=function(p){this.initFromCoordinates(p.x,p.x,p.y,p.y)};jsts.geom.Envelope.prototype.initFromEnvelope=function(env){this.minx=env.minx;this.maxx=env.maxx;this.miny=env.miny;this.maxy=env.maxy};jsts.geom.Envelope.prototype.setToNull=function(){this.minx=0;this.maxx=-1;this.miny=0;this.maxy=-1};jsts.geom.Envelope.prototype.isNull=function(){return this.maxx<this.minx};jsts.geom.Envelope.prototype.getHeight=function(){if(this.isNull()){return 0}return this.maxy-this.miny};jsts.geom.Envelope.prototype.getWidth=function(){if(this.isNull()){return 0}return this.maxx-this.minx};jsts.geom.Envelope.prototype.getMinX=function(){return this.minx};jsts.geom.Envelope.prototype.getMaxX=function(){return this.maxx};jsts.geom.Envelope.prototype.getMinY=function(){return this.miny};jsts.geom.Envelope.prototype.getMaxY=function(){return this.maxy};jsts.geom.Envelope.prototype.getArea=function(){return getWidth()*getHeight()};jsts.geom.Envelope.prototype.expandToInclude=function(){if(arguments[0]instanceof jsts.geom.Coordinate){this.expandToIncludeCoordinate(arguments[0])}else if(arguments[0]instanceof jsts.geom.Envelope){this.expandToIncludeEnvelope(arguments[0])}else{this.expandToIncludeValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.expandToIncludeCoordinate=function(p){this.expandToIncludeValues(p.x,p.y)};jsts.geom.Envelope.prototype.expandToIncludeValues=function(x,y){if(this.isNull()){this.minx=x;this.maxx=x;this.miny=y;this.maxy=y}else{if(x<this.minx){this.minx=x}if(x>this.maxx){this.maxx=x}if(y<this.miny){this.miny=y}if(y>this.maxy){this.maxy=y}}};jsts.geom.Envelope.prototype.expandToIncludeEnvelope=function(other){if(other.isNull()){return}if(this.isNull()){this.minx=other.getMinX();this.maxx=other.getMaxX();this.miny=other.getMinY();this.maxy=other.getMaxY()}else{if(other.minx<this.minx){this.minx=other.minx}if(other.maxx>this.maxx){this.maxx=other.maxx}if(other.miny<this.miny){this.miny=other.miny}if(other.maxy>this.maxy){this.maxy=other.maxy}}};jsts.geom.Envelope.prototype.expandBy=function(){if(arguments.length===1){this.expandByDistance(arguments[0])}else{this.expandByDistances(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.expandByDistance=function(distance){this.expandByDistances(distance,distance)};jsts.geom.Envelope.prototype.expandByDistances=function(deltaX,deltaY){if(this.isNull()){return}this.minx-=deltaX;this.maxx+=deltaX;this.miny-=deltaY;this.maxy+=deltaY;if(this.minx>this.maxx||this.miny>this.maxy){this.setToNull()}};jsts.geom.Envelope.prototype.translate=function(transX,transY){if(this.isNull()){return}this.init(this.minx+transX,this.maxx+transX,this.miny+transY,this.maxy+transY)};jsts.geom.Envelope.prototype.centre=function(){if(this.isNull()){return null}return new jsts.geom.Coordinate((this.minx+this.maxx)/2.0,(this.miny+this.maxy)/2.0)};jsts.geom.Envelope.prototype.intersection=function(env){if(this.isNull()||env.isNull()||!this.intersects(env)){return new jsts.geom.Envelope()}var intMinX=this.minx>env.minx?this.minx:env.minx;var intMinY=this.miny>env.miny?this.miny:env.miny;var intMaxX=this.maxx<env.maxx?this.maxx:env.maxx;var intMaxY=this.maxy<env.maxy?this.maxy:env.maxy;return new jsts.geom.Envelope(intMinX,intMaxX,intMinY,intMaxY)};jsts.geom.Envelope.prototype.intersects=function(){if(arguments[0]instanceof jsts.geom.Envelope){return this.intersectsEnvelope(arguments[0])}else if(arguments[0]instanceof jsts.geom.Coordinate){return this.intersectsCoordinate(arguments[0])}else{return this.intersectsValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.intersectsEnvelope=function(other){if(this.isNull()||other.isNull()){return false}var result=!(other.minx>this.maxx||other.maxx<this.minx||other.miny>this.maxy||other.maxy<this.miny);return result};jsts.geom.Envelope.prototype.intersectsCoordinate=function(p){return this.intersectsValues(p.x,p.y)};jsts.geom.Envelope.prototype.intersectsValues=function(x,y){if(this.isNull()){return false}return!(x>this.maxx||x<this.minx||y>this.maxy||y<this.miny)};jsts.geom.Envelope.prototype.contains=function(){if(arguments[0]instanceof jsts.geom.Envelope){return this.containsEnvelope(arguments[0])}else if(arguments[0]instanceof jsts.geom.Coordinate){return this.containsCoordinate(arguments[0])}else{return this.containsValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.containsEnvelope=function(other){return this.coversEnvelope(other)};jsts.geom.Envelope.prototype.containsCoordinate=function(p){return this.coversCoordinate(p)};jsts.geom.Envelope.prototype.containsValues=function(x,y){return this.coversValues(x,y)};jsts.geom.Envelope.prototype.covers=function(){if(p instanceof jsts.geom.Envelope){this.coversEnvelope(arguments[0])}else if(p instanceof jsts.geom.Coordinate){this.coversCoordinate(arguments[0])}else{this.coversValues(arguments[0],arguments[1])}};jsts.geom.Envelope.prototype.coversValues=function(x,y){if(this.isNull()){return false}return x>=this.minx&&x<=this.maxx&&y>=this.miny&&y<=this.maxy};jsts.geom.Envelope.prototype.coversCoordinate=function(p){return this.coversValues(p.x,p.y)};jsts.geom.Envelope.prototype.coversEnvelope=function(other){if(this.isNull()||other.isNull()){return false}return other.minx>=this.minx&&other.maxx<=this.maxx&&other.miny>=this.miny&&other.maxy<=this.maxy};jsts.geom.Envelope.prototype.distance=function(env){if(this.intersects(env)){return 0}var dx=0.0;if(this.maxx<env.minx){dx=env.minx-this.maxx}if(this.minx>env.maxx){dx=this.minx-env.maxx}var dy=0.0;if(this.maxy<env.miny){dy=env.miny-this.maxy}if(this.miny>env.maxy){dy=this.miny-env.maxy}if(dx===0.0){return dy}if(dy===0.0){return dx}return Math.sqrt(dx*dx+dy*dy)};jsts.geom.Envelope.prototype.equals=function(other){if(this.isNull()){return other.isNull()}return this.maxx===other.maxx&&this.maxy===other.maxy&&this.minx===other.minx&&this.miny===other.miny};jsts.geom.Envelope.prototype.toString=function(){return'Env['+this.minx+' : '+this.maxx+', '+this.miny+' : '+this.maxy+']'};jsts.geom.Envelope.intersects=function(p1,p2,q){if(arguments.length===4){return jsts.geom.Envelope.intersectsEnvelope(arguments[0],arguments[1],arguments[2],arguments[3])}var xc1=p1.x<p2.x?p1.x:p2.x;var xc2=p1.x>p2.x?p1.x:p2.x;var yc1=p1.y<p2.y?p1.y:p2.y;var yc2=p1.y>p2.y?p1.y:p2.y;if(((q.x>=xc1)&&(q.x<=xc2))&&((q.y>=yc1)&&(q.y<=yc2))){return true}return false};jsts.geom.Envelope.intersectsEnvelope=function(p1,p2,q1,q2){var minq=Math.min(q1.x,q2.x);var maxq=Math.max(q1.x,q2.x);var minp=Math.min(p1.x,p2.x);var maxp=Math.max(p1.x,p2.x);if(minp>maxq){return false}if(maxp<minq){return false}minq=Math.min(q1.y,q2.y);maxq=Math.max(q1.y,q2.y);minp=Math.min(p1.y,p2.y);maxp=Math.max(p1.y,p2.y);if(minp>maxq){return false}if(maxp<minq){return false}return true};jsts.geom.Envelope.prototype.clone=function(){return new jsts.geom.Envelope(this.minx,this.miny,this.maxx,this.maxy)};
  15 +jsts.geom.GeometryFactory=function(){};jsts.geom.GeometryFactory.prototype.createPoint=function(coordinate){if(coordinate===null){return new jsts.geom.Point()}return new jsts.geom.Point(coordinate)};jsts.geom.GeometryFactory.prototype.createLineString=function(coordinates){return new jsts.geom.LineString(coordinates)};jsts.geom.GeometryFactory.prototype.createLinearRing=function(coordinates){return new jsts.geom.LinearRing(coordinates)};jsts.geom.GeometryFactory.prototype.createPolygon=function(shell,holes){var rings=[shell];if(holes!==undefined){rings=rings.concat(holes)}return new jsts.geom.Polygon(rings)};jsts.geom.GeometryFactory.prototype.createGeometryCollection=function(){return new jsts.geom.GeometryCollection()};
  16 +jsts.geom.LineString=function(){};jsts.geom.LineString=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.LineString.prototype.getCoordinates=function(){return this.components};jsts.geom.LineString.prototype.getCoordinateN=function(n){return this.components[n]};jsts.geom.LineString.prototype.getCoordinate=function(){if(this.isEmpty()){return null}return this.getCoordinateN(0)};jsts.geom.LineString.prototype.getDimension=function(){return 1};jsts.geom.LineString.prototype.getBoundaryDimension=function(){if(this.isClosed()){return Dimension.FALSE}return 0};jsts.geom.LineString.prototype.isEmpty=function(){return this.components.length===0};jsts.geom.LineString.prototype.isClosed=function(){if(this.isEmpty()){return false}return this.getCoordinateN(0).equals2D(this.getCoordinateN(this.components.length-1))};jsts.geom.LineString.prototype.isRing=function(){return this.isClosed()&&this.isSimple()};jsts.geom.LineString.prototype.getGeometryType=function(){return'LineString'};jsts.geom.LineString.prototype.getBoundary=function(){return(new jsts.operation.BoundaryOp(this)).getBoundary()};jsts.geom.LineString.prototype.computeEnvelopeInternal=function(){if(this.isEmpty()){return new jsts.geom.Envelope()}var env=new jsts.geom.Envelope();for(var i=0;i<this.components.length;i++){var point=this.components[i];env.expandToInclude(point)}return env};jsts.geom.LineString.prototype.equalsExact=function(other,tolerance){var i;if(!this.isEquivalentClass(other)){return false}if(this.components.length!==other.components.length){return false}for(i=0;i<this.components.length;i++){if(!jsts.geom.Geometry.prototype.equal(this.components[i],other.components[i],tolerance)){return false}}return true};jsts.geom.LineString.prototype.clone=function(){var key,coordinate;var points=[];for(key in this.components){if(this.components.hasOwnProperty(key)){coordinate=this.components[key];points.push(coordinate.clone())}}var clone=new jsts.geom.LineString(points);return clone};jsts.geom.LineString.prototype.apply=function(filter){filter.filter(this)};
  17 +jsts.geom.MultiLineString=function(){};jsts.geom.MultiLineString=OpenLayers.Class(jsts.geom.GeometryCollection);jsts.geom.MultiLineString.prototype.getBoundary=function(){return(new jsts.operation.BoundaryOp(this)).getBoundary()};jsts.geom.MultiLineString.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}return jsts.geom.GeometryCollection.prototype.equalsExact.call(this,other,tolerance)};OpenLayers.Geometry.MultiLineString=OpenLayers.Class(OpenLayers.Geometry.MultiLineString,jsts.geom.MultiLineString);jsts.geom.MultiLineString=OpenLayers.Geometry.MultiLineString;
  18 +jsts.geom.LinearRing=function(){};jsts.geom.LinearRing=OpenLayers.Class(jsts.geom.LineString);jsts.geom.LinearRing.prototype.getBoundaryDimension=function(){return jsts.geom.Dimension.FALSE};jsts.geom.LinearRing.prototype.isSimple=function(){return true};jsts.geom.LinearRing.prototype.getGeometryType=function(){return'LinearRing'};OpenLayers.Geometry.LinearRing=OpenLayers.Class(OpenLayers.Geometry.LinearRing,jsts.geom.LinearRing);jsts.geom.LinearRing=OpenLayers.Geometry.LinearRing;OpenLayers.Geometry.LineString=OpenLayers.Class(OpenLayers.Geometry.LineString,jsts.geom.LineString,{initialize:function(points){OpenLayers.Geometry.Curve.prototype.initialize.apply(this,arguments);this.geometries=this.components}});jsts.geom.LineString=OpenLayers.Geometry.LineString;
  19 +jsts.geom.LineSegment=function(p0,p1){this.p0=p0;this.p1=p1};jsts.geom.LineSegment.prototype.p0=null;jsts.geom.LineSegment.prototype.p1=null;jsts.geom.LineSegment.prototype.projectionFactor=function(p){if(p.equals(this.p0))return 0.0;if(p.equals(this.p1))return 1.0;var dx=this.p1.x-this.p0.x;var dy=this.p1.y-this.p0.y;var len2=dx*dx+dy*dy;var r=((p.x-this.p0.x)*dx+(p.y-this.p0.y)*dy)/len2;return r};jsts.geom.LineSegment.prototype.closestPoint=function(p){var factor=this.projectionFactor(p);if(factor>0&&factor<1){return this.project(p)}var dist0=this.p0.distance(p);var dist1=this.p1.distance(p);if(dist0<dist1)return this.p0;return this.p1};jsts.geom.LineSegment.prototype.closestPoints=function(line){var intPt=this.intersection(line);if(intPt!==null){return[intPt,intPt]}var closestPt=[];var minDistance=Number.MAX_VALUE;var dist;var close00=this.closestPoint(line.p0);minDistance=close00.distance(line.p0);closestPt[0]=close00;closestPt[1]=line.p0;var close01=this.closestPoint(line.p1);dist=close01.distance(line.p1);if(dist<minDistance){minDistance=dist;closestPt[0]=close01;closestPt[1]=line.p1}var close10=line.closestPoint(this.p0);dist=close10.distance(this.p0);if(dist<minDistance){minDistance=dist;closestPt[0]=this.p0;closestPt[1]=close10}var close11=line.closestPoint(this.p1);dist=close11.distance(this.p1);if(dist<minDistance){minDistance=dist;closestPt[0]=this.p1;closestPt[1]=close11}return closestPt};jsts.geom.LineSegment.prototype.intersection=function(line){var li=new jsts.algorithm.RobustLineIntersector();li.computeIntersection(this.p0,this.p1,line.p0,line.p1);if(li.hasIntersection())return li.getIntersection(0);return null};jsts.geom.LineSegment.prototype.project=function(p){if(p.equals(this.p0)||p.equals(this.p1))return new jsts.geom.Coordinate(p);var r=this.projectionFactor(p);var coord=new jsts.geom.Coordinate();coord.x=this.p0.x+r*(this.p1.x-this.p0.x);coord.y=this.p0.y+r*(this.p1.y-this.p0.y);return coord};
  20 +jsts.geom.Point=function(){};jsts.geom.Point=OpenLayers.Class(jsts.geom.Geometry,{initialize:function(coordinate){if(coordinate===undefined)return;this.coordinate=coordinate}});jsts.geom.Point.prototype.coordinate=null;jsts.geom.Point.prototype.getCoordinate=function(){return this.coordinate};jsts.geom.Point.prototype.isEmpty=function(){return this.coordinate===null};jsts.geom.Point.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}if(this.isEmpty()&&other.isEmpty()){return true}return this.equal(other.getCoordinate(),this.getCoordinate(),tolerance)};jsts.geom.Point.prototype.getBoundary=function(){return new jsts.geom.GeometryCollection(null)};jsts.geom.Point.prototype.apply=function(filter){filter.filter(this)};jsts.geom.Point.prototype.clone=function(){return new jsts.geom.Point(this.coordinate.clone())};jsts.geom.Point.prototype.getGeometryType=function(){return'Point'};
  21 +jsts.geom.MultiPoint=function(){};jsts.geom.MultiPoint=OpenLayers.Class(jsts.geom.GeometryCollection);jsts.geom.MultiPoint.prototype.getBoundary=function(){return this.getFactory().createGeometryCollection(null)};jsts.geom.MultiPoint.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}return jsts.geom.GeometryCollection.prototype.equalsExact.call(this,other,tolerance)};OpenLayers.Geometry.MultiPoint=OpenLayers.Class(OpenLayers.Geometry.MultiPoint,jsts.geom.MultiPoint);jsts.geom.MultiPoint=OpenLayers.Geometry.MultiPoint;
  22 +jsts.geom.Polygon=function(){};jsts.geom.Polygon=OpenLayers.Class(jsts.geom.Geometry);jsts.geom.Polygon.prototype.getCoordinate=function(){return this.components[0].getCoordinate()};jsts.geom.Polygon.prototype.isEmpty=function(){for(var i=0;i<this.geometries.length;i++){if(!this.geometries[i].isEmpty()){return false}}return true};jsts.geom.Polygon.prototype.getExteriorRing=function(){return this.components[0]};jsts.geom.Polygon.prototype.getNumInteriorRing=function(){return this.components.slice(1).length};jsts.geom.Polygon.prototype.getBoundary=function(){if(this.isEmpty()){return this.getFactory().createMultiLineString(null)}var rings=[];var shell=this.components[0];rings[0]=shell;var holes=this.components.slice(1);for(var i=0;i<holes.length;i++){rings[i+1]=holes[i]}if(rings.length<=1)return this.getFactory().createLinearRing(rings[0].getCoordinateSequence());return this.getFactory().createMultiLineString(rings)};jsts.geom.Polygon.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}if(this.isEmpty()&&other.isEmpty()){return true}var holes=this.components.slice(1);var otherPolygon=other;var thisShell=this.components[0];var otherPolygonShell=otherPolygon.components[0];var otherPolygonHoles=otherPolygon.components.slice(1);if(!thisShell.equalsExact(otherPolygonShell,tolerance)){return false}if(holes.length!==otherPolygonHoles.length){return false}if(holes.length!==otherPolygonHoles.length){return false}for(var i=0;i<holes.length;i++){if(!(holes[i]).equalsExact(otherPolygonHoles[i],tolerance)){return false}}return true};jsts.geom.Polygon.prototype.apply=function(filter){filter.filter(this);if(filter instanceof jsts.geom.GeometryComponentFilter){var shell=this.components[0];shell.apply(filter);var holes=this.components.slice(1);for(var i=0;i<holes.length;i++){holes[i].apply(filter)}}};OpenLayers.Geometry.Polygon=OpenLayers.Class(OpenLayers.Geometry.Polygon,jsts.geom.Polygon);jsts.geom.Polygon=OpenLayers.Geometry.Polygon;
  23 +jsts.geom.MultiPolygon=function(){};jsts.geom.MultiPolygon=OpenLayers.Class(jsts.geom.GeometryCollection);jsts.geom.MultiPolygon.prototype.getBoundary=function(){if(this.isEmpty()){return this.getFactory().createMultiLineString(null)}var allRings=[];for(var i=0;i<this.geometries.length;i++){var polygon=this.geometries[i];var rings=polygon.getBoundary();for(var j=0;j<rings.getNumGeometries();j++){allRings.push(rings.getGeometryN(j))}}return this.getFactory().createMultiLineString(allRings)};jsts.geom.MultiPolygon.prototype.equalsExact=function(other,tolerance){if(!this.isEquivalentClass(other)){return false}return jsts.geom.GeometryCollection.prototype.equalsExact.call(this,other,tolerance)};OpenLayers.Geometry.MultiPolygon=OpenLayers.Class(OpenLayers.Geometry.MultiPolygon,jsts.geom.MultiPolygon);jsts.geom.MultiPolygon=OpenLayers.Geometry.MultiPolygon;
  24 +jsts.geom.util={};
  25 +jsts.geom.util.LinearComponentExtracter=function(lines,isForcedToLineString){this.lines=lines;this.isForcedToLineString=isForcedToLineString};jsts.geom.util.LinearComponentExtracter.prototype=new jsts.geom.GeometryComponentFilter();jsts.geom.util.LinearComponentExtracter.prototype.lines=null;jsts.geom.util.LinearComponentExtracter.prototype.isForcedToLineString=false;jsts.geom.util.LinearComponentExtracter.getLines=function(geoms,lines){if(arguments.length==1){return jsts.geom.util.LinearComponentExtracter.getLines5.apply(this,arguments)}else if(arguments.length==2&&typeof lines==='boolean'){return jsts.geom.util.LinearComponentExtracter.getLines6.apply(this,arguments)}else if(arguments.length==2&&geoms instanceof jsts.geom.Geometry){return jsts.geom.util.LinearComponentExtracter.getLines3.apply(this,arguments)}else if(arguments.length==3&&geoms instanceof jsts.geom.Geometry){return jsts.geom.util.LinearComponentExtracter.getLines4.apply(this,arguments)}else if(arguments.length==3){return jsts.geom.util.LinearComponentExtracter.getLines2.apply(this,arguments)}for(var i=0;i<geoms.length;i++){var g=geoms[i];jsts.geom.util.LinearComponentExtracter.getLines3(g,lines)}return lines};jsts.geom.util.LinearComponentExtracter.getLines2=function(geoms,lines,forceToLineString){for(var i=0;i<geoms.length;i++){var g=geoms[i];jsts.geom.util.LinearComponentExtracter.getLines4(g,lines,forceToLineString)}return lines};jsts.geom.util.LinearComponentExtracter.getLines3=function(geom,lines){if(geom instanceof LineString){lines.add(geom)}else{geom.apply(new jsts.geom.util.LinearComponentExtracter(lines))}return lines};jsts.geom.util.LinearComponentExtracter.getLines4=function(geom,lines,forceToLineString){geom.apply(new jsts.geom.util.LinearComponentExtracter(lines,forceToLineString));return lines};jsts.geom.util.LinearComponentExtracter.getLines5=function(geom){return jsts.geom.util.LinearComponentExtracter.getLines6(geom,false)};jsts.geom.util.LinearComponentExtracter.getLines6=function(geom,forceToLineString){var lines=[];geom.apply(new jsts.geom.util.LinearComponentExtracter(lines,forceToLineString));return lines};jsts.geom.util.LinearComponentExtracter.prototype.setForceToLineString=function(isForcedToLineString){this.isForcedToLineString=isForcedToLineString};jsts.geom.util.LinearComponentExtracter.prototype.filter=function(geom){if(this.isForcedToLineString&&geom instanceof jsts.geom.LinearRing){var line=geom.getFactory().createLineString(geom.getCoordinateSequence());this.lines.push(line);return}if(geom instanceof jsts.geom.LineString||geom instanceof jsts.geom.LinearRing)this.lines.push(geom)};
  26 +jsts.geom.util.PointExtracter=function(pts){this.pts=pts};jsts.geom.util.PointExtracter.prototype=new jsts.geom.GeometryFilter();jsts.geom.util.PointExtracter.prototype.pts=null;jsts.geom.util.PointExtracter.getPoints=function(geom,list){if(list===undefined){list=[]}if(geom instanceof jsts.geom.Point){list.push(geom)}else if(geom instanceof jsts.geom.GeometryCollection){geom.apply(new jsts.geom.util.PointExtracter(list))}return list};jsts.geom.util.PointExtracter.prototype.filter=function(geom){if(geom instanceof jsts.geom.Point)this.pts.push(geom)};
  27 +jsts.geom.util.PolygonExtracter=function(comps){this.comps=comps};jsts.geom.util.PolygonExtracter.prototype=new jsts.geom.GeometryFilter();jsts.geom.util.PolygonExtracter.prototype.comps=null;jsts.geom.util.PolygonExtracter.getPolygons=function(geom,list){if(list===undefined){list=[]}if(geom instanceof jsts.geom.Polygon){list.push(geom)}else if(geom instanceof jsts.geom.GeometryCollection){geom.apply(new jsts.geom.util.PolygonExtracter(list))}return list};jsts.geom.util.PolygonExtracter.prototype.filter=function(geom){if(geom instanceof jsts.geom.Polygon)this.comps.push(geom)};
  28 +jsts.algorithm={};
  29 +jsts.algorithm.BoundaryNodeRule=function(){};jsts.algorithm.BoundaryNodeRule.prototype.isInBoundary=function(boundaryCount){throw new jsts.error.AbstractMethodInvocationError()};jsts.algorithm.Mod2BoundaryNodeRule=function(){};jsts.algorithm.Mod2BoundaryNodeRule.prototype=new jsts.algorithm.BoundaryNodeRule();jsts.algorithm.Mod2BoundaryNodeRule.prototype.isInBoundary=function(boundaryCount){return boundaryCount%2===1};jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE=new jsts.algorithm.Mod2BoundaryNodeRule();jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE=jsts.algorithm.BoundaryNodeRule.MOD2_BOUNDARY_RULE;
  30 +jsts.algorithm.CentralEndpointIntersector=function(p00,p01,p10,p11){this.pts=[p00,p01,p10,p11];this.compute()};jsts.algorithm.CentralEndpointIntersector.getIntersection=function(p00,p01,p10,p11){var intor=new jsts.algorithm.CentralEndpointIntersector(p00,p01,p10,p11);return intor.getIntersection()};jsts.algorithm.CentralEndpointIntersector.prototype.pts=null;jsts.algorithm.CentralEndpointIntersector.prototype.intPt=null;jsts.algorithm.CentralEndpointIntersector.prototype.compute=function(){var centroid=jsts.algorithm.CentralEndpointIntersector.average(this.pts);this.intPt=this.findNearestPoint(centroid,this.pts)};jsts.algorithm.CentralEndpointIntersector.prototype.getIntersection=function(){return this.intPt};jsts.algorithm.CentralEndpointIntersector.average=function(pts){var avg=new jsts.geom.Coordinate();var i,n=pts.length;for(i=0;i<n;i++){avg.x+=pts[i].x;avg.y+=pts[i].y}if(n>0){avg.x/=n;avg.y/=n}return avg};jsts.algorithm.CentralEndpointIntersector.prototype.findNearestPoint=function(p,pts){var minDist=Number.MAX_VALUE;var i,result=null,dist;for(i=0;i<pts.length;i++){dist=p.distance(pts[i]);if(dist<minDist){minDist=dist;result=pts[i]}}return result};
  31 +
  32 +
  33 +
  34 +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;jsts.algorithm.CGAlgorithms.COLLINEAR=0;jsts.algorithm.CGAlgorithms.STRAIGHT=jsts.algorithm.CGAlgorithms.COLLINEAR;jsts.algorithm.CGAlgorithms.orientationIndex=function(p1,p2,q){var dx1,dy1,dx2,dy2;dx1=p2.x-p1.x;dy1=p2.y-p1.y;dx2=q.x-p2.x;dy2=q.y-p2.y;return jsts.algorithm.RobustDeterminant.signOfDet2x2(dx1,dy1,dx2,dy2)};jsts.algorithm.CGAlgorithms.isPointInRing=function(p,ring){return jsts.algorithm.CGAlgorithms.locatePointInRing(p,ring)!==jsts.geom.Location.EXTERIOR};jsts.algorithm.CGAlgorithms.locatePointInRing=function(p,ring){return jsts.algorithm.RayCrossingCounter.locatePointInRing(p,ring)};jsts.algorithm.CGAlgorithms.isOnLine=function(p,pt){var lineIntersector,i,il,p0,p1;lineIntersector=new jsts.algorithm.RobustLineIntersector();for(i=1,il=pt.length;i<il;i++){p0=pt[i-1];p1=pt[i];lineIntersector.computeIntersection(p,p0,p1);if(lineIntersector.hasIntersection()){return true}}return false};jsts.algorithm.CGAlgorithms.isCCW=function(ring){var nPts,hiPt,hiIndex,p,iPrev,iNext,prev,next,i,disc,isCCW;nPts=ring.length-1;if(nPts<3){throw new jsts.IllegalArgumentError('Ring has fewer than 3 points, so orientation cannot be determined')}hiPt=ring[0];hiIndex=0;i=1;for(i;i<=nPts;i++){p=ring[i];if(p.y>hiPt.y){hiPt=p;hiIndex=i}}iPrev=hiIndex;do{iPrev=iPrev-1;if(iPrev<0){iPrev=nPts}}while(ring[iPrev].equals2D(hiPt)&&iPrev!==hiIndex);iNext=hiIndex;do{iNext=(iNext+1)%nPts}while(ring[iNext].equals2D(hiPt)&&iNext!==hiIndex);prev=ring[iPrev];next=ring[iNext];if(prev.equals2D(hiPt)||next.equals2D(hiPt)||prev.equals2D(next)){return false}disc=jsts.algorithm.CGAlgorithms.computeOrientation(prev,hiPt,next);isCCW=false;if(disc===0){isCCW=(prev.x>next.x)}else{isCCW=(disc>0)}return isCCW};jsts.algorithm.CGAlgorithms.computeOrientation=function(p1,p2,q){return jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,q)};jsts.algorithm.CGAlgorithms.distancePointLine=function(p,A,B){if(!(A instanceof jsts.geom.Coordinate)){jsts.algorithm.CGAlgorithms.distancePointLine2.apply(this,arguments)}if(A.x===B.x&&A.y===B.y){return p.distance(A)}var r,s;r=((p.x-A.x)*(B.x-A.x)+(p.y-A.y)*(B.y-A.y))/((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y));if(r<=0.0){return p.distance(A)}if(r>=1.0){return p.distance(B)}s=((A.y-p.y)*(B.x-A.x)-(A.x-p.x)*(B.y-A.y))/((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y));return Math.abs(s)*Math.sqrt(((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y)))};jsts.algorithm.CGAlgorithms.distancePointLinePerpendicular=function(p,A,B){var s=((A.y-p.y)*(B.x-A.x)-(A.x-p.x)*(B.y-A.y))/((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y));return Math.abs(s)*Math.sqrt(((B.x-A.x)*(B.x-A.x)+(B.y-A.y)*(B.y-A.y)))};jsts.algorithm.CGAlgorithms.distancePointLine2=function(p,line){var minDistance,i,il,dist;if(line.length===0){throw new jsts.error.IllegalArgumentError('Line array must contain at least one vertex')}minDistance=p.distance(line[0]);for(i=0,il=line.length-1;i<il;i++){dist=jsts.algorithm.CGAlgorithms.distancePointLine(p,line[i],line[i+1]);if(dist<minDistance){minDistance=dist}}return minDistance};jsts.algorithm.CGAlgorithms.distanceLineLine=function(A,B,C,D){if(A.equals(B)){return jsts.algorithm.CGAlgorithms.distancePointLine(A,C,D)}if(C.equals(D)){return jsts.algorithm.CGAlgorithms.distancePointLine(D,A,B)}var r_top,r_bot,s_top,s_bot,s,r;r_top=(A.y-C.y)*(D.x-C.x)-(A.x-C.x)*(D.y-C.y);r_bot=(B.x-A.x)*(D.y-C.y)-(B.y-A.y)*(D.x-C.x);s_top=(A.y-C.y)*(B.x-A.x)-(A.x-C.x)*(B.y-A.y);s_bot=(B.x-A.x)*(D.y-C.y)-(B.y-A.y)*(D.x-C.x);if((r_bot===0)||(s_bot===0)){return Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(A,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(B,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(C,A,B),jsts.algorithm.CGAlgorithms.distancePointLine(D,A,B))))}s=s_top/s_bot;r=r_top/r_bot;if((r<0)||(r>1)||(s<0)||(s>1)){return Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(A,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(B,C,D),Math.min(jsts.algorithm.CGAlgorithms.distancePointLine(C,A,B),jsts.algorithm.CGAlgorithms.distancePointLine(D,A,B))))}return 0.0};jsts.algorithm.CGAlgorithms.signedArea=function(ring){if(ring.length<3){return 0.0}var sum,i,il,bx,by,cx,cy;sum=0.0;for(i=0,il=ring.length-1;i<il;i++){bx=ring[i].x;by=ring[i].y;cx=ring[i+1].x;cy=ring[i+1].y;sum+=(bx+cx)*(cy-by)}return-sum/2.0};jsts.algorithm.CGAlgorithms.signedArea=function(ring){var n,sum,p,bx,by,i,cx,cy;n=ring.length;if(n<3){return 0.0}sum=0.0;p=ring[0];bx=p.x;by=p.y;for(i=1;i<n;i++){p=ring[i];cx=p.x;cy=p.y;sum+=(bx+cx)*(cy-by);bx=cx;by=cy}return-sum/2.0};
  35 +jsts.algorithm.HCoordinate=function(){this.x=0.0;this.y=0.0;this.w=1.0;if(arguments.length===1){this.initFrom1Coordinate(arguments[0])}else if(arguments.length===2&&arguments[0]instanceof jsts.geom.Coordinate){this.initFrom2Coordinates(arguments[0],arguments[1])}else if(arguments.length===2&&arguments[0]instanceof jsts.algorithm.HCoordinate){this.initFrom2HCoordinates(arguments[0],arguments[1])}else if(arguments.length===2){this.initFromXY(arguments[0],arguments[1])}else if(arguments.length===3){this.initFromXYW(arguments[0],arguments[1],arguments[2])}else if(arguments.length===4){this.initFromXYW(arguments[0],arguments[1],arguments[2],arguments[3])}};jsts.algorithm.HCoordinate.intersection=function(p1,p2,q1,q2){var px,py,pw,qx,qy,qw,x,y,w,xInt,yInt;px=p1.y-p2.y;py=p2.x-p1.x;pw=p1.x*p2.y-p2.x*p1.y;qx=q1.y-q2.y;qy=q2.x-q1.x;qw=q1.x*q2.y-q2.x*q1.y;x=py*qw-qy*pw;y=qx*pw-px*qw;w=px*qy-qx*py;xInt=x/w;yInt=y/w;if(!isFinite(xInt)||!isFinite(yInt)){throw new jsts.error.NotRepresentableError()}return new jsts.geom.Coordinate(xInt,yInt)};jsts.algorithm.HCoordinate.prototype.initFrom1Coordinate=function(p){this.x=p.x;this.y=p.y;this.w=1.0};jsts.algorithm.HCoordinate.prototype.initFrom2Coordinates=function(p1,p2){this.x=p1.y-p2.y;this.y=p2.x-p1.x;this.w=p1.x*p2.y-p2.x*p1.y};jsts.algorithm.HCoordinate.prototype.initFrom2HCoordinates=function(p1,p2){this.x=p1.y*p2.w-p2.y*p1.w;this.y=p2.x*p1.w-p1.x*p2.w;this.w=p1.x*p2.y-p2.x*p1.y};jsts.algorithm.HCoordinate.prototype.initFromXYW=function(x,y,w){this.x=x;this.y=y;this.w=w};jsts.algorithm.HCoordinate.prototype.initFromXY=function(x,y){this.x=x;this.y=y;this.w=1.0};jsts.algorithm.HCoordinate.prototype.initFrom4Coordinates=function(p1,p2,q1,q2){var px,py,pw,qx,qy,qw;px=p1.y-p2.y;py=p2.x-p1.x;pw=p1.x*p2.y-p2.x*p1.y;qx=q1.y-q2.y;qy=q2.x-q1.x;qw=q1.x*q2.y-q2.x*q1.y;this.x=py*qw-qy*pw;this.y=qx*pw-px*qw;this.w=px*qy-qx*py};jsts.algorithm.HCoordinate.prototype.getX=function(){var a=this.x/this.w;if(!isFinite(a)){throw new jsts.error.NotRepresentableError()}return a};jsts.algorithm.HCoordinate.prototype.getY=function(){var a=this.y/this.w;if(!isFinite(a)){throw new jsts.error.NotRepresentableError()}return a};jsts.algorithm.HCoordinate.prototype.getCoordinate=function(){var p=new jsts.geom.Coordinate();p.x=this.getX();p.y=this.getY();return p};
  36 +jsts.algorithm.LineIntersector=function(){this.inputLines=[[],[]];this.intPt=[];this.intPt[0]=new jsts.geom.Coordinate();this.intPt[1]=new jsts.geom.Coordinate();this.pa=this.intPt[0];this.pb=this.intPt[1];this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.LineIntersector.NO_INTERSECTION=0;jsts.algorithm.LineIntersector.POINT_INTERSECTION=1;jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION=2;jsts.algorithm.LineIntersector.prototype.setPrecisionModel=function(precisionModel){this.precisionModel=precisionModel};jsts.algorithm.LineIntersector.prototype.getEndpoint=function(segmentIndex,ptIndex){return this.inputLines[segmentIndex][ptIndex]};jsts.algorithm.LineIntersector.computeEdgeDistance=function(p,p0,p1){var dx=Math.abs(p1.x-p0.x);var dy=Math.abs(p1.y-p0.y);var dist=-1.0;if(p.equals(p0)){dist=0.0}else if(p.equals(p1)){if(dx>dy){dist=dx}else{dist=dy}}else{var pdx=Math.abs(p.x-p0.x);var pdy=Math.abs(p.y-p0.y);if(dx>dy){dist=pdx}else{dist=pdy}if(dist===0.0&&!p.equals(p0)){dist=Math.max(pdx,pdy)}}if(dist===0.0&&!p.equals(p0)){throw new jsts.error.IllegalArgumentError('Bad distance calculation')}return dist};jsts.algorithm.LineIntersector.nonRobustComputeEdgeDistance=function(p,p1,p2){var dx=p.x-p1.x;var dy=p.y-p1.y;var dist=Math.sqrt(dx*dx+dy*dy);if(!(dist===0.0&&!p.equals(p1))){throw new jsts.error.IllegalArgumentError('Invalid distance calculation')}return dist};jsts.algorithm.LineIntersector.prototype.result=null;jsts.algorithm.LineIntersector.prototype.inputLines=null;jsts.algorithm.LineIntersector.prototype.intPt=null;jsts.algorithm.LineIntersector.prototype.intLineIndex=null;jsts.algorithm.LineIntersector.prototype._isProper=null;jsts.algorithm.LineIntersector.prototype.pa=null;jsts.algorithm.LineIntersector.prototype.pb=null;jsts.algorithm.LineIntersector.prototype.precisionModel=null;jsts.algorithm.LineIntersector.prototype.computeIntersection=function(p,p1,p2){throw new jsts.error.AbstractMethodInvocationError()};jsts.algorithm.LineIntersector.prototype.isCollinear=function(){return this.result===jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION};jsts.algorithm.LineIntersector.prototype.computeIntersection=function(p1,p2,p3,p4){this.inputLines[0][0]=p1;this.inputLines[0][1]=p2;this.inputLines[1][0]=p3;this.inputLines[1][1]=p4;this.result=this.computeIntersect(p1,p2,p3,p4)};jsts.algorithm.LineIntersector.prototype.computeIntersect=function(p1,p2,q1,q2){throw new jsts.error.AbstractMethodInvocationError()};jsts.algorithm.LineIntersector.prototype.isEndPoint=function(){return this.hasIntersection()&&!this._isProper};jsts.algorithm.LineIntersector.prototype.hasIntersection=function(){return this.result!==jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.LineIntersector.prototype.getIntersectionNum=function(){return this.result};jsts.algorithm.LineIntersector.prototype.getIntersection=function(intIndex){return this.intPt[intIndex]};jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(){if(this.intLineIndex===null){this.intLineIndex=[[],[]];this.computeIntLineIndex(0);this.computeIntLineIndex(1)}};jsts.algorithm.LineIntersector.prototype.isIntersection=function(pt){var i;for(i=0;i<this.result;i++){if(this.intPt[i].equals2D(pt)){return true}}return false};jsts.algorithm.LineIntersector.prototype.isInteriorIntersection=function(){if(this.isInteriorIntersection(0)){return true}if(this.isInteriorIntersection(1)){return true}return false};jsts.algorithm.LineIntersector.prototype.isInteriorIntersection=function(inputLineIndex){var i;for(i=0;i<this.result;i++){if(!(this.intPt[i].equals2D(this.inputLines[inputLineIndex][0])||this.intPt[i].equals2D(this.inputLines[inputLineIndex][1]))){return true}}return false};jsts.algorithm.LineIntersector.prototype.isProper=function(){return this.hasIntersection()&&this._isProper};jsts.algorithm.LineIntersector.prototype.getIntersectionAlongSegment=function(segmentIndex,intIndex){this.computeIntLineIndex();return this.intPt[intLineIndex[segmentIndex][intIndex]]};jsts.algorithm.LineIntersector.prototype.getIndexAlongSegment=function(segmentIndex,intIndex){this.computeIntLineIndex();return this.intLineIndex[segmentIndex][intIndex]};jsts.algorithm.LineIntersector.prototype.computeIntLineIndex=function(segmentIndex){var dist0=this.getEdgeDistance(segmentIndex,0);var dist1=this.getEdgeDistance(segmentIndex,1);if(dist0>dist1){this.intLineIndex[segmentIndex][0]=0;this.intLineIndex[segmentIndex][1]=1}else{this.intLineIndex[segmentIndex][0]=1;this.intLineIndex[segmentIndex][1]=0}};jsts.algorithm.LineIntersector.prototype.getEdgeDistance=function(segmentIndex,intIndex){var dist=jsts.algorithm.LineIntersector.computeEdgeDistance(this.intPt[intIndex],this.inputLines[segmentIndex][0],this.inputLines[segmentIndex][1]);return dist};
  37 +jsts.algorithm.PointLocator=function(boundaryRule){this.boundaryRule=boundaryRule?boundaryRule:jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE};jsts.algorithm.PointLocator.prototype.boundaryRule=null;jsts.algorithm.PointLocator.prototype.isIn=null;jsts.algorithm.PointLocator.prototype.numBoundaries=null;jsts.algorithm.PointLocator.prototype.intersects=function(p,geom){return this.locate(p,geom)!==jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.locate=function(p,geom){if(geom.isEmpty())return jsts.geom.Location.EXTERIOR;if(geom instanceof jsts.geom.LineString){return this.locate3(p,geom)}else if(geom instanceof jsts.geom.Polygon){return this.locate4(p,geom)}this.isIn=false;this.numBoundaries=0;this.computeLocation(p,geom);if(this.boundaryRule.isInBoundary(this.numBoundaries))return jsts.geom.Location.BOUNDARY;if(this.numBoundaries>0||this.isIn)return jsts.geom.Location.INTERIOR;return jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.computeLocation=function(p,geom){if(geom instanceof jsts.geom.Point||geom instanceof jsts.geom.LineString||geom instanceof jsts.geom.Polygon){this.updateLocationInfo(this.locate(p,geom))}else if(geom instanceof jsts.geom.MultiLineString){var ml=geom;for(var i=0;i<ml.getNumGeometries();i++){var l=ml.getGeometryN(i);this.updateLocationInfo(this.locate(p,l))}}else if(geom instanceof jsts.geom.MultiPolygon){var mpoly=geom;for(var i=0;i<mpoly.getNumGeometries();i++){var poly=mpoly.getGeometryN(i);this.updateLocationInfo(this.locate(p,poly))}}else if(geom instanceof jsts.geom.GeometryCollection){throw new jsts.error.NotImplementedError();var geomi=new GeometryCollectionIterator(geom);while(geomi.hasNext()){var g2=geomi.next();if(g2!=geom)this.computeLocation(p,g2)}}};jsts.algorithm.PointLocator.prototype.updateLocationInfo=function(loc){if(loc===jsts.geom.Location.INTERIOR)this.isIn=true;if(loc===jsts.geom.Location.BOUNDARY)this.numBoundaries++};jsts.algorithm.PointLocator.prototype.locate2=function(p,pt){var ptCoord=pt.getCoordinate();if(ptCoord.equals2D(p))return jsts.geom.Location.INTERIOR;return jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.locate3=function(p,l){if(!l.getEnvelopeInternal().intersects(p))return jsts.geom.Location.EXTERIOR;var pt=l.getCoordinates();if(!l.isClosed()){if(p.equals(pt[0])||p.equals(pt[pt.length-1])){return jsts.geom.Location.BOUNDARY}}if(jsts.algorithm.CGAlgorithms.isOnLine(p,pt))return jsts.geom.Location.INTERIOR;return jsts.geom.Location.EXTERIOR};jsts.algorithm.PointLocator.prototype.locateInPolygonRing=function(p,ring){if(!ring.getEnvelopeInternal().intersects(p))return jsts.geom.Location.EXTERIOR;return jsts.algorithm.CGAlgorithms.locatePointInRing(p,ring.getCoordinates())};jsts.algorithm.PointLocator.prototype.locate4=function(p,poly){if(poly.isEmpty())return jsts.geom.Location.EXTERIOR;var shell=poly.getExteriorRing();var shellLoc=this.locateInPolygonRing(p,shell);if(shellLoc===jsts.geom.Location.EXTERIOR)return jsts.geom.Location.EXTERIOR;if(shellLoc===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY;for(var i=0;i<poly.getNumInteriorRing();i++){var hole=poly.getInteriorRingN(i);var holeLoc=this.locateInPolygonRing(p,hole);if(holeLoc===jsts.geom.Location.INTERIOR)return jsts.geom.Location.EXTERIOR;if(holeLoc===jsts.geom.Location.BOUNDARY)return jsts.geom.Location.BOUNDARY}return jsts.geom.Location.INTERIOR};
  38 +jsts.algorithm.RayCrossingCounter=function(p){this.p=p};jsts.algorithm.RayCrossingCounter.locatePointInRing=function(p,ring){var counter=new jsts.algorithm.RayCrossingCounter(p);for(var i=1;i<ring.length;i++){var p1=ring[i];var p2=ring[i-1];counter.countSegment(p1,p2);if(counter.isOnSegment())return counter.getLocation()}return counter.getLocation()};jsts.algorithm.RayCrossingCounter.prototype.p=null;jsts.algorithm.RayCrossingCounter.prototype.crossingCount=0;jsts.algorithm.RayCrossingCounter.prototype.isPointOnSegment=false;jsts.algorithm.RayCrossingCounter.prototype.countSegment=function(p1,p2){if(p1.x<this.p.x&&p2.x<this.p.x)return;if(this.p.x==p2.x&&this.p.y===p2.y){this.isPointOnSegment=true;return}if(p1.y===this.p.y&&p2.y===this.p.y){var minx=p1.x;var maxx=p2.x;if(minx>maxx){minx=p2.x;maxx=p1.x}if(this.p.x>=minx&&this.p.x<=maxx){this.isPointOnSegment=true}return}if(((p1.y>this.p.y)&&(p2.y<=this.p.y))||((p2.y>this.p.y)&&(p1.y<=this.p.y))){var x1=p1.x-this.p.x;var y1=p1.y-this.p.y;var x2=p2.x-this.p.x;var y2=p2.y-this.p.y;var xIntSign=jsts.algorithm.RobustDeterminant.signOfDet2x2(x1,y1,x2,y2);if(xIntSign===0.0){this.isPointOnSegment=true;return}if(y2<y1)xIntSign=-xIntSign;if(xIntSign>0.0){this.crossingCount++}}};jsts.algorithm.RayCrossingCounter.prototype.isOnSegment=function(){return jsts.geom.isPointOnSegment};jsts.algorithm.RayCrossingCounter.prototype.getLocation=function(){if(this.isPointOnSegment)return jsts.geom.Location.BOUNDARY;if((this.crossingCount%2)===1){return jsts.geom.Location.INTERIOR}return jsts.geom.Location.EXTERIOR};jsts.algorithm.RayCrossingCounter.prototype.isPointInPolygon=function(){return this.getLocation()!==jsts.geom.Location.EXTERIOR};
  39 +jsts.algorithm.RobustDeterminant=function(){};jsts.algorithm.RobustDeterminant.signOfDet2x2=function(x1,y1,x2,y2){var sign,swap,k,count;count=0;sign=1;if((x1===0.0)||(y2===0.0)){if((y1===0.0)||(x2===0.0)){return 0}else if(y1>0){if(x2>0){return-sign}else{return sign}}else{if(x2>0){return sign}else{return-sign}}}if((y1===0.0)||(x2===0.0)){if(y2>0){if(x1>0){return sign}else{return-sign}}else{if(x1>0){return-sign}else{return sign}}}if(0.0<y1){if(0.0<y2){if(y1>=y2){sign=-sign;swap=x1;x1=x2;x2=swap;swap=y1;y1=y2;y2=swap}}else{if(y1<=-y2){sign=-sign;x2=-x2;y2=-y2}else{swap=x1;x1=-x2;x2=swap;swap=y1;y1=-y2;y2=swap}}}else{if(0.0<y2){if(-y1<=y2){sign=-sign;x1=-x1;y1=-y1}else{swap=-x1;x1=x2;x2=swap;swap=-y1;y1=y2;y2=swap}}else{if(y1>=y2){x1=-x1;y1=-y1;x2=-x2;y2=-y2}else{sign=-sign;swap=-x1;x1=-x2;x2=swap;swap=-y1;y1=-y2;y2=swap}}}if(0.0<x1){if(0.0<x2){if(x1>=x2){return sign}}else{return sign}}else{if(0.0<x2){return-sign}else{if(x1>=x2){sign=-sign;x1=-x1;x2=-x2}else{return-sign}}}while(true){count=count+1;k=Math.floor(x2/x1);x2=x2-k*x1;y2=y2-k*y1;if(y2<0.0){return-sign}if(y2>y1){return sign}if(x1>x2+x2){if(y1<y2+y2){return sign}}else{if(y1>y2+y2){return-sign}else{x2=x1-x2;y2=y1-y2;sign=-sign}}if(y2===0.0){if(x2===0.0){return 0}else{return-sign}}if(x2===0.0){return sign}k=Math.floor(x1/x2);x1=x1-k*x2;y1=y1-k*y2;if(y1<0.0){return sign}if(y1>y2){return-sign}if(x2>x1+x1){if(y2<y1+y1){return-sign}}else{if(y2>y1+y1){return sign}else{x1=x2-x1;y1=y2-y1;sign=-sign}}if(y1===0.0){if(x1===0.0){return 0}else{return sign}}if(x1===0.0){return-sign}}};
  40 +jsts.algorithm.RobustLineIntersector=function(){jsts.algorithm.RobustLineIntersector.prototype.constructor.call(this)};jsts.algorithm.RobustLineIntersector.prototype=new jsts.algorithm.LineIntersector();jsts.algorithm.RobustLineIntersector.prototype.computeIntersection=function(p,p1,p2){if(arguments.length===4){jsts.algorithm.LineIntersector.prototype.computeIntersection.apply(this,arguments);return}this._isProper=false;if(jsts.geom.Envelope.intersects(p1,p2,p)){if((jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,p)===0)&&(jsts.algorithm.CGAlgorithms.orientationIndex(p2,p1,p)===0)){this._isProper=true;if(p.equals(p1)||p.equals(p2)){this._isProper=false}this.result=jsts.algorithm.LineIntersector.POINT_INTERSECTION;return}}this.result=jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.RobustLineIntersector.prototype.computeIntersect=function(p1,p2,q1,q2){this._isProper=false;if(!jsts.geom.Envelope.intersects(p1,p2,q1,q2)){return jsts.algorithm.LineIntersector.NO_INTERSECTION}var Pq1=jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,q1);var Pq2=jsts.algorithm.CGAlgorithms.orientationIndex(p1,p2,q2);if((Pq1>0&&Pq2>0)||(Pq1<0&&Pq2<0)){return jsts.algorithm.LineIntersector.NO_INTERSECTION}var Qp1=jsts.algorithm.CGAlgorithms.orientationIndex(q1,q2,p1);var Qp2=jsts.algorithm.CGAlgorithms.orientationIndex(q1,q2,p2);if((Qp1>0&&Qp2>0)||(Qp1<0&&Qp2<0)){return jsts.algorithm.LineIntersector.NO_INTERSECTION}var collinear=Pq1===0&&Pq2===0&&Qp1===0&&Qp2===0;if(collinear){return this.computeCollinearIntersection(p1,p2,q1,q2)}if(Pq1===0||Pq2===0||Qp1===0||Qp2===0){this._isProper=false;if(p1.equals2D(q1)||p1.equals2D(q2)){this.intPt[0]=p1}else if(p2.equals2D(q1)||p2.equals2D(q2)){this.intPt[0]=p2}else if(Pq1===0){this.intPt[0]=new jsts.geom.Coordinate(q1)}else if(Pq2===0){this.intPt[0]=new jsts.geom.Coordinate(q2)}else if(Qp1===0){this.intPt[0]=new jsts.geom.Coordinate(p1)}else if(Qp2===0){this.intPt[0]=new jsts.geom.Coordinate(p2)}}else{this._isProper=true;this.intPt[0]=this.intersection(p1,p2,q1,q2)}return jsts.algorithm.LineIntersector.POINT_INTERSECTION};jsts.algorithm.RobustLineIntersector.prototype.computeCollinearIntersection=function(p1,p2,q1,q2){var p1q1p2=jsts.geom.Envelope.intersects(p1,p2,q1);var p1q2p2=jsts.geom.Envelope.intersects(p1,p2,q2);var q1p1q2=jsts.geom.Envelope.intersects(q1,q2,p1);var q1p2q2=jsts.geom.Envelope.intersects(q1,q2,p2);if(p1q1p2&&p1q2p2){this.intPt[0]=q1;this.intPt[1]=q2;return jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(q1p1q2&&q1p2q2){this.intPt[0]=p1;this.intPt[1]=p2;return jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q1p2&&q1p1q2){this.intPt[0]=q1;this.intPt[1]=p1;return q1.equals(p1)&&!p1q2p2&&!q1p2q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q1p2&&q1p2q2){this.intPt[0]=q1;this.intPt[1]=p2;return q1.equals(p2)&&!p1q2p2&&!q1p1q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q2p2&&q1p1q2){this.intPt[0]=q2;this.intPt[1]=p1;return q2.equals(p1)&&!p1q1p2&&!q1p2q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}if(p1q2p2&&q1p2q2){this.intPt[0]=q2;this.intPt[1]=p2;return q2.equals(p2)&&!p1q1p2&&!q1p1q2?jsts.algorithm.LineIntersector.POINT_INTERSECTION:jsts.algorithm.LineIntersector.COLLINEAR_INTERSECTION}return jsts.algorithm.LineIntersector.NO_INTERSECTION};jsts.algorithm.RobustLineIntersector.prototype.intersection=function(p1,p2,q1,q2){var intPt=this.intersectionWithNormalization(p1,p2,q1,q2);if(!this.isInSegmentEnvelopes(intPt)){intPt=jsts.algorithm.CentralEndpointIntersector.getIntersection(p1,p2,q1,q2)}if(this.precisionModel!==null){this.precisionModel.makePrecise(intPt)}return intPt};jsts.algorithm.RobustLineIntersector.prototype.intersectionWithNormalization=function(p1,p2,q1,q2){var n1=new jsts.geom.Coordinate(p1);var n2=new jsts.geom.Coordinate(p2);var n3=new jsts.geom.Coordinate(q1);var n4=new jsts.geom.Coordinate(q2);var normPt=new jsts.geom.Coordinate();this.normalizeToEnvCentre(n1,n2,n3,n4,normPt);var intPt=this.safeHCoordinateIntersection(n1,n2,n3,n4);intPt.x+=normPt.x;intPt.y+=normPt.y;return intPt};jsts.algorithm.RobustLineIntersector.prototype.safeHCoordinateIntersection=function(p1,p2,q1,q2){var intPt=null;try{intPt=jsts.algorithm.HCoordinate.intersection(p1,p2,q1,q2)}catch(e){if(e instanceof jsts.error.NotRepresentableError){intPt=jsts.algorithm.CentralEndpointIntersector.getIntersection(p1,p2,q1,q2)}else{throw e}}return intPt};jsts.algorithm.RobustLineIntersector.prototype.normalizeToMinimum=function(n1,n2,n3,n4,normPt){normPt.x=this.smallestInAbsValue(n1.x,n2.x,n3.x,n4.x);normPt.y=this.smallestInAbsValue(n1.y,n2.y,n3.y,n4.y);n1.x-=normPt.x;n1.y-=normPt.y;n2.x-=normPt.x;n2.y-=normPt.y;n3.x-=normPt.x;n3.y-=normPt.y;n4.x-=normPt.x;n4.y-=normPt.y};jsts.algorithm.RobustLineIntersector.prototype.normalizeToEnvCentre=function(n00,n01,n10,n11,normPt){var minX0=n00.x<n01.x?n00.x:n01.x;var minY0=n00.y<n01.y?n00.y:n01.y;var maxX0=n00.x>n01.x?n00.x:n01.x;var maxY0=n00.y>n01.y?n00.y:n01.y;var minX1=n10.x<n11.x?n10.x:n11.x;var minY1=n10.y<n11.y?n10.y:n11.y;var maxX1=n10.x>n11.x?n10.x:n11.x;var maxY1=n10.y>n11.y?n10.y:n11.y;var intMinX=minX0>minX1?minX0:minX1;var intMaxX=maxX0<maxX1?maxX0:maxX1;var intMinY=minY0>minY1?minY0:minY1;var intMaxY=maxY0<maxY1?maxY0:maxY1;var intMidX=(intMinX+intMaxX)/2.0;var intMidY=(intMinY+intMaxY)/2.0;normPt.x=intMidX;normPt.y=intMidY;n00.x-=normPt.x;n00.y-=normPt.y;n01.x-=normPt.x;n01.y-=normPt.y;n10.x-=normPt.x;n10.y-=normPt.y;n11.x-=normPt.x;n11.y-=normPt.y};jsts.algorithm.RobustLineIntersector.prototype.smallestInAbsValue=function(x1,x2,x3,x4){var x=x1;var xabs=Math.abs(x);if(Math.abs(x2)<xabs){x=x2;xabs=Math.abs(x2)}if(Math.abs(x3)<xabs){x=x3;xabs=Math.abs(x3)}if(Math.abs(x4)<xabs){x=x4}return x};jsts.algorithm.RobustLineIntersector.prototype.isInSegmentEnvelopes=function(intPt){var env0=new jsts.geom.Envelope(this.inputLines[0][0],this.inputLines[0][1]);var env1=new jsts.geom.Envelope(this.inputLines[1][0],this.inputLines[1][1]);return env0.contains(intPt)&&env1.contains(intPt)};
  41 +jsts.planargraph={};
  42 +jsts.planargraph.PlanarGraph=function(){this.edges=new jsts.HashSet();this.dirEdges=new jsts.HashSet()};jsts.planargraph.PlanarGraph.prototype.edges=null;jsts.planargraph.PlanarGraph.prototype.dirEdges=null;jsts.planargraph.PlanarGraph.prototype.nodeMap=null;
  43 +jsts.geomgraph={};
  44 +jsts.geomgraph.GraphComponent=function(label){this.label=label};jsts.geomgraph.GraphComponent.prototype.label=null;jsts.geomgraph.GraphComponent.prototype.isInResult=false;jsts.geomgraph.GraphComponent.prototype.isCovered=false;jsts.geomgraph.GraphComponent.prototype.isCoveredSet=false;jsts.geomgraph.GraphComponent.prototype.isVisited=false;jsts.geomgraph.GraphComponent.prototype.getLabel=function(){return this.label};jsts.geomgraph.GraphComponent.prototype.setLabel=function(label){this.label=label};jsts.geomgraph.GraphComponent.prototype.setInResult=function(isInResult){this.isInResult=isInResult};jsts.geomgraph.GraphComponent.prototype.isInResult=function(){return this.isInResult};jsts.geomgraph.GraphComponent.prototype.setCovered=function(isCovered){this.isCovered=isCovered;this.isCoveredSet=true};jsts.geomgraph.GraphComponent.prototype.isCovered=function(){return isCovered};jsts.geomgraph.GraphComponent.prototype.isCoveredSet=function(){return isCoveredSet};jsts.geomgraph.GraphComponent.prototype.isVisited=function(){return isVisited};jsts.geomgraph.GraphComponent.prototype.setVisited=function(isVisited){this.isVisited=isVisited};jsts.geomgraph.GraphComponent.prototype.getCoordinate=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.GraphComponent.prototype.computeIM=function(im){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.GraphComponent.prototype.isIsolated=function(){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.GraphComponent.prototype.updateIM=function(im){if(this.label.getGeometryCount()>=2){throw new jsts.error.NotRepresentableError('found partial label')}this.computeIM(im)};
  45 +jsts.geomgraph.Node=function(){};jsts.geomgraph.Node.prototype=new jsts.geomgraph.GraphComponent();jsts.geomgraph.Node.prototype.getLabel=function(){return new jsts.geomgraph.Label()};
  46 +jsts.geomgraph.NodeMap=function(){this.nodeMap=new jsts.Hashtable()};jsts.geomgraph.NodeMap.prototype.nodeMap=null;jsts.geomgraph.NodeMap.prototype.addNode=function(arg){var node,coord;if(arg instanceof jsts.geom.Coordinate){coord=arg;node=this.nodeMap.get(coord);if(node==null){node=new jsts.geomgraph.Node(coord,null);this.nodeMap.put(coord,node)}return node}else if(arg instanceof jsts.geomgraph.Node){node=arg;node=nodeMap.get(n.getCoordinate());if(node===null){this.nodeMap.put(n.getCoordinate(),n);return n}node.mergeLabel(n);return node}};jsts.geomgraph.NodeMap.prototype.add=function(e){var p=e.getCoordinate();var n=addNode(p);n.add(e)};jsts.geomgraph.NodeMap.prototype.find=function(coord){return nodeMap.get(coord)};jsts.geomgraph.NodeMap.prototype.values=function(){return this.nodeMap.values()};jsts.geomgraph.NodeMap.prototype.getBoundaryNodes=function(geomIndex){var bdyNodes=[];var i,values=this.values();for(i=0;i<values.length;i++){var node=values[i];if(node.getLabel().getLocation(geomIndex)===jsts.geom.Location.BOUNDARY)bdyNodes.add(node)}return bdyNodes};
  47 +jsts.geomgraph.Edge=function(pts,label){this.pts=pts;this.label=label;this.eiList=new jsts.geomgraph.EdgeIntersectionList(this)};jsts.geomgraph.Edge.prototype=new jsts.geomgraph.GraphComponent();jsts.geomgraph.Edge.prototype.pts=null;jsts.geomgraph.Edge.prototype.eiList=null;jsts.geomgraph.Edge.prototype.getNumPoints=function(){return this.pts.length};jsts.geomgraph.Edge.prototype.getCoordinates=function(){return this.pts};jsts.geomgraph.Edge.prototype.getCoordinate=function(i){return this.pts[i]};jsts.geomgraph.Edge.prototype.isClosed=function(){return this.pts[0].equals(this.pts[this.pts.length-1])};jsts.geomgraph.Edge.prototype.addIntersections=function(li,segmentIndex,geomIndex){for(var i=0;i<li.getIntersectionNum();i++){this.addIntersection(li,segmentIndex,geomIndex,i)}};jsts.geomgraph.Edge.prototype.addIntersection=function(li,segmentIndex,geomIndex,intIndex){var intPt=new jsts.geom.Coordinate(li.getIntersection(intIndex));var normalizedSegmentIndex=segmentIndex;var dist=li.getEdgeDistance(geomIndex,intIndex);var nextSegIndex=normalizedSegmentIndex+1;if(nextSegIndex<this.pts.length){var nextPt=this.pts[nextSegIndex];if(intPt.equals2D(nextPt)){normalizedSegmentIndex=nextSegIndex;dist=0.0}}var ei=this.eiList.add(intPt,normalizedSegmentIndex,dist)};jsts.geomgraph.Edge.prototype.getMaximumSegmentIndex=function(){return this.pts.length-1};
  48 +
  49 +jsts.geomgraph.EdgeIntersection=function(coord,segmentIndex,dist){this.coord=new jsts.geom.Coordinate(coord);this.segmentIndex=segmentIndex;this.dist=dist};jsts.geomgraph.EdgeIntersection.prototype.coord=null;jsts.geomgraph.EdgeIntersection.prototype.segmentIndex=null;jsts.geomgraph.EdgeIntersection.prototype.dist=null;jsts.geomgraph.EdgeIntersection.prototype.getCoordinate=function(){return this.coord};jsts.geomgraph.EdgeIntersection.prototype.getSegmentIndex=function(){return this.segmentIndex};jsts.geomgraph.EdgeIntersection.prototype.getDistance=function(){return this.dist};jsts.geomgraph.EdgeIntersection.prototype.compareTo=function(other){return this.compare(other.segmentIndex,other.dist)};jsts.geomgraph.EdgeIntersection.prototype.compare=function(segmentIndex,dist){if(this.segmentIndex<segmentIndex)return-1;if(this.segmentIndex>segmentIndex)return 1;if(this.dist<dist)return-1;if(this.dist>dist)return 1;return 0};jsts.geomgraph.EdgeIntersection.prototype.isEndPoint=function(maxSegmentIndex){if(segmentIndex==0&&dist==0.0)return true;if(segmentIndex==maxSegmentIndex)return true;return false};
  50 +jsts.geomgraph.EdgeIntersectionList=function(edge){this.edge=edge;this.nodeMap=new jsts.Hashtable()};jsts.geomgraph.EdgeIntersectionList.prototype.nodeMap=null;jsts.geomgraph.EdgeIntersectionList.prototype.edge=null;jsts.geomgraph.EdgeIntersectionList.prototype.add=function(intPt,segmentIndex,dist){var eiNew=new jsts.geomgraph.EdgeIntersection(intPt,segmentIndex,dist);var ei=this.nodeMap.get(eiNew);if(ei!==null){return ei}this.nodeMap.put(eiNew,eiNew);return eiNew};
  51 +jsts.geomgraph.PlanarGraph=function(){this.nodes=new jsts.geomgraph.NodeMap()};jsts.geomgraph.PlanarGraph.prototype.edges=[];jsts.geomgraph.PlanarGraph.prototype.nodes=null;jsts.geomgraph.PlanarGraph.prototype.insertEdge=function(e){this.edges.push(e)};
  52 +jsts.geomgraph.GeometryGraph=function(argIndex,parentGeom,boundaryNodeRule){jsts.geomgraph.GeometryGraph.prototype.constructor.call(this);this.lineEdgeMap=new jsts.Hashtable();this.ptLocator=new jsts.algorithm.PointLocator();this.argIndex=argIndex;this.parentGeom=parentGeom;this.boundaryNodeRule=boundaryNodeRule||jsts.algorithm.BoundaryNodeRule.OGC_SFS_BOUNDARY_RULE;if(parentGeom!=null){this.add(parentGeom)}};jsts.geomgraph.GeometryGraph.prototype=new jsts.geomgraph.PlanarGraph();jsts.geomgraph.GeometryGraph.determineBoundary=function(boundaryNodeRule,boundaryCount){return boundaryNodeRule.isInBoundary(boundaryCount)?jsts.geom.Location.BOUNDARY:jsts.geom.Location.INTERIOR};jsts.geomgraph.GeometryGraph.prototype.parentGeom=null;jsts.geomgraph.GeometryGraph.prototype.lineEdgeMap=null;jsts.geomgraph.GeometryGraph.prototype.boundaryNodeRule=null;jsts.geomgraph.GeometryGraph.prototype.useBoundaryDeterminationRule=true;jsts.geomgraph.GeometryGraph.prototype.argIndex=null;jsts.geomgraph.GeometryGraph.prototype.boundaryNodes=[];jsts.geomgraph.GeometryGraph.prototype.hasTooFewPoints=false;jsts.geomgraph.GeometryGraph.prototype.invalidPoint=null;jsts.geomgraph.GeometryGraph.prototype.areaPtLocator=null;jsts.geomgraph.GeometryGraph.prototype.ptLocator=null;jsts.geomgraph.GeometryGraph.prototype.createEdgeSetIntersector=function(){return new jsts.geomgraph.index.SimpleEdgeSetIntersector()};jsts.geomgraph.GeometryGraph.prototype.add=function(g){if(g.isEmpty()){return}if(g instanceof jsts.geom.MultiPolygon)this.useBoundaryDeterminationRule=false;if(g instanceof jsts.geom.Polygon)this.addPolygon(g);else if(g instanceof jsts.geom.LineString)this.addLineString(g);else if(g instanceof jsts.geom.Point)this.addPoint(g);else if(g instanceof jsts.geom.MultiPoint)this.addCollection(g);else if(g instanceof jsts.geom.MultiLineString)this.addCollection(g);else if(g instanceof jsts.geom.MultiPolygon)this.addCollection(g);else if(g instanceof jsts.geom.GeometryCollection)this.addCollection(g);else throw new jsts.error.IllegalArgumentError('Geometry type not supported.')};jsts.geomgraph.GeometryGraph.prototype.addPoint=function(p){var coord=p.getCoordinate();this.insertPoint(this.argIndex,coord,jsts.geom.Location.INTERIOR)};jsts.geomgraph.GeometryGraph.prototype.addLineString=function(line){var coords=jsts.geom.CoordinateArrays.removeRepeatedPoints(line.getCoordinates());if(coords.length<2){this.hasTooFewPoints=true;this.invalidPoint=coords[0];return}var e=new jsts.geomgraph.Edge(coords,new jsts.geomgraph.Label(this.argIndex,jsts.geom.Location.INTERIOR));this.lineEdgeMap.put(line,e);this.insertEdge(e);if(coords.length>=2===false){throw new jsts.error.IllegalArgumentError('found LineString with single point')}this.insertBoundaryPoint(this.argIndex,coords[0]);this.insertBoundaryPoint(this.argIndex,coords[coords.length-1])};jsts.geomgraph.GeometryGraph.prototype.computeSelfNodes=function(li,computeRingSelfNodes){var si=new jsts.geomgraph.index.SegmentIntersector(li,true,false);var esi=this.createEdgeSetIntersector();if(!computeRingSelfNodes&&(parentGeom instanceof jsts.geom.LinearRing||parentGeom instanceof jsts.geom.Polygon||parentGeom instanceof jsts.geom.MultiPolygon)){esi.computeIntersections(this.edges,si,false)}else{esi.computeIntersections(this.edges,si,true)}this.addSelfIntersectionNodes(this.argIndex);return si};jsts.geomgraph.GeometryGraph.prototype.insertPoint=function(argIndex,coord,onLocation){var n=this.nodes.addNode(coord);var lbl=n.getLabel();if(lbl==null){n.label=new jsts.geomgraph.Label(this.argIndex,this.onLocation)}else lbl.setLocation(this.argIndex,this.onLocation)};jsts.geomgraph.GeometryGraph.prototype.insertBoundaryPoint=function(argIndex,coord){var n=this.nodes.addNode(coord);var lbl=n.getLabel();var boundaryCount=1;var loc=jsts.geom.Location.NONE;if(lbl!==null)loc=lbl.getLocation(argIndex,jsts.geomgraph.Position.ON);if(loc===jsts.geom.Location.BOUNDARY)boundaryCount++;var newLoc=jsts.geomgraph.GeometryGraph.determineBoundary(this.boundaryNodeRule,boundaryCount);lbl.setLocation(argIndex,newLoc)};jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNodes=function(argIndex){var i,e,eLoc,j,ei;for(i=0;i<this.edges.length;i++){e=this.edges[i];eLoc=e.getLabel().getLocation(argIndex);for(j=0;j<e.eiList.length;j++){ei=e.eiList[j];this.addSelfIntersectionNode(argIndex,ei.coord,eLoc)}}};jsts.geomgraph.GeometryGraph.prototype.addSelfIntersectionNode=function(argIndex,coord,loc){if(this.isBoundaryNode(argIndex,coord))return;if(loc===jsts.geom.Location.BOUNDARY&&this.useBoundaryDeterminationRule)this.insertBoundaryPoint(argIndex,coord);else this.insertPoint(argIndex,coord,loc)};
  53 +jsts.geomgraph.Label=function(){var geomIndex,onLoc,leftLoc,rightLoc;if(arguments.length===4){geomIndex=arguments[0];onLoc=arguments[1];leftLoc=arguments[2];rightLoc=arguments[3];this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE);this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE,jsts.geom.Location.NONE,jsts.geom.Location.NONE);this.elt[geomIndex].setLocations(onLoc,leftLoc,rightLoc)}else if(arguments.length===3){onLoc=arguments[0];leftLoc=arguments[1];rightLoc=arguments[2];this.elt[0]=new jsts.geomgraph.TopologyLocation(onLoc,leftLoc,rightLoc);this.elt[1]=new jsts.geomgraph.TopologyLocation(onLoc,leftLoc,rightLoc)}else if(arguments.length===2){geomIndex=arguments[0];onLoc=arguments[1];this.elt[0]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE);this.elt[1]=new jsts.geomgraph.TopologyLocation(jsts.geom.Location.NONE);this.elt[geomIndex].setLocation(onLoc)}else if(arguments[0]instanceof jsts.geomgraph.Label){this.elt[0]=new jsts.geomgraph.TopologyLocation(lbl.elt[0]);this.elt[1]=new jsts.geomgraph.TopologyLocation(lbl.elt[1])}else if(arguments[0]instanceof Number){onLoc=arguments[0];this.elt[0]=new jsts.geomgraph.TopologyLocation(onLoc);this.elt[1]=new jsts.geomgraph.TopologyLocation(onLoc)}};jsts.geomgraph.Label.toLineLabel=function(label){var i,lineLabel=new jsts.geomgraph.Label(jsts.geom.Location.NONE);for(i=0;i<2;i++){lineLabel.setLocation(i,label.getLocation(i))}return lineLabel};jsts.geomgraph.Label.prototype.elt=[];jsts.geomgraph.Label.prototype.flip=function(){this.elt[0].flip();this.elt[1].flip()};jsts.geomgraph.Label.prototype.getLocation=function(geomIndex,posIndex){return this.elt[geomIndex].get(posIndex)};jsts.geomgraph.Label.prototype.getLocation=function(geomIndex){return this.elt[geomIndex].get(jsts.geomgraph.Position.ON)};jsts.geomgraph.Label.prototype.setLocation=function(geomIndex,posIndex,location){this.elt[geomIndex].setLocation(posIndex,location)};jsts.geomgraph.Label.prototype.setLocation=function(geomIndex,location){this.elt[geomIndex].setLocation(jsts.geomgraph.Position.ON,location)};jsts.geomgraph.Label.prototype.setAllLocations=function(geomIndex,location){this.elt[geomIndex].setAllLocations(location)};jsts.geomgraph.Label.prototype.setAllLocationsIfNull=function(geomIndex,location){this.elt[geomIndex].setAllLocationsIfNull(location)};jsts.geomgraph.Label.prototype.setAllLocationsIfNull=function(location){this.setAllLocationsIfNull(0,location);this.setAllLocationsIfNull(1,location)};jsts.geomgraph.Label.prototype.merge=function(lbl){var i;for(i=0;i<2;i++){if(this.elt[i]===null&&lbl.elt[i]!==null){this.elt[i]=new jsts.geomgraph.TopologyLocation(lbl.elt[i])}else{this.elt[i].merge(lbl.elt[i])}}};jsts.geomgraph.Label.prototype.getGeometryCount=function(){var count=0;if(!this.elt[0].isNull()){count++}if(!this.elt[1].isNull()){count++}return count};jsts.geomgraph.Label.prototype.isNull=function(geomIndex){return this.elt[geomIndex].isNull()};jsts.geomgraph.Label.prototype.isAnyNull=function(geomIndex){return this.elt[geomIndex].isAnyNull()};jsts.geomgraph.Label.prototype.isArea=function(){return this.elt[0].isArea()||elt[1].isArea()};jsts.geomgraph.Label.prototype.isArea=function(geomIndex){return this.elt[geomIndex].isArea()};jsts.geomgraph.Label.prototype.isLine=function(geomIndex){return this.elt[geomIndex].isLine()};jsts.geomgraph.Label.prototype.isEqualOnSide=function(lbl,side){return this.elt[0].isEqualOnSide(lbl.elt[0],side)&&this.elt[1].isEqualOnSide(lbl.elt[1],side)};jsts.geomgraph.Label.prototype.allPositionsEqual=function(geomIndex,loc){return this.elt[geomIndex].allPositionsEqual(loc)};jsts.geomgraph.Label.prototype.toLine=function(geomIndex){if(this.elt[geomIndex].isArea()){this.elt[geomIndex]=new jsts.geomgraph.TopologyLocation(this.elt[geomIndex].location[0])}};
  54 +jsts.geomgraph.Position=function(){};jsts.geomgraph.Position.ON=0;jsts.geomgraph.Position.LEFT=1;jsts.geomgraph.Position.RIGHT=2;jsts.geomgraph.Position.opposite=function(position){if(position===jsts.geomgraph.Position.LEFT){return jsts.geomgraph.Position.RIGHT}if(position===jsts.geomgraph.Position.RIGHT){return jsts.geomgraph.Position.LEFT}return position};
  55 +jsts.geomgraph.TopologyLocation=function(){if(arguments.length===3){var on=arguments[0];var left=arguments[1];var right=arguments[2];this.init(3);this.location[jsts.geomgraph.Position.ON]=on;this.location[jsts.geomgraph.Position.LEFT]=left;this.location[jsts.geomgraph.Position.RIGHT]=right}else if(arguments[0]instanceof jsts.geomgraph.TopologyLocation){var gl=arguments[0];init(gl.location.length);if(gl!=null){for(var i=0;i<this.location.length;i++){this.location[i]=gl.location[i]}}}else if(arguments[0]instanceof Number){var on=arguments[0];init(1);this.location[Position.ON]=on}else if(arguments[0]instanceof Array){var location=arguments[0];init(location.length)}};jsts.geomgraph.TopologyLocation.prototype.location=[];jsts.geomgraph.TopologyLocation.prototype.init=function(size){this.location[size]=null;this.setAllLocations(jsts.geom.Location.NONE)};jsts.geomgraph.TopologyLocation.prototype.get=function(posIndex){if(posIndex<this.location.length)return this.location[posIndex];return jsts.geom.Location.NONE};jsts.geomgraph.TopologyLocation.prototype.isNull=function(){for(var i=0;i<this.location.length;i++){if(this.location[i]!==jsts.geom.Location.NONE)return false}return true};jsts.geomgraph.TopologyLocation.prototype.isAnyNull=function(){for(var i=0;i<this.location.length;i++){if(this.location[i]===jsts.geom.Location.NONE)return true}return false};jsts.geomgraph.TopologyLocation.prototype.isEqualOnSide=function(le,locIndex){return this.location[locIndex]==le.location[locIndex]};jsts.geomgraph.TopologyLocation.prototype.isArea=function(){return this.location.length>1};jsts.geomgraph.TopologyLocation.prototype.isLine=function(){return this.location.length==1};jsts.geomgraph.TopologyLocation.prototype.flip=function(){if(this.location.length<=1)return;var temp=this.location[jsts.geom.Position.LEFT];this.location[jsts.geomgraph.Position.LEFT]=this.location[jsts.geom.Position.RIGHT];this.location[jsts.geomgraph.Position.RIGHT]=temp};jsts.geomgraph.TopologyLocation.prototype.setAllLocations=function(locValue){for(var i=0;i<this.location.length;i++){this.location[i]=locValue}};jsts.geomgraph.TopologyLocation.prototype.setAllLocationsIfNull=function(locValue){for(var i=0;i<this.location.length;i++){if(this.location[i]===jsts.geom.Location.NONE)this.location[i]=locValue}};jsts.geomgraph.TopologyLocation.prototype.setLocation=function(locIndex,locValue){if(locValue!==undefined){this.location[locIndex]=locValue}else{this.setLocation(jsts.geomgraph.Position.ON,locIndex)}};jsts.geomgraph.TopologyLocation.prototype.getLocations=function(){return location};jsts.geomgraph.TopologyLocation.prototype.setLocations=function(on,left,right){this.location[jsts.geomgraph.Position.ON]=on;this.location[jsts.geomgraph.Position.LEFT]=left;this.location[jsts.geomgraph.Position.RIGHT]=right};jsts.geomgraph.TopologyLocation.prototype.allPositionsEqual=function(loc){for(var i=0;i<this.location.length;i++){if(this.location[i]!==loc)return false}return true};jsts.geomgraph.TopologyLocation.prototype.merge=function(gl){if(gl.location.length>this.location.length){var newLoc=[];newLoc[jsts.geomgraph.Position.ON]=this.location[jsts.geomgraph.Position.ON];newLoc[jsts.geomgraph.Position.LEFT]=jsts.geom.Location.NONE;newLoc[jsts.geomgraph.Position.RIGHT]=jsts.geom.Location.NONE;this.location=newLoc}for(var i=0;i<this.location.length;i++){if(this.location[i]==jsts.geom.Location.NONE&&i<gl.location.length)this.location[i]=gl.location[i]}};
  56 +jsts.geomgraph.index={};
  57 +jsts.geomgraph.index.EdgeSetIntersector=function(){};jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections=function(edges,si,testAllSegments){throw new jsts.error.AbstractMethodInvocationError()};jsts.geomgraph.index.EdgeSetIntersector.prototype.computeIntersections=function(edges0,edges1,si){throw new jsts.error.AbstractMethodInvocationError()};
  58 +jsts.geomgraph.index.SegmentIntersector=function(li,includeProper,recordIsolated){this.li=li;this.includeProper=includeProper;this.recordIsolated=recordIsolated};jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments=function(i1,i2){return Math.abs(i1-i2)===1};jsts.geomgraph.index.SegmentIntersector.prototype._hasIntersection=false;jsts.geomgraph.index.SegmentIntersector.prototype.hasProper=false;jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInterior=false;jsts.geomgraph.index.SegmentIntersector.prototype.properIntersectionPoint=null;jsts.geomgraph.index.SegmentIntersector.prototype.li=null;jsts.geomgraph.index.SegmentIntersector.prototype.includeProper=null;jsts.geomgraph.index.SegmentIntersector.prototype.recordIsolated=null;jsts.geomgraph.index.SegmentIntersector.prototype.isSelfIntersection=null;jsts.geomgraph.index.SegmentIntersector.prototype.numIntersections=0;jsts.geomgraph.index.SegmentIntersector.prototype.numTests=0;jsts.geomgraph.index.SegmentIntersector.prototype.bdyNodes=null;jsts.geomgraph.index.SegmentIntersector.prototype.setBoundaryNodes=function(bdyNodes0,bdyNodes1){this.bdyNodes=[];this.bdyNodes[0]=bdyNodes0;this.bdyNodes[1]=bdyNodes1};jsts.geomgraph.index.SegmentIntersector.prototype.getProperIntersectionPoint=function(){return this.properIntersectionPoint};jsts.geomgraph.index.SegmentIntersector.prototype.hasIntersection=function(){return this._hasIntersection};jsts.geomgraph.index.SegmentIntersector.prototype.hasProperIntersection=function(){return this.hasProper};jsts.geomgraph.index.SegmentIntersector.prototype.hasProperInteriorIntersection=function(){return this.hasProperInterior};jsts.geomgraph.index.SegmentIntersector.prototype.isTrivialIntersection=function(e0,segIndex0,e1,segIndex1){if(e0==e1){if(this.li.getIntersectionNum()==1){if(jsts.geomgraph.index.SegmentIntersector.isAdjacentSegments(segIndex0,segIndex1))return true;if(e0.isClosed()){var maxSegIndex=e0.getNumPoints()-1;if((segIndex0==0&&segIndex1==maxSegIndex)||(segIndex1==0&&segIndex0==maxSegIndex)){return true}}}}return false};jsts.geomgraph.index.SegmentIntersector.prototype.addIntersections=function(e0,segIndex0,e1,segIndex1){if(e0===e1&&segIndex0===segIndex1)return;this.numTests++;var p00=e0.getCoordinates()[segIndex0];var p01=e0.getCoordinates()[segIndex0+1];var p10=e1.getCoordinates()[segIndex1];var p11=e1.getCoordinates()[segIndex1+1];this.li.computeIntersection(p00,p01,p10,p11);if(this.li.hasIntersection()){if(this.recordIsolated){e0.setIsolated(false);e1.setIsolated(false)}this.numIntersections++;if(!this.isTrivialIntersection(e0,segIndex0,e1,segIndex1)){this._hasIntersection=true;if(this.includeProper||!this.li.isProper()){e0.addIntersections(this.li,segIndex0,0);e1.addIntersections(this.li,segIndex1,1)}if(this.li.isProper()){this.properIntersectionPoint=this.li.getIntersection(0).clone();this.hasProper=true;if(!this.isBoundaryPoint(this.li,this.bdyNodes))this.hasProperInterior=true}}}};jsts.geomgraph.index.SegmentIntersector.prototype.isBoundaryPoint=function(li,bdyNodes){if(bdyNodes===null)return false;if(bdyNodes[0]instanceof Array){if(this.isBoundaryPoint(li,bdyNodes[0]))return true;if(this.isBoundaryPoint(li,bdyNodes[1]))return true;return false}else{for(var i=0;i<bdyNodes.length;i++){var node=bdyNodes[i];var pt=node.getCoordinate();if(li.isIntersection(pt))return true}return false}};
  59 +jsts.geomgraph.index.SimpleEdgeSetIntersector=function(){};jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector();jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.nOverlaps=0;jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersections=function(edges,si,testAllSegments){var i0,i1,edge0,edge1;this.nOverlaps=0;for(i0=0;i0<edges.length;i0++){edge0=edges[i0];for(i1=0;i1<edges.length;i1++){edge1=edges[i1];if(testAllSegments||edge0!==edge1){this.computeIntersects(edge0,edge1,si)}}}};jsts.geomgraph.index.SimpleEdgeSetIntersector.prototype.computeIntersects=function(e0,e1,si){var pts0=e0.getCoordinates();var pts1=e1.getCoordinates();var i0,i1;for(i0=0;i0<pts0.length-1;i0++){for(i1=0;i1<pts1.length-1;i1++){si.addIntersections(e0,i0,e1,i1)}}};
  60 +jsts.geomgraph.index.SimpleMCSweepLineIntersector=function(){};jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector();
  61 +jsts.index={};
  62 +jsts.index.ArrayListVisitor=function(){this.items=[]};jsts.index.ArrayListVisitor.prototype.visitItem=function(item){this.items.push(item)};jsts.index.ArrayListVisitor.prototype.getItems=function(){return this.items};
  63 +jsts.index.DoubleBits=function(){};jsts.index.DoubleBits.powerOf2=function(exp){return Math.pow(2,exp)};jsts.index.DoubleBits.exponent=function(d){return jsts.index.DoubleBits.CVTFWD(64,d)-1023};jsts.index.DoubleBits.CVTFWD=function(NumW,Qty){var Sign,Expo,Mant,Bin,nb01='';var Inf={32:{d:0x7F,c:0x80,b:0,a:0},64:{d:0x7FF0,c:0,b:0,a:0}};var ExW={32:8,64:11}[NumW],MtW=NumW-ExW-1;if(!Bin){Sign=Qty<0||1/Qty<0; if(!isFinite(Qty)){Bin=Inf[NumW];if(Sign){Bin.d+=1<<(NumW/4-1)}Expo=Math.pow(2,ExW)-1;Mant=0}}if(!Bin){Expo={32:127,64:1023}[NumW];Mant=Math.abs(Qty);while(Mant>=2){Expo++;Mant/=2}while(Mant<1&&Expo>0){Expo--;Mant*=2}if(Expo<=0){Mant/=2;nb01='Zero or Denormal'}if(NumW===32&&Expo>254){nb01='Too big for Single';Bin={d:Sign?0xFF:0x7F,c:0x80,b:0,a:0};Expo=Math.pow(2,ExW)-1;Mant=0}}return Expo};
  64 +jsts.index.IntervalSize=function(){};jsts.index.IntervalSize.MIN_BINARY_EXPONENT=-50;jsts.index.IntervalSize.isZeroWidth=function(min,max){var width=max-min;if(width===0.0){return true}var maxAbs,scaledInterval,level;maxAbs=Math.max(Math.abs(min),Math.abs(max));scaledInterval=width/maxAbs;level=jsts.index.DoubleBits.exponent(scaledInterval);return level<=jsts.index.IntervalSize.MIN_BINARY_EXPONENT};
  65 +jsts.index.quadtree={};
  66 +jsts.index.quadtree.Key=function(itemEnv){this.pt=new jsts.geom.Coordinate();this.level=0;this.env=null;this.computeKey(itemEnv)};jsts.index.quadtree.Key.computeQuadLevel=function(env){var dx,dy,dMax,level;dx=env.getWidth();dy=env.getHeight();dMax=dx>dy?dx:dy;level=jsts.index.DoubleBits.exponent(dMax)+1;return level};jsts.index.quadtree.Key.prototype.getPoint=function(){return this.pt};jsts.index.quadtree.Key.prototype.getLevel=function(){return this.level};jsts.index.quadtree.Key.prototype.getEnvelope=function(){return this.env};jsts.index.quadtree.Key.prototype.getCentre=function(){var x,y;x=(this.env.getMinX()+this.env.getMaxX())/2;y=(this.env.getMinY()+this.env.getMaxY())/2;return new jsts.geom.Coordinate(x,y)};jsts.index.quadtree.Key.prototype.computeKey=function(){if(arguments[0]instanceof jsts.geom.Envelope){this.computeKeyFromEnvelope(arguments[0])}else{this.computeKeyFromLevel(arguments[0],arguments[1])}};jsts.index.quadtree.Key.prototype.computeKeyFromEnvelope=function(env){this.level=jsts.index.quadtree.Key.computeQuadLevel(env);this.env=new jsts.geom.Envelope();this.computeKey(this.level,env);while(!this.env.contains(env)){this.level+=1;this.computeKey(this.level,env)}};jsts.index.quadtree.Key.prototype.computeKeyFromLevel=function(level,env){var quadSize=jsts.index.DoubleBits.powerOf2(level);this.pt.x=Math.floor(env.getMinX()/quadSize)*quadSize;this.pt.y=Math.floor(env.getMinY()/quadSize)*quadSize;this.env.init(this.pt.x,this.pt.x+quadSize,this.pt.y,this.pt.y+quadSize)};
  67 +jsts.index.quadtree.NodeBase=function(){this.subnode=new Array(4);this.subnode[0]=null;this.subnode[1]=null;this.subnode[2]=null;this.subnode[3]=null;this.items=[]};jsts.index.quadtree.NodeBase.prototype.getSubnodeIndex=function(env,centre){var subnodeIndex=-1;if(env.getMinX()>=centre.x){if(env.getMinY()>=centre.y){subnodeIndex=3}if(env.getMaxY()<=centre.y){subnodeIndex=1}}if(env.getMaxX()<=centre.x){if(env.getMinY()>=centre.y){subnodeIndex=2}if(env.getMaxY()<=centre.y){subnodeIndex=0}}return subnodeIndex};jsts.index.quadtree.NodeBase.prototype.getItems=function(){return this.items};jsts.index.quadtree.NodeBase.prototype.hasItems=function(){return(this.items.length>0)};jsts.index.quadtree.NodeBase.prototype.add=function(item){this.items.push(item)};jsts.index.quadtree.NodeBase.prototype.remove=function(itemEnv,item){if(!this.isSearchMatch(itemEnv)){return false}var found=false,i=0;for(i;i<4;i++){if(this.subnode[i]!==null){found=this.subnode[i].remove(itemEnv,item);if(found){if(this.subnode[i].isPrunable()){this.subnode[i]=null}break}}}if(found){return found}if(OpenLayers.Util.indexOf(this.items,item)!==-1){OpenLayers.Util.removeItem(this.items,item);found=true}return found};jsts.index.quadtree.NodeBase.prototype.isPrunable=function(){return!(this.hasChildren()||this.hasItems())};jsts.index.quadtree.NodeBase.prototype.hasChildren=function(){var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){return true}}return false};jsts.index.quadtree.NodeBase.prototype.isEmpty=function(){var isEmpty=true;if(this.items.length>0){isEmpty=false}var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){if(!this.subnode[i].isEmpty()){isEmpty=false}}}return isEmpty};jsts.index.quadtree.NodeBase.prototype.addAllItems=function(resultItems){resultItems=resultItems.concat(this.items);var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){resultItems=this.subnode[i].addAllItems(resultItems)}}return resultItems};jsts.index.quadtree.NodeBase.prototype.addAllItemsFromOverlapping=function(searchEnv,resultItems){if(!this.isSearchMatch(searchEnv)){return}resultItems=resultItems.concat(this.items);var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){resultItems=this.subnode[i].addAllItemsFromOverlapping(searchEnv,resultItems)}}};jsts.index.quadtree.NodeBase.prototype.visit=function(searchEnv,visitor){if(!this.isSearchMatch(searchEnv)){return}this.visitItems(searchEnv,visitor);var i=0;for(i;i<4;i++){if(this.subnode[i]!==null){this.subnode[i].visit(searchEnv,visitor)}}};jsts.index.quadtree.NodeBase.prototype.visitItems=function(env,visitor){var i=0,il=this.items.length;for(i;i<il;i++){visitor.visitItem(this.items[i])}};jsts.index.quadtree.NodeBase.prototype.depth=function(){var maxSubDepth=0,i=0,sqd;for(i;i<4;i++){if(this.subnode[i]!==null){sqd=this.subnode[i].depth();if(sqd>maxSubDepth){maxSubDepth=sqd}}}return maxSubDepth+1};jsts.index.quadtree.NodeBase.prototype.size=function(){var subSize=0,i=0;for(i;i<4;i++){if(this.subnode[i]!==null){subSize+=this.subnode[i].size()}}return subSize+this.items.length};jsts.index.quadtree.NodeBase.prototype.getNodeCount=function(){var subSize=0,i=0;for(i;i<4;i++){if(this.subnode[i]!==null){subSize+=this.subnode[i].size()}}return subSize+1};
  68 +jsts.index.quadtree.Node=function(env,level){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments);this.env=env;this.level=level;this.centre=new jsts.geom.Coordinate();this.centre.x=(env.getMinX()+env.getMaxX())/2;this.centre.y=(env.getMinY()+env.getMaxY())/2};jsts.index.quadtree.Node.prototype=new jsts.index.quadtree.NodeBase();jsts.index.quadtree.Node.createNode=function(env){var key,node;key=new jsts.index.quadtree.Key(env);node=new jsts.index.quadtree.Node(key.getEnvelope(),key.getLevel());return node};jsts.index.quadtree.Node.createExpanded=function(node,addEnv){var expandEnv=new jsts.geom.Envelope(addEnv),largerNode;if(node!==null){expandEnv.expandToInclude(node.env)}largerNode=jsts.index.quadtree.Node.createNode(expandEnv);if(node!==null){largerNode.insertNode(node)}return largerNode};jsts.index.quadtree.Node.prototype.getEnvelope=function(){return this.env};jsts.index.quadtree.Node.prototype.isSearchMatch=function(searchEnv){return this.env.intersects(searchEnv)};jsts.index.quadtree.Node.prototype.getNode=function(searchEnv){var subnodeIndex=this.getSubnodeIndex(searchEnv,this.centre),node;if(subnodeIndex!==-1){node=this.getSubnode(subnodeIndex);return node.getNode(searchEnv)}else{return this}};jsts.index.quadtree.Node.prototype.find=function(searchEnv){var subnodeIndex=this.getSubnodeIndex(searchEnv,this.centre),node;if(subnodeIndex===-1){return this}if(this.subnode[subnodeIndex]!==null){node=this.subnode[subnodeIndex];return node.find(searchEnv)}return this};jsts.index.quadtree.Node.prototype.insertNode=function(node){var index=this.getSubnodeIndex(node.env,this.centre),childNode;if(node.level===this.level-1){this.subnode[index]=node}else{childNode=this.createSubnode(index);childNode.insertNode(node);this.subnode[index]=childNode}};jsts.index.quadtree.Node.prototype.getSubnode=function(index){if(this.subnode[index]===null){this.subnode[index]=this.createSubnode(index)}return this.subnode[index]};jsts.index.quadtree.Node.prototype.createSubnode=function(index){var minx=0.0,maxx=0.0,miny=0.0,maxy=0.0,sqEnv,node;switch(index){case 0:minx=this.env.getMinX();maxx=this.centre.x;miny=this.env.getMinY();maxy=this.centre.y;break;case 1:minx=this.centre.x;maxx=this.env.getMaxX();miny=this.env.getMinY();maxy=this.centre.y;break;case 2:minx=this.env.getMinX();maxx=this.centre.x;miny=this.centre.y;maxy=this.env.getMaxY();break;case 3:minx=this.centre.x;maxx=this.env.getMaxX();miny=this.centre.y;maxy=this.env.getMaxY();break}sqEnv=new jsts.geom.Envelope(minx,maxx,miny,maxy);node=new jsts.index.quadtree.Node(sqEnv,this.level-1);return node};
  69 +jsts.index.quadtree.Quadtree=function(){this.root=new jsts.index.quadtree.Root();this.minExtent=1.0};jsts.index.quadtree.Quadtree.ensureExtent=function(itemEnv,minExtent){var minx,maxx,miny,maxy;minx=itemEnv.getMinX();maxx=itemEnv.getMaxX();miny=itemEnv.getMinY();maxy=itemEnv.getMaxY();if(minx!==maxx&&miny!==maxy){return itemEnv}if(minx===maxx){minx=minx-(minExtent/2.0);maxx=minx+(minExtent/2.0)}if(miny===maxy){miny=miny-(minExtent/2.0);maxy=miny+(minExtent/2.0)}return new jsts.geom.Envelope(minx,maxx,miny,maxy)};jsts.index.quadtree.Quadtree.prototype.depth=function(){return this.root.depth()};jsts.index.quadtree.Quadtree.prototype.size=function(){return this.root.size()};jsts.index.quadtree.Quadtree.prototype.insert=function(itemEnv,item){this.collectStats(itemEnv);var insertEnv=jsts.index.quadtree.Quadtree.ensureExtent(itemEnv,this.minExtent);this.root.insert(insertEnv,item)};jsts.index.quadtree.Quadtree.prototype.remove=function(itemEnv,item){var posEnv=jsts.index.quadtree.Quadtree.ensureExtent(itemEnv,this.minExtent);return this.root.remove(posEnv,item)};jsts.index.quadtree.Quadtree.prototype.query=function(){if(arguments.length===1){return jsts.index.quadtree.Quadtree.prototype.queryByEnvelope.apply(this,arguments)}else{jsts.index.quadtree.Quadtree.prototype.queryWithVisitor.apply(this,arguments)}};jsts.index.quadtree.Quadtree.prototype.queryByEnvelope=function(searchEnv){var visitor=new jsts.index.ArrayListVisitor();this.query(searchEnv,visitor);return visitor.getItems()};jsts.index.quadtree.Quadtree.prototype.queryWithVisitor=function(searchEnv,visitor){this.root.visit(searchEnv,visitor)};jsts.index.quadtree.Quadtree.prototype.queryAll=function(){var foundItems=[];foundItems=this.root.addAllItems(foundItems);return foundItems};jsts.index.quadtree.Quadtree.prototype.collectStats=function(itemEnv){var delX=itemEnv.getWidth();if(delX<this.minExtent&&delX>0.0){this.minExtent=delX}var delY=itemEnv.getHeight();if(delY<this.minExtent&&delY>0.0){this.minExtent=delY}};
  70 +jsts.index.quadtree.Root=function(){jsts.index.quadtree.NodeBase.prototype.constructor.apply(this,arguments);this.origin=new jsts.geom.Coordinate(0.0,0.0)};jsts.index.quadtree.Root.prototype=new jsts.index.quadtree.NodeBase();jsts.index.quadtree.Root.prototype.insert=function(itemEnv,item){var index=this.getSubnodeIndex(itemEnv,this.origin);if(index===-1){this.add(item);return}var node=this.subnode[index];if(node===null||!node.getEnvelope().contains(itemEnv)){var largerNode=jsts.index.quadtree.Node.createExpanded(node,itemEnv);this.subnode[index]=largerNode}this.insertContained(this.subnode[index],itemEnv,item)};jsts.index.quadtree.Root.prototype.insertContained=function(tree,itemEnv,item){var isZeroX,isZeroY,node;isZeroX=jsts.index.IntervalSize.isZeroWidth(itemEnv.getMinX(),itemEnv.getMaxX());isZeroY=jsts.index.IntervalSize.isZeroWidth(itemEnv.getMinY(),itemEnv.getMaxY());if(isZeroX||isZeroY){node=tree.find(itemEnv)}else{node=tree.getNode(itemEnv)}node.add(item)};jsts.index.quadtree.Root.prototype.isSearchMatch=function(searchEnv){return true};
  71 +jsts.io={};
  72 +jsts.io.WKTReader=function(){};jsts.io.WKTReader.prototype.read=function(wkt){var geometry=OpenLayers.Geometry.fromWKT(wkt);if(geometry instanceof jsts.geom.Coordinate){geometry=new jsts.geom.Point(geometry)}if(geometry===undefined){var type=wkt.split(' ')[0].toLowerCase();switch(type){case'point':geometry=new OpenLayers.Geometry.Point();break;case'multipoint':geometry=new OpenLayers.Geometry.MultiPoint();break;case'linestring':geometry=new OpenLayers.Geometry.LineString();break;case'multilinestring':geometry=new OpenLayers.Geometry.MultiLineString();break;case'polygon':geometry=new OpenLayers.Geometry.Polygon();break;case'multipolygon':geometry=new OpenLayers.Geometry.MultiPolygon();break}}return geometry};
  73 +jsts.io.WKTWriter=function(){};jsts.io.WKTWriter.prototype.write=function(geometry){var format=new OpenLayers.Format.WKT();var feature=new OpenLayers.Feature.Vector(geometry);var wkt=format.write(feature);return wkt};
  74 +jsts.operation={};
  75 +jsts.operation.IsSimpleOp=function(geom){this.geom=geom};jsts.operation.IsSimpleOp.prototype.geom=null;jsts.operation.IsSimpleOp.prototype.isClosedEndpointsInInterior=true;jsts.operation.IsSimpleOp.prototype.nonSimpleLocation=null;jsts.operation.IsSimpleOp.prototype.IsSimpleOp=function(geom){this.geom=geom};jsts.operation.IsSimpleOp.prototype.isSimple=function(){this.nonSimpleLocation=null;if(this.geom instanceof jsts.geom.LineString){return this.isSimpleLinearGeometry(this.geom)}if(this.geom instanceof jsts.geom.MultiLineString){return this.isSimpleLinearGeometry(this.geom)}if(this.geom instanceof jsts.geom.MultiPoint){return this.isSimpleMultiPoint(this.geom)}return true};jsts.operation.IsSimpleOp.prototype.isSimpleMultiPoint=function(mp){if(mp.isEmpty())return true;var points=[];for(var i=0;i<mp.getNumGeometries();i++){var pt=mp.getGeometryN(i);var p=pt.getCoordinate();for(var j=0;j<points.length;j++){var point=points[j];if(p.equals2D(point)){this.nonSimpleLocation=p;return false}}points.push(p)}return true};jsts.operation.IsSimpleOp.prototype.isSimpleLinearGeometry=function(geom){if(geom.isEmpty())return true;var graph=new jsts.geomgraph.GeometryGraph(0,geom);var li=new jsts.algorithm.RobustLineIntersector();var si=graph.computeSelfNodes(li,true);if(!si.hasIntersection())return true;if(si.hasProperIntersection()){this.nonSimpleLocation=si.getProperIntersectionPoint();return false}if(this.hasNonEndpointIntersection(graph))return false;if(this.isClosedEndpointsInInterior){if(this.hasClosedEndpointIntersection(graph))return false}return true};jsts.operation.IsSimpleOp.prototype.hasNonEndpointIntersection=function(graph){for(var i=0;i<graph.edges.length;i++){var e=graph.edges[i];var maxSegmentIndex=e.getMaximumSegmentIndex();for(var j=0;j<e.eiList.length;j++){var ei=e.eiList[j];if(!ei.isEndPoint(maxSegmentIndex)){this.nonSimpleLocation=ei.getCoordinate();return true}}}return false};jsts.operation.IsSimpleOp.prototype.hasClosedEndpointIntersection=function(graph){var endPoints=[];for(var i=0;i<graph.edges.length;i++){var e=graph.edges[i];var maxSegmentIndex=e.getMaximumSegmentIndex();var isClosed=e.isClosed();var p0=e.getCoordinate(0);this.addEndpoint(endPoints,p0,isClosed);var p1=e.getCoordinate(e.getNumPoints()-1);this.addEndpoint(endPoints,p1,isClosed)}for(var i=0;i<endPoints.length;i++){var eiInfo=endPoints[i].ei;if(eiInfo.isClosed&&eiInfo.degree!=2){this.nonSimpleLocation=eiInfo.getCoordinate();return true}}return false};jsts.operation.IsSimpleOp.EndpointInfo=function(pt){this.pt=pt;this.isClosed=false;this.degree=0};jsts.operation.IsSimpleOp.EndpointInfo.prototype.pt=null;jsts.operation.IsSimpleOp.EndpointInfo.prototype.isClosed=null;jsts.operation.IsSimpleOp.EndpointInfo.prototype.degree=null;jsts.operation.IsSimpleOp.EndpointInfo.prototype.getCoordinate=function(){return this.pt};jsts.operation.IsSimpleOp.EndpointInfo.prototype.addEndpoint=function(isClosed){this.degree++;this.isClosed=this.isClosed||isClosed};jsts.operation.IsSimpleOp.prototype.addEndpoint=function(endPoints,p,isClosed){var eiInfo=null;for(var i=0;i<endPoints.length;i++){var endPoint=endPoints[i];if(endPoint.p.equals2D(p)){eiInfo=endPoint.ei}}if(eiInfo===null){eiInfo=new jsts.operation.IsSimpleOp.EndpointInfo(p);endPoints.push({p:p,ei:eiInfo})}eiInfo.addEndpoint(isClosed)};
  76 +jsts.operation.buffer={};
  77 +jsts.operation.buffer.BufferBuilder=function(bufParams){this.bufParams=bufParams};jsts.operation.buffer.BufferBuilder.prototype.buffer=function(){throw new jsts.error.NotImplementedError()};
  78 +jsts.operation.buffer.BufferOp=function(g,bufParams){this.argGeom=g;this.bufParams=bufParams?bufParams:new jsts.operation.buffer.BufferParameters()};jsts.operation.buffer.BufferOp.MAX_PRECISION_DIGITS=12;jsts.operation.buffer.BufferOp.precisionScaleFactor=function(g,distance,maxPrecisionDigits){var env=g.getEnvelopeInternal();var envSize=Math.max(env.getHeight(),env.getWidth());var expandByDistance=distance>0.0?distance:0.0;var bufEnvSize=envSize+2*expandByDistance;var bufEnvLog10=(Math.log(bufEnvSize)/Math.log(10)+1.0);var minUnitLog10=bufEnvLog10-maxPrecisionDigits;var scaleFactor=Math.pow(10.0,-minUnitLog10);return scaleFactor};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance){var gBuf=new jsts.operation.buffer.BufferOp(g);var geomBuf=gBuf.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance,params){var bufOp=new jsts.operation.buffer.BufferOp(g,params);var geomBuf=bufOp.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance,quadrantSegments){var bufOp=new jsts.operation.buffer.BufferOp(g);bufOp.setQuadrantSegments(quadrantSegments);var geomBuf=bufOp.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.bufferOp=function(g,distance,quadrantSegments,endCapStyle){var bufOp=new jsts.operation.buffer.BufferOp(g);bufOp.setQuadrantSegments(quadrantSegments);bufOp.setEndCapStyle(endCapStyle);var geomBuf=bufOp.getResultGeometry(distance);return geomBuf};jsts.operation.buffer.BufferOp.prototype.argGeom=null;jsts.operation.buffer.BufferOp.prototype.distance=null;jsts.operation.buffer.BufferOp.prototype.bufParams=null;jsts.operation.buffer.BufferOp.prototype.resultGeometry=null;jsts.operation.buffer.BufferOp.prototype.setEndCapStyle=function(endCapStyle){this.bufParams.setEndCapStyle(endCapStyle)};jsts.operation.buffer.BufferOp.prototype.setQuadrantSegments=function(quadrantSegments){this.bufParams.setQuadrantSegments(quadrantSegments)};jsts.operation.buffer.BufferOp.prototype.getResultGeometry=function(dist){this.distance=dist;this.computeGeometry();return resultGeometry};jsts.operation.buffer.BufferOp.prototype.computeGeometry=function(){this.bufferOriginalPrecision();if(resultGeometry!==null){return}var argPM=argGeom.getPrecisionModel();if(argPM.getType()===PrecisionModel.FIXED){this.bufferFixedPrecision(argPM)}else{this.bufferReducedPrecision()}};jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision=function(){var precDigits;for(precDigits=MAX_PRECISION_DIGITS;precDigits>=0;precDigits--){try{this.bufferReducedPrecision(precDigits)}catch(ex){saveException=ex}if(resultGeometry!==null){return}}throw saveException};jsts.operation.buffer.BufferOp.prototype.bufferOriginalPrecision=function(){var bufBuilder=new jsts.operation.buffer.BufferBuilder(this.bufParams);resultGeometry=bufBuilder.buffer(this.argGeom,this.distance)};jsts.operation.buffer.BufferOp.prototype.bufferReducedPrecision=function(precisionDigits){var sizeBasedScaleFactor=this.precisionScaleFactor(argGeom,distance,precisionDigits);var fixedPM=new jsts.geom.PrecisionModel(sizeBasedScaleFactor);this.bufferFixedPrecision(fixedPM)};jsts.operation.buffer.BufferOp.prototype.bufferFixedPrecision=function(fixedPM){var noder=new ScaledNoder(new MCIndexSnapRounder(new PrecisionModel(1.0)),fixedPM.getScale());var bufBuilder=new jsts.operation.buffer.BufferBuilder(bufParams);bufBuilder.setWorkingPrecisionModel(fixedPM);bufBuilder.setNoder(noder);resultGeometry=bufBuilder.buffer(argGeom,distance)};
  79 +jsts.operation.buffer.BufferParameters=function(){};jsts.operation.buffer.BufferParameters.CAP_ROUND=1;jsts.operation.buffer.BufferParameters.CAP_FLAT=2;jsts.operation.buffer.BufferParameters.CAP_SQUARE=3;jsts.operation.buffer.BufferParameters.JOIN_ROUND=1;jsts.operation.buffer.BufferParameters.JOIN_MITRE=2;jsts.operation.buffer.BufferParameters.OIN_BEVEL=3;jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS=8;jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT=5.0;jsts.operation.buffer.BufferParameters.prototype.quadrantSegments=jsts.operation.buffer.BufferParameters.DEFAULT_QUADRANT_SEGMENTS;jsts.operation.buffer.BufferParameters.prototype.endCapStyle=jsts.operation.buffer.BufferParameters.CAP_ROUND;jsts.operation.buffer.BufferParameters.prototype.joinStyle=jsts.operation.buffer.BufferParameters.JOIN_ROUND;jsts.operation.buffer.BufferParameters.prototype.mitreLimit=jsts.operation.buffer.BufferParameters.DEFAULT_MITRE_LIMIT;jsts.operation.buffer.BufferParameters.prototype.setEndCapStyle=function(endCapStyle){this.endCapStyle=endCapStyle};jsts.operation.buffer.BufferParameters.prototype.setQuadrantSegments=function(quadrantSegments){this.quadrantSegments=quadrantSegments};
  80 +jsts.operation.distance={};
  81 +jsts.operation.distance.ConnectedElementLocationFilter=function(locations){this.locations=locations};jsts.operation.distance.ConnectedElementLocationFilter.prototype=new jsts.geom.GeometryFilter();jsts.operation.distance.ConnectedElementLocationFilter.prototype.locations=null;jsts.operation.distance.ConnectedElementLocationFilter.getLocations=function(geom){var locations=[];geom.apply(new jsts.operation.distance.ConnectedElementLocationFilter(locations));return locations};jsts.operation.distance.ConnectedElementLocationFilter.prototype.filter=function(geom){if(geom instanceof jsts.geom.Point||geom instanceof jsts.geom.LineString||geom instanceof jsts.geom.Polygon)this.locations.push(new jsts.operation.distance.GeometryLocation(geom,0,geom.getCoordinate()))};
  82 +jsts.operation.distance.DistanceOp=function(g0,g1,terminateDistance){this.ptLocator=new jsts.algorithm.PointLocator();this.geom=[];this.geom[0]=g0;this.geom[1]=g1;this.terminateDistance=terminateDistance};jsts.operation.distance.DistanceOp.prototype.geom=null;jsts.operation.distance.DistanceOp.prototype.terminateDistance=0.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(g0,g1){var distOp=new jsts.operation.distance.DistanceOp(g0,g1,0.0);return distOp.distance()};jsts.operation.distance.DistanceOp.isWithinDistance=function(g0,g1,distance){var distOp=new jsts.operation.distance.DistanceOp(g0,g1,distance);return distOp.distance()<=distance};jsts.operation.distance.DistanceOp.nearestPoints=function(g0,g1){var distOp=new jsts.operation.distance.DistanceOp(g0,g1,0.0);return distOp.nearestPoints()};jsts.operation.distance.DistanceOp.prototype.distance=function(){if(this.geom[0]===null||this.geom[1]===null)throw new jsts.error.IllegalArgumentError('null geometries are not supported');if(this.geom[0].isEmpty()||this.geom[1].isEmpty())return 0.0;this.computeMinDistance();return this.minDistance};jsts.operation.distance.DistanceOp.prototype.nearestPoints=function(){this.computeMinDistance();var nearestPts=[this.minDistanceLocation[0].getCoordinate(),this.minDistanceLocation[1].getCoordinate()];return nearestPts};jsts.operation.distance.DistanceOp.prototype.nearestLocations=function(){this.computeMinDistance();return this.minDistanceLocation};jsts.operation.distance.DistanceOp.prototype.updateMinDistance=function(locGeom,flip){if(locGeom[0]===null)return;if(flip){this.minDistanceLocation[0]=locGeom[1];this.minDistanceLocation[1]=locGeom[0]}else{this.minDistanceLocation[0]=locGeom[0];this.minDistanceLocation[1]=locGeom[1]}};jsts.operation.distance.DistanceOp.prototype.computeMinDistance=function(){if(arguments.length>0){this.computeMinDistance2.apply(this,arguments);return}if(this.minDistanceLocation!==null)return;this.minDistanceLocation=[];this.computeContainmentDistance();if(this.minDistance<=this.terminateDistance)return;this.computeFacetDistance()};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance=function(){if(arguments.length===2){this.computeContainmentDistance2.apply(this,arguments);return}else if(arguments.length===3&&(!arguments[0]instanceof jsts.operation.distance.GeometryLocation)){this.computeContainmentDistance3.apply(this,arguments);return}else if(arguments.length===3){this.computeContainmentDistance4.apply(this,arguments);return}var locPtPoly=[];this.computeContainmentDistance2(0,locPtPoly);if(this.minDistance<=this.terminateDistance)return;this.computeContainmentDistance2(1,locPtPoly)};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance2=function(polyGeomIndex,locPtPoly){var locationsIndex=1-polyGeomIndex;var polys=jsts.geom.util.PolygonExtracter.getPolygons(this.geom[polyGeomIndex]);if(polys.length>0){var insideLocs=jsts.operation.distance.ConnectedElementLocationFilter.getLocations(this.geom[locationsIndex]);this.computeContainmentDistance3(insideLocs,polys,locPtPoly);if(this.minDistance<=this.terminateDistance){this.minDistanceLocation[locationsIndex]=locPtPoly[0];this.minDistanceLocation[polyGeomIndex]=locPtPoly[1];return}}};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance3=function(locs,polys,locPtPoly){for(var i=0;i<locs.length;i++){var loc=locs[i];for(var j=0;j<polys.length;j++){this.computeContainmentDistance4(loc,polys[j],locPtPoly);if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeContainmentDistance4=function(ptLoc,poly,locPtPoly){var pt=ptLoc.getCoordinate();if(jsts.geom.Location.EXTERIOR!==this.ptLocator.locate(pt,poly)){this.minDistance=0.0;locPtPoly[0]=ptLoc;locPtPoly[1]=new jsts.operation.distance.GeometryLocation(poly,pt);return}};jsts.operation.distance.DistanceOp.prototype.computeFacetDistance=function(){var locGeom=[];var lines0=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[0]);var lines1=jsts.geom.util.LinearComponentExtracter.getLines(this.geom[1]);var pts0=jsts.geom.util.PointExtracter.getPoints(this.geom[0]);var pts1=jsts.geom.util.PointExtracter.getPoints(this.geom[1]);this.computeMinDistanceLines(lines0,lines1,locGeom);this.updateMinDistance(locGeom,false);if(this.minDistance<=this.terminateDistance)return;locGeom[0]=null;locGeom[1]=null;this.computeMinDistanceLinesPoints(lines0,pts1,locGeom);this.updateMinDistance(locGeom,false);if(this.minDistance<=this.terminateDistance)return;locGeom[0]=null;locGeom[1]=null;this.computeMinDistanceLinesPoints(lines1,pts0,locGeom);this.updateMinDistance(locGeom,true);if(this.minDistance<=this.terminateDistance)return;locGeom[0]=null;locGeom[1]=null;this.computeMinDistancePoints(pts0,pts1,locGeom);this.updateMinDistance(locGeom,false)};jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLines=function(lines0,lines1,locGeom){for(var i=0;i<lines0.length;i++){var line0=lines0[i];for(var j=0;j<lines1.length;j++){var line1=lines1[j];this.computeMinDistance(line0,line1,locGeom);if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistancePoints=function(points0,points1,locGeom){for(var i=0;i<points0.length;i++){var pt0=points0[i];for(var j=0;j<points1.length;j++){var pt1=points1[j];var dist=pt0.getCoordinate().distance(pt1.getCoordinate());if(dist<this.minDistance){this.minDistance=dist;locGeom[0]=new jsts.operation.distance.GeometryLocation(pt0,0,pt0.getCoordinate());locGeom[1]=new jsts.operation.distance.GeometryLocation(pt1,0,pt1.getCoordinate())}if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistanceLinesPoints=function(lines,points,locGeom){for(var i=0;i<lines.length;i++){var line=lines[i];for(var j=0;j<points.length;j++){var pt=points[j];this.computeMinDistance(line,pt,locGeom);if(this.minDistance<=this.terminateDistance)return}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistance2=function(line0,line1,locGeom){if(line1 instanceof jsts.geom.Point){this.computeMinDistance3(line0,line1,locGeom);return}if(line0.getEnvelopeInternal().distance(line1.getEnvelopeInternal())>this.minDistance){return}var coord0=line0.getCoordinates();var coord1=line1.getCoordinates();for(var i=0;i<coord0.length-1;i++){for(var j=0;j<coord1.length-1;j++){var dist=jsts.algorithm.CGAlgorithms.distanceLineLine(coord0[i],coord0[i+1],coord1[j],coord1[j+1]);if(dist<this.minDistance){this.minDistance=dist;var seg0=new jsts.geom.LineSegment(coord0[i],coord0[i+1]);var seg1=new jsts.geom.LineSegment(coord1[j],coord1[j+1]);var closestPt=seg0.closestPoints(seg1);locGeom[0]=new jsts.operation.distance.GeometryLocation(line0,i,closestPt[0]);locGeom[1]=new jsts.operation.distance.GeometryLocation(line1,j,closestPt[1])}if(this.minDistance<=this.terminateDistance){return}}}};jsts.operation.distance.DistanceOp.prototype.computeMinDistance3=function(line,pt,locGeom){if(line.getEnvelopeInternal().distance(pt.getEnvelopeInternal())>this.minDistance){return}var coord0=line.getCoordinates();var coord=pt.getCoordinate();for(var i=0;i<coord0.length-1;i++){var dist=jsts.algorithm.CGAlgorithms.distancePointLine(coord,coord0[i],coord0[i+1]);if(dist<this.minDistance){this.minDistance=dist;var seg=new jsts.geom.LineSegment(coord0[i],coord0[i+1]);var segClosestPoint=seg.closestPoint(coord);locGeom[0]=new jsts.operation.distance.GeometryLocation(line,i,segClosestPoint);locGeom[1]=new jsts.operation.distance.GeometryLocation(pt,0,coord)}if(this.minDistance<=this.terminateDistance){return}}};
  83 +jsts.operation.distance.GeometryLocation=function(component,segIndex,pt){this.component=component;this.segIndex=segIndex;this.pt=pt};jsts.operation.distance.GeometryLocation.INSIDE_AREA=-1;jsts.operation.distance.GeometryLocation.prototype.component=null;jsts.operation.distance.GeometryLocation.prototype.segIndex=null;jsts.operation.distance.GeometryLocation.prototype.pt=null;jsts.operation.distance.GeometryLocation.prototype.getGeometryComponent=function(){return this.component};jsts.operation.distance.GeometryLocation.prototype.getSegmentIndex=function(){return this.segIndex};jsts.operation.distance.GeometryLocation.prototype.getCoordinate=function(){return this.pt};jsts.operation.distance.GeometryLocation.prototype.isInsideArea=function(){return this.segIndex===jsts.operation.distance.GeometryLocation.INSIDE_AREA};
... ...
pacotes/jsts/tempjs/temp.js
1   -jsts.geomgraph.index.SimpleMCSweepLineIntersector=function(){};jsts.geomgraph.index.SimpleMCSweepLineIntersector.prototype=new jsts.geomgraph.index.EdgeSetIntersector();
2 1 \ No newline at end of file
  2 +jsts.operation.distance.GeometryLocation=function(component,segIndex,pt){this.component=component;this.segIndex=segIndex;this.pt=pt};jsts.operation.distance.GeometryLocation.INSIDE_AREA=-1;jsts.operation.distance.GeometryLocation.prototype.component=null;jsts.operation.distance.GeometryLocation.prototype.segIndex=null;jsts.operation.distance.GeometryLocation.prototype.pt=null;jsts.operation.distance.GeometryLocation.prototype.getGeometryComponent=function(){return this.component};jsts.operation.distance.GeometryLocation.prototype.getSegmentIndex=function(){return this.segIndex};jsts.operation.distance.GeometryLocation.prototype.getCoordinate=function(){return this.pt};jsts.operation.distance.GeometryLocation.prototype.isInsideArea=function(){return this.segIndex===jsts.operation.distance.GeometryLocation.INSIDE_AREA};
3 3 \ No newline at end of file
... ...