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,
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.
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 QGIS the backround is more obvious:
How could I limit the overlapping to the borders of my area. Clipping is till now not an option.
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 ). 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!
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.