Opened 8 years ago
Closed 8 years ago
#9988 closed Bugs (invalid)
boost::geometry::intersection returns opposite of intersection
Reported by: | Owned by: | Barend Gehrels | |
---|---|---|---|
Milestone: | To Be Determined | Component: | geometry |
Version: | Boost 1.55.0 | Severity: | Problem |
Keywords: | intersection | Cc: |
Description
For some geometries boost intersection returns a geometry that is the opposite (the geometric difference) of the intersection. Here is an exampl. Geometry 1: POLYGON((-84.5922 35.9063, -84.5924 35.9064, -84.5929 35.9062, -84.5926 35.9057, -84.5927 35.9056, -84.5926 35.9054, -84.5915 35.9058, -84.5915 35.906, -84.5918 35.9065, -84.5922 35.9063)) Geometry 2: POLYGON((-84.5932 35.9051, -84.5932 35.906, -84.5921 35.906, -84.5921 35.9051, -84.5932 35.9051)) Output: POLYGON((-84.5928 35.906, -84.5926 35.9057,-84.5927 35.9056, -84.5926 35.9054, -84.5921 35.9056, -84.5921 35.9051, -84.5932 35.9051, -84.5932 35.906, -84.5928 35.906)) Correct Output: POLYGON ((-84.5921 35.905581818181815, -84.5926 35.9054, -84.5927 35.9056, -84.5926 35.9057, -84.59278 35.906, -84.5921 35.906, -84.5921 35.905581818181815))
Change History (2)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Hi, thanks for your report.
One of your geometries is counter clockwise. Please use boost::geometry::correct in that case. If done, the intersection is OK. Producing the difference with a counter clockwise polygon is intentional - it considers all of the outside as the polygon, and makes an intersection with that all-of-the-outside with the polygon. This is the difference.
I resolve it as "invalid"
Regards, Barend
Sorry for the formatting, I don't think I can edit the post.