I was able to extract the water area using Otsu algorithm for a specified year. Now I want to prepare a split window app to compare year on year for which I need to transform the whole code to a "on-click" button.

Any idea on how to do the same in Earth Engine.

Please find below the link to my code. https://code.earthengine.google.com/c22b9554bc13cbde76407b109338886d

  • there are some suggestions you could follow in the earth engine community: developers.google.com/earth-engine/guides/ui_widgets
    – Jobbo90
    Feb 9 at 11:38
  • Actually could create the split window by the help of the above link, but not sure how to incorporate the otsu algorithm inside a function to get the result on a click. code.earthengine.google.com/7265709f60ff8d40582e0ca043303711
    – P.Kim
    Feb 9 at 12:34
  • What should the onlick do? Click in the map and apply the algorithm to the geometry around that point? Perhaps provide some more details on what you exactly want
    – Jobbo90
    Feb 9 at 12:40
  • Basically it is a split window app where user can compare different years waterbody area on the respective layers, to do that we need the waterbody area calculation on the backend. I have it developed for one year with given dates, now need to incorporate that in a function package inside the split window app. The onclick will be a ui button which will give the waterbody area.
    – P.Kim
    Feb 9 at 12:51
  • okay so I have successfully created the first part of the code and created the onclick button. But my error starts here. When I try to add the same button onto the two panels of a split window, the Sentinel composite doesnt show up. Can anyone please help me out here. Below is the link to my code.code.earthengine.google.com/8a4bf72c4989668ca7ed912e3cf2e677
    – P.Kim
    Feb 15 at 5:30


Your Answer

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

Browse other questions tagged or ask your own question.