It doesn't make sense to add or remove points from a Polygon
's exterior, because you'd want to recalculate poly.area
, poly.length
, etc. anyway. Instead, create a new Polygon
instance from the old polygon's coordinates:
coords = poly.exterior.coords[:]
coords[1] = (2.0, 6.0) # coordinate to change
new_poly = Polygon(coords)
Note that this doesn't account for points in poly.interior
.