bento.geo.overlay

bento.geo.overlay(sdata, s1, s2, name, how='intersection', make_valid=True)

Overlay two shape elements in a SpatialData object and store the result as a new shape element.

Parameters:
  • sdata (SpatialData) – Spatial formatted SpatialData object

  • s1 (str) – Name of the first shape element

  • s2 (str) – Name of the second shape element

  • how (str) – Type of overlay operation to perform. Options are “intersection”, “union”, “difference”, “symmetric_difference”, by default “intersection”

  • make_valid (bool) – If True, correct invalid geometries with GeoPandas, by default True

  • instance_key (str) – Name of the shape element to use as the instance for indexing, by default “cell_boundaries”. If None, no indexing is performed.

Returns:

A new SpatialData object with the resulting shapes from the overlay operation.

Return type:

SpatialData