ee.String.decodeJSON

  • The String.decodeJSON() method decodes a JSON string.

  • The method takes a string as input and returns an Object.

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 
 ()) 
 display 
 ( 
 data 
 ) 
 display 
 ( 
 data 
 . 
 get 
 ( 
 'a' 
 )) 
Create a Mobile Website
View Site in Mobile | Classic
Share by: