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.
- checksums.yaml +8 -8
- data/lib/jsts-rails/version.rb +1 -1
- data/vendor/assets/javascripts/javascript.util.js +33 -1
- data/vendor/assets/javascripts/jsts-original.js +164 -1573
- data/vendor/assets/javascripts/jsts.js +197 -0
- data/vendor/assets/javascripts/jsts/algorithm/Angle.js +387 -0
- data/vendor/assets/javascripts/jsts/algorithm/BoundaryNodeRule.js +67 -0
- data/vendor/assets/javascripts/jsts/algorithm/CGAlgorithms.js +596 -0
- data/vendor/assets/javascripts/jsts/algorithm/CentralEndpointIntersector.js +118 -0
- data/vendor/assets/javascripts/jsts/algorithm/CentroidArea.js +225 -0
- data/vendor/assets/javascripts/jsts/algorithm/CentroidLine.js +85 -0
- data/vendor/assets/javascripts/jsts/algorithm/CentroidPoint.js +77 -0
- data/vendor/assets/javascripts/jsts/algorithm/ConvexHull.js +409 -0
- data/vendor/assets/javascripts/jsts/algorithm/HCoordinate.js +234 -0
- data/vendor/assets/javascripts/jsts/algorithm/LineIntersector.js +502 -0
- data/vendor/assets/javascripts/jsts/algorithm/MCPointInRing.js +124 -0
- data/vendor/assets/javascripts/jsts/algorithm/PointLocator.js +247 -0
- data/vendor/assets/javascripts/jsts/algorithm/RayCrossingCounter.js +215 -0
- data/vendor/assets/javascripts/jsts/algorithm/RobustDeterminant.js +353 -0
- data/vendor/assets/javascripts/jsts/algorithm/RobustLineIntersector.js +477 -0
- data/vendor/assets/javascripts/jsts/algorithm/distance/DiscreteHausdorffDistance.js +228 -0
- data/vendor/assets/javascripts/jsts/algorithm/distance/DistanceToPoint.js +68 -0
- data/vendor/assets/javascripts/jsts/algorithm/distance/PointPairDistance.js +104 -0
- data/vendor/assets/javascripts/jsts/algorithm/locate/PointOnGeometryLocator.js +7 -0
- data/vendor/assets/javascripts/jsts/algorithm/locate/SimplePointInAreaLocator.js +102 -0
- data/vendor/assets/javascripts/jsts/geom/Coordinate.js +158 -0
- data/vendor/assets/javascripts/jsts/geom/CoordinateArrays.js +148 -0
- data/vendor/assets/javascripts/jsts/geom/CoordinateFilter.js +29 -0
- data/vendor/assets/javascripts/jsts/geom/CoordinateList.js +157 -0
- data/vendor/assets/javascripts/jsts/geom/CoordinateSequenceFilter.js +63 -0
- data/vendor/assets/javascripts/jsts/geom/Dimension.js +137 -0
- data/vendor/assets/javascripts/jsts/geom/Envelope.js +833 -0
- data/vendor/assets/javascripts/jsts/geom/Geometry.js +1535 -0
- data/vendor/assets/javascripts/jsts/geom/GeometryCollection.js +230 -0
- data/vendor/assets/javascripts/jsts/geom/GeometryComponentFilter.js +36 -0
- data/vendor/assets/javascripts/jsts/geom/GeometryFactory.js +263 -0
- data/vendor/assets/javascripts/jsts/geom/GeometryFilter.js +29 -0
- data/vendor/assets/javascripts/jsts/geom/IntersectionMatrix.js +650 -0
- data/vendor/assets/javascripts/jsts/geom/LineSegment.js +275 -0
- data/vendor/assets/javascripts/jsts/geom/LineString.js +299 -0
- data/vendor/assets/javascripts/jsts/geom/LinearRing.js +69 -0
- data/vendor/assets/javascripts/jsts/geom/Location.js +83 -0
- data/vendor/assets/javascripts/jsts/geom/MultiLineString.js +47 -0
- data/vendor/assets/javascripts/jsts/geom/MultiPoint.js +64 -0
- data/vendor/assets/javascripts/jsts/geom/MultiPolygon.js +64 -0
- data/vendor/assets/javascripts/jsts/geom/Point.js +197 -0
- data/vendor/assets/javascripts/jsts/geom/Polygon.js +263 -0
- data/vendor/assets/javascripts/jsts/geom/PrecisionModel.js +187 -0
- data/vendor/assets/javascripts/jsts/geom/Triangle.js +313 -0
- data/vendor/assets/javascripts/jsts/geom/util/GeometryCombiner.js +143 -0
- data/vendor/assets/javascripts/jsts/geom/util/GeometryExtracter.js +76 -0
- data/vendor/assets/javascripts/jsts/geom/util/GeometryTransformer.js +295 -0
- data/vendor/assets/javascripts/jsts/geom/util/LinearComponentExtracter.js +207 -0
- data/vendor/assets/javascripts/jsts/geom/util/PointExtracter.js +67 -0
- data/vendor/assets/javascripts/jsts/geom/util/PolygonExtracter.js +71 -0
- data/vendor/assets/javascripts/jsts/geomgraph/Depth.js +145 -0
- data/vendor/assets/javascripts/jsts/geomgraph/DirectedEdge.js +270 -0
- data/vendor/assets/javascripts/jsts/geomgraph/DirectedEdgeStar.js +388 -0
- data/vendor/assets/javascripts/jsts/geomgraph/Edge.js +291 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeEnd.js +188 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeEndStar.js +322 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeIntersection.js +122 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeIntersectionList.js +146 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeList.js +111 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeNodingValidator.js +76 -0
- data/vendor/assets/javascripts/jsts/geomgraph/EdgeRing.js +230 -0
- data/vendor/assets/javascripts/jsts/geomgraph/GeometryGraph.js +469 -0
- data/vendor/assets/javascripts/jsts/geomgraph/GraphComponent.js +181 -0
- data/vendor/assets/javascripts/jsts/geomgraph/Label.js +316 -0
- data/vendor/assets/javascripts/jsts/geomgraph/Node.js +105 -0
- data/vendor/assets/javascripts/jsts/geomgraph/NodeFactory.js +22 -0
- data/vendor/assets/javascripts/jsts/geomgraph/NodeMap.js +128 -0
- data/vendor/assets/javascripts/jsts/geomgraph/PlanarGraph.js +214 -0
- data/vendor/assets/javascripts/jsts/geomgraph/Position.js +63 -0
- data/vendor/assets/javascripts/jsts/geomgraph/Quadrant.js +143 -0
- data/vendor/assets/javascripts/jsts/geomgraph/TopologyLocation.js +251 -0
- data/vendor/assets/javascripts/jsts/geomgraph/index/EdgeSetIntersector.js +47 -0
- data/vendor/assets/javascripts/jsts/geomgraph/index/SegmentIntersector.js +298 -0
- data/vendor/assets/javascripts/jsts/geomgraph/index/SimpleEdgeSetIntersector.js +107 -0
- data/vendor/assets/javascripts/jsts/geomgraph/index/SimpleMCSweepLineIntersector.js +29 -0
- data/vendor/assets/javascripts/jsts/index/ArrayListVisitor.js +37 -0
- data/vendor/assets/javascripts/jsts/index/DoubleBits.js +132 -0
- data/vendor/assets/javascripts/jsts/index/IntervalSize.js +55 -0
- data/vendor/assets/javascripts/jsts/index/ItemVisitor.js +23 -0
- data/vendor/assets/javascripts/jsts/index/SpatialIndex.js +67 -0
- data/vendor/assets/javascripts/jsts/index/bintree/Bintree.js +224 -0
- data/vendor/assets/javascripts/jsts/index/bintree/Interval.js +160 -0
- data/vendor/assets/javascripts/jsts/index/bintree/Key.js +110 -0
- data/vendor/assets/javascripts/jsts/index/bintree/Node.js +204 -0
- data/vendor/assets/javascripts/jsts/index/bintree/NodeBase.js +220 -0
- data/vendor/assets/javascripts/jsts/index/bintree/Root.js +113 -0
- data/vendor/assets/javascripts/jsts/index/chain/MonotoneChain.js +244 -0
- data/vendor/assets/javascripts/jsts/index/chain/MonotoneChainBuilder.js +106 -0
- data/vendor/assets/javascripts/jsts/index/chain/MonotoneChainOverlapAction.js +56 -0
- data/vendor/assets/javascripts/jsts/index/chain/MonotoneChainSelectAction.js +44 -0
- data/vendor/assets/javascripts/jsts/index/kdtree/KdNode.js +171 -0
- data/vendor/assets/javascripts/jsts/index/kdtree/KdTree.js +218 -0
- data/vendor/assets/javascripts/jsts/index/quadtree/Key.js +134 -0
- data/vendor/assets/javascripts/jsts/index/quadtree/Node.js +220 -0
- data/vendor/assets/javascripts/jsts/index/quadtree/NodeBase.js +330 -0
- data/vendor/assets/javascripts/jsts/index/quadtree/Quadtree.js +228 -0
- data/vendor/assets/javascripts/jsts/index/quadtree/Root.js +105 -0
- data/vendor/assets/javascripts/jsts/index/strtree/AbstractNode.js +107 -0
- data/vendor/assets/javascripts/jsts/index/strtree/AbstractSTRtree.js +594 -0
- data/vendor/assets/javascripts/jsts/index/strtree/Boundable.js +37 -0
- data/vendor/assets/javascripts/jsts/index/strtree/BoundablePair.js +0 -0
- data/vendor/assets/javascripts/jsts/index/strtree/Interval.js +94 -0
- data/vendor/assets/javascripts/jsts/index/strtree/ItemBoundable.js +60 -0
- data/vendor/assets/javascripts/jsts/index/strtree/SIRtree.js +122 -0
- data/vendor/assets/javascripts/jsts/index/strtree/STRtree.js +450 -0
- data/vendor/assets/javascripts/jsts/io/GeoJSONParser.js +471 -0
- data/vendor/assets/javascripts/jsts/io/GeoJSONReader.js +58 -0
- data/vendor/assets/javascripts/jsts/io/GeoJSONWriter.js +38 -0
- data/vendor/assets/javascripts/jsts/io/OpenLayersParser.js +245 -0
- data/vendor/assets/javascripts/jsts/io/WKTParser.js +421 -0
- data/vendor/assets/javascripts/jsts/io/WKTReader.js +68 -0
- data/vendor/assets/javascripts/jsts/io/WKTWriter.js +61 -0
- data/vendor/assets/javascripts/jsts/noding/BasicSegmentString.js +87 -0
- data/vendor/assets/javascripts/jsts/noding/FastNodingValidator.js +127 -0
- data/vendor/assets/javascripts/jsts/noding/InteriorIntersectionFinder.js +171 -0
- data/vendor/assets/javascripts/jsts/noding/IntersectionAdder.js +198 -0
- data/vendor/assets/javascripts/jsts/noding/IntersectionFinderAdder.js +79 -0
- data/vendor/assets/javascripts/jsts/noding/MCIndexNoder.js +147 -0
- data/vendor/assets/javascripts/jsts/noding/NodableSegmentString.js +35 -0
- data/vendor/assets/javascripts/jsts/noding/NodedSegmentString.js +235 -0
- data/vendor/assets/javascripts/jsts/noding/Noder.js +41 -0
- data/vendor/assets/javascripts/jsts/noding/NodingValidator.js +5 -0
- data/vendor/assets/javascripts/jsts/noding/Octant.js +84 -0
- data/vendor/assets/javascripts/jsts/noding/OrientedCoordinateArray.js +94 -0
- data/vendor/assets/javascripts/jsts/noding/ScaledNoder.js +105 -0
- data/vendor/assets/javascripts/jsts/noding/SegmentIntersector.js +45 -0
- data/vendor/assets/javascripts/jsts/noding/SegmentNode.js +70 -0
- data/vendor/assets/javascripts/jsts/noding/SegmentNodeList.js +262 -0
- data/vendor/assets/javascripts/jsts/noding/SegmentPointComparator.js +78 -0
- data/vendor/assets/javascripts/jsts/noding/SegmentString.js +61 -0
- data/vendor/assets/javascripts/jsts/noding/SinglePassNoder.js +51 -0
- data/vendor/assets/javascripts/jsts/noding/snapround/HotPixel.js +271 -0
- data/vendor/assets/javascripts/jsts/noding/snapround/MCIndexPointSnapper.js +96 -0
- data/vendor/assets/javascripts/jsts/noding/snapround/MCIndexSnapRounder.js +147 -0
- data/vendor/assets/javascripts/jsts/operation/BoundaryOp.js +166 -0
- data/vendor/assets/javascripts/jsts/operation/GeometryGraphOperation.js +90 -0
- data/vendor/assets/javascripts/jsts/operation/IsSimpleOp.js +293 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/BufferBuilder.js +317 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/BufferInputLineSimplifier.js +294 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/BufferOp.js +340 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/BufferParameters.js +328 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/BufferSubgraph.js +296 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/OffsetCurveBuilder.js +369 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/OffsetCurveSetBuilder.js +301 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/OffsetSegmentGenerator.js +777 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/OffsetSegmentString.js +109 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/RightmostEdgeFinder.js +164 -0
- data/vendor/assets/javascripts/jsts/operation/buffer/SubgraphDepthLocater.js +220 -0
- data/vendor/assets/javascripts/jsts/operation/distance/ConnectedElementLocationFilter.js +67 -0
- data/vendor/assets/javascripts/jsts/operation/distance/DistanceOp.js +506 -0
- data/vendor/assets/javascripts/jsts/operation/distance/GeometryLocation.js +102 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/LineBuilder.js +194 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/MaximalEdgeRing.js +72 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/MinimalEdgeRing.js +33 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/OverlayNodeFactory.js +26 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/OverlayOp.js +584 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/PointBuilder.js +103 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/PolygonBuilder.js +282 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/snap/GeometrySnapper.js +228 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/snap/LineStringSnapper.js +228 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/snap/SnapIfNeededOverlayOp.js +85 -0
- data/vendor/assets/javascripts/jsts/operation/overlay/snap/SnapOverlayOp.js +134 -0
- data/vendor/assets/javascripts/jsts/operation/polygonize/EdgeRing.js +259 -0
- data/vendor/assets/javascripts/jsts/operation/polygonize/PolygonizeDirectedEdge.js +94 -0
- data/vendor/assets/javascripts/jsts/operation/polygonize/PolygonizeEdge.js +31 -0
- data/vendor/assets/javascripts/jsts/operation/polygonize/PolygonizeGraph.js +507 -0
- data/vendor/assets/javascripts/jsts/operation/polygonize/Polygonizer.js +259 -0
- data/vendor/assets/javascripts/jsts/operation/relate/EdgeEndBuilder.js +140 -0
- data/vendor/assets/javascripts/jsts/operation/relate/EdgeEndBundle.js +183 -0
- data/vendor/assets/javascripts/jsts/operation/relate/EdgeEndBundleStar.js +48 -0
- data/vendor/assets/javascripts/jsts/operation/relate/RelateComputer.js +444 -0
- data/vendor/assets/javascripts/jsts/operation/relate/RelateNode.js +46 -0
- data/vendor/assets/javascripts/jsts/operation/relate/RelateNodeFactory.js +25 -0
- data/vendor/assets/javascripts/jsts/operation/relate/RelateNodeGraph.js +118 -0
- data/vendor/assets/javascripts/jsts/operation/relate/RelateOp.js +75 -0
- data/vendor/assets/javascripts/jsts/operation/union/CascadedPolygonUnion.js +319 -0
- data/vendor/assets/javascripts/jsts/operation/union/PointGeometryUnion.js +118 -0
- data/vendor/assets/javascripts/jsts/operation/union/UnaryUnionOp.js +244 -0
- data/vendor/assets/javascripts/jsts/operation/union/UnionInteracting.js +156 -0
- data/vendor/assets/javascripts/jsts/operation/valid/ConnectedInteriorTester.js +259 -0
- data/vendor/assets/javascripts/jsts/operation/valid/ConsistentAreaTester.js +127 -0
- data/vendor/assets/javascripts/jsts/operation/valid/IndexedNestedRingTester.js +89 -0
- data/vendor/assets/javascripts/jsts/operation/valid/IsValidOp.js +619 -0
- data/vendor/assets/javascripts/jsts/operation/valid/TopologyValidationError.js +199 -0
- data/vendor/assets/javascripts/jsts/planargraph/DirectedEdge.js +232 -0
- data/vendor/assets/javascripts/jsts/planargraph/DirectedEdgeStar.js +168 -0
- data/vendor/assets/javascripts/jsts/planargraph/Edge.js +124 -0
- data/vendor/assets/javascripts/jsts/planargraph/GraphComponent.js +182 -0
- data/vendor/assets/javascripts/jsts/planargraph/Node.js +127 -0
- data/vendor/assets/javascripts/jsts/planargraph/NodeMap.js +76 -0
- data/vendor/assets/javascripts/jsts/planargraph/PlanarGraph.js +246 -0
- data/vendor/assets/javascripts/jsts/simplify/LineSegmentIndex.js +101 -0
- data/vendor/assets/javascripts/jsts/triangulate/DelaunayTriangulationBuilder.js +224 -0
- data/vendor/assets/javascripts/jsts/triangulate/IncrementalDelaunayTriangulator.js +111 -0
- data/vendor/assets/javascripts/jsts/triangulate/VoronoiDiagramBuilder.js +172 -0
- data/vendor/assets/javascripts/jsts/triangulate/quadedge/LastFoundQuadEdgeLocator.js +52 -0
- data/vendor/assets/javascripts/jsts/triangulate/quadedge/QuadEdge.js +437 -0
- data/vendor/assets/javascripts/jsts/triangulate/quadedge/QuadEdgeSubdivision.js +1064 -0
- data/vendor/assets/javascripts/jsts/triangulate/quadedge/TrianglePredicate.js +350 -0
- data/vendor/assets/javascripts/jsts/triangulate/quadedge/Vertex.js +496 -0
- data/vendor/assets/javascripts/jsts/util/Assert.js +80 -0
- data/vendor/assets/javascripts/jsts/util/AssertionFailedException.js +23 -0
- data/vendor/assets/javascripts/jsts/util/UniqueCoordinateArrayFilter.js +52 -0
- 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';
|