Export the TOA reflectance of 1c product to CSV file

dl stands for digital, it is a integer and not a number between 0 and 1.

1 Like

Dear Nicolas,

As you say, dl means digital number.
How can I get this value from image by any libraries such as C library or java library? I means, which library of which language I can use to get this value ?
I dont want to see this value by opening SNAP anytime.

Best.

SNAP can export S2 products or jp2 files for a variety of formats (GeoTiff, Envi, etc.) or you could use the openjpeg library.

Dear Nicolas,

Can i export jp2 to csv by openjpeg library?

No, but for this you can use SNAP:

  • draw a polygon or a shape on the zone of the image you want to export
  • choose File/Export/other/Transect pixels

Or you can just export to CSV…

Thank Nicolas,

Exporting the intensity of pixel of image to csv by Snap is exactly what I am doing.
I means I don’t want to belong to Snap,and use another tool or library to do this task.

Best.

If you don’t want the GUI, SNAP also comes with a command line mode (gpt). Otherwise what is the reason you don’t want SNAP?

Hi Guillaume,

I would like to convert my raster image to csv, and classify crop types using the pixel values from ROIs, or known values of ROIs. e.g. values 1-10 = wheat, values 11-20 = barley etc
Do you know if this is possible?

Why going through a csv then ?

Multiples possibilities in SNAP (Raster > Classification …), QGis, ArcGIS, ENVI,… are optimized for working on raster and are very efficient.

@Guillaume is right. Why going the csv-way?

But if you really need to you can do
File / Export / CSV
This will export the whole product. So you would need to subset it first.
Or if you have already defined your ROI and have a mask for it
Raster / Export / Mask Pixels
Or right click in the image and chose Export Mask Pixels from the context menu.

Its just QGIS is taking so long , I thought If I could export the pixels as a CSv file , maybe I could classify the image in excel, perhaps?

Doesn’t look like a good idea for speed !

if you don’t have ENVI or ArcGIS and QGis is really to slow, you can go for command line or GUI versions of OTB which is one of the most efficient library for image manipulations… Including classification tools.

I reprojected a radarsat VV file to RD new , but when i extract the pixel values and export to csv, then make a shapefile , the value points have shifted . when i try to reconvert . What could be the problem ?


What has shifted the lat/lon coordinates or the VV values at the exracted points?
When does the shift occur, after export to csv, after creating the shapefile (how is this created?) or when converting back?