ui.Chart.image.seriesByRegion
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Generuje wykres z kolekcji obrazów. Wyodrębnia i wykreśla wartość określonego pasma w każdym regionie dla każdego obrazu w kolekcji. Zwykle jest to ciąg czasowy.
- Oś X = obraz oznaczony etykietą xProperty (domyślnie: „system:time_start”).
- Oś Y = dane wyjściowe reduktora.
– Series = Region oznaczony etykietą seriesProperty (domyślnie: „system:index”).
Zwraca wykres.
Wykorzystanie | Zwroty |
---|
ui.Chart.image.seriesByRegion(imageCollection, regions, reducer, band, scale, xProperty, seriesProperty) | ui.Chart |
Argument | Typ | Szczegóły |
---|
imageCollection | ImageCollection | Obiekt ImageCollection z danymi, które mają być uwzględnione na wykresie. |
regions | Feature|FeatureCollection|Geometry|List<Feature>|List<Geometry> | Regiony do zmniejszenia. |
reducer | Ograniczenie | Funkcja redukująca, która generuje wartość dla osi Y. Musi zwracać jedną wartość. |
band | Number|String, opcjonalnie | Nazwa pasma do zmniejszenia za pomocą funkcji redukującej. Domyślnie jest to pierwszy zakres. |
scale | Numer, opcjonalny | Skala do użycia z reduktorem w metrach. |
xProperty | Ciąg znaków, opcjonalnie | Właściwość, która ma być używana jako etykieta każdego obrazu na osi x. Domyślna wartość to „system:time_start”. |
seriesProperty | Ciąg znaków, opcjonalnie | Właściwość funkcji w opt_regions, która ma być używana na potrzeby etykiet serii. Domyślna wartość to „system:index”. |
Przykłady
Edytor kodu (JavaScript)
// Define regions of pixels to reduce and chart a time series for.
var regions = ee.FeatureCollection([
ee.Feature(
ee.Geometry.BBox(-121.916, 37.130, -121.844, 37.076), {label: 'Forest'}),
ee.Feature(
ee.Geometry.BBox(-122.438, 37.765, -122.396, 37.800), {label: 'Urban'})
]);
// Define an image collection time series to chart, MODIS vegetation indices
// in this case.
var imgCol = ee.ImageCollection('MODIS/006/MOD13A1')
.filter(ee.Filter.date('2015-01-01', '2020-01-01'))
.select(['NDVI', 'EVI']);
// Define the chart and print it to the console.
var chart = ui.Chart.image.seriesByRegion({
imageCollection: imgCol,
band: 'NDVI',
regions: regions,
reducer: ee.Reducer.mean(),
scale: 500,
seriesProperty: 'label',
xProperty: 'system:time_start'
})
.setOptions({
title: 'Average NDVI Value by Date',
hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},
vAxis: {
title: 'NDVI (x1e4)',
titleTextStyle: {italic: false, bold: true}
},
lineWidth: 5,
colors: ['0f8755', '808080'],
});
print(chart);
O ile nie stwierdzono inaczej, treść tej strony jest objęta licencją Creative Commons – uznanie autorstwa 4.0, a fragmenty kodu są dostępne na licencji Apache 2.0. Szczegółowe informacje na ten temat zawierają zasady dotyczące witryny Google Developers. Java jest zastrzeżonym znakiem towarowym firmy Oracle i jej podmiotów stowarzyszonych.
Ostatnia aktualizacja: 2025-07-25 UTC.
[null,null,["Ostatnia aktualizacja: 2025-07-25 UTC."],[[["\u003cp\u003eGenerates a chart that visualizes the change in a specific band's value over time within defined regions of an image collection.\u003c/p\u003e\n"],["\u003cp\u003eCharts the reducer output on the y-axis, time (or a specified property) on the x-axis, and uses regions as separate series.\u003c/p\u003e\n"],["\u003cp\u003eOffers customization options for the chart's appearance, such as titles, axes labels, line properties, and series colors, enabling detailed visual representation of the data.\u003c/p\u003e\n"],["\u003cp\u003eUses a reducer to summarize pixel values within each region for every image in the collection, allowing for analysis of trends and patterns.\u003c/p\u003e\n"],["\u003cp\u003eAccepts an image collection, regions of interest, a reducer, and optional parameters for band selection, scale, and property labeling for flexible data analysis and visualization.\u003c/p\u003e\n"]]],["This code generates a chart from an image collection, extracting and plotting band values per region. It uses `ui.Chart.image.seriesByRegion` with parameters: `imageCollection`, `regions`, `reducer`, `band`, `scale`, `xProperty`, and `seriesProperty`. The x-axis represents images labeled by `xProperty`, the y-axis shows the reducer's output, and series are labeled by `seriesProperty`. It takes data from an `imageCollection`, reduces it based on regions, and displays the results in a chart, frequently displaying a time series. An example provided uses MODIS vegetation indices.\n"],null,["# ui.Chart.image.seriesByRegion\n\n\u003cbr /\u003e\n\nGenerates a Chart from an image collection. Extracts and plots the value of the specified band in each region for each image in the collection. Usually a time series.\n\n\u003cbr /\u003e\n\n- X-axis = Image labeled by xProperty (default: 'system:time_start').\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.seriesByRegion(imageCollection, regions, reducer, `*band* `, `*scale* `, `*xProperty* `, `*seriesProperty*`)` | ui.Chart |\n\n| Argument | Type | Details |\n|-------------------|-------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------|\n| `imageCollection` | ImageCollection | An ImageCollection with data to be included in the chart. |\n| `regions` | Feature\\|FeatureCollection\\|Geometry\\|List\\\u003cFeature\\\u003e\\|List\\\u003cGeometry\\\u003e | The regions to reduce. |\n| `reducer` | Reducer | Reducer that generates the value for the y-axis. Must return a single value. |\n| `band` | Number\\|String, optional | The band name to reduce using the reducer. Defaults to the first band. |\n| `scale` | Number, optional | Scale to use with the reducer in meters. |\n| `xProperty` | String, optional | Property to be used as the label for each image on the x-axis. Defaults to 'system:time_start'. |\n| `seriesProperty` | String, optional | Property of features in opt_regions to be used for series labels. Defaults to 'system:index'. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\n// Define regions of pixels to reduce and chart a time series for.\nvar regions = ee.FeatureCollection([\n ee.Feature(\n ee.Geometry.BBox(-121.916, 37.130, -121.844, 37.076), {label: 'Forest'}),\n ee.Feature(\n ee.Geometry.BBox(-122.438, 37.765, -122.396, 37.800), {label: 'Urban'})\n]);\n\n// Define an image collection time series to chart, MODIS vegetation indices\n// in this case.\nvar imgCol = ee.ImageCollection('MODIS/006/MOD13A1')\n .filter(ee.Filter.date('2015-01-01', '2020-01-01'))\n .select(['NDVI', 'EVI']);\n\n// Define the chart and print it to the console.\nvar chart = ui.Chart.image.seriesByRegion({\n imageCollection: imgCol,\n band: 'NDVI',\n regions: regions,\n reducer: ee.Reducer.mean(),\n scale: 500,\n seriesProperty: 'label',\n xProperty: 'system:time_start'\n})\n.setOptions({\n title: 'Average NDVI Value by Date',\n hAxis: {title: 'Date', titleTextStyle: {italic: false, bold: true}},\n vAxis: {\n title: 'NDVI (x1e4)',\n titleTextStyle: {italic: false, bold: true}\n },\n lineWidth: 5,\n colors: ['0f8755', '808080'],\n});\nprint(chart);\n```"]]