公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ee.Image.interpolate
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
将输入图像第一个波段中的每个点插值到由 x 和 y 数组指定的分段线性函数中。x 值必须严格递增。如果输入点小于第一个或大于最后一个 x 值,则输出由“行为”实参指定:“外推”指定输出值从两个最近的点外推,“钳制”指定输出值取自最近的点,“输入”指定输出值从输入复制,“遮盖”指定输出值被遮盖。
用法 | 返回 |
---|
Image.interpolate(x, y, behavior) | 图片 |
参数 | 类型 | 详细信息 |
---|
此:image | 图片 | 应用插值的图片。 |
x | 列表 | 分段函数中的 x 轴(输入)值。 |
y | 列表 | 分段函数中的 y 轴(输出)值。 |
behavior | 字符串,默认值:“extrapolate” | 超出所提供函数范围的点的行为。选项包括:'extrapolate'、'clamp'、'mask' 或 'input'。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\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'. |"]]