Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
Stay organized with collections
Save and categorize content based on your preferences.
Concatenates pixels from each band into a single array per pixel. The result will be masked if any input bands are masked.
Usage
Returns
Image.toArray(axis)
Image
Argument
Type
Details
this: image
Image
Image of bands to convert to an array per pixel. Bands must have scalar pixels, or array pixels with equal dimensionality.
axis
Integer, default: 0
Axis to concatenate along; must be at least 0 and at most the dimension of the inputs. If the axis equals the dimension of the inputs, the result will have 1 more dimension than the inputs.
[[["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."],[[["`Image.toArray()` converts an image's band values into an array for each pixel, creating an \"array image\"."],["The optional `axis` argument controls the dimension along which the bands are concatenated in the array image."],["Array images can be displayed and inspected, with the first element of the array represented visually."],["This function enables analysis and manipulation of multi-band images by treating pixel values as arrays."]]],["The `toArray()` method concatenates pixel values from an image's bands into a single array per pixel. It takes an optional `axis` argument to specify the concatenation direction; the default is 0. The method converts the multi-band image to an array image, resulting in a single \"array\" band. If any input band has masked pixels, the resulting array will also be masked. You can use `toArray(1)` to create 2D array image or `toArray(2)` to create 3D array.\n"]]