geost.base.CptCollection.select_within_polygons#

CptCollection.select_within_polygons(polygons: str | Path | GeoDataFrame | PolygonGeometries, buffer: float | int = 0, invert: bool = False)#

Make a selection of the collection based on polygon geometries.

Parameters:
  • polygons (str | Path | gpd.GeoDataFrame | PolygonGeometries) – Any type of polygon geometries that can be used for the selection: GeoDataFrame containing polygons or filepath to a shapefile like file, or Shapely Polygon, MultiPolygon or list containing Polygon objects.

  • buffer (float | int, optional) – Optional buffer distance around the polygon selection geometries, by default 0.

  • invert (bool, optional) – Invert the selection, by default False.

Returns:

New instance of the current object containing only the selection resulting from application of this method. e.g. if you are calling this method from a Collection, you will get an instance of a Collection back.

Return type:

New instance of the current object.