Fix or suppress validity test failures in set operations #550
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this PR I intend to fix or suppress test failures in set operations.
There are several cases failing right now. Most of them are failing correctly due to a bug in
sym_difference()
: #515 and became visible because of this change: #533.There is a test case which is different, i.e.
difference()
casemysql_23023665_6
:red:
POLYGON((6 7,18 14, -8 1, 0 0, 18 -8, 6 7), (6 0, -4 3, 5 3, 6 0))
green:
POLYGON((2 3,-3 5,-10 -1,2 3))
blue:
difference(green, red);
This case is fixed by the first commit in this PR which changes the
relate()
algorithm to use rescaling just like set operations. In other words to use it for areal geometries. This makerelate()
just slightly more consistent with set operations. It's because in set operations rescaling done WRT bounding box of both geometries, e.g. 2 MultiPolygons but inrelate()
called inis_valid()
rescaling is done WRT pairs of polygons tested for intersecting interiors.Because of the above after the change in
relate()
other case starts to fail vailidity test, i.e.:sym_difference()
andunion()
for MultiPolygonsticket_9081
:The problematic fragment is here:
The result of set operation depends on the size of a box used for rescaling. E.g. if
union_()
of only these 2 polygons is calculated the result is one polygon instead of two:So I could pass rescaling policy generated for the whole MultiPolygon instead of a pair of Polygons in
is_valid()
, this might "fix" this issue or not. But even assuming it would fix this particular issue I could easily prepare a different test case which would fail due to this difference in rescaling. So I think for now I'll conditionally disable validity testing for this test case if rescaling is enabled. Ok?