Ogłoszenie: wszystkie projekty niekomercyjne zarejestrowane do korzystania z Earth Engine przed
15 kwietnia 2025 r. muszą
potwierdzić spełnianie warunków użycia niekomercyjnego , aby zachować dostęp. Jeśli nie przejdziesz weryfikacji do 26 września 2025 r., Twój dostęp może zostać wstrzymany.
Prześlij opinię
ee.ImageCollection.reduceToImage
Zadbaj o dobrą organizację dzięki kolekcji
Zapisuj i kategoryzuj treści zgodnie ze swoimi preferencjami.
Tworzy obraz z kolekcji obiektów, stosując funkcję redukującą do wybranych właściwości wszystkich obiektów, które przecinają każdy piksel.
Wykorzystanie Zwroty ImageCollection. reduceToImage (properties, reducer)
Obraz
Argument Typ Szczegóły to: collection
FeatureCollection Kolekcja obiektów do przecięcia z każdym pikselem wyjściowym. properties
Lista Właściwości, które należy wybrać z każdej funkcji i przekazać do funkcji redukującej. reducer
Ograniczenie Reduktor do łączenia właściwości każdej przecinającej się funkcji w wynik końcowy, który będzie przechowywany w pikselu.
Przykłady
Edytor kodu (JavaScript)
var col = ee . ImageCollection ( 'LANDSAT/LC08/C02/T1_TOA' )
. filterBounds ( ee . Geometry . BBox ( - 124.0 , 43.2 , - 116.5 , 46.3 ))
. filterDate ( '2021' , '2022' );
// Image visualization settings.
var visParams = {
bands : [ 'B4' , 'B3' , 'B2' ],
min : 0.01 ,
max : 0.25
};
Map . addLayer ( col . mean (), visParams , 'RGB mean' );
// Reduce the geometry (footprint) of images in the collection to an image.
// Image property values are applied to the pixels intersecting each
// image's geometry and then a per-pixel reduction is performed according
// to the selected reducer. Here, the image cloud cover property is assigned
// to the pixels intersecting image geometry and then reduced to a single
// image representing the per-pixel mean image cloud cover.
var meanCloudCover = col . reduceToImage ({
properties : [ 'CLOUD_COVER' ],
reducer : ee . Reducer . mean ()
});
Map . setCenter ( - 119.87 , 44.76 , 6 );
Map . addLayer ( meanCloudCover , { min : 0 , max : 50 }, 'Cloud cover mean' );
Konfiguracja Pythona
Informacje o interfejsie Python API i używaniu geemap
do interaktywnego programowania znajdziesz na stronie
Środowisko Python .
import ee
import geemap.core as geemap
Colab (Python)
col = (
ee . ImageCollection ( 'LANDSAT/LC08/C02/T1_TOA' )
. filterBounds ( ee . Geometry . BBox ( - 124.0 , 43.2 , - 116.5 , 46.3 ))
. filterDate ( '2021' , '2022' )
)
# Image visualization settings.
vis_params = { 'bands' : [ 'B4' , 'B3' , 'B2' ], 'min' : 0.01 , 'max' : 0.25 }
m = geemap . Map ()
m . add_layer ( col . mean (), vis_params , 'RGB mean' )
# Reduce the geometry (footprint) of images in the collection to an image.
# Image property values are applied to the pixels intersecting each
# image's geometry and then a per-pixel reduction is performed according
# to the selected reducer. Here, the image cloud cover property is assigned
# to the pixels intersecting image geometry and then reduced to a single
# image representing the per-pixel mean image cloud cover.
mean_cloud_cover = col . reduceToImage (
properties = [ 'CLOUD_COVER' ], reducer = ee . Reducer . mean ()
)
m . set_center ( - 119.87 , 44.76 , 6 )
m . add_layer ( mean_cloud_cover , { 'min' : 0 , 'max' : 50 }, 'Cloud cover mean' )
m
Prześlij opinię
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-26 UTC.
Chcesz przekazać coś jeszcze?
[[["Łatwo zrozumieć","easyToUnderstand","thumb-up"],["Rozwiązało to mój problem","solvedMyProblem","thumb-up"],["Inne","otherUp","thumb-up"]],[["Brak potrzebnych mi informacji","missingTheInformationINeed","thumb-down"],["Zbyt skomplikowane / zbyt wiele czynności do wykonania","tooComplicatedTooManySteps","thumb-down"],["Nieaktualne treści","outOfDate","thumb-down"],["Problem z tłumaczeniem","translationIssue","thumb-down"],["Problem z przykładami/kodem","samplesCodeIssue","thumb-down"],["Inne","otherDown","thumb-down"]],["Ostatnia aktualizacja: 2025-07-26 UTC."],[],[]]