areaSort#

geetools.ee_feature_collection.FeatureCollectionAccessor.areaSort(ascending=True)#

Sort the features in the collection by area.

Parameters:

ascending (bool) – Whether to sort in ascending order.

Returns:

The sorted collection.

Return type:

ee.FeatureCollection

Examples

import ee, geetools
from geetools.utils import initialize_documentation

initialize_documentation()

fc = ee.FeatureCollection("FAO/GAUL/2015/level0").limit(5)
fc = fc.geetools.areaSort()
fc.aggregate_array("ADM0_NAME").getInfo()
['Montenegro', 'Taiwan', 'Serbia', 'South Sudan', 'Sudan']