公告:所有在
2025 年 4 月 15 日之前注册使用 Earth Engine 的非商业项目都必须
验证是否符合非商业性质的资格条件,才能继续使用 Earth Engine。
ui.Chart.image.regions
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
根据图片生成图表。提取并绘制一个或多个区域中每个波段的值。
- X 轴 = 由 xProperty 标记的频段(默认:频段名称)。
- Y 轴 = Reducer 输出。
- 序列 = 由 seriesProperty 标记的区域(默认值:'system:index')。
返回图表。
用法 | 返回 |
---|
ui.Chart.image.regions(image, regions, reducer, scale, seriesProperty, xLabels) | ui.Chart |
参数 | 类型 | 详细信息 |
---|
image | 图片 | 要从中提取波段值的图片。 |
regions | Feature|FeatureCollection|Geometry|List<Feature>|List<Geometry>,可选 | 要缩减的区域。默认为影像的覆盖区。 |
reducer | Reducer,可选 | 用于生成 y 轴值的 reducer。必须为每个波段返回一个值。 |
scale | 数字,可选 | 以米为单位的像素比例。 |
seriesProperty | 字符串,可选 | 用作图例中每个区域标签的属性。默认为“system:index”。 |
xLabels | List<Object>,可选 | 用于 x 轴上频段的标签列表。必须与图像波段具有相同数量的元素。如果省略,频段将使用其名称进行标记。如果标签是数值(例如波长),则 x 轴将是连续的。 |
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003eGenerates a chart visualizing the values of image bands within specified regions, plotted against band labels or custom x-axis labels.\u003c/p\u003e\n"],["\u003cp\u003eUsers can define regions for analysis, the reducer for calculating band values, pixel scale, legend labels, and custom x-axis labels for the chart.\u003c/p\u003e\n"],["\u003cp\u003eThe chart's y-axis represents the reducer output, while the x-axis represents either band names or user-defined labels, and separate series are plotted for each region.\u003c/p\u003e\n"],["\u003cp\u003eThe function accepts an image, regions, a reducer, scale, series property for legend labels, and custom x-axis labels as input parameters.\u003c/p\u003e\n"],["\u003cp\u003eIt outputs a chart object displaying the extracted and plotted band values.\u003c/p\u003e\n"]]],[],null,["# ui.Chart.image.regions\n\n\u003cbr /\u003e\n\nGenerates a Chart from an image. Extracts and plots the value of each band in one or more regions.\n\n\u003cbr /\u003e\n\n- X-axis = Band labeled by xProperty (default: band name).\n\n- Y-axis = Reducer output.\n\n- Series = Region labeled by seriesProperty (default: 'system:index').\n\nReturns a chart.\n\n| Usage | Returns |\n|-----------------------------------------------------------------------------------------------------------|----------|\n| `ui.Chart.image.regions(image, `*regions* `, `*reducer* `, `*scale* `, `*seriesProperty* `, `*xLabels*`)` | ui.Chart |\n\n| Argument | Type | Details |\n|------------------|-----------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `image` | Image | Image to extract band values from. |\n| `regions` | Feature\\|FeatureCollection\\|Geometry\\|List\\\u003cFeature\\\u003e\\|List\\\u003cGeometry\\\u003e, optional | Regions to reduce. Defaults to the image's footprint. |\n| `reducer` | Reducer, optional | Reducer that generates the value(s) for the y-axis. Must return a single value per band. |\n| `scale` | Number, optional | The pixel scale in meters. |\n| `seriesProperty` | String, optional | Property to be used as the label for each region in the legend. Defaults to 'system:index'. |\n| `xLabels` | List\\\u003cObject\\\u003e, optional | A list of labels used for bands on the x-axis. Must have the same number of elements as the image bands. If omitted, bands will be labeled with their names. If the labels are numeric (e.g. wavelengths), x-axis will be continuous. |"]]