medoid#

geetools.ImageCollectionAccessor.medoid()#

Compute the medoid of the ee.ImageCollection.

The medoid is the image that has the smallest sum of distances to all other images in the collection. The distance is computed using the Euclidean distance between the pixels of the images.

Returns:

An Image that is the medoid of the ee.ImageCollection.

Return type:

ee.Image

Examples

import ee, geetools

ee.Initialize()

collection = (
    ee.ImageCollection("LANDSAT/LC08/C01/T1_TOA")
    .filterBounds(ee.Geometry.Point(-122.262, 37.8719))
    .filterDate("2014-01-01", "2014-12-31")
)

medoid = collection.geetools.medoid()
print(medoid.getInfo())