ee.Dictionary.evaluate

Récupère de manière asynchrone la valeur de cet objet à partir du serveur et la transmet à la fonction de rappel fournie.

UtilisationRenvoie
Dictionary.evaluate(callback)
ArgumentTypeDétails
ceci : computedobjectComputedObjectInstance ComputedObject.
callbackFonctionFonction de la forme function(success, failure), appelée lorsque le serveur renvoie une réponse. Si la requête a abouti, l'argument "success" contient le résultat évalué. Si la requête a échoué, l'argument d'échec contient un message d'erreur.

Exemples

Éditeur de code (JavaScript)

// A dictionary (e.g. results of ee.Image.reduceRegion of an S2 image).
var dictServer = ee.Dictionary({
  B1: 182,
  B2: 219,
  B3: 443
});

// Use evaluate to transfer server-side dictionary to the client.
dictServer.evaluate(function(dictClient) {
  print('Client-side dot notation to access "B1" value', dictClient.B1);
  print('Client-side bracket notation to access "B1" value', dictClient['B1']);

  print('Client-side operations to print all key-value pairs');
  Object.keys(dictClient).forEach(function(key) {
    print('    ' + key + ': ' + dictClient[key]);
  });
});

Configuration de Python

Consultez la page Environnement Python pour en savoir plus sur l'API Python et sur l'utilisation de geemap pour le développement interactif.

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.Dictionary objects.
# Use ee.Dictionary.getInfo() instead.