Announcement: All noncommercial projects registered to use Earth Engine before April 15, 2025 must verify noncommercial eligibility to maintain Earth Engine access.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-13 UTC."],[[["\u003cp\u003eApplies a morphological reducer filter to each band of an image using a pre-defined or custom kernel.\u003c/p\u003e\n"],["\u003cp\u003eThe filter can be customized using parameters such as radius, kernel type, units, and iterations.\u003c/p\u003e\n"],["\u003cp\u003eUsers can define their own kernel, overriding the default options of kernel type and radius.\u003c/p\u003e\n"],["\u003cp\u003eThe function returns a modified image after applying the specified operations.\u003c/p\u003e\n"]]],["The `focalMode()` function applies a morphological reducer filter to an image's bands. It uses a specified `kernelType` (circle, square, etc.) or a custom `kernel`, with a defined `radius` and measurement `units` (pixels or meters). The operation can be repeated `iterations` times. If a custom `kernel` is provided, the `kernelType` and `radius` are ignored. The function returns a new image with the filter applied.\n"],null,["Applies a morphological reducer() filter to each band of an image using a named or custom kernel.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|------------------------------------------------------------------------------------------|---------|\n| Image.focalMode`(`*radius* `, `*kernelType* `, `*units* `, `*iterations* `, `*kernel*`)` | Image |\n\n| Argument | Type | Details |\n|---------------|---------------------------|------------------------------------------------------------------------------------------------------------|\n| this: `image` | Image | The image to which to apply the operations. |\n| `radius` | Float, default: 1.5 | The radius of the kernel to use. |\n| `kernelType` | String, default: \"circle\" | The type of kernel to use. Options include: 'circle', 'square', 'cross', 'plus', 'octagon', and 'diamond'. |\n| `units` | String, default: \"pixels\" | If a kernel is not specified, this determines whether the kernel is in meters or pixels. |\n| `iterations` | Integer, default: 1 | The number of times to apply the given kernel. |\n| `kernel` | Kernel, default: null | A custom kernel. If used, kernelType and radius are ignored. |"]]