(line, splitter)
return chunks
Split a LineString with a MultiPoint
Split a LineString with a MultiPoint
Split a LineString with a MultiPoint
def _split_line_with_multipoint(line, splitter):
        """Split a LineString with a MultiPoint"""

        assert(isinstance(line, LineString))
        assert(isinstance(splitter, MultiPoint))

        chunks = [line]
        for pt in splitter.geoms:
            new_chunks = []
            for chunk in filter(lambda x: not x.is_empty, chunks):
                # add the newly split 2 lines or the same line if not split
                new_chunks.extend(SplitOp._split_line_with_point(chunk, pt))
            chunks = new_chunks

        return chunks
def _split_line_with_multipoint ( line , splitter ) : assert ( isinstance ( line , LineString ) ) assert ( isinstance ( splitter , MultiPoint ) ) chunks = [ line ] for pt in splitter . geoms : new_chunks = [ ] for chunk in filter ( lambda x : not x . is_empty , chunks ) : # add the newly split 2 lines or the same line if not split new_chunks . extend ( SplitOp . _split_line_with_point ( chunk , pt ) ) chunks = new_chunks return chunks