Opened 3 years ago
Closed 3 years ago
#1099 closed defect (fixed)
Polygon compareToSameClass does not account for holes
Reported by: | Brendan Ward | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 3.10.0 |
Component: | Default | Version: | 3.9.0 |
Severity: | Unassigned | Keywords: | |
Cc: |
Description
This function returns true even if holes are different between polygons.
Only the outer shell is compared: https://github.com/libgeos/geos/blob/3.9/src/geom/Polygon.cpp#L329-L333
This looks like it is also the same case in JTS: https://github.com/locationtech/jts/blob/jts-1.18.0/modules/core/src/main/java/org/locationtech/jts/geom/Polygon.java#L369-L396
(only the second variant compares holes)
Looks like the fix here is to use a similar approach as the second function above in GEOS. Working up a PR per that approach now.
Change History (3)
comment:1 by , 3 years ago
comment:3 by , 3 years ago
Milestone: | 3.9.1 → 3.10.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Resolved by https://github.com/libgeos/geos/pull/397
Dang, that's a bit egregious. Definitely needs to be fixed.