def count_points_in_polygon(x,points_sindex):
    """Count points in a polygon

    Inputs are:
        x -- row of dataframe
        points_sindex -- spatial index of dataframe with points in the region to consider
    Outputs are:
        Amount of points in polygon
    """
    return len(list(points_sindex.intersection(x.bounds)))