Question

I want to convert each date of NDVI value of area in csv format any idea please ?

  • 1 October 2019
  • 2 replies
  • 6 views

I have download B4 and B8 band from S3 and create NDVI image but unable to convert in CSV


2 replies

Userlevel 4
Badge +25

That sounds like quite a complex project. Can you give us any more details? For example, what structure do you want the CSV file to be? And when you say "unable to convert" can you tell us what have you tried and what happens? Does it fail with an error? Or is the data just the wrong structure? The more information you can provide, the more likely it is we will be able to give a useful response.

Badge +2

Hi @bariavijit250, You could use a RasterCellCoercer in point mode and let the band values extract as Z-values. Then use a CoordinateExtractor to get x,y,z values and write them out using a csv writer.

Some points to consider:

  • Sentinel produces vaste amounts of data, so you might want to put a RasterResampler in front of the RasterCellCoercer to (temporarily) reduce the size of it for experimenting reasons (use percentage mode, something like 1%)
  • Depending on the type of raster (bands) you can use a RasterInterpretationCoercer to create a numeric (real64 or so) raster in stead of an RGB three band raster.
  • An RGB raster might also contain a palette, you probably want to get rid of that using a RasterPaletteResolver
  • Or remove the B4 and B8 bands to keep just the band holding the NDVI values if you were combining the B4/B8 bands and then used the RasterExpressionEvaluator to generate the NDVI band.
  • If there is no geolocation in the raster, you will probably need to use an AffineWarper or a Scaler/Offsetter combination to get it onto the right place on Earth.
  • If you use some exotic Excel that reads decimal points as thousand separator, like I do, you could replace them using a StringReplacer on the x,y,z coordinates.
  • I'm not sure in the end this will work.

Good luck and have fun, this is nice stuff.

Reply