Closed aaron-zonder-meer closed 3 years ago
Hi Aaron, I will take a look.
@aaron-zonder-meer I believe the problem here is because the second multipolygon seems to be invalid. It consists of a single Polygon that consists of 5 concentric rings. Instead, it should consist of 3 polygons, and the holes should be oriented according to the spec: See this https://tools.ietf.org/html/rfc7946#section-3.1.6 https://tools.ietf.org/html/rfc7946#section-3.1.7
Try using makeSimple on the second geometry before passing it to union.
@stolstov Thank you very much for your quick response. Like you said, this geometry was not according to the spec, and not considered 'simple' in the framework. Your solution helped a great deal. As far as I'm concerned, this issue can be closed.
It seems that the union method on the OGCGeometry does not behave as expected. The first case is when a MultiPolygon with multiple inner rings is unioned with itself. The second case is when a MultiPolygon with multiple inner rings is unioned with a simple polygon (rectangle).
The set up is as follows:
version:
example code snippet:
Result union on same shape:
result of union with different shape:
original shapes: