ee.Geometry.evaluate

ดึงค่าของออบเจ็กต์นี้จากเซิร์ฟเวอร์แบบอะซิงโครนัสและส่งไปยังฟังก์ชัน Callback ที่ระบุ

การใช้งานการคืนสินค้า
Geometry.evaluate(callback)
อาร์กิวเมนต์ประเภทรายละเอียด
computedobjectComputedObjectอินสแตนซ์ ComputedObject
callbackฟังก์ชันฟังก์ชันของฟังก์ชันแบบฟอร์ม (สำเร็จ, ไม่สำเร็จ) ซึ่งจะเรียกใช้เมื่อเซิร์ฟเวอร์แสดงผลคำตอบ หากคำขอสำเร็จ อาร์กิวเมนต์ความสำเร็จจะมีผลลัพธ์ที่ประเมินแล้ว หากคำขอล้มเหลว อาร์กิวเมนต์ความล้มเหลวจะมีข้อความแสดงข้อผิดพลาด

ตัวอย่าง

ตัวแก้ไขโค้ด (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);

การตั้งค่า Python

ดูข้อมูลเกี่ยวกับ Python API และการใช้ geemap เพื่อการพัฒนาแบบอินเทอร์แอกทีฟได้ที่หน้าสภาพแวดล้อม Python

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.