Skip to main content
added 12 characters in body
Source Link
TomazicM
  • 27k
  • 23
  • 31
  • 42

I was trying to retrieving chlorophyll-a levels using Landsat9. After processed it using this function :

 //Clorophyll-a Levels
 // Coefficients
 var a0= 0.341
 var a1= -3.001
 var a2= 2.811
 var a3= -2.041
 var a4= 0.0400

function R(img){
return img.expression(
      'log10(blue/green)',
      {
        'blue': img.select('B2'),
        'green': img.select('B3')
      });
}

var Ratio = citra.map(R)

function chlor(img){
return img.expression(
      '10**(a0+a1*R+a2*R**2+a3*R**3)+a4',
      {
        'a0': a0,
        'a1': a1,
        'a2': a2,
        'a3': a3,
        'a4': a4,
        'R': Ratio
      })
}

var chl = citra.map(chlor)

var ChlVisPar = {min:0.4,max:1.5,palette:['blue','lime','yellow','orange','red']}
Map.addLayer(chl,ChlVisPar,'Chlor-a')

I cant visualize using the Map.addLayer(chla,ChlVisPar,'Chlor-a')Map.addLayer(chla,ChlVisPar,'Chlor-a') and iI got messages  :

Layer error: Image.pow, argument 'image1': Invalid type. Expected type: Image. Actual type: ImageCollection.

Layer error: Image.pow, argument 'image1': Invalid type.
Expected type: Image.
Actual type: ImageCollection.

howHow do iI solve this?

I was trying to retrieving chlorophyll-a levels using Landsat9. After processed it using this function :

 //Clorophyll-a Levels
 // Coefficients
 var a0= 0.341
 var a1= -3.001
 var a2= 2.811
 var a3= -2.041
 var a4= 0.0400

function R(img){
return img.expression(
      'log10(blue/green)',
      {
        'blue': img.select('B2'),
        'green': img.select('B3')
      });
}

var Ratio = citra.map(R)

function chlor(img){
return img.expression(
      '10**(a0+a1*R+a2*R**2+a3*R**3)+a4',
      {
        'a0': a0,
        'a1': a1,
        'a2': a2,
        'a3': a3,
        'a4': a4,
        'R': Ratio
      })
}

var chl = citra.map(chlor)

var ChlVisPar = {min:0.4,max:1.5,palette:['blue','lime','yellow','orange','red']}
Map.addLayer(chl,ChlVisPar,'Chlor-a')

I cant visualize using the Map.addLayer(chla,ChlVisPar,'Chlor-a') and i got messages  :

Layer error: Image.pow, argument 'image1': Invalid type. Expected type: Image. Actual type: ImageCollection.

how do i solve this?

I was trying to retrieving chlorophyll-a levels using Landsat9. After processed it using this function :

 //Clorophyll-a Levels
 // Coefficients
 var a0= 0.341
 var a1= -3.001
 var a2= 2.811
 var a3= -2.041
 var a4= 0.0400

function R(img){
return img.expression(
      'log10(blue/green)',
      {
        'blue': img.select('B2'),
        'green': img.select('B3')
      });
}

var Ratio = citra.map(R)

function chlor(img){
return img.expression(
      '10**(a0+a1*R+a2*R**2+a3*R**3)+a4',
      {
        'a0': a0,
        'a1': a1,
        'a2': a2,
        'a3': a3,
        'a4': a4,
        'R': Ratio
      })
}

var chl = citra.map(chlor)

var ChlVisPar = {min:0.4,max:1.5,palette:['blue','lime','yellow','orange','red']}
Map.addLayer(chl,ChlVisPar,'Chlor-a')

I cant visualize using the Map.addLayer(chla,ChlVisPar,'Chlor-a') and I got messages:

Layer error: Image.pow, argument 'image1': Invalid type.
Expected type: Image.
Actual type: ImageCollection.

How do I solve this?

Source Link

Can't visualize ImageCollection using Map.addLayer()

I was trying to retrieving chlorophyll-a levels using Landsat9. After processed it using this function :

 //Clorophyll-a Levels
 // Coefficients
 var a0= 0.341
 var a1= -3.001
 var a2= 2.811
 var a3= -2.041
 var a4= 0.0400

function R(img){
return img.expression(
      'log10(blue/green)',
      {
        'blue': img.select('B2'),
        'green': img.select('B3')
      });
}

var Ratio = citra.map(R)

function chlor(img){
return img.expression(
      '10**(a0+a1*R+a2*R**2+a3*R**3)+a4',
      {
        'a0': a0,
        'a1': a1,
        'a2': a2,
        'a3': a3,
        'a4': a4,
        'R': Ratio
      })
}

var chl = citra.map(chlor)

var ChlVisPar = {min:0.4,max:1.5,palette:['blue','lime','yellow','orange','red']}
Map.addLayer(chl,ChlVisPar,'Chlor-a')

I cant visualize using the Map.addLayer(chla,ChlVisPar,'Chlor-a') and i got messages :

Layer error: Image.pow, argument 'image1': Invalid type. Expected type: Image. Actual type: ImageCollection.

how do i solve this?