Announcement: All noncommercial projects registered to use Earth Engine before
April 15, 2025 must
verify noncommercial eligibility to maintain Earth Engine access.
ee.Image.interpolate
Stay organized with collections
Save and categorize content based on your preferences.
Interpolates each point in the first band of the input image into the piecewise-linear function specified by the x and y arrays. The x values must be strictly increasing. If an input point is less than the first or greater than the last x value, then the output is specified by the "behavior" argument: "extrapolate" specifies the output value is extrapolated from the two nearest points, "clamp" specifies the output value is taken from the nearest point, "input" specifies the output value is copied from the input, and "mask" specifies the output value is masked.
Usage | Returns | Image.interpolate(x, y, behavior) | Image |
Argument | Type | Details | this: image | Image | The image to which the interpolation is applied. |
x | List | The x axis (input) values in the piecewise function. |
y | List | The y axis (output) values in the piecewise function. |
behavior | String, default: "extrapolate" | The behavior for points that are outside of the range of the supplied function. Options are: 'extrapolate', 'clamp', 'mask', or 'input'. |
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 2024-07-13 UTC.
[null,null,["Last updated 2024-07-13 UTC."],[[["\u003cp\u003eThe \u003ccode\u003einterpolate\u003c/code\u003e function modifies an image by applying a piecewise-linear function to its first band, mapping input pixel values (x-axis) to output values (y-axis).\u003c/p\u003e\n"],["\u003cp\u003eUsers define the function using 'x' and 'y' lists, ensuring 'x' values are strictly increasing.\u003c/p\u003e\n"],["\u003cp\u003eFor input values outside the defined function range, the 'behavior' argument controls the output, with options including extrapolation, clamping, using original input, or masking.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a modified image with the interpolation applied.\u003c/p\u003e\n"],["\u003cp\u003eThe function can be used via \u003ccode\u003eImage.interpolate(x, y, behavior)\u003c/code\u003e, with 'x' and 'y' being lists and 'behavior' being a string with a default of 'extrapolate'.\u003c/p\u003e\n"]]],[],null,["# ee.Image.interpolate\n\nInterpolates each point in the first band of the input image into the piecewise-linear function specified by the x and y arrays. The x values must be strictly increasing. If an input point is less than the first or greater than the last x value, then the output is specified by the \"behavior\" argument: \"extrapolate\" specifies the output value is extrapolated from the two nearest points, \"clamp\" specifies the output value is taken from the nearest point, \"input\" specifies the output value is copied from the input, and \"mask\" specifies the output value is masked.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|-----------------------------------------|---------|\n| Image.interpolate`(x, y, `*behavior*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|--------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to which the interpolation is applied. |\n| `x` | List | The x axis (input) values in the piecewise function. |\n| `y` | List | The y axis (output) values in the piecewise function. |\n| `behavior` | String, default: \"extrapolate\" | The behavior for points that are outside of the range of the supplied function. Options are: 'extrapolate', 'clamp', 'mask', or 'input'. |"]]