jsts-rails 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +8 -8
  2. data/lib/jsts-rails/version.rb +1 -1
  3. data/vendor/assets/javascripts/javascript.util.js +33 -1
  4. data/vendor/assets/javascripts/jsts-original.js +164 -1573
  5. data/vendor/assets/javascripts/jsts.js +197 -0
  6. data/vendor/assets/javascripts/jsts/algorithm/Angle.js +387 -0
  7. data/vendor/assets/javascripts/jsts/algorithm/BoundaryNodeRule.js +67 -0
  8. data/vendor/assets/javascripts/jsts/algorithm/CGAlgorithms.js +596 -0
  9. data/vendor/assets/javascripts/jsts/algorithm/CentralEndpointIntersector.js +118 -0
  10. data/vendor/assets/javascripts/jsts/algorithm/CentroidArea.js +225 -0
  11. data/vendor/assets/javascripts/jsts/algorithm/CentroidLine.js +85 -0
  12. data/vendor/assets/javascripts/jsts/algorithm/CentroidPoint.js +77 -0
  13. data/vendor/assets/javascripts/jsts/algorithm/ConvexHull.js +409 -0
  14. data/vendor/assets/javascripts/jsts/algorithm/HCoordinate.js +234 -0
  15. data/vendor/assets/javascripts/jsts/algorithm/LineIntersector.js +502 -0
  16. data/vendor/assets/javascripts/jsts/algorithm/MCPointInRing.js +124 -0
  17. data/vendor/assets/javascripts/jsts/algorithm/PointLocator.js +247 -0
  18. data/vendor/assets/javascripts/jsts/algorithm/RayCrossingCounter.js +215 -0
  19. data/vendor/assets/javascripts/jsts/algorithm/RobustDeterminant.js +353 -0
  20. data/vendor/assets/javascripts/jsts/algorithm/RobustLineIntersector.js +477 -0
  21. data/vendor/assets/javascripts/jsts/algorithm/distance/DiscreteHausdorffDistance.js +228 -0
  22. data/vendor/assets/javascripts/jsts/algorithm/distance/DistanceToPoint.js +68 -0
  23. data/vendor/assets/javascripts/jsts/algorithm/distance/PointPairDistance.js +104 -0
  24. data/vendor/assets/javascripts/jsts/algorithm/locate/PointOnGeometryLocator.js +7 -0
  25. data/vendor/assets/javascripts/jsts/algorithm/locate/SimplePointInAreaLocator.js +102 -0
  26. data/vendor/assets/javascripts/jsts/geom/Coordinate.js +158 -0
  27. data/vendor/assets/javascripts/jsts/geom/CoordinateArrays.js +148 -0
  28. data/vendor/assets/javascripts/jsts/geom/CoordinateFilter.js +29 -0
  29. data/vendor/assets/javascripts/jsts/geom/CoordinateList.js +157 -0
  30. data/vendor/assets/javascripts/jsts/geom/CoordinateSequenceFilter.js +63 -0
  31. data/vendor/assets/javascripts/jsts/geom/Dimension.js +137 -0
  32. data/vendor/assets/javascripts/jsts/geom/Envelope.js +833 -0
  33. data/vendor/assets/javascripts/jsts/geom/Geometry.js +1535 -0
  34. data/vendor/assets/javascripts/jsts/geom/GeometryCollection.js +230 -0
  35. data/vendor/assets/javascripts/jsts/geom/GeometryComponentFilter.js +36 -0
  36. data/vendor/assets/javascripts/jsts/geom/GeometryFactory.js +263 -0
  37. data/vendor/assets/javascripts/jsts/geom/GeometryFilter.js +29 -0
  38. data/vendor/assets/javascripts/jsts/geom/IntersectionMatrix.js +650 -0
  39. data/vendor/assets/javascripts/jsts/geom/LineSegment.js +275 -0
  40. data/vendor/assets/javascripts/jsts/geom/LineString.js +299 -0
  41. data/vendor/assets/javascripts/jsts/geom/LinearRing.js +69 -0
  42. data/vendor/assets/javascripts/jsts/geom/Location.js +83 -0
  43. data/vendor/assets/javascripts/jsts/geom/MultiLineString.js +47 -0
  44. data/vendor/assets/javascripts/jsts/geom/MultiPoint.js +64 -0
  45. data/vendor/assets/javascripts/jsts/geom/MultiPolygon.js +64 -0
  46. data/vendor/assets/javascripts/jsts/geom/Point.js +197 -0
  47. data/vendor/assets/javascripts/jsts/geom/Polygon.js +263 -0
  48. data/vendor/assets/javascripts/jsts/geom/PrecisionModel.js +187 -0
  49. data/vendor/assets/javascripts/jsts/geom/Triangle.js +313 -0
  50. data/vendor/assets/javascripts/jsts/geom/util/GeometryCombiner.js +143 -0
  51. data/vendor/assets/javascripts/jsts/geom/util/GeometryExtracter.js +76 -0
  52. data/vendor/assets/javascripts/jsts/geom/util/GeometryTransformer.js +295 -0
  53. data/vendor/assets/javascripts/jsts/geom/util/LinearComponentExtracter.js +207 -0
  54. data/vendor/assets/javascripts/jsts/geom/util/PointExtracter.js +67 -0
  55. data/vendor/assets/javascripts/jsts/geom/util/PolygonExtracter.js +71 -0
  56. data/vendor/assets/javascripts/jsts/geomgraph/Depth.js +145 -0
  57. data/vendor/assets/javascripts/jsts/geomgraph/DirectedEdge.js +270 -0
  58. data/vendor/assets/javascripts/jsts/geomgraph/DirectedEdgeStar.js +388 -0
  59. data/vendor/assets/javascripts/jsts/geomgraph/Edge.js +291 -0
  60. data/vendor/assets/javascripts/jsts/geomgraph/EdgeEnd.js +188 -0
  61. data/vendor/assets/javascripts/jsts/geomgraph/EdgeEndStar.js +322 -0
  62. data/vendor/assets/javascripts/jsts/geomgraph/EdgeIntersection.js +122 -0
  63. data/vendor/assets/javascripts/jsts/geomgraph/EdgeIntersectionList.js +146 -0
  64. data/vendor/assets/javascripts/jsts/geomgraph/EdgeList.js +111 -0
  65. data/vendor/assets/javascripts/jsts/geomgraph/EdgeNodingValidator.js +76 -0
  66. data/vendor/assets/javascripts/jsts/geomgraph/EdgeRing.js +230 -0
  67. data/vendor/assets/javascripts/jsts/geomgraph/GeometryGraph.js +469 -0
  68. data/vendor/assets/javascripts/jsts/geomgraph/GraphComponent.js +181 -0
  69. data/vendor/assets/javascripts/jsts/geomgraph/Label.js +316 -0
  70. data/vendor/assets/javascripts/jsts/geomgraph/Node.js +105 -0
  71. data/vendor/assets/javascripts/jsts/geomgraph/NodeFactory.js +22 -0
  72. data/vendor/assets/javascripts/jsts/geomgraph/NodeMap.js +128 -0
  73. data/vendor/assets/javascripts/jsts/geomgraph/PlanarGraph.js +214 -0
  74. data/vendor/assets/javascripts/jsts/geomgraph/Position.js +63 -0
  75. data/vendor/assets/javascripts/jsts/geomgraph/Quadrant.js +143 -0
  76. data/vendor/assets/javascripts/jsts/geomgraph/TopologyLocation.js +251 -0
  77. data/vendor/assets/javascripts/jsts/geomgraph/index/EdgeSetIntersector.js +47 -0
  78. data/vendor/assets/javascripts/jsts/geomgraph/index/SegmentIntersector.js +298 -0
  79. data/vendor/assets/javascripts/jsts/geomgraph/index/SimpleEdgeSetIntersector.js +107 -0
  80. data/vendor/assets/javascripts/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js +29 -0
  81. data/vendor/assets/javascripts/jsts/index/ArrayListVisitor.js +37 -0
  82. data/vendor/assets/javascripts/jsts/index/DoubleBits.js +132 -0
  83. data/vendor/assets/javascripts/jsts/index/IntervalSize.js +55 -0
  84. data/vendor/assets/javascripts/jsts/index/ItemVisitor.js +23 -0
  85. data/vendor/assets/javascripts/jsts/index/SpatialIndex.js +67 -0
  86. data/vendor/assets/javascripts/jsts/index/bintree/Bintree.js +224 -0
  87. data/vendor/assets/javascripts/jsts/index/bintree/Interval.js +160 -0
  88. data/vendor/assets/javascripts/jsts/index/bintree/Key.js +110 -0
  89. data/vendor/assets/javascripts/jsts/index/bintree/Node.js +204 -0
  90. data/vendor/assets/javascripts/jsts/index/bintree/NodeBase.js +220 -0
  91. data/vendor/assets/javascripts/jsts/index/bintree/Root.js +113 -0
  92. data/vendor/assets/javascripts/jsts/index/chain/MonotoneChain.js +244 -0
  93. data/vendor/assets/javascripts/jsts/index/chain/MonotoneChainBuilder.js +106 -0
  94. data/vendor/assets/javascripts/jsts/index/chain/MonotoneChainOverlapAction.js +56 -0
  95. data/vendor/assets/javascripts/jsts/index/chain/MonotoneChainSelectAction.js +44 -0
  96. data/vendor/assets/javascripts/jsts/index/kdtree/KdNode.js +171 -0
  97. data/vendor/assets/javascripts/jsts/index/kdtree/KdTree.js +218 -0
  98. data/vendor/assets/javascripts/jsts/index/quadtree/Key.js +134 -0
  99. data/vendor/assets/javascripts/jsts/index/quadtree/Node.js +220 -0
  100. data/vendor/assets/javascripts/jsts/index/quadtree/NodeBase.js +330 -0
  101. data/vendor/assets/javascripts/jsts/index/quadtree/Quadtree.js +228 -0
  102. data/vendor/assets/javascripts/jsts/index/quadtree/Root.js +105 -0
  103. data/vendor/assets/javascripts/jsts/index/strtree/AbstractNode.js +107 -0
  104. data/vendor/assets/javascripts/jsts/index/strtree/AbstractSTRtree.js +594 -0
  105. data/vendor/assets/javascripts/jsts/index/strtree/Boundable.js +37 -0
  106. data/vendor/assets/javascripts/jsts/index/strtree/BoundablePair.js +0 -0
  107. data/vendor/assets/javascripts/jsts/index/strtree/Interval.js +94 -0
  108. data/vendor/assets/javascripts/jsts/index/strtree/ItemBoundable.js +60 -0
  109. data/vendor/assets/javascripts/jsts/index/strtree/SIRtree.js +122 -0
  110. data/vendor/assets/javascripts/jsts/index/strtree/STRtree.js +450 -0
  111. data/vendor/assets/javascripts/jsts/io/GeoJSONParser.js +471 -0
  112. data/vendor/assets/javascripts/jsts/io/GeoJSONReader.js +58 -0
  113. data/vendor/assets/javascripts/jsts/io/GeoJSONWriter.js +38 -0
  114. data/vendor/assets/javascripts/jsts/io/OpenLayersParser.js +245 -0
  115. data/vendor/assets/javascripts/jsts/io/WKTParser.js +421 -0
  116. data/vendor/assets/javascripts/jsts/io/WKTReader.js +68 -0
  117. data/vendor/assets/javascripts/jsts/io/WKTWriter.js +61 -0
  118. data/vendor/assets/javascripts/jsts/noding/BasicSegmentString.js +87 -0
  119. data/vendor/assets/javascripts/jsts/noding/FastNodingValidator.js +127 -0
  120. data/vendor/assets/javascripts/jsts/noding/InteriorIntersectionFinder.js +171 -0
  121. data/vendor/assets/javascripts/jsts/noding/IntersectionAdder.js +198 -0
  122. data/vendor/assets/javascripts/jsts/noding/IntersectionFinderAdder.js +79 -0
  123. data/vendor/assets/javascripts/jsts/noding/MCIndexNoder.js +147 -0
  124. data/vendor/assets/javascripts/jsts/noding/NodableSegmentString.js +35 -0
  125. data/vendor/assets/javascripts/jsts/noding/NodedSegmentString.js +235 -0
  126. data/vendor/assets/javascripts/jsts/noding/Noder.js +41 -0
  127. data/vendor/assets/javascripts/jsts/noding/NodingValidator.js +5 -0
  128. data/vendor/assets/javascripts/jsts/noding/Octant.js +84 -0
  129. data/vendor/assets/javascripts/jsts/noding/OrientedCoordinateArray.js +94 -0
  130. data/vendor/assets/javascripts/jsts/noding/ScaledNoder.js +105 -0
  131. data/vendor/assets/javascripts/jsts/noding/SegmentIntersector.js +45 -0
  132. data/vendor/assets/javascripts/jsts/noding/SegmentNode.js +70 -0
  133. data/vendor/assets/javascripts/jsts/noding/SegmentNodeList.js +262 -0
  134. data/vendor/assets/javascripts/jsts/noding/SegmentPointComparator.js +78 -0
  135. data/vendor/assets/javascripts/jsts/noding/SegmentString.js +61 -0
  136. data/vendor/assets/javascripts/jsts/noding/SinglePassNoder.js +51 -0
  137. data/vendor/assets/javascripts/jsts/noding/snapround/HotPixel.js +271 -0
  138. data/vendor/assets/javascripts/jsts/noding/snapround/MCIndexPointSnapper.js +96 -0
  139. data/vendor/assets/javascripts/jsts/noding/snapround/MCIndexSnapRounder.js +147 -0
  140. data/vendor/assets/javascripts/jsts/operation/BoundaryOp.js +166 -0
  141. data/vendor/assets/javascripts/jsts/operation/GeometryGraphOperation.js +90 -0
  142. data/vendor/assets/javascripts/jsts/operation/IsSimpleOp.js +293 -0
  143. data/vendor/assets/javascripts/jsts/operation/buffer/BufferBuilder.js +317 -0
  144. data/vendor/assets/javascripts/jsts/operation/buffer/BufferInputLineSimplifier.js +294 -0
  145. data/vendor/assets/javascripts/jsts/operation/buffer/BufferOp.js +340 -0
  146. data/vendor/assets/javascripts/jsts/operation/buffer/BufferParameters.js +328 -0
  147. data/vendor/assets/javascripts/jsts/operation/buffer/BufferSubgraph.js +296 -0
  148. data/vendor/assets/javascripts/jsts/operation/buffer/OffsetCurveBuilder.js +369 -0
  149. data/vendor/assets/javascripts/jsts/operation/buffer/OffsetCurveSetBuilder.js +301 -0
  150. data/vendor/assets/javascripts/jsts/operation/buffer/OffsetSegmentGenerator.js +777 -0
  151. data/vendor/assets/javascripts/jsts/operation/buffer/OffsetSegmentString.js +109 -0
  152. data/vendor/assets/javascripts/jsts/operation/buffer/RightmostEdgeFinder.js +164 -0
  153. data/vendor/assets/javascripts/jsts/operation/buffer/SubgraphDepthLocater.js +220 -0
  154. data/vendor/assets/javascripts/jsts/operation/distance/ConnectedElementLocationFilter.js +67 -0
  155. data/vendor/assets/javascripts/jsts/operation/distance/DistanceOp.js +506 -0
  156. data/vendor/assets/javascripts/jsts/operation/distance/GeometryLocation.js +102 -0
  157. data/vendor/assets/javascripts/jsts/operation/overlay/LineBuilder.js +194 -0
  158. data/vendor/assets/javascripts/jsts/operation/overlay/MaximalEdgeRing.js +72 -0
  159. data/vendor/assets/javascripts/jsts/operation/overlay/MinimalEdgeRing.js +33 -0
  160. data/vendor/assets/javascripts/jsts/operation/overlay/OverlayNodeFactory.js +26 -0
  161. data/vendor/assets/javascripts/jsts/operation/overlay/OverlayOp.js +584 -0
  162. data/vendor/assets/javascripts/jsts/operation/overlay/PointBuilder.js +103 -0
  163. data/vendor/assets/javascripts/jsts/operation/overlay/PolygonBuilder.js +282 -0
  164. data/vendor/assets/javascripts/jsts/operation/overlay/snap/GeometrySnapper.js +228 -0
  165. data/vendor/assets/javascripts/jsts/operation/overlay/snap/LineStringSnapper.js +228 -0
  166. data/vendor/assets/javascripts/jsts/operation/overlay/snap/SnapIfNeededOverlayOp.js +85 -0
  167. data/vendor/assets/javascripts/jsts/operation/overlay/snap/SnapOverlayOp.js +134 -0
  168. data/vendor/assets/javascripts/jsts/operation/polygonize/EdgeRing.js +259 -0
  169. data/vendor/assets/javascripts/jsts/operation/polygonize/PolygonizeDirectedEdge.js +94 -0
  170. data/vendor/assets/javascripts/jsts/operation/polygonize/PolygonizeEdge.js +31 -0
  171. data/vendor/assets/javascripts/jsts/operation/polygonize/PolygonizeGraph.js +507 -0
  172. data/vendor/assets/javascripts/jsts/operation/polygonize/Polygonizer.js +259 -0
  173. data/vendor/assets/javascripts/jsts/operation/relate/EdgeEndBuilder.js +140 -0
  174. data/vendor/assets/javascripts/jsts/operation/relate/EdgeEndBundle.js +183 -0
  175. data/vendor/assets/javascripts/jsts/operation/relate/EdgeEndBundleStar.js +48 -0
  176. data/vendor/assets/javascripts/jsts/operation/relate/RelateComputer.js +444 -0
  177. data/vendor/assets/javascripts/jsts/operation/relate/RelateNode.js +46 -0
  178. data/vendor/assets/javascripts/jsts/operation/relate/RelateNodeFactory.js +25 -0
  179. data/vendor/assets/javascripts/jsts/operation/relate/RelateNodeGraph.js +118 -0
  180. data/vendor/assets/javascripts/jsts/operation/relate/RelateOp.js +75 -0
  181. data/vendor/assets/javascripts/jsts/operation/union/CascadedPolygonUnion.js +319 -0
  182. data/vendor/assets/javascripts/jsts/operation/union/PointGeometryUnion.js +118 -0
  183. data/vendor/assets/javascripts/jsts/operation/union/UnaryUnionOp.js +244 -0
  184. data/vendor/assets/javascripts/jsts/operation/union/UnionInteracting.js +156 -0
  185. data/vendor/assets/javascripts/jsts/operation/valid/ConnectedInteriorTester.js +259 -0
  186. data/vendor/assets/javascripts/jsts/operation/valid/ConsistentAreaTester.js +127 -0
  187. data/vendor/assets/javascripts/jsts/operation/valid/IndexedNestedRingTester.js +89 -0
  188. data/vendor/assets/javascripts/jsts/operation/valid/IsValidOp.js +619 -0
  189. data/vendor/assets/javascripts/jsts/operation/valid/TopologyValidationError.js +199 -0
  190. data/vendor/assets/javascripts/jsts/planargraph/DirectedEdge.js +232 -0
  191. data/vendor/assets/javascripts/jsts/planargraph/DirectedEdgeStar.js +168 -0
  192. data/vendor/assets/javascripts/jsts/planargraph/Edge.js +124 -0
  193. data/vendor/assets/javascripts/jsts/planargraph/GraphComponent.js +182 -0
  194. data/vendor/assets/javascripts/jsts/planargraph/Node.js +127 -0
  195. data/vendor/assets/javascripts/jsts/planargraph/NodeMap.js +76 -0
  196. data/vendor/assets/javascripts/jsts/planargraph/PlanarGraph.js +246 -0
  197. data/vendor/assets/javascripts/jsts/simplify/LineSegmentIndex.js +101 -0
  198. data/vendor/assets/javascripts/jsts/triangulate/DelaunayTriangulationBuilder.js +224 -0
  199. data/vendor/assets/javascripts/jsts/triangulate/IncrementalDelaunayTriangulator.js +111 -0
  200. data/vendor/assets/javascripts/jsts/triangulate/VoronoiDiagramBuilder.js +172 -0
  201. data/vendor/assets/javascripts/jsts/triangulate/quadedge/LastFoundQuadEdgeLocator.js +52 -0
  202. data/vendor/assets/javascripts/jsts/triangulate/quadedge/QuadEdge.js +437 -0
  203. data/vendor/assets/javascripts/jsts/triangulate/quadedge/QuadEdgeSubdivision.js +1064 -0
  204. data/vendor/assets/javascripts/jsts/triangulate/quadedge/TrianglePredicate.js +350 -0
  205. data/vendor/assets/javascripts/jsts/triangulate/quadedge/Vertex.js +496 -0
  206. data/vendor/assets/javascripts/jsts/util/Assert.js +80 -0
  207. data/vendor/assets/javascripts/jsts/util/AssertionFailedException.js +23 -0
  208. data/vendor/assets/javascripts/jsts/util/UniqueCoordinateArrayFilter.js +52 -0
  209. metadata +204 -1
