diff --git a/Project.toml b/Project.toml index 28b58d351..70a473743 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GeometryOps" uuid = "3251bfac-6a57-4b6d-aa61-ac1fef2975ab" authors = ["Anshul Singhvi ", "Rafael Schouten ", "Skylar Gering ", "and contributors"] -version = "0.1.38" +version = "0.1.39" [deps] AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" diff --git a/src/methods/geom_relations/geom_geom_processors.jl b/src/methods/geom_relations/geom_geom_processors.jl index 0049f993d..602c2588f 100644 --- a/src/methods/geom_relations/geom_geom_processors.jl +++ b/src/methods/geom_relations/geom_geom_processors.jl @@ -627,6 +627,7 @@ function _line_filled_curve_interactions( elseif mid_val == point_out out_curve = true end + p_start = p_end end # already checked segment against whole filled curve l_start = l_end diff --git a/test/methods/geom_relations.jl b/test/methods/geom_relations.jl index 4e3cb4622..42528eb50 100644 --- a/test/methods/geom_relations.jl +++ b/test/methods/geom_relations.jl @@ -57,6 +57,9 @@ p10 = LG.Polygon([ [[0.15, 0.55], [0.15, 0.95], [0.55, 0.95], [0.55, 0.55], [0.15, 0.55]] ]) p11 = LG.Polygon(r3) +# Polygon with interior notch sharing collinear edges with a rectangle (issue #396) +p12 = LG.Polygon([[[0.0, 0.0], [0.0, 4.0], [8.0, 4.0], [8.0, 0.0], [0.0, 0.0]]]) +p13 = LG.Polygon([[[0.0, 0.0], [0.0, 2.0], [7.0, 1.0], [7.0, 3.0], [0.0, 3.0], [0.0, 4.0], [8.0, 4.0], [8.0, 0.0], [0.0, 0.0]]]) mpt1 = LG.MultiPoint([pt1, pt2]) mpt2 = LG.MultiPoint([pt2, pt3]) @@ -157,6 +160,8 @@ test_pairs = [ (p6, p1, "p6", "p1", "Polygon inside of other polygon's hole"), (p7, p1, "p7", "p1", "Polygons overlap"), (p10, p1, "p10", "p1", "Polygon's with nested holes"), + (p12, p13, "p12", "p13", "Rectangle with polygon with collinear notch (#396)"), + (p13, p12, "p13", "p12", "Polygon with collinear notch inside rectangle (#396)"), # Multigeometries (mpt1, mpt1, "mpt1", "mpt1", "Same set of points for multipoints"), (mpt1, mpt2, "mpt1", "mpt2", "Some point matches, others are different"),