Not sure why, but some polygons become invalid (which usually means a
self-intersecting "polygon", such as two triangles that meet at a point)
during this transformation. Shapely includes a tool to reshape polygons
into validity, so use that.
(cherry picked from commit 1f4fd0fd04fa62f100eae141a594fee33206b330)