Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
Method: projects.thumbnails.create
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Crea un ID che può essere utilizzato per visualizzare un'immagine "miniatura".
Questo attributo viene utilizzato in combinazione con thumbnails.getPixels
. Una chiamata a thumbnails.create
fornisce un'espressione e alcune opzioni di output. Il risultato di thumbnails.create
è un ID che rappresenta un'immagine che è il risultato della valutazione dell'espressione e dell'applicazione di queste opzioni. Successivamente, è possibile effettuare chiamate a thumbnails.getPixels
per ottenere i dati dell'immagine per l'intera immagine risultante. L'ID sarà valido per un periodo moderato (poche ore).
Il caso d'uso più comune per questa coppia di endpoint è fornire un'espressione complessa tramite una richiesta POST a thumbnails.create
e poi recuperare l'immagine calcolata tramite una richiesta GET a thumbnails.getPixels
. Questa procedura in due parti consente un utilizzo in più situazioni rispetto a ComputePixels
. In particolare: - il risultato di ComputePixels
deve essere simballato per ottenere i byte dell'immagine codificata. Il risultato di thumbnails.getPixels
può essere visualizzato direttamente da un browser. - ComputePixels
può essere chiamato solo da un utente autorizzato, utilizzando un token OAuth con ambito corretto. thumbnails.create
ha la stessa limitazione, ma thumbnails.getPixels
può essere richiamato con un URL contenente una chiave API, pertanto gli URL che lo richiamano possono essere utilizzati in modo più ampio.
Il risultato della valutazione dell'espressione deve soddisfare alcuni requisiti ragionevoli per il formato dell'immagine richiesto. In particolare, il formato JPEG o PNG richiede che siano presenti una o tre bande di output e che i valori vengano tagliati se sono al di fuori dell'intervallo 0-255.
La descrizione "miniatura" non implica una limitazione delle dimensioni dell'immagine calcolata: a thumbnails.create
/thumbnails.getPixels
si applicano le stesse limitazioni di ComputePixels
. Le richieste sono limitate a 48 MB di dati non compressi per richiesta, calcolati come prodotto delle dimensioni della richiesta in pixel, del numero di bande di immagini richieste e del numero di byte per pixel per ogni banda. Le richieste sono inoltre limitate a un massimo di 32.000 pixel in entrambe le dimensioni e a un massimo di 1024 bande. Le richieste che superano questi limiti restituiranno un codice di errore 400 (BAD_REQUEST).
Richiesta HTTP
POST https://earthengine.googleapis.com/v1alpha/{parent=projects/*}/thumbnails
L'URL utilizza la sintassi di transcodifica gRPC.
Parametri del percorso
Parametri |
parent |
string
Obbligatorio. La raccolta di miniature principale (ad es. "projects/*").
L'autorizzazione richiede la seguente autorizzazione IAM sulla risorsa specificata parent :
earthengine.thumbnails.create
|
Parametri di query
Parametri |
workloadTag |
string
Tag fornito dall'utente per monitorare questo calcolo.
|
Corpo della richiesta
Il corpo della richiesta contiene un'istanza di Thumbnail
.
Corpo della risposta
In caso di esito positivo, il corpo della risposta contiene un'istanza di Thumbnail
appena creata.
Ambiti di autorizzazione
Richiede uno dei seguenti ambiti OAuth:
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
Per ulteriori informazioni, consulta la sezione OAuth 2.0 Overview.
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 2025-07-25 UTC."],[[["\u003cp\u003e\u003ccode\u003ethumbnails.create\u003c/code\u003e generates an ID representing an image created from an expression and output options, usable with \u003ccode\u003ethumbnails.getPixels\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ethumbnails.getPixels\u003c/code\u003e retrieves image data using the ID from \u003ccode\u003ethumbnails.create\u003c/code\u003e, offering broader usage than \u003ccode\u003eComputePixels\u003c/code\u003e due to API key accessibility.\u003c/p\u003e\n"],["\u003cp\u003eThe resulting image must adhere to format requirements (e.g., JPEG/PNG need 1-3 bands, values within 0-255).\u003c/p\u003e\n"],["\u003cp\u003eWhile called "thumbnail", image size is subject to the same limits as \u003ccode\u003eComputePixels\u003c/code\u003e, with restrictions on dimensions, bands, and data size to prevent errors.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves a POST request to \u003ccode\u003ethumbnails.create\u003c/code\u003e to provide the expression, followed by a GET request to \u003ccode\u003ethumbnails.getPixels\u003c/code\u003e to fetch the image.\u003c/p\u003e\n"]]],[],null,["# Method: projects.thumbnails.create\n\nCreates an ID that can be used to render a \"thumbnail\" image.\n\nThis is used in conjunction with `thumbnails.getPixels`. A call to `thumbnails.create` provides an expression and some output options. The result of `thumbnails.create` is an ID that represents an image that is the result of evaluating that expression and applying those options. Subsequently, calls to `thumbnails.getPixels` can be made to get the image data for the entire resulting image. The ID will be valid for a moderate period (a few hours).\n\nThe most common use case for this pair of endpoints is to provide a complex expression via a POST to `thumbnails.create`, and then fetch the computed image via a GET to `thumbnails.getPixels`. This two-part process allows for use in more situations than `ComputePixels`. In particular: - the result of `ComputePixels` needs to be unwrapped to get the encoded image bytes. The result of `thumbnails.getPixels` can be displayed directly by a browser. - `ComputePixels` can only be called by an authorised user, using a properly-scoped OAuth token. `thumbnails.create` has the same restriction, but `thumbnails.getPixels` can be invoked with a URL containing an API key, so URLs invoking it can be used more broadly.\n\nThe result of evaluating the expression has to meet some reasonable requirements for the requested image format. In particular, JPEG or PNG format requires that there be one or three output bands, and clips values that are outside the 0-255 range.\n\nThe description \"thumbnail\" does not imply a restriction on the size of the computed image: the same restrictions as `ComputePixels` apply to `thumbnails.create`/`thumbnails.getPixels`. Requests 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\n### HTTP request\n\n`POST https://earthengine.googleapis.com/v1alpha/{parent=projects/*}/thumbnails`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `parent` | `string` Required. The parent of the thumbnail collection (e.g., \"projects/\\*\"). Authorization requires the following [IAM](https://cloud.google.com/iam/docs/) permission on the specified resource `parent`: - `earthengine.thumbnails.create` |\n\n### Query parameters\n\n| Parameters ||\n|---------------|-------------------------------------------------------|\n| `workloadTag` | `string` User supplied tag to track this computation. |\n\n### Request body\n\nThe request body contains an instance of [Thumbnail](/earth-engine/reference/rest/v1alpha/projects.locations.thumbnails#Thumbnail).\n\n### Response body\n\nIf successful, the response body contains a newly created instance of [Thumbnail](/earth-engine/reference/rest/v1alpha/projects.locations.thumbnails#Thumbnail).\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)."]]