ee.Geometry.evaluate

Truy xuất không đồng bộ giá trị của đối tượng này từ máy chủ và truyền giá trị đó đến hàm callback được cung cấp.

Cách sử dụngGiá trị trả về
Geometry.evaluate(callback)
Đối sốLoạiChi tiết
this: computedobjectComputedObjectThực thể ComputedObject.
callbackHàmMột hàm của hàm biểu mẫu (thành công, không thành công), được gọi khi máy chủ trả về câu trả lời. Nếu yêu cầu thành công, đối số thành công sẽ chứa kết quả được đánh giá. Nếu yêu cầu không thành công, đối số không thành công sẽ chứa thông báo lỗi.

Ví dụ

Trình soạn thảo mã (JavaScript)

// Define a callback function that prints a GeoJSON string.
var printGeoJSONString = function(geometry) {
  geometry = ee.Geometry(geometry);
  print(geometry.toGeoJSONString());
};

// Create a simple computed geometry.
var computedGeometry = ee.Geometry.Point(0, 0).buffer(10);

// Evaluate the callback function that asynchronously retrieves and prints
// the GeoJSON string representation of computed geometry.
computedGeometry.evaluate(printGeoJSONString);

Thiết lập Python

Hãy xem trang Môi trường Python để biết thông tin về Python API và cách sử dụng geemap cho quá trình phát triển có tính tương tác.

import ee
import geemap.core as geemap

Colab (Python)

# The Earth Engine Python client library does not have an evaluate method for
# asynchronous evaluation of ee.Geometry objects.
# Use ee.Geometry.getInfo() instead.