Page Summary
-
The
ee.Algorithms.ObjectType()function returns a string representing the type of a given object. -
This function can be used to determine the type of various Earth Engine objects including numbers, strings, lists, and even properties of features.
-
The function takes a single argument,
value, which is the object whose type is to be determined. -
Examples demonstrate its usage in both JavaScript and Python.
| Usage | Returns |
|---|---|
ee.Algorithms.ObjectType( value
)
|
String |
| Argument | Type | Details |
|---|---|---|
value
|
Object, default: null | The object to get the type of. |
Examples
Code Editor (JavaScript)
print ( ee . Algorithms . ObjectType ( 1 )); // The string "Integer" print ( ee . Algorithms . ObjectType ( ee . Number ( 1 ))); // The string "Integer" print ( ee . Algorithms . ObjectType ( ee . String ( 'a string' ))); // The string "String" print ( ee . Algorithms . ObjectType ( ee . List ([ 1 , 'a string' ]))); // The string "List" // ee.Algorithms.ObjectType can be used to get the type of properties // of ee.Image or ee.Feature objects. var feature = ee . Feature ( null , // No need for geometry in this example. { 'int' : 42 , 'int8' : ee . Number ( - 3 ). int8 (), }); // The string "Integer" print ( 'int:' , ee . Algorithms . ObjectType ( feature . get ( 'int' ))); // The string "Long" print ( 'int8:' , ee . Algorithms . ObjectType ( feature . get ( 'int8' )));
import ee import geemap.core as geemap
Colab (Python)
display ( ee . Algorithms . ObjectType ( ee . Number ( 1 ))) # The string "Integer" display ( ee . Algorithms . ObjectType ( ee . String ( 'a string' ))) # The string "String" display ( ee . Algorithms . ObjectType ( ee . List ([ 1 , 'a string' ]))) # The string "List" # ee.Algorithms.ObjectType can be used to get the type of properties # of ee.Image or ee.Feature objects. feature = ee . Feature ( None , # No need for geometry in this example. { 'int' : 42 , 'int8' : ee . Number ( - 3 ) . int8 (), } ) # The string "Integer" display ( 'int:' , ee . Algorithms . ObjectType ( feature . get ( 'int' ))) # The string "Long" display ( 'int8:' , ee . Algorithms . ObjectType ( feature . get ( 'int8' )))

