#NEWLINE# @ staticmethod #NEWLINE# def _split_polygon_with_line( poly , splitter ) : #NEWLINE# #INDENT# 'Split a Polygon with a LineString' #NEWLINE# assert isinstance ( poly , Polygon ) #NEWLINE# assert isinstance ( splitter , LineString ) #NEWLINE# union = poly . boundary . union ( splitter ) #NEWLINE# return [ pg for pg in polygonize ( union ) if poly . contains ( pg . representative_point ( ) ) ]