ee.Dictionary.serialize
Returns the serialized representation of this object.
Usage | Returns |
---|
Dictionary.serialize(legacy) | String |
Argument | Type | Details |
---|
this: computedobject | ComputedObject | The ComputedObject instance. |
legacy | Boolean, optional | Enables legacy format. |
Examples
// A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
var dict = ee.Dictionary({
B1: 182,
B2: 219,
B3: 443
});
print('Serialized representation of ee.Dictionary', dict.serialize());
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
# A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
dic = ee.Dictionary({
'B1': 182,
'B2': 219,
'B3': 443
})
print('Serialized representation of ee.Dictionary:', dic.serialize(), sep='\n')
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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["`serialize()` returns a serialized (string) representation of a given ComputedObject (like a dictionary)."],["This method accepts an optional boolean argument `legacy` to enable legacy formatting."],["The primary use case is to obtain a string representation of a dictionary-like object for further processing or display."]]],["The `serialize()` method, applicable to a `ComputedObject` instance, returns a string representation of the object. For a `Dictionary`, `serialize()` converts the dictionary into a string. It accepts an optional boolean argument `legacy` to enable legacy format. The examples demonstrate serializing a dictionary object using both JavaScript and Python, printing the string representation of the dictionary.\n"]]