-
Notifications
You must be signed in to change notification settings - Fork 19
Description
There's an issue with the procedure to add points of adjacent layers to a newly added layer. The implementation is in the connect_layers method of the DStabilityModel. It converts the to-be-added layer and an existing layer to linestrings, makes a union of the two and then uses the shapely operation polygonize to turn them into polygons. Finally it checks if the result of polygonize has two polygons. If it doesn't, then the original polygons are returned.
Works like a charm, except when there are layers enclosed by the two layers under consideration. See the example beneath, where the blue and orange layers are being considered. polygonize then also creates the green enclosed layer. This results in three polygons, hence the original polygons are returned because there are more than two polygons. Resulting in an invalid geometry.
