I am trying to map the maximum water extent in a certain area. Therefore I thought to use the JRC dataset by using the 'max_extent' band. The code however gives me the following error: "max_extent" is not defined in this scope. The 'max_extent' band is binary instead of for instance the 'occurrence' band.

  1. Is there something wrong in my code?
  2. How to visualize the binary 'max_extent' band?
  3. Is the JRC datset suitable for this task, or should I use another method?


// ------MAXIMUM EXTENT------------------------------------------------------------------------------------------------------------

var gsw = ee.Image('JRC/GSW1_0/GlobalSurfaceWater');

var occurrence = gsw.select('max_extent');


  eeObject: occurrence.updateMask(max_extent.divide(100)),
  name: "Maximum Water Extent (1984-2015)",  

closed as too broad by PolyGeo Apr 30 '18 at 22:00

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    Welcome to GIS SE. As a new user, please take the Tour, which stresses the importance of asking one question per Question. Please Edit your Question so there is one question. – Vince Apr 30 '18 at 10:41
  1. Yes, 'max_extent' is not defined in your scope. Check your code, there isn't any object called max_extent
  2. Map.addLayer(gsw.select('max_extent'))
  3. Is unclear the aim of your analysis, please be clear. If you want the maximum water extent in a certain area, just use max extent instead occurrence layer.
  • Thanks! In the end it turned out to be the '.divide(100)' part which was interfering. – Alexander Nijhuis May 2 '18 at 5:51

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