0

I want to implement a rendering transformation using the NDVI index on grayscale tiff. I am following this link:- https://docs.geoserver.org/stable/en/user/styling/sld/extensions/rendering-transform.html What type of data will work for it?

I tried the sld provided in the Geoserver manual, but that doesn't seem to work on my data, but on applying that style, it does not work

<NamedLayer>
    <Name>cite:NDVI</Name>
    <UserStyle>
      <Title>NDVI</Title>
      <FeatureTypeStyle>
        <Transformation>
          <ogc:Function name="ras:Jiffle">
            <ogc:Function name="parameter">
              <ogc:Literal>GRAY_INDEX</ogc:Literal>
            </ogc:Function>
          </ogc:Function>
        </Transformation>
        <Rule>
          <RasterSymbolizer>
            <Opacity>1.0</Opacity>
            <ColorMap>
              <ColorMapEntry color="#0000ff" quantity="-0.17"/>
              <ColorMapEntry color="#548022" quantity="0.07"/>
              <ColorMapEntry color="#f6f7f5" quantity="0.4"/>
            </ColorMap>
          </RasterSymbolizer>
        </Rule>
      </FeatureTypeStyle>
    </UserStyle>
  </NamedLayer>
</StyledLayerDescriptor>

I want my grayscale tiff to be transformed to NDVI band color mapping.

Lior Bar-On
  • 10,784
  • 5
  • 34
  • 46
Zucoop
  • 11
  • 2

1 Answers1

0

The page you link to shows how to calculate NDVI from a multiband Sentinel image by combining bands 3 and 7, using this formula.

            nir = src[7];
            vir = src[3];
            dest = (nir - vir) / (nir + vir);

Your grayscale image only has one band so it is impossible to calculate NDVI from it.

Ian Turton
  • 10,018
  • 1
  • 28
  • 47
  • Yaa missed that....but I had another shapefile placed on top of it where I had calculated average ndvi values...could that be used....sorry but I am quite new to geoserver. average_ndvi - 0.42500886027984, 0.328813077211667,0.203915735123556,..... Thanks – Zucoop Oct 18 '19 at 14:49
  • just draw the shapefile then – Ian Turton Oct 18 '19 at 14:56