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 TestSimpleLineSymDifference() { var a = Read("LINESTRING (1 1, 9 1)"); var b = Read("POINT (5 1)"); var expected = Read("LINESTRING (1 1, 9 1)"); CheckEqual(expected, OverlayNGTest.SymDifference(a, b, 1)); }
public void TestLinePointSymDifference() { var a = Read("LINESTRING (1 1, 9 1)"); var b = Read("POINT (15 1)"); var expected = Read("GEOMETRYCOLLECTION (POINT (15 1), LINESTRING (1 1, 9 1))"); CheckEqual(expected, OverlayNGTest.SymDifference(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 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)); }
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 TestLinestringEmptyPointUnion() { var a = Read("LINESTRING (10 10, 20 20)"); var b = Read("POINT EMPTY"); var expected = Read("LINESTRING (10 10, 20 20)"); var actual = OverlayNGTest.Union(a, b, 1); CheckEqual(expected, actual); }
public void TestSimpleSymDifference() { var a = Read("MULTIPOINT ((1 2), (1 1), (2 2), (2 1))"); var b = Read("MULTIPOINT ((2 2), (2 1), (3 2), (3 1))"); var expected = Read("MULTIPOINT ((1 2), (1 1), (3 2), (3 1))"); CheckEqual(expected, OverlayNGTest.SymDifference(a, b, 1)); }
public void TestEmptyInputUUnion() { var a = Read("MULTIPOINT ((1 1), (3 1))"); var b = Read("POINT EMPTY"); var expected = Read("MULTIPOINT ((1 1), (3 1))"); CheckEqual(expected, OverlayNGTest.Union(a, b, 1)); }
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)); }
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)); }
public void TestSimpleFloatUnion() { var a = Read("MULTIPOINT ((1 1), (1.5 1.1), (2 1), (2.1 1.1))"); var b = Read("MULTIPOINT ((1.5 1.1), (2 1), (2 1.2))"); var expected = Read("MULTIPOINT ((1 1), (1.5 1.1), (2 1), (2 1.2), (2.1 1.1))"); CheckEqual(expected, OverlayNGTest.Union(a, b)); }
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)); }
public void TestEmptyDifference() { var a = Read("MULTIPOINT ((1 1), (3 1))"); var b = Read("MULTIPOINT ((1 1), (2 1), (3 1))"); var expected = Read("POINT EMPTY"); CheckEqual(expected, OverlayNGTest.Difference(a, b, 1)); }
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)); }
public void TestTriangleFillingHoleUnionPrec10() { var a = Read("POLYGON ((0 0, 4 0, 4 4, 0 4, 0 0), (1 1, 1 2, 2 1, 1 1), (1 2, 1 3, 2 3, 1 2), (2 3, 3 3, 3 2, 2 3))"); var b = Read("POLYGON ((2 1, 3 1, 3 2, 2 1))"); var expected = Read("POLYGON ((0 0, 0 4, 4 4, 4 0, 0 0), (1 2, 1 1, 2 1, 1 2), (2 3, 1 3, 1 2, 2 3), (3 2, 3 3, 2 3, 3 2))"); CheckEqual(expected, OverlayNGTest.Union(a, b, 10)); }
public void TestBoxHoleCollapseAlongBEdgeUnion() { var a = Read("POLYGON ((0 3, 3 3, 3 0, 0 0, 0 3), (1 1.2, 1 1.1, 2.3 1.1, 1 1.2))"); var b = Read("POLYGON ((1 1, 2 1, 2 0, 1 0, 1 1))"); var expected = Read("POLYGON ((0 0, 0 3, 3 3, 3 0, 2 0, 1 0, 0 0))"); CheckEqual(expected, OverlayNGTest.Union(b, a, 1)); }
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)); }
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)); }
public void TestCollapseBoxTriangleUnion() { var a = Read("POLYGON ((10 10, 100 10, 10 11, 10 10))"); var b = Read("POLYGON ((90 0, 200 0, 200 200, 90 200, 90 0))"); var expected = Read("MULTIPOLYGON (((90 10, 10 10, 10 11, 90 10)), ((90 10, 90 200, 200 200, 200 0, 90 0, 90 10)))"); CheckEqual(expected, OverlayNGTest.Union(a, b, 1)); }
public static Geometry Intersection(Geometry a, Geometry b, double scaleFactor) { return(OverlayNGTest.Intersection(a, b, scaleFactor)); }