I would like to know if there is any function or method in Google Earth Engine (GEE) that allows to fill sinks in Digital Elevation Models (DEM) like the algorithms available in traditional GIS softwares that use the D8 model.


If you just want to find if any pixel has a value lower than any of it's immediate neighbors, you can do a reduceRegion and a threshold. Note that this runs at whatever scale you're currently viewing, so the results are different at each zoom level.

var elev = ee.Image("USGS/SRTMGL1_003")

// Make a 3x3 kernel but punch out the center.
var kernel = ee.Kernel.fixed(3, 3, [[1, 1, 1], [1, 0, 1], [1, 1, 1]])

var localMin = elev.reduceNeighborhood(ee.Reducer.min(), kernel)
var sinks = elev.lt(localMin)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.