byProperties#

geetools.ee_feature_collection.FeatureCollectionAccessor.byProperties(featureId='system:index', properties=[], labels=[])#

Get a dictionary with all feature values for each properties.

This method is returning a dictionary with all the properties as keys and their values in each feaure as a list.

{
    "property1": {"feature1": value1, "feature2": value2, ...},
    "property2": {"feature1": value1, "feature2": value2, ...},
    ...
}

The output remain server side and can be used to create a client side plot.

Parameters:
  • featureId (str | ee.String) – The property used to label features. Defaults to “system:index”.

  • properties (list | ee.List) – A list of properties to get the values from.

  • labels (list) – A list of names to replace properties names. Default to the properties names.

Returns:

A dictionary with all the properties as keys and their values in each feaure as a list.

Return type:

ee.Dictionary

See also

Example

import ee, geetools
from geetools.utils import initialize_documentation
from matplotlib import pyplot as plt

initialize_documentation()

fc = ee.FeatureCollection("FAO/GAUL/2015/level2").limit(3)
d = fc.geetools.byProperties(properties=["ADM1_CODE", "ADM2_CODE"])
d.getInfo()
{'ADM1_CODE': {'00000000000000000253': 48357,
  '00000000000000000267': 115003,
  '00000000000000000269': 115003},
 'ADM2_CODE': {'00000000000000000253': 115068,
  '00000000000000000267': 115032,
  '00000000000000000269': 115069}}