Method: projects.image.computePixels
Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Calcule une tuile de pixels en effectuant un calcul arbitraire sur les données d'image.
Les requêtes sont limitées à 48 Mo de données non compressées par requête, calculées comme le produit des dimensions de la requête en pixels, du nombre de bandes d'image demandées et du nombre d'octets par pixel pour chaque bande. Les requêtes sont également limitées à 32 ko de pixels dans chaque dimension et à 1 024 bandes au maximum. Les requêtes qui dépassent ces limites génèrent un code d'erreur 400 (BAD_REQUEST).
Si la requête aboutit, le corps de la réponse contient les données de pixel demandées dans l'encodage spécifié dans le champ fileFormat
de la requête.
Requête HTTP
POST https://earthengine.googleapis.com/v1beta/{project=projects/*}/image:computePixels
L'URL utilise la syntaxe de transcodage gRPC.
Paramètres de chemin d'accès
Paramètres |
project |
string
ID ou numéro du projet Google Cloud Platform à traiter comme client du service pour cette requête. Format : projects/{project-id}
L'autorisation IAM suivante est requise pour la ressource project indiquée :
earthengine.computations.create
|
Corps de la requête
Le corps de la requête contient des données présentant la structure suivante :
Champs |
expression |
object (Expression )
Expression à calculer.
|
fileFormat |
enum (ImageFileFormat )
Format de fichier de sortie dans lequel renvoyer les valeurs de pixel.
|
grid |
object (PixelGrid )
Paramètres décrivant comment l'image calculée par expression doit être reprojetée et rognée. Si cet argument n'est pas présent, l'image calculée complète est renvoyée dans sa projection native.
|
bandIds[] |
string
Si présent, spécifie un ensemble spécifique de bandes qui sera sélectionné à partir du résultat de l'évaluation de expression . Si ce paramètre n'est pas présent, toutes les bandes résultant de expression sont sélectionnées.
|
visualizationOptions |
object (VisualizationOptions )
Si présent, ensemble d'options de visualisation à appliquer pour produire une visualisation RVB 8 bits des données.
|
workloadTag |
string
Balise fournie par l'utilisateur pour suivre ce calcul.
|
Corps de la réponse
Si la requête aboutit, la réponse est une réponse HTTP générique dont le format est défini par la méthode.
Champs d'application des autorisations
Nécessite l'un des champs d'application OAuth suivants :
https://www.googleapis.com/auth/earthengine
https://www.googleapis.com/auth/earthengine.readonly
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/cloud-platform.read-only
Pour en savoir plus, consultez OAuth 2.0 Overview.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/07/25 (UTC).
[null,null,["Dernière mise à jour le 2025/07/25 (UTC)."],[[["\u003cp\u003eThis API computes a tile of pixels by performing a user-defined computation on image data using an expression.\u003c/p\u003e\n"],["\u003cp\u003eRequests are limited to 48MB of uncompressed data and specific dimensions, exceeding which results in a 400 error.\u003c/p\u003e\n"],["\u003cp\u003eSuccessful responses contain pixel data in the specified file format, encoded within the HTTP response body.\u003c/p\u003e\n"],["\u003cp\u003eThe API requires authorization using specific OAuth scopes like \u003ccode\u003ehttps://www.googleapis.com/auth/earthengine\u003c/code\u003e or \u003ccode\u003ehttps://www.googleapis.com/auth/cloud-platform\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eUsers can define the projection, clipping, band selection, and visualization options for the computed image within the request.\u003c/p\u003e\n"]]],["This API computes a tile of pixels from image data via an arbitrary expression. Input parameters include `expression`, `fileFormat`, `grid`, `bandIds`, `visualizationOptions`, and `workloadTag`. Requests are limited to 48MB of uncompressed data, 32K pixels per dimension, and 1024 bands, returning a 400 error code if these limits are exceeded. A successful request returns pixel data in the specified `fileFormat`, with authorization requiring specific OAuth scopes.\n"],null,["# Method: projects.image.computePixels\n\nComputes a tile of pixels by performing an arbitrary computation on image data.\n\nRequests are limited to 48MB in uncompressed data per request, computed as the product of the request dimensions in pixels, the number of image bands requested, and the number of bytes per pixel for each band. Requests are also limited to at most 32K pixels in either dimension and at most 1024 bands. Requests exceeding these limits will result in an error code of 400 (BAD_REQUEST).\n\nIf successful, the response body contains the requested pixel data in the encoding specified in the `fileFormat` field of the request.\n\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1beta/{project=projects/*}/image:computePixels`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|-----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `project` | `string` The project id or project number of the Google Cloud Platform project that should be treated as the service consumer for this request. Format is `projects/{project-id}`. Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `project`: - `earthengine.computations.create` |\n\n### Request body\n\nThe request body contains data with the following structure:\n\n| JSON representation |\n|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"expression\": { object (/earth-engine/reference/rest/v1beta/Expression) }, \"fileFormat\": enum (/earth-engine/reference/rest/v1beta/ImageFileFormat), \"grid\": { object (/earth-engine/reference/rest/v1beta/PixelGrid) }, \"bandIds\": [ string ], \"visualizationOptions\": { object (/earth-engine/reference/rest/v1beta/VisualizationOptions) }, \"workloadTag\": string } ``` |\n\n| Fields ||\n|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `expression` | `object (`[Expression](/earth-engine/reference/rest/v1beta/Expression)`)` The expression to compute. |\n| `fileFormat` | `enum (`[ImageFileFormat](/earth-engine/reference/rest/v1beta/ImageFileFormat)`)` The output file format in which to return the pixel values. |\n| `grid` | `object (`[PixelGrid](/earth-engine/reference/rest/v1beta/PixelGrid)`)` Parameters describing how the image computed by `expression` should be reprojected and clipped. If not present, the full computed image is returned in its native projection. |\n| `bandIds[]` | `string` If present, specifies a specific set of bands that will be selected from the result of evaluating `expression`. If not present, all bands resulting from `expression` will be selected. |\n| `visualizationOptions` | `object (`[VisualizationOptions](/earth-engine/reference/rest/v1beta/VisualizationOptions)`)` If present, a set of visualization options to apply to produce an 8-bit RGB visualization of the data. |\n| `workloadTag` | `string` User supplied tag to track this computation. |\n\n### Response body\n\nIf successful, the response is a generic HTTP response whose format is defined by the method.\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/earthengine`\n- `\n https://www.googleapis.com/auth/earthengine.readonly`\n- `\n https://www.googleapis.com/auth/cloud-platform`\n- `\n https://www.googleapis.com/auth/cloud-platform.read-only`\n\nFor more information, see the [OAuth 2.0 Overview](/identity/protocols/OAuth2)."]]