ee.Image.reduceResolution
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.
Cho phép chiếu lại bằng cách sử dụng bộ giảm tốc đã cho để kết hợp tất cả các pixel đầu vào tương ứng với từng pixel đầu ra. 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ư hình ảnh đầu vào có các dải.
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, các hàm giảm có một đầu vào và một đầu ra sẽ giữ nguyên tên dải đầu vào, còn các hàm giảm có một đầu vào và nhiều đầu ra sẽ thêm tên dải đầu vào làm tiền tố cho tên đầu ra (ví dụ: "10_mean", "10_stdDev", "20_mean", "20_stdDev").
Trọng số đầu vào của chương trình giảm sẽ là tích của mặt nạ đầu vào và phần nhỏ của pixel đầu ra được bao phủ bởi pixel đầu vào.
Cách sử dụng | Giá trị trả về |
---|
Image.reduceResolution(reducer, bestEffort, maxPixels) | Hình ảnh |
Đối số | Loại | Thông tin chi tiết |
---|
this: image | Hình ảnh | Hình ảnh đầu vào. |
reducer | Bộ giảm tốc | Bộ giảm cần áp dụng để dùng cho việc kết hợp các pixel. |
bestEffort | Boolean, mặc định: false | Nếu việc sử dụng đầu vào ở độ phân giải mặc định sẽ yêu cầu quá nhiều pixel, hãy bắt đầu bằng các pixel đầu vào đã giảm từ một cấp độ kim tự tháp cho phép hoạt động thành công. |
maxPixels | Số nguyên, mặc định: 64 | Số lượng pixel đầu vào tối đa cần kết hợp cho mỗi pixel đầu ra. Nếu bạn đặt giá trị này quá lớn, thì sẽ xảy ra sự cố hết bộ 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-26 UTC.
[null,null,["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[[["\u003cp\u003eThis operation reprojects images using a reducer to combine input pixels for each output pixel, applying it per band or across bands based on reducer input.\u003c/p\u003e\n"],["\u003cp\u003eOutput band names are determined by the reducer's output names, sometimes preserving, prefixing, or directly using them.\u003c/p\u003e\n"],["\u003cp\u003eInput pixel weights are calculated using input mask and fractional output pixel coverage.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ereduceResolution\u003c/code\u003e method takes an image, reducer, and optional parameters for handling large operations, returning a reprojected image.\u003c/p\u003e\n"],["\u003cp\u003eOptional parameters \u003ccode\u003ebestEffort\u003c/code\u003e and \u003ccode\u003emaxPixels\u003c/code\u003e control memory usage and allow for processing large images by adjusting input resolution and pixel combination limits.\u003c/p\u003e\n"]]],[],null,["# ee.Image.reduceResolution\n\nEnables reprojection using the given reducer to combine all input pixels corresponding to each output pixel. If 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 input image has bands.\n\n\u003cbr /\u003e\n\nThe reducer output names determine the names of the output bands: reducers with multiple inputs will use the output names directly, reducers with a single input and single output will preserve the input band names, and reducers with a single input and multiple outputs will prefix the output name with the input band name (e.g., '10_mean', '10_stdDev', '20_mean', '20_stdDev').\n\nReducer input weights will be the product of the input mask and the fraction of the output pixel covered by the input pixel.\n\n| Usage | Returns |\n|-------------------------------------------------------------------|---------|\n| Image.reduceResolution`(reducer, `*bestEffort* `, `*maxPixels*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The input image. |\n| `reducer` | Reducer | The reducer to apply to be used for combining pixels. |\n| `bestEffort` | Boolean, default: false | If using the input at its default resolution would require too many pixels, start with already-reduced input pixels from a pyramid level that allows the operation to succeed. |\n| `maxPixels` | Integer, default: 64 | The maximum number of input pixels to combine for each output pixel. Setting this too large will cause out-of-memory problems. |"]]