Beispiel #1
0
        private static void AssertCanJoin(IPolyline line1, IPolyline line2)
        {
            var path1 = (IPath)((IGeometryCollection)line1).get_Geometry(0);

            double totalLength = path1.Length + line2.Length;

            IPolyline resultPolyline = GeometryFactory.Clone(line2);
            var       resultPath     = (IPath)((IGeometryCollection)resultPolyline).get_Geometry(0);

            SegmentReplacementUtils.JoinConnectedPaths(path1, resultPath);
            GeometryUtils.Simplify(resultPolyline, true, true);

            Assert.AreEqual(totalLength, resultPath.Length);
            Assert.AreEqual(1, ((IGeometryCollection)resultPolyline).GeometryCount);
        }