spatialdata.polygon_query#

spatialdata.polygon_query(sdata, polygons, target_coordinate_system, filter_table=True, shapes=True, points=True, images=True, labels=True)#

Query a spatial data object by a polygon, filtering shapes and points.

Parameters:
  • sdata (SpatialData) – The SpatialData object to query

  • polygon – The polygon (or list of polygons) to query by

  • target_coordinate_system (str) – The coordinate system of the polygon

  • shapes (bool (default: True)) – Whether to filter shapes

  • points (bool (default: True)) – Whether to filter points

Return type:

SpatialData

Returns:

: The queried SpatialData object with filtered shapes and points.

Notes

This function will be refactored to be more general. The table is not filtered by this function, but is passed as is, this will also changed during the refactoring making this function more general and ergonomic.