polartoolkit.points_inside_shapefile

polartoolkit.points_inside_shapefile#

points_inside_shapefile(points, shapefile, crs=None, coord_names=None, hemisphere=None, epsg=None)[source]#

return a subset of a dataframe which is located inside a shapefile.

Parameters:
  • points (DataFrame | GeoDataFrame) โ€“ dataframe with coordinate columns specified by coord_names to use for defining if within shapefile

  • shapefile (GeoDataFrame) โ€“ shapefile to use for defining if point are within it or not

  • crs (str | None) โ€“ if points is not a geodataframe, crs to use to convert into a geodataframe, by default None

  • coord_names (tuple[str, str] | None) โ€“ names of coordinate columns, by default โ€˜xโ€™ and โ€˜yโ€™ or โ€˜eastingโ€™ and โ€˜northingโ€™

  • hemisphere (str | None) โ€“ set projection based on โ€œnorthโ€ or โ€œsouthโ€ hemispheres, by default None

  • epsg (str | None) โ€“ set projection from EPSG code string (โ€œ3031โ€), by default None

Returns:

returns a subset dataframe

Return type:

DataFrame | GeoDataFrame