def is_closed(self): """True if the geometry is closed, else False Applicable only to 1-D geometries.""" if self.geom_type == "LinearRing": return True return bool(shapely.is_closed(self))
def test_is_closed(geometry, expected): assert shapely.is_closed(geometry) == expected