public void TestSimpleLineIntersection()
 {
     var a = Read("LINESTRING (1 1, 9 1)");
     var b = Read("POINT (5 1)");
     var expected = Read("POINT (5 1)");
     CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
 }
 public void TestPointLineIntersectionPrec()
 {
     var a = Read("POINT (10.1 10.4)");
     var b = Read("LINESTRING (9.6 10, 20.1 19.6)");
     var expected = Read("POINT EMPTY");
     CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
 }
 public void TestPolygonDisjointIntersection()
 {
     var a = Read("POLYGON ((4 2, 6 2, 6 0, 4 0, 4 2))");
     var b = Read("POINT (15 1)");
     var expected = Read("POINT EMPTY");
     CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
 }
 public void TestLinePointInOutIntersection()
 {
     var a = Read("LINESTRING (1 1, 9 1)");
     var b = Read("MULTIPOINT ((5 1), (15 1))");
     var expected = Read("POINT (5 1)");
     CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
 }
Пример #5
0
        public void TestDisjointLinesRoundedIntersection()
        {
            var a        = Read("LINESTRING (3 2, 3 4)");
            var b        = Read("LINESTRING (1.1 1.6, 3.8 1.9)");
            var expected = Read("POINT (3 2)");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #6
0
        public void TestRoundedBoxesIntersection()
        {
            var a        = Read("POLYGON ((0.6 0.1, 0.6 1.9, 2.9 1.9, 2.9 0.1, 0.6 0.1))");
            var b        = Read("POLYGON ((1.1 3.9, 2.9 3.9, 2.9 2.1, 1.1 2.1, 1.1 3.9))");
            var expected = Read("LINESTRING (1 2, 3 2)");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #7
0
        public void TestPolyPolyTouchIntersection()
        {
            var a        = Read("POLYGON ((300 0, 100 0, 100 100, 300 100, 300 0))");
            var b        = Read("POLYGON ((100 200, 300 200, 300 100, 200 100, 200 0, 100 0, 100 200))");
            var expected = Read("GEOMETRYCOLLECTION (LINESTRING (200 100, 300 100), POLYGON ((200 0, 100 0, 100 100, 200 100, 200 0)))");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #8
0
        public void TestParallelSpikes()
        {
            var a        = Read("POLYGON ((1 3.3, 1.3 1.4, 3.1 1.4, 3.1 0.9, 1.3 0.9, 1 -0.2, 0.8 1.3, 1 3.3))");
            var b        = Read("POLYGON ((1 2.9, 2.9 2.9, 2.9 1.3, 1.7 1, 1.3 0.9, 1 0.4, 1 2.9))");
            var expected = Read("POLYGON EMPTY");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #9
0
        public void TestEmptyInputIntersection()
        {
            var a        = Read("MULTIPOINT ((1 1), (3 1))");
            var b        = Read("POINT EMPTY");
            var expected = Read("POINT EMPTY");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #10
0
        public void TestSimpleIntersection()
        {
            var a        = Read("MULTIPOINT ((1 1), (2 1))");
            var b        = Read("POINT (2 1)");
            var expected = Read("POINT (2 1)");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #11
0
        public void TestDisjointPointsRoundedIntersection()
        {
            var a        = Read("POINT (10.1 10)");
            var b        = Read("POINT (10 10.1)");
            var expected = Read("POINT (10 10)");

            CheckEqual(expected, OverlayNGTest.Intersection(a, b, 1));
        }
Пример #12
0
 public static Geometry Intersection(Geometry a, Geometry b, double scaleFactor)
 {
     return(OverlayNGTest.Intersection(a, b, scaleFactor));
 }