I'm working on a map view that detects new ice using Sentinel-1 together with Google Earth Engine.
When adding images to Google Earth Engine I can set the min and max values for my layer in numbers but then in the map view I have the possibility to change change these values and also select different stretch options.
Is it possible to choose one of these options instead of entering a max and min view in the code? Right now my code end looks like this:
Map.addLayer(hh2017, {
bands: ["HH"],
max: -5,
min: -19,
opacity: 1,
palette: ['002bff','a4d5ff','979797','080358','000029' ]
}, 'sentinel-1');
I want it to be Stretch: 90%
The reason I need to stretch the image each time is that they all look a bit different.
Best Answer
As described here, you may want to try a Styled Layer Descriptor. The previous answer also works, but requires you to use
getInfo()
, which can cause your browser to lock (see Client-Server doc for details). Here's another approach: