ee.Image.where
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
מחליף ערכים באופן מותנה.
לכל פיקסל בכל פס של input, אם הפיקסל התואם ב-test שונה מאפס, הפלט יהיה הפיקסל התואם ב-value, אחרת הפלט יהיה פיקסל הקלט.
אם בפיקסל מסוים, אחד מהערכים test או value מוסתר, נעשה שימוש בערך הקלט. אם הקלט מוסתר, לא מתבצעת פעולה.
לפסי הפלט יש את אותם שמות כמו לפסי הקלט. טיפוס הפלט של כל פס הוא הגדול מבין טיפוסי הקלט והערך. תמונת הפלט שומרת על המטא-נתונים ועל טביעת הרגל של תמונת הקלט.
שימוש | החזרות |
---|
Image.where(test, value) | תמונה |
ארגומנט | סוג | פרטים |
---|
זה: input | תמונה | תמונת הקלט. |
test | תמונה | תמונה לבדיקה. הפיקסלים של התמונה הזו קובעים אילו מהפיקסלים של הקלט יוחזרו. אם מדובר בפס יחיד, הוא ישמש את כל הפסים בתמונת הקלט. יכול להיות שזו לא תמונה של מערך. |
value | תמונה | ערך הפלט שבו יש להשתמש אם המבחן לא שווה לאפס. אם מדובר בפס יחיד, הוא ישמש את כל הפסים בתמונת הקלט. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\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. |"]]