Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference depends on order of polygons #193

Open
asinghvi17 opened this issue Aug 3, 2024 · 0 comments
Open

difference depends on order of polygons #193

asinghvi17 opened this issue Aug 3, 2024 · 0 comments
Labels
bug Something isn't working clipping About polygon clipping or processing

Comments

@asinghvi17
Copy link
Member

asinghvi17 commented Aug 3, 2024

I was trying to make a more minimal example for #191 and ran into the following strange bug.

julia> import GeometryOps as GO, GeoInterface as GI
julia> p56 = GI.Polygon([[(0.0, 0.0), (0.0, 10.0), (10.0, 10.0), (10.0, 0.0), (0.0, 0.0)]]);
julia> p57 = GI.Polygon([[(0.0, 0.0), (0.0, 11.0), (11.0, 11.0), (11.0, 0.0), (0.0, 0.0)]]);
julia> p1 = GO.difference(p57, p56; target = GI.PolygonTrait()) # this is good
1-element Vector{GeoInterface.Wrappers.Polygon{false, false, Vector{GeoInterface.Wrappers.LinearRing{false, false, Vector{Tuple{Float64, Float64}}, Nothing, Nothing}}, Nothing, Nothing}}:
 GeoInterface.Wrappers.Polygon{false, false, Vector{GeoInterface.Wrappers.LinearRing{false, false, Vector{Tuple{Float64, Float64}}, Nothing, Nothing}}, Nothing, Nothing}(GeoInterface.Wrappers.LinearRing{false, false, Vector{Tuple{Float64, Float64}}, Nothing, Nothing}[GeoInterface.Wrappers.LinearRing{false, false, Vector{Tuple{Float64, Float64}}, Nothing, Nothing}([(0.0, 10.0), (0.0, 11.0), (11.0, 11.0), (11.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)], nothing, nothing)], nothing, nothing)

julia> p1 = GO.difference(p56, p57; target = GI.PolygonTrait()) # this is bad
GeoInterface.Wrappers.Polygon{false, false, Vector{GeoInterface.Wrappers.LinearRing{false, false, Vector{Tuple{Float64, Float64}}, Nothing, Nothing}}, Nothing, Nothing}[]
julia> begin; f, a, p = poly(p56); poly!(a, p57); f; end

download-3

@asinghvi17 asinghvi17 added bug Something isn't working clipping About polygon clipping or processing labels Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working clipping About polygon clipping or processing
Projects
None yet
Development

No branches or pull requests

1 participant