Annuncio: tutti i progetti non commerciali registrati per l'utilizzo di Earth Engine prima del
15 aprile 2025 devono
verificare l'idoneità non commerciale per mantenere l'accesso a Earth Engine.
ui.Chart.image.seriesByRegion
Mantieni tutto organizzato con le raccolte
Salva e classifica i contenuti in base alle tue preferenze.
Genera un grafico da una raccolta di immagini. Estrae e traccia il valore della banda specificata in ogni regione per ogni immagine della raccolta. Di solito una serie temporale.
- Asse X = Immagine etichettata da xProperty (impostazione predefinita: "system:time_start").
- Asse Y = Output del riduttore.
- Series = Region labeled by seriesProperty (default: 'system:index').
Restituisce un grafico.
Utilizzo | Resi |
---|
ui.Chart.image.seriesByRegion(imageCollection, regions, reducer, band, scale, xProperty, seriesProperty) | ui.Chart |
Argomento | Tipo | Dettagli |
---|
imageCollection | ImageCollection | Un ImageCollection con i dati da includere nel grafico. |
regions | Feature|FeatureCollection|Geometry|List<Feature>|List<Geometry> | Le regioni da ridurre. |
reducer | Riduttore | Funzione di riduzione che genera il valore per l'asse Y. Deve restituire un singolo valore. |
band | Numero|Stringa, facoltativo | Il nome della band da ridurre utilizzando il riduttore. Il valore predefinito è la prima banda. |
scale | Numero, facoltativo | Scala da utilizzare con il riduttore in metri. |
xProperty | Stringa, facoltativa | Proprietà da utilizzare come etichetta per ogni immagine sull'asse X. Il valore predefinito è "system:time_start". |
seriesProperty | Stringa, facoltativa | Proprietà delle funzionalità in opt_regions da utilizzare per le etichette delle serie. Il valore predefinito è "system:index". |
Esempi
Editor di codice (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);
Salvo quando diversamente specificato, i contenuti di questa pagina sono concessi in base alla licenza Creative Commons Attribution 4.0, mentre gli esempi di codice sono concessi in base alla licenza Apache 2.0. Per ulteriori dettagli, consulta le norme del sito di Google Developers. Java è un marchio registrato di Oracle e/o delle sue consociate.
Ultimo aggiornamento 2025-07-25 UTC.
[null,null,["Ultimo aggiornamento 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```"]]