geost.accessor.GeostFrame.select_within_polygons#

GeostFrame.select_within_polygons(polygons: str | Path | GeoDataFrame | GeometryType, buffer: float | int = 0, invert: bool = False) GeoDataFrame[source]#

Select all data that lie within given polygon geometries.

Parameters:
  • polygons (str | Path | gpd.GeoDataFrame | GeometryType) – 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. The default is 0.

  • invert (bool, optional) – Invert the selection, selects all data that lie outside the selection polygons.

Returns:

GeoDataFrame instance containing only the selected geometries.

Return type:

gpd.GeoDataFrame