xoa.core.geo.GeoSelector.select

xoa.core.geo.GeoSelector.select#

GeoSelector.select(shape, fit='outer', pad=0, pad_units='points')[source]#

Find the indices of the points that are in a shape

Parameters:
  • shape (Box, Circle, Polygon) – Any object with a bounds and a contains method

  • fit ({"outer", "inner"}) – Either the smallest window that contains all the points inside the shape, with a mask when some points of the window are outside, or the largest window with only points inside, without mask.

  • pad (float, "edges") – Margin around the shape, in pad_units. With "edges", which is 0.5 grid point, points are selected when their cell touches the shape.

  • pad_units ({"points", "dist", "deg"}) – Either grid points, with a local estimate of the step given by the cell extent (half_extents), a distance in the units of the radius, or an arc in degrees. Grid points are not valid for a cloud of points.

Returns:

  • tuple – Indexers along each axis, as slices or arrays of indices

  • array_like, None – Boolean mask of the points of the window that are inside, with one dimension per indexer, or None if all of them are inside or if there is no window.