Closed AtiX closed 7 years ago
I'm kind of guessing here, but i think it is meant to be like this, and that the algorithm does not explicitly distinguish between holes and multiple polygons. The return value is simply an array of linear rings and it's up to the user to interpret the meaning of them. In your case, one can in effect think of the return value as an invalid polygon where the second LR is a hole which lies outside the first LR...
I agree, a more structured response would be nice, but may not be within the purview of this module
@fresidue, exactly, thanks for the explanation. We will be looking into this issue a bit later, cause actually, the algorithm is capable of maintaining, so to say, the geometry depth, but now it's buggy, to say the least.
👍 +1 @AtiX comments, noticed the same issue.
and it's up to the user to interpret the meaning of them.
@fresidue I disagree, the user can't distinguish the inner & outers, especially if the outer is not in the first position and the inners & outers are mixed (also trying to achieve this with minimal performance loss).
Example If you had your source polygon with an inner, and the target did a difference
operation, then you would receive 3 polygons (linestrings) in no particular order.
https://gist.github.com/5a8496e2ffc77dfe47c7ffbed8a8fb59
The results "look" good as a single Polygon (Geometry is malformed), however there's not an easy way to convert it to a MultiPolygon or a collection of individual Polygons.
The changes are released in 0.2.0
🎉 Woot!
Hi,
I have a question regarding the return values of the operations - more specifically, in what cases is a MultiPolygon (since the API docs specify
<Geometry>
as either Polygon or MultiPolygon) returned?Take this example looking at the
difference
operation:The big polygon is split in two by the smaller polygon - so far so good. However, the return value is one Polygon with a hole (with the hole not being within the outline, which makes not that much sense):
I did expect a MultiPolygon return value, since the two polygons aren't connected to each other anymore, so a value like:
Is this a known limitation / a bug / should that be like this?
Thanks :smile: !