ee.FeatureCollection.toDictionary
Extract properties from a feature as a dictionary.
Usage | Returns |
---|
FeatureCollection.toDictionary(properties) | Dictionary |
Argument | Type | Details |
---|
this: element | Element | The feature to extract the property from. |
properties | List, default: null | The list of properties to extract. Defaults to all non-system properties. |
Examples
// FeatureCollection of power plants.
var fc = ee.FeatureCollection('WRI/GPPD/power_plants');
print('All non-system FeatureCollection properties as an ee.Dictionary',
fc.toDictionary());
print('Selected properties as an ee.Dictionary',
fc.toDictionary(['description', 'provider']));
Python setup
See the
Python Environment page for information on the Python API and using
geemap
for interactive development.
import ee
import geemap.core as geemap
# FeatureCollection of power plants.
fc = ee.FeatureCollection('WRI/GPPD/power_plants')
print('All non-system FeatureCollection properties as an ee.Dictionary:',
fc.toDictionary().getInfo())
print('Selected properties as an ee.Dictionary:',
fc.toDictionary(['description', 'provider']).getInfo())
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[[["The `toDictionary()` function extracts properties from an Earth Engine Feature or FeatureCollection and returns them as a dictionary."],["By default, `toDictionary()` extracts all non-system properties; you can also specify a list of properties to extract."],["This function is available for both the JavaScript and Python Earth Engine APIs."],["The extracted dictionary can be printed or further processed using Earth Engine methods or your preferred scripting language."]]],[]]