Exemple #1
0
def subtract_turbine_exclusion_zone(min_spacing: float,
                                    source_shape: BaseGeometry,
                                    turbine_positions: [Point],
                                    ) -> BaseGeometry:
    """
    Subtract the min spacing around each turbine from a site polygon
    :param min_spacing: minimum distance around turbine
    :param source_shape: site polygon
    :param turbine_positions: Points of the turbines within the source_shape
    :return: modified shape with the circles around the turbines removed
    """
    if len(turbine_positions) <= 0:
        return source_shape
    return source_shape.difference(
        unary_union([turbine.buffer(min_spacing) for turbine in turbine_positions]))