ee.String.decodeJSON
Decodes a JSON string.
Usage | Returns | String.decodeJSON() | Object |
Argument | Type | Details | this: string | String | The string to decode. |
Examples
Code Editor (JavaScript)
var data = ee.Dictionary(ee.String('{"a": "abc", "b": 1}').decodeJSON());
print(data);
print(data.get('a'));
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
Colab (Python)
data = ee.Dictionary(ee.String('{"a": "abc", "b": 1}').decodeJSON())
print(data.getInfo())
print(data.get('a').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 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Decodes a JSON string (this: `string`) and returns an `Object`."],["Provides usage examples in JavaScript, Python using `geemap`, and Colab with Python."],["The `decodeJSON()` method is called on an `ee.String` object containing the JSON string."],["The resulting object can be accessed like a dictionary using methods like `get()` to retrieve specific values."]]],[]]