2

What I mean is: We are giving the min and max value to the visualization parameters but in my case min and max value changes according to geometry so how can i find the min and max value and give these values to the visualization parameters.

My code is:

var median = coll.reduce(ee.Reducer.median()).clip(geometry);

var extrema = median.select('CO_column_number_density_median').reduceRegion(ee.Reducer.minMax(),geometry,250);

var min1 = extrema.getNumber('CO_column_number_density_median_min');

var max1 = extrema.getNumber('CO_column_number_density_median_max');

  var visParams={
    min:min1,
    max:max1,
    opacity: 1.0,
    palette: ["blue","green","red","cyan","black","yellow","purple"],
    bands:['CO_column_number_density_median']
    };  

  Map.addLayer(median,visParams, 'true-color composite');

1 Answer 1

1

I will find the solution but this method is very slow. so if anybody found another solution then please tell me the solution.

soluton:

var median = coll.reduce(ee.Reducer.median()).clip(geometry);
  var Extrema=median.select('CO_column_number_density_median').reduceRegion(ee.Reducer.minMax(),geometry,250)

  var min1=(Extrema.getNumber('CO_column_number_density_median_min')).getInfo();
  var max1=(Extrema.getNumber('CO_column_number_density_median_max')).getInfo();

  var visParams={
    min:min1,
    max: max1,
    opacity: 1.0,
    palette: ["blue","green","red","yellow","black","cyan","purple"],
    bands:['CO_column_number_density_median']
  };  

  Map.addLayer(median,visParams, 'true-color composite');

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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