Export from SNAP to QGIS

Hi all,

I am trying to import my supervised classification from SNAP to QGIS. I exported the file in GeoTIFF format in SNAP and opened it in QGIS. But the raster is all red… what are the steps I am missing?

(Also, could you tell me if a KNN classification is pertinent for land use classification (my classes are: crop, grassland, forest, shrubland etct). Of all algorithms, it seems to be giving me the most accurate classification; but I see RF and ML being used more often…)

Thanks in advance,
Cheers

1 Like

maybe the color range does not fit to the data distribution? What are the min and max values used in QGIS to display the raster?

That is found in the raster histogram right? If so, then band 1 has min=2.002, max=10.989 and band 2 has min=1, max=1.

band 1 is the one with the classification. As it ranges between 2 and 11 there must be values. Have you made sure that the colors in QGIS cover this range? You can set it to “unique values” instead of a stretched color ramp so that each value gets its own color.

It worked! Thanks a lot :slight_smile:

Hello,

The same happened to me. I actually coloured it manually because otherwise it wasn’t working.

I noticed that after opening the SNAP-file in QGIS the “overlapping” which is coloured in grey is part of the background. I want it to be a color from the classes as the other ones. I didn’t noticed it in SNAP but after doing the import into QGIS I realized it.

In SNAP:
image

In QGIS:

In QGIS the backround is more obvious:
image

How could I limit the overlapping to the borders of my area. Clipping is till now not an option.

Thanks
Carolina

As I have read the problem earlier from your first post, I’d suggest to export the band 1 which has the classification, from optical —>band extractor, no need to import to other format in this case, however keep the SNAP format, you’ll get folder has the header and the file image, drag and drop it in QGIS, and see if has any difference of color,

Concerning the background color, check up the training classes, and also in case this within red circle the classes’ borders and the background whether both give NaN or not!

I already drag and drop the image and this worked.
Concerning your other advice, I do not understand exactly what you mean (new in this :slight_smile: ). There is always a class which appears as kind of default-class and yes the backround and part of the real area has the overlapping color as I circled in red.

I meant, did you select the Training aria carefully, or some pixels of masked area NaN, are already included!

Hello,

I was doing other things the past time. My question still remains and also the problem shown in the picture.
I actually had originally a picture which was rectangular which I clipped in QGIS. Afterwards I used the clipped image to aply the LUC. You always have to choose the image you use (Function BandSet: Multiband) if not you can’t proceed with the selection of the ROIs. What did you mean by pixels of masked area? By the way the training data is from QGIS but the error can be seen on SNAP after the classification is done.

@ABraun
The geotiff products exported from snap to QGIS contains those no-data areas, is there a way to remove those areas from snap before the export?

You don’t need to export to GeoTiff, you can directly open SNAP data in QGIS: Export of products from SNAP

But in any way, you can define this pixel value as NoData in the QGIS raster properties as well.

1 Like

Those areas of no data have the value of Zero but I am afraid that pixels inside the interferogram itself that has a phase value of zero would be filtererd out as well. here’s my attempt of defining No-data-value to remove those areas

Actual zeroes inside the phase are not very likely and will not have a large effect