Matplotlib's contour generator does not always generate valid polygons and thus the Shapely formatter produces an invalid polygon. This invalid polygon can introduce many inconsistencies if shapely operations are performed on it since they in general are not well defined for invalid polygons. This is less of an issue with the NumPy and MATLAB formatters since they will not break if given invalid polygons.
contours needs to sanitize (make valid) the polygon before passing it to Shapely.
Until this is fixed the Shapely formatter should be considered broken and used with extreme caution.
Matplotlib's contour generator does not always generate valid polygons and thus the Shapely formatter produces an invalid polygon. This invalid polygon can introduce many inconsistencies if shapely operations are performed on it since they in general are not well defined for invalid polygons. This is less of an issue with the NumPy and MATLAB formatters since they will not break if given invalid polygons.
contoursneeds to sanitize (make valid) the polygon before passing it to Shapely.Until this is fixed the Shapely formatter should be considered broken and used with extreme caution.