-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
Sorry that these coordinates are complicated, I haven't been able to recreate with simpler coordinates.
using LibGEOS, Plots
c1 = [[[0.0, 65905.78568220709], [12540.144108116785, 66644.10887217366], [13639.90993528687, 64693.73062699103], [13323.160413385054, 61494.1194419435], [2375.0223287135154, 53673.4087205281], [0.0, 52759.58192468053], [0.0, 65905.78568220709]]]
c2 = [[[23303.577415035626, 55323.60484150198], [19851.52938808218, 49637.68131132904], [2375.022328713516, 53673.4087205281], [13323.160413385054, 61494.1194419435], [23303.577415035626, 55323.60484150198]]]
p1 = LibGEOS.Polygon(c1)
p2 = LibGEOS.Polygon(c2)
plot(p1) # top in image below
plot!(p2) # bottom in image below
When plotted, they look like follows:
They don't appear to be overlapping. However, the union is the lower of the two polygons, and the intersection is the bottom.
u = LibGEOS.union(p1, p2)
plot!(u)
i = LibGEOS.intersection(p1, p2)
plot!(i)
All polygons are valid if tested with ifValid. This doesn't happen if I set up two squares that share a border. Then the intersection is the line between them, and the union is a larger rectangle made of both.
Please let me know if I am missing something.
Metadata
Metadata
Assignees
Labels
No labels


