(self, geoms, distance, index)
return points, ids
geoms - array of pygeos lines
geoms - array of pygeos lines
geoms - array of pygeos lines
def _dense_point_array(self, geoms, distance, index):
        """
        geoms - array of pygeos lines
        """
        # interpolate lines to represent them as points for Voronoi
        points = []
        ids = []

        if pygeos.get_type_id(geoms[0]) not in [1, 2, 5]:
            lines = pygeos.boundary(geoms)
        else:
            lines = geoms
        lengths = pygeos.length(lines)
        for ix, line, length in zip(index, lines, lengths):
            if length > distance:  # some polygons might have collapsed
                pts = pygeos.line_interpolate_point(
                    line,
                    np.linspace(0.1, length - 0.1, num=int((length - 0.1) // distance)),
                )  # .1 offset to keep a gap between two segments
                points.append(pygeos.get_coordinates(pts))
                ids += [ix] * len(pts)

        points = np.vstack(points)

        return points, ids
def _dense_point_array ( self , geoms , distance , index ) : # interpolate lines to represent them as points for Voronoi points = [ ] ids = [ ] if pygeos . get_type_id ( geoms [ 0 ] ) not in [ 1 , 2 , 5 ] : lines = pygeos . boundary ( geoms ) else : lines = geoms lengths = pygeos . length ( lines ) for ix , line , length in zip ( index , lines , lengths ) : if length > distance : # some polygons might have collapsed pts = pygeos . line_interpolate_point ( line , np . linspace ( 0.1 , length - 0.1 , num = int ( ( length - 0.1 ) // distance ) ) , ) # .1 offset to keep a gap between two segments points . append ( pygeos . get_coordinates ( pts ) ) ids += [ ix ] * len ( pts ) points = np . vstack ( points ) return points , ids