Method: projects.thumbnails.create
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
ऐसा आईडी बनाता है जिसका इस्तेमाल "थंबनेल" इमेज को रेंडर करने के लिए किया जा सकता है.
इसका इस्तेमाल thumbnails.getPixels
के साथ किया जाता है. thumbnails.create
को कॉल करने पर, आपको एक्सप्रेशन और आउटपुट के कुछ विकल्प मिलते हैं. thumbnails.create
का नतीजा एक आईडी होता है, जो उस एक्सप्रेशन का आकलन करने और उन विकल्पों को लागू करने के नतीजे के तौर पर एक इमेज दिखाता है. इसके बाद, thumbnails.getPixels
को कॉल करके, नतीजे में मिली पूरी इमेज का डेटा पाया जा सकता है. यह आईडी कुछ घंटों के लिए मान्य होगा.
एंडपॉइंट के इस जोड़े के लिए, सबसे आम इस्तेमाल का उदाहरण यह है कि thumbnails.create
पर POST के ज़रिए कोई जटिल एक्सप्रेशन दिया जाए. इसके बाद, thumbnails.getPixels
पर GET के ज़रिए कैलकुलेट की गई इमेज फ़ेच की जाए. दो चरणों वाली इस प्रोसेस का इस्तेमाल, ComputePixels
की तुलना में ज़्यादा स्थितियों में किया जा सकता है. खास तौर पर: - एन्कोड की गई इमेज के बाइट पाने के लिए, ComputePixels
के नतीजे को अनरैप करना होगा. thumbnails.getPixels
का नतीजा, सीधे ब्राउज़र से दिखाया जा सकता है. - ComputePixels
को सिर्फ़ अनुमति वाला उपयोगकर्ता, सही दायरे वाले OAuth टोकन का इस्तेमाल करके कॉल कर सकता है. thumbnails.create
पर भी यही पाबंदी है. हालांकि, thumbnails.getPixels
को एपीआई कुंजी वाले यूआरएल से शुरू किया जा सकता है. इसलिए, इसे शुरू करने वाले यूआरएल का इस्तेमाल ज़्यादा बड़े पैमाने पर किया जा सकता है.
एक्सप्रेशन का आकलन करने के नतीजे को, अनुरोध किए गए इमेज फ़ॉर्मैट की कुछ ज़रूरी शर्तों को पूरा करना होगा. खास तौर पर, JPEG या PNG फ़ॉर्मैट के लिए ज़रूरी है कि एक या तीन आउटपुट बैंड हों. साथ ही, क्लिप की वैल्यू 0 से 255 की रेंज से बाहर होनी चाहिए.
"थंबनेल" ब्यौरे का मतलब, कैलकुलेट की गई इमेज के साइज़ पर पाबंदी नहीं है: ComputePixels
पर लागू होने वाली वही पाबंदियां thumbnails.create
/thumbnails.getPixels
पर भी लागू होती हैं. हर अनुरोध के लिए, अनकंप्रेस किए गए डेटा की सीमा 48 एमबी तक है. इसे पिक्सल में अनुरोध के डाइमेंशन, अनुरोध की गई इमेज बैंड की संख्या, और हर बैंड के लिए हर पिक्सल की बाइट की संख्या के प्रॉडक्ट के तौर पर कैलकुलेट किया जाता है. अनुरोधों के लिए, किसी भी डाइमेंशन में ज़्यादा से ज़्यादा 32K पिक्सल और ज़्यादा से ज़्यादा 1024 बैंड की सीमा तय है. इन सीमाओं से ज़्यादा अनुरोध करने पर, गड़बड़ी का कोड 400 (BAD_REQUEST) दिखेगा.
एचटीटीपी अनुरोध
POST https://earthengine.googleapis.com/v1alpha/{parent=projects/*}/thumbnails
यूआरएल में gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल किया गया है.
पाथ पैरामीटर
पैरामीटर |
parent |
string
ज़रूरी है. थंबनेल कलेक्शन का पैरंट (उदाहरण के लिए, "projects/*").
अनुमति पाने के लिए, दिए गए संसाधन parent पर IAM की यह अनुमति ज़रूरी है:
earthengine.thumbnails.create
|
क्वेरी पैरामीटर
पैरामीटर |
workloadTag |
string
इस कैलकुलेशन को ट्रैक करने के लिए, उपयोगकर्ता का दिया गया टैग.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में Thumbnail
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में Thumbnail
का नया इंस्टेंस शामिल किया जाता है.
अनुमति के दायरे
इसके लिए, 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
ज़्यादा जानकारी के लिए, OAuth 2.0 Overview देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-25 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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)."]]