spatialdata.get_centroids

Contents

spatialdata.get_centroids#

spatialdata.get_centroids(e, coordinate_system='global')#

Get the centroids of the geometries contained in a SpatialElement, as a new Points element.

Parameters:
  • e (Union[SpatialImage, MultiscaleSpatialImage, GeoDataFrame, DataFrame]) – The SpatialElement. Only points, shapes (circles, polygons and multipolygons) and labels are supported.

  • coordinate_system (str (default: 'global')) – The coordinate system in which the centroids are computed.

Return type:

DataFrame

Notes

For Multipolygon.