groupInterval#

geetools.ImageCollectionAccessor.groupInterval(unit='month', duration=1)#

Transform the ee.ImageCollection into a list of smaller collection of the specified duration.

For example using unit as “month” and duration as 1, the ee.ImageCollection will be transformed into a list of ee.ImageCollection with each ee.ImageCollection containing images for each month. Make sure the collection is filtered beforehand to reduce the number of images that needs to be processed.

Parameters:
  • unit (str) – The unit of time to split the collection. Available units: year, month, week, day, hour, minute or second.

  • duration (int) – The duration of each split.

Returns:

A list of ee.ImageCollection grouped by interval

Return type:

ee.List

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")
)

split = collection.geetools.groupInterval("month", 1)
print(split.getInfo())