ee.Image.paint
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
Paints the geometries of a collection onto an image, using the given 'color' value to replace each band's values where any geometry covers the image (or, if a line width is specified, where the perimeters do).
האלגוריתם הזה מתאים בעיקר להמרת נתונים קטגוריים ממאפייני תכונות לפיקסלים בתמונה. אם רוצים להמחיש אוסף, כדאי להשתמש במקום זאת ב-FeatureCollection.style, שתומך בצבעי RGB, בעוד שהאלגוריתם הזה הוא 'מונוכרומטי' בלבד (משתמש בערכים מספריים יחידים).
שימוש | החזרות |
---|
Image.paint(featureCollection, color, width) | תמונה |
ארגומנט | סוג | פרטים |
---|
זה: image | תמונה | התמונה שעליה מצוירת הקולקציה. |
featureCollection | FeatureCollection | האוסף צבוע על התמונה. |
color | אובייקט, ברירת מחדל: 0 | ערך הפיקסל לצביעה בכל פס של תמונת הקלט, כמספר שישמש לכל התכונות, או כשם של מאפיין מספרי שיילקח מכל תכונה באוסף. |
width | אובייקט, ברירת מחדל: null | רוחב הקו, כמספר שיהיה רוחב הקו של כל הצורות הגיאומטריות, או כשם של מאפיין מספרי שיילקח מכל תכונה באוסף. אם לא מציינים צבע, הצורות הגיאומטריות יהיו מלאות ולא רק קווי מתאר. |
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-07-26 (שעון UTC).
[null,null,["עדכון אחרון: 2025-07-26 (שעון UTC)."],[[["\u003cp\u003ePaints geometries from a FeatureCollection onto an image, replacing pixel values with a specified color or property value where geometries overlap.\u003c/p\u003e\n"],["\u003cp\u003eIdeal for converting categorical feature data to image pixels, offering a monochrome visualization.\u003c/p\u003e\n"],["\u003cp\u003eOffers options to fill geometries or outline them using a specified line width, which can be uniform or vary based on feature properties.\u003c/p\u003e\n"],["\u003cp\u003eUses a single color value for all bands of the image, making it suitable for thematic mapping and data representation rather than visual styling.\u003c/p\u003e\n"],["\u003cp\u003eFor visualizing collections with RGB colors and more styling options, FeatureCollection.style is recommended as a more suitable alternative.\u003c/p\u003e\n"]]],[],null,["# ee.Image.paint\n\nPaints the geometries of a collection onto an image, using the given 'color' value to replace each band's values where any geometry covers the image (or, if a line width is specified, where the perimeters do).\n\n\u003cbr /\u003e\n\nThis algorithm is most suitable for converting categorical data from feature properties to pixels in an image; if you wish to visualize a collection, consider using FeatureCollection.style instead, which supports RGB colors whereas this algorithm is strictly 'monochrome' (using single numeric values).\n\n| Usage | Returns |\n|---------------------------------------------------------|---------|\n| Image.paint`(featureCollection, `*color* `, `*width*`)` | Image |\n\n| Argument | Type | Details |\n|---------------------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image on which the collection is painted. |\n| `featureCollection` | FeatureCollection | The collection painted onto the image. |\n| `color` | Object, default: 0 | The pixel value to paint into every band of the input image, either as a number which will be used for all features, or the name of a numeric property to take from each feature in the collection. |\n| `width` | Object, default: null | Line width, either as a number which will be the line width for all geometries, or the name of a numeric property to take from each feature in the collection. If unspecified, the geometries will be filled instead of outlined. |"]]