polartoolkit.points_inside_region

polartoolkit.points_inside_region#

points_inside_region(df, region, names=('x', 'y'), reverse=False)[source]#

return a subset of a dataframe which is within a region

Parameters:
  • df (DataFrame) โ€“ dataframe with coordinate columns to use for defining if within region

  • region (tuple[float, float, float, float]) โ€“ bounding region in format [xmin, xmax, ymin, ymax] for bounds of new subset dataframe

  • names (tuple[str, str]) โ€“ column names to use for x and y coordinates, by default (โ€œxโ€, โ€œyโ€) or (โ€œeastingโ€, โ€œnorthingโ€)

  • reverse (bool) โ€“ if True, will return points outside the region, by default False

Returns:

returns a subset dataframe

Return type:

DataFrame