ee.ImageCollection.reduce
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Áp dụng một hàm giảm trên tất cả hình ảnh trong một tập hợp.
Nếu hàm giảm có một đầu vào, thì hàm này sẽ được áp dụng riêng cho từng dải của tập hợp; nếu không, hàm này phải có cùng số lượng đầu vào như số lượng dải của tập hợp.
Tên đầu ra của hàm giảm xác định tên của các dải đầu ra: các hàm giảm có nhiều đầu vào sẽ sử dụng trực tiếp tên đầu ra, trong khi các hàm giảm có một đầu vào sẽ thêm tên dải đầu vào vào tên đầu ra (ví dụ: '10_mean', '20_mean').
Cách sử dụng | Giá trị trả về |
---|
ImageCollection.reduce(reducer, parallelScale) | Hình ảnh |
Đối số | Loại | Thông tin chi tiết |
---|
this: collection | ImageCollection | Tập hợp hình ảnh cần giảm. |
reducer | Bộ giảm tốc | Hàm rút gọn để áp dụng cho bộ sưu tập đã cho. |
parallelScale | Số thực, mặc định: 1 | Hệ số tỷ lệ dùng để giới hạn mức sử dụng bộ nhớ; sử dụng parallelScale lớn hơn (ví dụ: 2 hoặc 4) có thể cho phép các phép tính hết bộ nhớ với giá trị mặc định. |
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[[["\u003cp\u003eApplies a reducer function across all images within an ImageCollection, resulting in a single output Image.\u003c/p\u003e\n"],["\u003cp\u003eReducers can operate on individual bands or multiple bands simultaneously, determining the output band names accordingly.\u003c/p\u003e\n"],["\u003cp\u003eUtilizes a parallelScale factor to manage memory consumption during computation.\u003c/p\u003e\n"],["\u003cp\u003eAccess this functionality via the \u003ccode\u003eImageCollection.reduce()\u003c/code\u003e method, providing the reducer and optional parallelScale as parameters.\u003c/p\u003e\n"]]],[],null,["# ee.ImageCollection.reduce\n\nApplies a reducer across all of the images in a collection.\n\n\u003cbr /\u003e\n\nIf the reducer has a single input, it will be applied separately to each band of the collection; otherwise it must have the same number of inputs as the collection has bands.\n\nThe reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, while reducers with a single input will prefix the output name with the input band name (e.g., '10_mean', '20_mean').\n\n| Usage | Returns |\n|------------------------------------------------------|---------|\n| ImageCollection.reduce`(reducer, `*parallelScale*`)` | Image |\n\n| Argument | Type | Details |\n|--------------------|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `collection` | ImageCollection | The image collection to reduce. |\n| `reducer` | Reducer | The reducer to apply to the given collection. |\n| `parallelScale` | Float, default: 1 | A scaling factor used to limit memory use; using a larger parallelScale (e.g., 2 or 4) may enable computations that run out of memory with the default. |"]]