Announcement: On
November 13, 2024, all users will need to
use a Cloud project in order to access Earth Engine. After this date, continued individual access without a Cloud project will require
an exception.
ee.Number
Constructs a new Number.
Usage | Returns | ee.Number(number) | Number |
Argument | Type | Details | number | Number|Object | A number or a computed object. |
Examples
Code Editor (JavaScript)
print(ee.Number(0)); // 0
print(ee.Number(1)); // 1
print(ee.Number(0.0)); // 0
print(ee.Number(1.0)); // 1
print(ee.Number(-1.0)); // -1
print(ee.Number(Math.PI)); // 3.141592653589793
print(ee.Number(1.2e-35)); // 1.2e-35
print(ee.Number(3.4e10)); // 34000000000
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)
import math
print(ee.Number(0).getInfo()) # 0
print(ee.Number(1).getInfo()) # 1
print(ee.Number(0.0).getInfo()) # 0
print(ee.Number(1.0).getInfo()) # 1
print(ee.Number(-1.0).getInfo()) # -1
print(ee.Number(math.pi).getInfo()) # 3.141592653589793
print(ee.Number(1.2e-35).getInfo()) # 1.2e-35
print(ee.Number(3.4e10).getInfo()) # 34000000000
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."],[[["`ee.Number()` constructs a new Earth Engine Number object from a number or a computed object."],["The input can be an integer, a floating-point number, or a computed object representing a numerical value."],["Earth Engine Numbers handle a wide range of numerical values, including very small and very large numbers."],["The `getInfo()` method (in Python) can be used to retrieve the client-side representation of the number."]]],[]]