공지사항 :
2025년 4월 15일 전에 Earth Engine 사용을 위해 등록된 모든 비상업용 프로젝트는 액세스 권한을 유지하기 위해
비상업용 자격 요건을 인증 해야 합니다. 2025년 9월 26일까지 인증하지 않으면 액세스가 보류될 수 있습니다.
의견 보내기
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.
print ( 'x + y:' ,
ee . Number . expression ( 'x + y' , variables ) . getInfo ())
print ( 'x - y:' ,
ee . Number . expression ( 'x - y' , variables ) . getInfo ())
print ( 'x * y:' ,
ee . Number . expression ( 'x * y' , variables ) . getInfo ())
print ( 'x / y:' ,
ee . Number . expression ( 'x / y' , variables ) . getInfo ())
print ( 'x ** y:' ,
ee . Number . expression ( 'x ** y' , variables ) . getInfo ())
print ( 'x % y:' ,
ee . Number . expression ( 'x % y' , variables ) . getInfo ())
# Logical operators.
print ( 'x || y:' ,
ee . Number . expression ( 'x || y' , variables ) . getInfo ())
print ( 'x && y:' ,
ee . Number . expression ( 'x && y' , variables ) . getInfo ())
print ( '!(x):' ,
ee . Number . expression ( '!(x)' , variables ) . getInfo ())
# Relational operators.
print ( 'x > y:' ,
ee . Number . expression ( 'x > y' , variables ) . getInfo ())
print ( 'x >= y:' ,
ee . Number . expression ( 'x >= y' , variables ) . getInfo ())
print ( 'x < y:' ,
ee . Number . expression ( 'x < y' , variables ) . getInfo ())
print ( 'x <= y:' ,
ee . Number . expression ( 'x <= y' , variables ) . getInfo ())
print ( 'x == y:' ,
ee . Number . expression ( 'x == y' , variables ) . getInfo ())
print ( 'x != y:' ,
ee . Number . expression ( 'x != y' , variables ) . getInfo ())
# Conditional JavaScript (ternary) operator.
print ( '(x < y) ? 100 : 1000):' ,
ee . Number . expression ( '(x < y) ? 100 : 1000' , variables ) . getInfo ())
# Constants in the expression.
print ( '100 * (x + y):' ,
ee . Number . expression ( '100 * (x + y)' , variables ) . getInfo ())
# JavaScript Math constants.
print ( 'Math.PI:' ,
ee . Number . expression ( 'Math.PI' , None ) . getInfo ())
print ( 'Math.E:' ,
ee . Number . expression ( 'Math.E' , None ) . getInfo ())
# 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 }) . getInfo ())
# ee.Number functions.
print ( 'Use ee.Number add. add(x, y):' ,
ee . Number . expression ( 'add(x, y)' , variables ) . getInfo ())
print ( 'Use ee.Number add and subtract. subtract(add(x, y), 5):' ,
ee . Number . expression ( 'subtract(add(x, y), 5)' , variables ) . getInfo ())
의견 보내기
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스 에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스 에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책 을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-29(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-07-29(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"]]