ee.Image.where
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
جایگزینی مشروط مقادیر را انجام می دهد.
برای هر پیکسل در هر باند «ورودی»، اگر پیکسل مربوطه در «تست» غیر صفر است، پیکسل مربوطه را از نظر مقدار خروجی بگیرید، در غیر این صورت پیکسل ورودی را خروجی بگیرید.
اگر در یک پیکسل معین، تست یا مقدار پوشانده شود، از مقدار ورودی استفاده می شود. اگر ورودی ماسک باشد، هیچ کاری انجام نمی شود.
باندهای خروجی هم نام باندهای ورودی هستند. نوع خروجی هر باند بزرگتر از نوع ورودی و مقدار است. تصویر خروجی ابرداده و ردپای تصویر ورودی را حفظ می کند.
استفاده | برمی گرداند | Image. where (test, value) | تصویر |
استدلال | تایپ کنید | جزئیات | این: input | تصویر | تصویر ورودی |
test | تصویر | تصویر آزمایشی پیکسل های این تصویر تعیین می کند که کدام یک از پیکسل های ورودی برگردانده شود. اگر این یک باند باشد، برای همه باندهای تصویر ورودی استفاده می شود. این ممکن است یک تصویر آرایه نباشد. |
value | تصویر | مقدار خروجی برای استفاده در جایی که تست صفر نیست. اگر این یک باند باشد، برای همه باندهای تصویر ورودی استفاده می شود. |
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-24 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eReplaces input image pixel values with values from a secondary image based on a test image's pixel values.\u003c/p\u003e\n"],["\u003cp\u003eIf the test image pixel is non-zero, the corresponding pixel from the value image is used; otherwise, the original input pixel is retained.\u003c/p\u003e\n"],["\u003cp\u003eInput image metadata and footprint are preserved in the output image.\u003c/p\u003e\n"],["\u003cp\u003eOutput image band types are determined by the larger type between the input and value images.\u003c/p\u003e\n"],["\u003cp\u003eMasked pixels in either test or value images result in the original input pixel being used in the output.\u003c/p\u003e\n"]]],[],null,["# ee.Image.where\n\nPerforms conditional replacement of values.\n\n\u003cbr /\u003e\n\nFor each pixel in each band of 'input', if the corresponding pixel in 'test' is nonzero, output the corresponding pixel in value, otherwise output the input pixel.\n\nIf at a given pixel, either test or value is masked, the input value is used. If the input is masked, nothing is done.\n\nThe output bands have the same names as the input bands. The output type of each band is the larger of the input and value types. The output image retains the metadata and footprint of the input image.\n\n| Usage | Returns |\n|----------------------------|---------|\n| Image.where`(test, value)` | Image |\n\n| Argument | Type | Details |\n|---------------|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `input` | Image | The input image. |\n| `test` | Image | The test image. The pixels of this image determines which of the input pixels is returned. If this is a single band, it is used for all bands in the input image. This may not be an array image. |\n| `value` | Image | The output value to use where test is not zero. If this is a single band, it is used for all bands in the input image. |"]]