Duyuru:
15 Nisan 2025'ten önce Earth Engine'i kullanmak için kaydedilen tüm ticari olmayan projelerin Earth Engine erişimini sürdürmek için
ticari olmayan uygunluğu doğrulaması gerekir.
ee.Date.evaluate
Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Bu nesnenin değerini sunucudan eşzamansız olarak alır ve sağlanan geri çağırma işlevine iletir.
Kullanım | İadeler |
---|
Date.evaluate(callback) | |
Bağımsız Değişken | Tür | Ayrıntılar |
---|
bu: computedobject | ComputedObject | ComputedObject örneği. |
callback | İşlev | Sunucu yanıt döndürdüğünde çağrılan, function(success, failure) biçimindeki bir işlev. İstek başarılı olursa başarı bağımsız değişkeni, değerlendirilen sonucu içerir. İstek başarısız olursa hata bağımsız değişkeni bir hata mesajı içerir. |
Örnekler
Kod Düzenleyici (JavaScript)
/**
* WARNING: this function transfers data from Earth Engine servers to the
* client. Doing so can negatively affect request processing and client
* performance. Server-side options should be used whenever possible.
* Learn more about the distinction between server and client:
* https://developers.google.com/earth-engine/guides/client_server
*/
// A server-side ee.Date object.
var dateServer = ee.Date('2021-4-30');
// Use evaluate to transfer server-side date to the client. The result is
// an object with keys "type" and "value" where "value" is milliseconds since
// Unix epoch.
dateServer.evaluate(function(dateClient) {
print('Client-side date is an object', typeof dateClient);
print('Object keys include "type" and "value"', Object.keys(dateClient));
print('"value" is milliseconds since Unix epoch', dateClient.value);
print('Client-side date in JS Date constructor', new Date(dateClient.value));
});
Python kurulumu
Python API'si ve etkileşimli geliştirme için geemap
kullanımı hakkında bilgi edinmek üzere
Python Ortamı sayfasına bakın.
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.Date objects.
# Use ee.Date.getInfo() instead.
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2025-07-26 UTC.
[null,null,["Son güncelleme tarihi: 2025-07-26 UTC."],[[["\u003cp\u003e\u003ccode\u003eDate.evaluate()\u003c/code\u003e retrieves the value of a server-side \u003ccode\u003eee.Date\u003c/code\u003e object and passes it to a callback function.\u003c/p\u003e\n"],["\u003cp\u003eThe callback function receives the evaluated result as an object with \u003ccode\u003etype\u003c/code\u003e and \u003ccode\u003evalue\u003c/code\u003e keys, where \u003ccode\u003evalue\u003c/code\u003e represents milliseconds since the Unix epoch.\u003c/p\u003e\n"],["\u003cp\u003eExcessive use of \u003ccode\u003eevaluate\u003c/code\u003e can impact performance due to data transfer from Earth Engine servers to the client.\u003c/p\u003e\n"],["\u003cp\u003eThe Python client library uses \u003ccode\u003egetInfo()\u003c/code\u003e instead of \u003ccode\u003eevaluate\u003c/code\u003e for asynchronous evaluation of \u003ccode\u003eee.Date\u003c/code\u003e objects.\u003c/p\u003e\n"]]],["The `Date.evaluate(callback)` method asynchronously retrieves a ComputedObject's value from the server. It uses a callback function with `success` and `failure` arguments to handle the server's response. If successful, `success` provides the evaluated result; otherwise, `failure` gives an error message. The JavaScript example transfers a server-side date to the client, revealing its \"type\" and \"value\" (milliseconds since Unix epoch). Python uses `ee.Date.getInfo()` for similar functionality.\n"],null,["# ee.Date.evaluate\n\n\u003cbr /\u003e\n\nAsynchronously retrieves the value of this object from the server and passes it to the provided callback function.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------------|---------|\n| Date.evaluate`(callback)` | |\n\n| Argument | Type | Details |\n|------------------------|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `computedobject` | ComputedObject | The ComputedObject instance. |\n| `callback` | Function | A function of the form function(success, failure), called when the server returns an answer. If the request succeeded, the success argument contains the evaluated result. If the request failed, the failure argument will contains an error message. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n/**\n * WARNING: this function transfers data from Earth Engine servers to the\n * client. Doing so can negatively affect request processing and client\n * performance. Server-side options should be used whenever possible.\n * Learn more about the distinction between server and client:\n * https://developers.google.com/earth-engine/guides/client_server\n */\n\n// A server-side ee.Date object.\nvar dateServer = ee.Date('2021-4-30');\n\n// Use evaluate to transfer server-side date to the client. The result is\n// an object with keys \"type\" and \"value\" where \"value\" is milliseconds since\n// Unix epoch.\ndateServer.evaluate(function(dateClient) {\n print('Client-side date is an object', typeof dateClient);\n print('Object keys include \"type\" and \"value\"', Object.keys(dateClient));\n print('\"value\" is milliseconds since Unix epoch', dateClient.value);\n print('Client-side date in JS Date constructor', new Date(dateClient.value));\n});\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# The Earth Engine Python client library does not have an evaluate method for\n# asynchronous evaluation of ee.Date objects.\n# Use ee.Date.getInfo() instead.\n```"]]