geetools.FeatureCollectionAccessor.byFeatures#
- geetools.FeatureCollectionAccessor.byFeatures(featureId='system:index', properties=[], labels=[])#
Get a dictionary with all property values for each feature.
This method is returning a dictionary with all the feature ids as keys and their properties as a dictionary.
{ "feature1": {"property1": value1, "property2": value2, ...}, "feature2": {"property1": value1, "property2": value2, ...}, ... }
The output remain server side and can be used to create a client side plot.
- Parameters:
featureId (geetools.types.ee_str) – The property to use as the feature id. Defaults to “system:index”. This property needs to be a string property.
properties (geetools.types.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 feature ids as keys and their properties as a dictionary.
- Return type:
ee.Dictionary
Examples
import ee, geetools fc = ee.FeatureCollection("FAO/GAUL/2015/level2").limit(10) d = fc.geetools.byFeature(featureId="ADM2_CODE", properties=["ADM0_CODE"]) d.getInfo()