Skip to content

Commit c70fe68

Browse files
committed
Reject polygons that are completely collinear
1 parent 5b22283 commit c70fe68

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/transformations/correction/cut_at_antimeridian.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ function build_polygons(segments::Vector{Vector{Tuple{Float64,Float64}}})::Vecto
237237
if !all(p == segment[1] for p in segment)
238238
push!(polygons, GI.Polygon([segment]))
239239
end
240-
return polygons
240+
return filter(polygons) do p
241+
x1 = GI.x(first(GI.getpoint(p)))
242+
!all(p -> GI.x(p) == x1, GI.getpoint(p))
243+
end
241244
end
242245
end
243246

0 commit comments

Comments
 (0)