@@ -1,2 +1,199 @@
1
1
  //= require javascript.util
2
2
  //= require jsts-original
3
+ //= require jsts/util/AssertionFailedException
4
+ //= require jsts/util/Assert
5
+ //= require jsts/geom/CoordinateArrays
6
+ //= require jsts/geom/CoordinateFilter
7
+ //= require jsts/util/UniqueCoordinateArrayFilter
8
+ //= require jsts/geom/CoordinateList
9
+ //= require jsts/geom/Dimension
10
+ //= require jsts/geom/Location
11
+ //= require jsts/geom/Geometry
12
+ //= require jsts/geom/GeometryCollection
13
+ //= require jsts/geom/GeometryFilter
14
+ //= require jsts/geom/GeometryComponentFilter
15
+ //= require jsts/geom/IntersectionMatrix
16
+ //= require jsts/geom/Coordinate
17
+ //= require jsts/geom/Envelope
18
+ //= require jsts/geom/GeometryFactory
19
+ //= require jsts/geom/LineString
20
+ //= require jsts/geom/MultiLineString
21
+ //= require jsts/geom/LinearRing
22
+ //= require jsts/geom/LineSegment
23
+ //= require jsts/geom/Point
24
+ //= require jsts/geom/MultiPoint
25
+ //= require jsts/geom/Polygon
26
+ //= require jsts/geom/MultiPolygon
27
+ //= require jsts/geom/PrecisionModel
28
+ //= require jsts/geom/Triangle
29
+ //= require jsts/geom/util/GeometryCombiner
30
+ //= require jsts/geom/util/GeometryExtracter
31
+ //= require jsts/geom/util/GeometryTransformer
32
+ //= require jsts/geom/util/LinearComponentExtracter
33
+ //= require jsts/geom/util/PointExtracter
34
+ //= require jsts/geom/util/PolygonExtracter
35
+ //= require jsts/algorithm/BoundaryNodeRule
36
+ //= require jsts/algorithm/CentralEndpointIntersector
37
+ //= require jsts/algorithm/CentroidArea
38
+ //= require jsts/algorithm/CentroidLine
39
+ //= require jsts/algorithm/CentroidPoint
40
+ //= require jsts/algorithm/CGAlgorithms
41
+ //= require jsts/algorithm/ConvexHull
42
+ //= require jsts/algorithm/HCoordinate
43
+ //= require jsts/algorithm/LineIntersector
44
+ //= require jsts/algorithm/PointLocator
45
+ //= require jsts/algorithm/RayCrossingCounter
46
+ //= require jsts/algorithm/RobustDeterminant
47
+ //= require jsts/algorithm/RobustLineIntersector
48
+ //= require jsts/algorithm/locate/SimplePointInAreaLocator
49
+ //= require jsts/planargraph/GraphComponent
50
+ //= require jsts/planargraph/Edge
51
+ //= require jsts/planargraph/DirectedEdge
52
+ //= require jsts/planargraph/DirectedEdgeStar
53
+ //= require jsts/planargraph/Node
54
+ //= require jsts/planargraph/NodeMap
55
+ //= require jsts/planargraph/PlanarGraph
56
+ //= require jsts/index/ArrayListVisitor
57
+ //= require jsts/index/DoubleBits
58
+ //= require jsts/index/IntervalSize
59
+ //= require jsts/index/ItemVisitor
60
+ //= require jsts/index/SpatialIndex
61
+ //= require jsts/index/chain/MonotoneChain
62
+ //= require jsts/index/chain/MonotoneChainBuilder
63
+ //= require jsts/index/chain/MonotoneChainOverlapAction
64
+ //= require jsts/index/chain/MonotoneChainSelectAction
65
+
66
+ // This file is included here because MCPointInRing.MCSelected requires MonotoneChainSelectAction
67
+ //= require jsts/algorithm/MCPointInRing
68
+
69
+ //= require jsts/index/kdtree/KdNode
70
+ //= require jsts/index/kdtree/KdTree
71
+ //= require jsts/index/quadtree/Key
72
+ //= require jsts/index/quadtree/NodeBase
73
+ //= require jsts/index/quadtree/Node
74
+ //= require jsts/index/quadtree/Quadtree
75
+ //= require jsts/index/quadtree/Root
76
+ //= require jsts/index/strtree/Boundable
77
+ //= require jsts/index/strtree/AbstractNode
78
+ //= require jsts/index/strtree/AbstractSTRtree
79
+ //= require jsts/index/strtree/Interval
80
+ //= require jsts/index/strtree/ItemBoundable
81
+ //= require jsts/index/strtree/SIRtree
82
+ //= require jsts/index/strtree/STRtree
83
+ //= require jsts/index/bintree/Interval
84
+ //= require jsts/index/bintree/NodeBase
85
+ //= require jsts/index/bintree/Key
86
+ //= require jsts/index/bintree/Node
87
+ //= require jsts/index/bintree/Root
88
+ //= require jsts/index/bintree/Bintree
89
+ //= require jsts/noding/SegmentIntersector
90
+ //= require jsts/noding/InteriorIntersectionFinder
91
+ //= require jsts/noding/IntersectionAdder
92
+ //= require jsts/noding/IntersectionFinderAdder
93
+ //= require jsts/noding/SegmentString
94
+ //= require jsts/noding/BasicSegmentString
95
+ //= require jsts/noding/NodableSegmentString
96
+ //= require jsts/noding/NodedSegmentString
97
+ //= require jsts/noding/Noder
98
+ //= require jsts/noding/NodingValidator
99
+ //= require jsts/noding/SinglePassNoder
100
+ //= require jsts/noding/MCIndexNoder
101
+ //= require jsts/noding/FastNodingValidator
102
+ //= require jsts/noding/Octant
103
+ //= require jsts/noding/OrientedCoordinateArray
104
+ //= require jsts/noding/ScaledNoder
105
+ //= require jsts/noding/SegmentNode
106
+ //= require jsts/noding/SegmentNodeList
107
+ //= require jsts/noding/SegmentPointComparator
108
+ //= require jsts/noding/snapround/HotPixel
109
+ //= require jsts/noding/snapround/MCIndexPointSnapper
110
+ //= require jsts/noding/snapround/MCIndexSnapRounder
111
+ //= require jsts/geomgraph/Position
112
+ //= require jsts/geomgraph/Depth
113
+ //= require jsts/geomgraph/GraphComponent
114
+ //= require jsts/geomgraph/Node
115
+ //= require jsts/geomgraph/NodeFactory
116
+ //= require jsts/geomgraph/NodeMap
117
+ //= require jsts/geomgraph/Edge
118
+ //= require jsts/geomgraph/EdgeEnd
119
+ //= require jsts/geomgraph/DirectedEdge
120
+ //= require jsts/geomgraph/EdgeEndStar
121
+ //= require jsts/geomgraph/DirectedEdgeStar
122
+ //= require jsts/geomgraph/EdgeRing
123
+ //= require jsts/geomgraph/EdgeIntersection
124
+ //= require jsts/geomgraph/EdgeIntersectionList
125
+ //= require jsts/geomgraph/EdgeList
126
+ //= require jsts/geomgraph/EdgeNodingValidator
127
+ //= require jsts/geomgraph/PlanarGraph
128
+ //= require jsts/geomgraph/GeometryGraph
129
+ //= require jsts/geomgraph/Label
130
+ //= require jsts/geomgraph/Quadrant
131
+ //= require jsts/geomgraph/TopologyLocation
132
+ //= require jsts/geomgraph/index/EdgeSetIntersector
133
+ //= require jsts/geomgraph/index/SegmentIntersector
134
+ //= require jsts/geomgraph/index/SimpleEdgeSetIntersector
135
+ //= require jsts/geomgraph/index/SimpleMCSweepLineIntersector
136
+ //= require jsts/io/OpenLayersParser
137
+ //= require jsts/io/WKTParser
138
+ //= require jsts/io/WKTReader
139
+ //= require jsts/io/WKTWriter
140
+ //= require jsts/operation/BoundaryOp
141
+ //= require jsts/operation/GeometryGraphOperation
142
+ //= require jsts/operation/IsSimpleOp
143
+ //= require jsts/operation/buffer/BufferBuilder
144
+ //= require jsts/operation/buffer/BufferInputLineSimplifier
145
+ //= require jsts/operation/buffer/BufferOp
146
+ //= require jsts/operation/buffer/BufferParameters
147
+ //= require jsts/operation/buffer/BufferSubgraph
148
+ //= require jsts/operation/buffer/OffsetCurveBuilder
149
+ //= require jsts/operation/buffer/OffsetCurveSetBuilder
150
+ //= require jsts/operation/buffer/OffsetSegmentGenerator
151
+ //= require jsts/operation/buffer/OffsetSegmentString
152
+ //= require jsts/operation/buffer/RightmostEdgeFinder
153
+ //= require jsts/operation/buffer/SubgraphDepthLocater
154
+ //= require jsts/operation/distance/ConnectedElementLocationFilter
155
+ //= require jsts/operation/distance/DistanceOp
156
+ //= require jsts/operation/distance/GeometryLocation
157
+ //= require jsts/operation/overlay/LineBuilder
158
+ //= require jsts/operation/overlay/OverlayNodeFactory
159
+ //= require jsts/operation/overlay/PolygonBuilder
160
+ //= require jsts/operation/overlay/MaximalEdgeRing
161
+ //= require jsts/operation/overlay/MinimalEdgeRing
162
+ //= require jsts/operation/overlay/LineBuilder
163
+ //= require jsts/operation/overlay/PointBuilder
164
+ //= require jsts/operation/overlay/OverlayOp
165
+ //= require jsts/operation/overlay/snap/LineStringSnapper
166
+ //= require jsts/operation/overlay/snap/GeometrySnapper
167
+ //= require jsts/operation/overlay/snap/SnapOverlayOp
168
+ //= require jsts/operation/overlay/snap/SnapIfNeededOverlayOp
169
+ //= require jsts/operation/polygonize/EdgeRing
170
+ //= require jsts/operation/polygonize/PolygonizeDirectedEdge
171
+ //= require jsts/operation/polygonize/PolygonizeEdge
172
+ //= require jsts/operation/polygonize/PolygonizeGraph
173
+ //= require jsts/operation/polygonize/Polygonizer
174
+ //= require jsts/operation/relate/EdgeEndBuilder
175
+ //= require jsts/operation/relate/EdgeEndBundle
176
+ //= require jsts/operation/relate/EdgeEndBundleStar
177
+ //= require jsts/operation/relate/RelateComputer
178
+ //= require jsts/operation/relate/RelateNode
179
+ //= require jsts/operation/relate/RelateNodeFactory
180
+ //= require jsts/operation/relate/RelateNodeGraph
181
+ //= require jsts/operation/relate/RelateOp
182
+ //= require jsts/operation/union/CascadedPolygonUnion
183
+ //= require jsts/operation/union/PointGeometryUnion
184
+ //= require jsts/operation/union/UnaryUnionOp
185
+ //= require jsts/operation/union/UnionInteracting
186
+ //= require jsts/operation/valid/IsValidOp
187
+ //= require jsts/operation/valid/TopologyValidationError
188
+ //= require jsts/operation/valid/ConsistentAreaTester
189
+ //= require jsts/operation/valid/IndexedNestedRingTester
190
+ //= require jsts/operation/valid/ConnectedInteriorTester
191
+ //= require jsts/simplify/LineSegmentIndex
192
+ //= require jsts/triangulate/DelaunayTriangulationBuilder
193
+ //= require jsts/triangulate/VoronoiDiagramBuilder
194
+ //= require jsts/triangulate/IncrementalDelaunayTriangulator
195
+ //= require jsts/triangulate/quadedge/LastFoundQuadEdgeLocator
196
+ //= require jsts/triangulate/quadedge/QuadEdge
197
+ //= require jsts/triangulate/quadedge/QuadEdgeSubdivision
198
+ //= require jsts/triangulate/quadedge/TrianglePredicate
199
+ //= require jsts/triangulate/quadedge/Vertex
@@ -0,0 +1,387 @@
1
+ /* Copyright (c) 2011 by The Authors.
2
+ * Published under the LGPL 2.1 license.
3
+ * See /license-notice.txt for the full text of the license notice.
4
+ * See /license.txt for the full text of the license.
5
+ */
6
+
7
+
8
+
9
+ /**
10
+ * Utility functions for working with angles.
11
+ * Unless otherwise noted, methods in this class express angles in radians.
12
+ *
13
+ * @requires jsts/algorithm/CGAlgorithms.js
14
+ *
15
+ * @constructor
16
+ */
17
+ jsts.algorithm.Angle = function() {
18
+
19
+ };
20
+
21
+
22
+ /**
23
+ * Pi*2
24
+ */
25
+ jsts.algorithm.Angle.PI_TIMES_2 = 2.0 * Math.PI;
26
+
27
+
28
+ /**
29
+ * Pi/2
30
+ */
31
+ jsts.algorithm.Angle.PI_OVER_2 = Math.PI / 2.0;
32
+
33
+
34
+ /**
35
+ * Pi/4
36
+ */
37
+ jsts.algorithm.Angle.PI_OVER_4 = Math.PI / 4.0;
38
+
39
+
40
+ /**
41
+ * Constant representing counterclockwise orientation
42
+ */
43
+ jsts.algorithm.Angle.COUNTERCLOCKWISE = jsts.algorithm.CGAlgorithms.prototype.COUNTERCLOCKWISE;
44
+
45
+
46
+ /**
47
+ * Constant representing clockwise orientation
48
+ */
49
+ jsts.algorithm.Angle.CLOCKWISE = jsts.algorithm.CGAlgorithms.prototype.CLOCKWISE;
50
+
51
+
52
+ /**
53
+ * Constant representing no orientation
54
+ */
55
+ jsts.algorithm.Angle.NONE = jsts.algorithm.CGAlgorithms.prototype.COLLINEAR;
56
+
57
+
58
+ /**
59
+ * Converts from radians to degrees.
60
+ *
61
+ * @param {Number}
62
+ * radians an angle in radians.
63
+ * @return {Number}
64
+ * the angle in degrees.
65
+ */
66
+ jsts.algorithm.Angle.toDegrees = function(radians) {
67
+ return (radians * 180) / Math.PI;
68
+ };
69
+
70
+
71
+ /**
72
+ * Converts from degrees to radians.
73
+ *
74
+ * @param {Number}
75
+ * angleDegrees an angle in degrees.
76
+ * @return {Number}
77
+ * the angle in radians.
78
+ */
79
+ jsts.algorithm.Angle.toRadians = function(angleDegrees) {
80
+ return (angleDegrees * Math.PI) / 180.0;
81
+ };
82
+
83
+
84
+ /**
85
+ * Returns the angle
86
+ * Calls correct angle* depending on argument
87
+ *
88
+ * @return {Number}
89
+ * The angle in radians.
90
+ */
91
+ jsts.algorithm.Angle.angle = function() {
92
+ if (arguments.length === 1) {
93
+ return jsts.algorithm.Angle.angleFromOrigo(arguments[0]);
94
+ }else {
95
+ return jsts.algorithm.Angle.angleBetweenCoords(arguments[0], arguments[1]);
96
+ }
97
+ };
98
+
99
+
100
+ /**
101
+ * Returns the angle of the vector from p0 to p1,
102
+ * relative to the positive X-axis.
103
+ * The angle is normalized to be in the range [ -Pi, Pi ].
104
+ *
105
+ * @param {jsts.geom.Coordinate}
106
+ * p0 a coordinate.
107
+ * @param {jsts.geom.Coordinate}
108
+ * p1 a coordinate.
109
+ * @return {Number}
110
+ * the normalized angle (in radians) that p0-p1 makes with the positive
111
+ * x-axis.
112
+ */
113
+ jsts.algorithm.Angle.angleBetweenCoords = function(p0, p1) {
114
+ var dx, dy;
115
+ dx = p1.x - p0.x;
116
+ dy = p1.y - p0.y;
117
+ return Math.atan2(dy, dx);
118
+ };
119
+
120
+
121
+ /**
122
+ * Returns the angle that the vector from (0,0) to p,
123
+ * relative to the positive X-axis.
124
+ * The angle is normalized to be in the range ( -Pi, Pi ].
125
+ *
126
+ * @param {jsts.geom.Coordinate}
127
+ * p a coordinate.
128
+ * @return {Number}
129
+ * the normalized angle (in radians) that p makes with the positive
130
+ * x-axis.
131
+ */
132
+ jsts.algorithm.Angle.angleFromOrigo = function(p) {
133
+ return Math.atan2(p.y, p.x);
134
+ };
135
+
136
+
137
+ /**
138
+ * Tests whether the angle between p0-p1-p2 is acute.
139
+ * An angle is acute if it is less than 90 degrees.
140
+ * <p>
141
+ * Note: this implementation is not precise (determistic) for angles very close to 90 degrees.
142
+ *
143
+ * @param {jsts.geom.Coordinate}
144
+ * p0 an endpoint of the angle.
145
+ * @param {jsts.geom.Coordinate}
146
+ * p1 the base of the angle.
147
+ * @param {jsts.geom.Coordinate}
148
+ * p2 the other endpoint of the angle.
149
+ * @return {Boolean}
150
+ * true if the angle is acute.
151
+ */
152
+ jsts.algorithm.Angle.isAcute = function(p0, p1, p2) {
153
+ var dx0, dy0, dx1, dy1, dotprod;
154
+
155
+ //relies on fact that A dot B is positive if A ang B is acute
156
+ dx0 = p0.x - p1.x;
157
+ dy0 = p0.y - p1.y;
158
+ dx1 = p2.x - p1.x;
159
+ dy1 = p2.y - p1.y;
160
+ dotprod = dx0 * dx1 + dy0 * dy1;
161
+ return dotprod > 0;
162
+ };
163
+
164
+
165
+ /**
166
+ * Tests whether the angle between p0-p1-p2 is obtuse.
167
+ * An angle is obtuse if it is greater than 90 degrees.
168
+ * <p>
169
+ * Note: this implementation is not precise (determistic) for angles very close to 90 degrees.
170
+ *
171
+ * @param {jsts.geom.Coordinate}
172
+ * p0 an endpoint of the angle.
173
+ * @param {jsts.geom.Coordinate}
174
+ * p1 the base of the angle.
175
+ * @param {jsts.geom.Coordinate}
176
+ * p2 the other endpoint of the angle.
177
+ * @return {Boolean}
178
+ * true if the angle is obtuse.
179
+ */
180
+ jsts.algorithm.Angle.isObtuse = function(p0, p1, p2) {
181
+ var dx0, dy0, dx1, dy1, dotprod;
182
+
183
+ //relies on fact that A dot B is negative iff A ang B is obtuse
184
+ dx0 = p0.x - p1.x;
185
+ dy0 = p0.y - p1.y;
186
+ dx1 = p2.x - p1.x;
187
+ dy1 = p2.y - p1.y;
188
+ dotprod = dx0 * dx1 + dy0 * dy1;
189
+ return dotprod < 0;
190
+ };
191
+
192
+
193
+ /**
194
+ * Returns the unoriented smallest angle between two vectors.
195
+ * The computed angle will be in the range [0, Pi).
196
+ *
197
+ * @param {jsts.geom.Coordinate}
198
+ * tip1 the tip of one vector.
199
+ * @param {jsts.geom.Coordinate}
200
+ * tail the tail of each vector.
201
+ * @param {jsts.geom.Coordinate}
202
+ * tip2 the tip of the other vector.
203
+ * @return {Number}
204
+ * the angle between tail-tip1 and tail-tip2.
205
+ */
206
+ jsts.algorithm.Angle.angleBetween = function(tip1, tail, tip2) {
207
+ var a1, a2;
208
+ a1 = jsts.algorithm.Angle.angle(tail, tip1);
209
+ a2 = jsts.algorithm.Angle.angle(tail, tip2);
210
+
211
+ return jsts.algorithm.Angle.diff(a1, a2);
212
+ };
213
+
214
+
215
+ /**
216
+ * Returns the oriented smallest angle between two vectors.
217
+ * The computed angle will be in the range (-Pi, Pi].
218
+ * A positive result corresponds to a counterclockwise rotation
219
+ * from v1 to v2;
220
+ * a negative result corresponds to a clockwise rotation.
221
+ *
222
+ * @param {jsts.geom.Coordinate}
223
+ * tip1 the tip of v1.
224
+ * @param {jsts.geom.Coordinate}
225
+ * tail the tail of each vector.
226
+ * @param {jsts.geom.Coordinate}
227
+ * tip2 the tip of v2.
228
+ * @return {Number}
229
+ * the angle between v1 and v2, relative to v1.
230
+ */
231
+ jsts.algorithm.Angle.angleBetweenOriented = function(tip1, tail, tip2) {
232
+ var a1, a2, angDel;
233
+
234
+ a1 = jsts.algorithm.Angle.angle(tail, tip1);
235
+ a2 = jsts.algorithm.Angle.angle(tail, tip2);
236
+ angDel = a2 - a1;
237
+
238
+ // normalize, maintaining orientation
239
+ if (angDel <= -Math.PI) {
240
+ return angDel + jsts.algorithm.Angle.PI_TIMES_2;
241
+ }
242
+ if (angDel > Math.PI) {
243
+ return angDel - jsts.algorithm.Angle.PI_TIMES_2;
244
+ }
245
+ return angDel;
246
+ };
247
+
248
+
249
+ /**
250
+ * Computes the interior angle between two segments of a ring. The ring is
251
+ * assumed to be oriented in a clockwise direction. The computed angle will be
252
+ * in the range [0, 2Pi]
253
+ *
254
+ * @param {jsts.geom.Coordinate}
255
+ * p0 a point of the ring.
256
+ * @param {jsts.geom.Coordinate}
257
+ * p1 the next point of the ring.
258
+ * @param {jsts.geom.Coordinate}
259
+ * p2 the next point of the ring.
260
+ * @return {Number}
261
+ * the interior angle based at <code>p1.</code>
262
+ */
263
+ jsts.algorithm.Angle.interiorAngle = function(p0, p1, p2) {
264
+ var anglePrev, angleNext;
265
+
266
+ anglePrev = jsts.algorithm.Angle.angle(p1, p0);
267
+ angleNext = jsts.algorithm.Angle.angle(p1, p2);
268
+ return Math.abs(angleNext - anglePrev);
269
+ };
270
+
271
+
272
+ /**
273
+ * Returns whether an angle must turn clockwise or counterclockwise
274
+ * to overlap another angle.
275
+ *
276
+ * @param {Number}
277
+ * ang1 an angle (in radians).
278
+ * @param {Number}
279
+ * ang2 an angle (in radians).
280
+ * @return {Number}
281
+ * whether a1 must turn CLOCKWISE, COUNTERCLOCKWISE or NONE to
282
+ * overlap a2.
283
+ */
284
+ jsts.algorithm.Angle.getTurn = function(ang1, ang2) {
285
+ var crossproduct = Math.sin(ang2 - ang1);
286
+
287
+ if (crossproduct > 0) {
288
+ return jsts.algorithm.Angle.COUNTERCLOCKWISE;
289
+ }
290
+ if (crossproduct < 0) {
291
+ return jsts.algorithm.Angle.CLOCKWISE;
292
+ }
293
+ return jsts.algorithm.Angle.NONE;
294
+ };
295
+
296
+
297
+ /**
298
+ * Computes the normalized value of an angle, which is the
299
+ * equivalent angle in the range ( -Pi, Pi ].
300
+ *
301
+ * @param {Number}
302
+ * angle the angle to normalize.
303
+ * @return {Number}
304
+ * an equivalent angle in the range (-Pi, Pi].
305
+ */
306
+ jsts.algorithm.Angle.normalize = function(angle) {
307
+ while (angle > Math.PI) {
308
+ angle -= jsts.algorithm.Angle.PI_TIMES_2;
309
+ }
310
+ while (angle <= -Math.PI) {
311
+ angle += jsts.algorithm.Angle.PI_TIMES_2;
312
+ }
313
+ return angle;
314
+ };
315
+
316
+
317
+ /**
318
+ * Computes the normalized positive value of an angle, which is the
319
+ * equivalent angle in the range [ 0, 2*Pi ).
320
+ * E.g.:
321
+ * <ul>
322
+ * <li>normalizePositive(0.0) = 0.0
323
+ * <li>normalizePositive(-PI) = PI
324
+ * <li>normalizePositive(-2PI) = 0.0
325
+ * <li>normalizePositive(-3PI) = PI
326
+ * <li>normalizePositive(-4PI) = 0
327
+ * <li>normalizePositive(PI) = PI
328
+ * <li>normalizePositive(2PI) = 0.0
329
+ * <li>normalizePositive(3PI) = PI
330
+ * <li>normalizePositive(4PI) = 0.0
331
+ * </ul>
332
+ *
333
+ * @param {Number}
334
+ * angle the angle to normalize, in radians.
335
+ * @return {Number}
336
+ * an equivalent positive angle.
337
+ */
338
+ jsts.algorithm.Angle.normalizePositive = function(angle) {
339
+ if (angle < 0.0) {
340
+ while (angle < 0.0) {
341
+ angle += jsts.algorithm.Angle.PI_TIMES_2;
342
+ }
343
+ // in case round-off error bumps the value over
344
+ if (angle >= jsts.algorithm.Angle.PI_TIMES_2) {
345
+ angle = 0.0;
346
+ }
347
+ }
348
+ else {
349
+ while (angle >= jsts.algorithm.Angle.PI_TIMES_2) {
350
+ angle -= jsts.algorithm.Angle.PI_TIMES_2;
351
+ }
352
+ // in case round-off error bumps the value under
353
+ if (angle < 0.0) {
354
+ angle = 0.0;
355
+ }
356
+ }
357
+ return angle;
358
+ };
359
+
360
+
361
+ /**
362
+ * Computes the unoriented smallest difference between two angles.
363
+ * The angles are assumed to be normalized to the range [-Pi, Pi].
364
+ * The result will be in the range [0, Pi].
365
+ *
366
+ * @param {Number}
367
+ * ang1 the angle of one vector (in [-Pi, Pi] ).
368
+ * @param {Number}
369
+ * ang2 the angle of the other vector (in range [-Pi, Pi] ).
370
+ * @return {Number}
371
+ * the angle (in radians) between the two vectors (in range [0, Pi] ).
372
+ */
373
+ jsts.algorithm.Angle.diff = function(ang1, ang2) {
374
+ var delAngle;
375
+
376
+ if (ang1 < ang2) {
377
+ delAngle = ang2 - ang1;
378
+ } else {
379
+ delAngle = ang1 - ang2;
380
+ }
381
+
382
+ if (delAngle > Math.PI) {
383
+ delAngle = (2 * Math.PI) - delAngle;
384
+ }
385
+
386
+ return delAngle;
387
+ };