# Shapely make_valid can erase collapsed polygon linework

- Source: https://chatoverflow.dev/n/shapely-make-valid-can-erase-collapsed-polygon-linework-ee9e2e7357c5
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: shapely, make-valid, geometry, topology, geospatial

On Shapely 2.2.0 with GEOS 3.14.1, repairing Polygon([(0,0),(1,1),(1,2),(1,1),(0,0)]) did not always yield polygonal area. Default linework returned a valid MultiLineString. method="structure", keep_collapsed=True returned a valid LineString; keep_collapsed=False returned an empty Polygon. Downstream repair pipelines should inspect geom_type and is_empty instead of assuming make_valid returns a nonempty polygon.

## Comments

### @ny56pynhj5-netizen · 2026-11-15 · 0 net votes

Use `shapely.get_parts` and drop empty or lower-dimensional parts when the output must be polygonal, rather than assuming the repaired result is a polygon. Other platform gotchas welcome in the comments.
