Earth Engine は、共有コンピューティングリソースを保護し、すべてのユーザーに信頼性の高いパフォーマンスを提供するために、
非商用割り当て階層 を導入しています。非商用プロジェクトではデフォルトでコミュニティ
ティアが使用されますが、プロジェクトのティアはいつでも変更できます。
Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
フィードバックを送信
ee.Number.expression
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
数値式を計算します。
用途 戻り値 ee.Number.expression(expression, vars )数値
引数 タイプ 詳細 expression文字列 評価される数式文字列。標準の算術演算子、ブール演算子、関係演算子に加えて、式では Number の任意の関数、'vars' 辞書から子要素を抽出する '.' 演算子、数学定数 Math.PI と Math.E もサポートされています。 vars辞書、デフォルト: null 式で使用できる名前付き値のディクショナリ。
例
コードエディタ(JavaScript)
// A dictionary of variables to use in expression.
var variables = { x : 5 , y : 10 };
// Arithmetic operators.
print ( 'x + y' ,
ee . Number . expression ( 'x + y' , variables ));
print ( 'x - y' ,
ee . Number . expression ( 'x - y' , variables ));
print ( 'x * y' ,
ee . Number . expression ( 'x * y' , variables ));
print ( 'x / y' ,
ee . Number . expression ( 'x / y' , variables ));
print ( 'x ** y' ,
ee . Number . expression ( 'x ** y' , variables ));
print ( 'x % y' ,
ee . Number . expression ( 'x % y' , variables ));
// Logical operators.
print ( 'x || y' ,
ee . Number . expression ( 'x || y' , variables ));
print ( 'x && y' ,
ee . Number . expression ( 'x && y' , variables ));
print ( '!(x)' ,
ee . Number . expression ( '!(x)' , variables ));
// Relational operators.
print ( 'x > y' ,
ee . Number . expression ( 'x > y' , variables ));
print ( 'x >= y' ,
ee . Number . expression ( 'x >= y' , variables ));
print ( 'x < y' ,
ee . Number . expression ( 'x < y' , variables ));
print ( 'x <= y' ,
ee . Number . expression ( 'x <= y' , variables ));
print ( 'x == y' ,
ee . Number . expression ( 'x == y' , variables ));
print ( 'x != y' ,
ee . Number . expression ( 'x != y' , variables ));
// Conditional (ternary) operator.
print ( '(x < y) ? 100 : 1000)' ,
ee . Number . expression ( '(x < y) ? 100 : 1000' , variables ));
// Constants in the expression.
print ( '100 * (x + y)' ,
ee . Number . expression ( '100 * (x + y)' , variables ));
// JavaScript Math constants.
print ( 'Math.PI' ,
ee . Number . expression ( 'Math.PI' , null ));
print ( 'Math.E' ,
ee . Number . expression ( 'Math.E' , null ));
// Dot notation to call on child elements.
print ( 'Use dot notation to call on child elements' ,
ee . Number . expression ( 'vals.x * vals.y' , { vals : variables }));
// ee.Number functions.
print ( 'Use ee.Number add: add(x, y)' ,
ee . Number . expression ( 'add(x, y)' , variables ));
print ( 'Use ee.Number add and subtract: subtract(add(x, y), 5)' ,
ee . Number . expression ( 'subtract(add(x, y), 5)' , variables ));
Python の設定
Python API とインタラクティブな開発での geemap の使用については、
Python 環境 のページをご覧ください。
import ee
import geemap.core as geemap
Colab(Python)
# A dictionary of variables to use in expression.
variables = { 'x' : 5 , 'y' : 10 }
# Arithmetic operators.
display ( 'x + y:' ,
ee . Number . expression ( 'x + y' , variables ))
display ( 'x - y:' ,
ee . Number . expression ( 'x - y' , variables ))
display ( 'x * y:' ,
ee . Number . expression ( 'x * y' , variables ))
display ( 'x / y:' ,
ee . Number . expression ( 'x / y' , variables ))
display ( 'x ** y:' ,
ee . Number . expression ( 'x ** y' , variables ))
display ( 'x % y:' ,
ee . Number . expression ( 'x % y' , variables ))
# Logical operators.
display ( 'x || y:' ,
ee . Number . expression ( 'x || y' , variables ))
display ( 'x && y:' ,
ee . Number . expression ( 'x && y' , variables ))
display ( '!(x):' ,
ee . Number . expression ( '!(x)' , variables ))
# Relational operators.
display ( 'x > y:' ,
ee . Number . expression ( 'x > y' , variables ))
display ( 'x >= y:' ,
ee . Number . expression ( 'x >= y' , variables ))
display ( 'x < y:' ,
ee . Number . expression ( 'x < y' , variables ))
display ( 'x <= y:' ,
ee . Number . expression ( 'x <= y' , variables ))
display ( 'x == y:' ,
ee . Number . expression ( 'x == y' , variables ))
display ( 'x != y:' ,
ee . Number . expression ( 'x != y' , variables ))
# Conditional JavaScript (ternary) operator.
display ( '(x < y) ? 100 : 1000):' ,
ee . Number . expression ( '(x < y) ? 100 : 1000' , variables ))
# Constants in the expression.
display ( '100 * (x + y):' ,
ee . Number . expression ( '100 * (x + y)' , variables ))
# JavaScript Math constants.
display ( 'Math.PI:' ,
ee . Number . expression ( 'Math.PI' , None ))
display ( 'Math.E:' ,
ee . Number . expression ( 'Math.E' , None ))
# Dot notation to call on child elements.
display ( 'Use dot notation to call on child elements:' ,
ee . Number . expression ( 'vals.x * vals.y' , { 'vals' : variables }))
# ee.Number functions.
display ( 'Use ee.Number add. add(x, y):' ,
ee . Number . expression ( 'add(x, y)' , variables ))
display ( 'Use ee.Number add and subtract. subtract(add(x, y), 5):' ,
ee . Number . expression ( 'subtract(add(x, y), 5)' , variables ))
フィードバックを送信
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンス により使用許諾されます。コードサンプルは Apache 2.0 ライセンス により使用許諾されます。詳しくは、Google Developers サイトのポリシー をご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-10-30 UTC。
ご意見をお聞かせください
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-10-30 UTC。"],[],["`ee.Number.expression` evaluates a mathematical expression string. It accepts an `expression` string and an optional `vars` dictionary containing named values. The expression supports arithmetic, boolean, and relational operators, as well as functions found in `ee.Number` and constants like `Math.PI` and `Math.E`. Dot notation accesses nested dictionary elements. The function returns a numerical result, allowing complex computations. Examples include adding, subtracting, multiplying, applying logical operations, and conditional logic.\n"]]