Stay organized with collections
Save and categorize content based on your preferences.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["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."]]],[]]