def smooth_linestring(linestring, smooth_sigma):
    smooth_x = np.array(filters.gaussian_filter1d(
        linestring.xy[0],
        smooth_sigma)
        )
    smooth_y = np.array(filters.gaussian_filter1d(
        linestring.xy[1],
        smooth_sigma)
        )
    smoothed_coords = np.hstack((smooth_x, smooth_y))
    smoothed_coords = zip(smooth_x, smooth_y)
    linestring_smoothed = LineString(smoothed_coords)
    return linestring_smoothed
Uses a gauss filter to smooth out the LineString coordinates.
dataset/ETHPy150Open ungarj/label_centerlines/src_create_centerlines.py/smooth_linestring