I have several layers I want to combine using map algebra in Google Earth Engine. However, I need to scale them to have 1-5 values so they are comparable. Here is an example of one layer, slope, which I need to scale to values in the range 1-5.
// Load the SRTM image.
var srtm = ee.Image('CGIAR/SRTM90_V4');
// Apply an algorithm to an image.
var slope = ee.Terrain.slope(srtm);
var Vis = {
min: 1.0,
max: 30.0,
palette: ['001137', '0aab1e', 'e7eb05', 'ff4a2d', 'e90000'],
};
Map.setCenter(-74.93, 4.71, 5);
// Display the result.
// Center on the Grand Canyon.
Map.addLayer(slope, Vis, 'slope');