Announcement: On November 13, 2024, all users will need to use a Cloud project in order to access Earth Engine. After this date, continued individual access without a Cloud project will require an exception.
Stay organized with collections
Save and categorize content based on your preferences.
Extracts a rectangular region of pixels from an image into a ND array per band. The arrays are returned in a feature retaining the same properties as the image and a geometry the same as that used to sample the image (or the image footprint if unspecified). Each band is sampled in its input projection, and if no geometry is specified, sampled using its footprint. For scalar bands, the output array is 2D. For array bands the output array is (2+N)D where N is the number of dimensions in the original band. If sampling array bands, all arrays must have the same number of elements. If a band's sampled region is entirely masked and a default array value is specified, the default array value is used in-lieu of sampling the image.
[[["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."],[[["The `sampleRectangle` function extracts a rectangular region of pixels from an image, returning a Feature with the sampled data in a multi-dimensional array."],["The extracted region is defined by a Geometry or defaults to the image's footprint, with output preserving the image's properties."],["Sampling occurs in each band's original projection and handles masked regions using provided default values or array values if necessary."],["For images with array bands, the output array will have dimensions corresponding to the image's original band structure plus the spatial dimensions."],["The function provides options to specify properties to retain, default values for masked pixels, and default values for masked array pixels."]]],[]]