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).
This 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).
Usage | Returns |
---|
Image.paint(featureCollection, color, width) | Image |
Argument | Type | Details |
---|
this: image | Image | The image on which the collection is painted. |
featureCollection | FeatureCollection | The collection painted onto the image. |
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. |
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. |
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-10-06 UTC.
[null,null,["Last updated 2023-10-06 UTC."],[[["Paints geometries from a FeatureCollection onto an image, replacing pixel values with a specified color or property value where geometries overlap."],["Ideal for converting categorical feature data to image pixels, offering a monochrome visualization."],["Offers options to fill geometries or outline them using a specified line width, which can be uniform or vary based on feature properties."],["Uses a single color value for all bands of the image, making it suitable for thematic mapping and data representation rather than visual styling."],["For visualizing collections with RGB colors and more styling options, FeatureCollection.style is recommended as a more suitable alternative."]]],[]]