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
@@ -0,0 +1,69 @@
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
+ (function() {
8
+
9
+ /**
10
+ * Models an OGC SFS <code>LinearRing</code>. A LinearRing is a LineString
11
+ * which is both closed and simple. In other words, the first and last
12
+ * coordinate in the ring must be equal, and the interior of the ring must not
13
+ * self-intersect. Either orientation of the ring is allowed.
14
+ * <p>
15
+ * A ring must have either 0 or 4 or more points. The first and last points
16
+ * must be equal (in 2D). If these conditions are not met, the constructors
17
+ * throw an {@link IllegalArgumentException}
18
+ *
19
+ * @requires jsts/geom/LineString.js
20
+ */
21
+
22
+
23
+ /**
24
+ * @extends jsts.geom.LineString
25
+ * @constructor
26
+ */
27
+ jsts.geom.LinearRing = function(points, factory) {
28
+ jsts.geom.LineString.apply(this, arguments);
29
+ };
30
+ jsts.geom.LinearRing.prototype = new jsts.geom.LineString();
31
+ jsts.geom.LinearRing.constructor = jsts.geom.LinearRing;
32
+
33
+
34
+ /**
35
+ * Returns <code>Dimension.FALSE</code>, since by definition LinearRings do
36
+ * not have a boundary.
37
+ *
38
+ * @return {int} Dimension.FALSE.
39
+ */
40
+ jsts.geom.LinearRing.prototype.getBoundaryDimension = function() {
41
+ return jsts.geom.Dimension.FALSE;
42
+ };
43
+
44
+
45
+ /**
46
+ * Returns <code>true</code>, since by definition LinearRings are always
47
+ * simple.
48
+ *
49
+ * @return {Boolean} <code>true.</code>
50
+ *
51
+ * @see Geometry#isSimple
52
+ */
53
+ jsts.geom.LinearRing.prototype.isSimple = function() {
54
+ return true;
55
+ };
56
+
57
+
58
+ /**
59
+ * @return {String} String representation of LinearRing type.
60
+ */
61
+ jsts.geom.LinearRing.prototype.getGeometryType = function() {
62
+ return 'LinearRing';
63
+ };
64
+
65
+ jsts.geom.LinearRing.MINIMUM_VALID_SIZE = 4;
66
+
67
+ jsts.geom.LinearRing.prototype.CLASS_NAME = 'jsts.geom.LinearRing';
68
+
69
+ })();
@@ -0,0 +1,83 @@
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
+ * Constants representing the different topological locations which can occur in
11
+ * a {@link Geometry}. The constants are also used as the row and column
12
+ * indices of DE-9IM {@link IntersectionMatrix}es.
13
+ *
14
+ * @constructor
15
+ */
16
+ jsts.geom.Location = function() {
17
+ };
18
+
19
+
20
+ /**
21
+ * The location value for the interior of a geometry. Also, DE-9IM row index of
22
+ * the interior of the first geometry and column index of the interior of the
23
+ * second geometry.
24
+ *
25
+ * @const
26
+ * @type {number}
27
+ */
28
+ jsts.geom.Location.INTERIOR = 0;
29
+
30
+
31
+ /**
32
+ * The location value for the boundary of a geometry. Also, DE-9IM row index of
33
+ * the boundary of the first geometry and column index of the boundary of the
34
+ * second geometry.
35
+ *
36
+ * @const
37
+ * @type {number}
38
+ */
39
+ jsts.geom.Location.BOUNDARY = 1;
40
+
41
+
42
+ /**
43
+ * The location value for the exterior of a geometry. Also, DE-9IM row index of
44
+ * the exterior of the first geometry and column index of the exterior of the
45
+ * second geometry.
46
+ *
47
+ * @const
48
+ * @type {number}
49
+ */
50
+ jsts.geom.Location.EXTERIOR = 2;
51
+
52
+
53
+ /**
54
+ * Used for uninitialized location values.
55
+ *
56
+ * @const
57
+ * @type {number}
58
+ */
59
+ jsts.geom.Location.NONE = -1;
60
+
61
+
62
+ /**
63
+ * Converts the location value to a location symbol, for example,
64
+ * <code>EXTERIOR => 'e'</code> .
65
+ *
66
+ * @param {number}
67
+ * locationValue either EXTERIOR, BOUNDARY, INTERIOR or NONE.
68
+ * @return {string} either 'e', 'b', 'i' or '-'.
69
+ */
70
+ jsts.geom.Location.toLocationSymbol = function(locationValue) {
71
+ switch (locationValue) {
72
+ case jsts.geom.Location.EXTERIOR:
73
+ return 'e';
74
+ case jsts.geom.Location.BOUNDARY:
75
+ return 'b';
76
+ case jsts.geom.Location.INTERIOR:
77
+ return 'i';
78
+ case jsts.geom.Location.NONE:
79
+ return '-';
80
+ }
81
+ throw new jsts.IllegalArgumentError('Unknown location value: ' +
82
+ locationValue);
83
+ };
@@ -0,0 +1,47 @@
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
+ (function() {
8
+
9
+ /**
10
+ * @requires jsts/geom/GeometryCollection.js
11
+ */
12
+
13
+ /**
14
+ * @constructor
15
+ * @extends jsts.geom.GeometryCollection
16
+ */
17
+ jsts.geom.MultiLineString = function(geometries, factory) {
18
+ this.geometries = geometries || [];
19
+ this.factory = factory;
20
+ };
21
+
22
+ jsts.geom.MultiLineString.prototype = new jsts.geom.GeometryCollection();
23
+ jsts.geom.MultiLineString.constructor = jsts.geom.MultiLineString;
24
+
25
+ jsts.geom.MultiLineString.prototype.getBoundary = function() {
26
+ return (new jsts.operation.BoundaryOp(this)).getBoundary();
27
+ };
28
+
29
+
30
+ /**
31
+ * @param {Geometry}
32
+ * other
33
+ * @param {double}
34
+ * tolerance
35
+ * @return {boolean}
36
+ */
37
+ jsts.geom.MultiLineString.prototype.equalsExact = function(other, tolerance) {
38
+ if (!this.isEquivalentClass(other)) {
39
+ return false;
40
+ }
41
+ return jsts.geom.GeometryCollection.prototype.equalsExact.call(this, other,
42
+ tolerance);
43
+ };
44
+
45
+ jsts.geom.MultiLineString.prototype.CLASS_NAME = 'jsts.geom.MultiLineString';
46
+
47
+ })();
@@ -0,0 +1,64 @@
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
+ * @requires jsts/geom/GeometryCollection.js
9
+ */
10
+
11
+ (function() {
12
+
13
+ /**
14
+ * @requires jsts/geom/GeometryCollection.js
15
+ */
16
+
17
+ /**
18
+ * @constructor
19
+ * @extends jsts.geom.GeometryCollection
20
+ */
21
+ jsts.geom.MultiPoint = function(points, factory) {
22
+ this.geometries = points || [];
23
+ this.factory = factory;
24
+ };
25
+
26
+ jsts.geom.MultiPoint.prototype = new jsts.geom.GeometryCollection();
27
+ jsts.geom.MultiPoint.constructor = jsts.geom.MultiPoint;
28
+
29
+
30
+
31
+ /**
32
+ * Gets the boundary of this geometry. Zero-dimensional geometries have no
33
+ * boundary by definition, so an empty GeometryCollection is returned.
34
+ *
35
+ * @return {Geometry} an empty GeometryCollection.
36
+ * @see Geometry#getBoundary
37
+ */
38
+ jsts.geom.MultiPoint.prototype.getBoundary = function() {
39
+ return this.getFactory().createGeometryCollection(null);
40
+ };
41
+
42
+ jsts.geom.MultiPoint.prototype.getGeometryN = function(n) {
43
+ return this.geometries[n];
44
+ };
45
+
46
+
47
+ /**
48
+ * @param {Geometry}
49
+ * other
50
+ * @param {double}
51
+ * tolerance
52
+ * @return {boolean}
53
+ */
54
+ jsts.geom.MultiPoint.prototype.equalsExact = function(other, tolerance) {
55
+ if (!this.isEquivalentClass(other)) {
56
+ return false;
57
+ }
58
+ return jsts.geom.GeometryCollection.prototype.equalsExact.call(this, other,
59
+ tolerance);
60
+ };
61
+
62
+ jsts.geom.MultiPoint.prototype.CLASS_NAME = 'jsts.geom.MultiPoint';
63
+
64
+ })();
@@ -0,0 +1,64 @@
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
+ (function() {
8
+
9
+ /**
10
+ * @requires jsts/geom/GeometryCollection.js
11
+ */
12
+
13
+ /**
14
+ * @constructor
15
+ * @extends jsts.geom.GeometryCollection
16
+ */
17
+ jsts.geom.MultiPolygon = function(geometries, factory) {
18
+ this.geometries = geometries || [];
19
+ this.factory = factory;
20
+ };
21
+
22
+ jsts.geom.MultiPolygon.prototype = new jsts.geom.GeometryCollection();
23
+ jsts.geom.MultiPolygon.constructor = jsts.geom.MultiPolygon;
24
+
25
+ /**
26
+ * Computes the boundary of this geometry
27
+ *
28
+ * @return {Geometry} a lineal geometry (which may be empty).
29
+ * @see Geometry#getBoundary
30
+ */
31
+ jsts.geom.MultiPolygon.prototype.getBoundary = function() {
32
+ if (this.isEmpty()) {
33
+ return this.getFactory().createMultiLineString(null);
34
+ }
35
+ var allRings = [];
36
+ for (var i = 0; i < this.geometries.length; i++) {
37
+ var polygon = this.geometries[i];
38
+ var rings = polygon.getBoundary();
39
+ for (var j = 0; j < rings.getNumGeometries(); j++) {
40
+ allRings.push(rings.getGeometryN(j));
41
+ }
42
+ }
43
+ return this.getFactory().createMultiLineString(allRings);
44
+ };
45
+
46
+
47
+ /**
48
+ * @param {Geometry}
49
+ * other
50
+ * @param {double}
51
+ * tolerance
52
+ * @return {boolean}
53
+ */
54
+ jsts.geom.MultiPolygon.prototype.equalsExact = function(other, tolerance) {
55
+ if (!this.isEquivalentClass(other)) {
56
+ return false;
57
+ }
58
+ return jsts.geom.GeometryCollection.prototype.equalsExact.call(this, other,
59
+ tolerance);
60
+ };
61
+
62
+ jsts.geom.MultiPolygon.prototype.CLASS_NAME = 'jsts.geom.MultiPolygon';
63
+
64
+ })();
@@ -0,0 +1,197 @@
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
+ * @requires jsts/geom/Coordinate.js
10
+ * @requires jsts/geom/Geometry.js
11
+ */
12
+
13
+
14
+
15
+ /**
16
+ * @constructor
17
+ * @extends jsts.geom.Geometry
18
+ */
19
+ jsts.geom.Point = function(coordinate, factory) {
20
+ this.factory = factory;
21
+
22
+ if (coordinate === undefined)
23
+ return;
24
+
25
+ this.coordinate = coordinate;
26
+ };
27
+
28
+ jsts.geom.Point.prototype = new jsts.geom.Geometry();
29
+ jsts.geom.Point.constructor = jsts.geom.Point;
30
+
31
+
32
+ jsts.geom.Point.CLASS_NAME = 'jsts.geom.Point';
33
+
34
+
35
+ jsts.geom.Point.prototype.coordinate = null;
36
+
37
+
38
+ /**
39
+ * @return {number} x-axis value of this Point.
40
+ */
41
+ jsts.geom.Point.prototype.getX = function() {
42
+ return this.coordinate.x;
43
+ };
44
+
45
+
46
+ /**
47
+ * @return {number} y-axis value of this Point.
48
+ */
49
+ jsts.geom.Point.prototype.getY = function() {
50
+ return this.coordinate.y;
51
+ };
52
+
53
+ jsts.geom.Point.prototype.getCoordinate = function() {
54
+ return this.coordinate;
55
+ };
56
+
57
+
58
+ /**
59
+ * @return {Coordinate[]} this Point as coordinate array.
60
+ */
61
+ jsts.geom.Point.prototype.getCoordinates = function() {
62
+ return this.isEmpty() ? [] : [this.coordinate];
63
+ };
64
+
65
+ jsts.geom.Point.prototype.isEmpty = function() {
66
+ return this.coordinate === null;
67
+ };
68
+
69
+ jsts.geom.Point.prototype.equalsExact = function(other, tolerance) {
70
+ if (!this.isEquivalentClass(other)) {
71
+ return false;
72
+ }
73
+ if (this.isEmpty() && other.isEmpty()) {
74
+ return true;
75
+ }
76
+ return this.equal(other.getCoordinate(), this.getCoordinate(), tolerance);
77
+ };
78
+
79
+
80
+ /**
81
+ * @return {number} number of coordinates (0 or 1).
82
+ */
83
+ jsts.geom.Point.prototype.getNumPoints = function() {
84
+ return this.isEmpty() ? 0 : 1;
85
+ };
86
+
87
+
88
+ /**
89
+ * @return {boolean} Point is always simple.
90
+ */
91
+ jsts.geom.Point.prototype.isSimple = function() {
92
+ return true;
93
+ };
94
+
95
+
96
+ /**
97
+ * Gets the boundary of this geometry. Zero-dimensional geometries have no
98
+ * boundary by definition, so an empty GeometryCollection is returned.
99
+ *
100
+ * @return {GeometryCollection} an empty GeometryCollection.
101
+ * @see Geometry#getBoundary
102
+ */
103
+ jsts.geom.Point.prototype.getBoundary = function() {
104
+ return new jsts.geom.GeometryCollection(null);
105
+ };
106
+
107
+
108
+ /**
109
+ * @return {Envelope} Envelope of this point.
110
+ */
111
+ jsts.geom.Point.prototype.computeEnvelopeInternal = function() {
112
+ if (this.isEmpty()) {
113
+ return new jsts.geom.Envelope();
114
+ }
115
+ return new jsts.geom.Envelope(this.coordinate);
116
+ };
117
+
118
+ jsts.geom.Point.prototype.apply = function(filter) {
119
+ if (filter instanceof jsts.geom.GeometryFilter || filter instanceof jsts.geom.GeometryComponentFilter) {
120
+ filter.filter(this);
121
+ } else if (filter instanceof jsts.geom.CoordinateFilter) {
122
+ if (this.isEmpty()) { return; }
123
+ filter.filter(this.getCoordinate());
124
+ }
125
+
126
+ };
127
+
128
+ jsts.geom.Point.prototype.clone = function() {
129
+ return new jsts.geom.Point(this.coordinate.clone(), this.factory);
130
+ };
131
+
132
+
133
+ /**
134
+ * @return {number} Always 0.
135
+ */
136
+ jsts.geom.Point.prototype.getDimension = function() {
137
+ return 0;
138
+ };
139
+
140
+
141
+ /**
142
+ * @return {number} Always Dimension.FALSE.
143
+ */
144
+ jsts.geom.Point.prototype.getBoundaryDimension = function() {
145
+ return jsts.geom.Dimension.FALSE;
146
+ };
147
+
148
+
149
+ /**
150
+ * @return {Point} Reversed point is a cloned point.
151
+ */
152
+ jsts.geom.Point.prototype.reverse = function() {
153
+ return this.clone();
154
+ };
155
+
156
+
157
+ /**
158
+ * A Point is valid iff:
159
+ * <ul>
160
+ * <li>the coordinate which defines it is a valid coordinate (i.e does not have
161
+ * an NaN X or Y ordinate)
162
+ * </ul>
163
+ *
164
+ * @return {boolean} true iff the Point is valid.
165
+ */
166
+ jsts.geom.Point.prototype.isValid = function() {
167
+ if (!jsts.operation.valid.IsValidOp.isValid(this.getCoordinate())) {
168
+ return false;
169
+ }
170
+ return true;
171
+ };
172
+
173
+
174
+ /**
175
+ *
176
+ */
177
+ jsts.geom.Point.prototype.normalize = function() {
178
+ // a Point is always in normalized form
179
+ };
180
+
181
+ jsts.geom.Point.prototype.compareToSameClass = function(other) {
182
+ var point = other;
183
+ return this.getCoordinate().compareTo(point.getCoordinate());
184
+ };
185
+
186
+ /**
187
+ * @return {string} String representation of Point type.
188
+ */
189
+ jsts.geom.Point.prototype.getGeometryType = function() {
190
+ return 'Point';
191
+ };
192
+
193
+ jsts.geom.Point.prototype.hashCode = function() {
194
+ return 'Point_' + this.coordinate.hashCode();
195
+ };
196
+
197
+ jsts.geom.Point.prototype.CLASS_NAME = 'jsts.geom.Point';