I have problem with masking Sentinel-2 images. I can open image in RGB window and import .shp file which defines my area of interested, but after using Land/Sea mask tool I receive all the extracted bands entirely black - even inside of the mask. Does anyone have problem like that or someone know good way for creating subset of snap images with .shp layer? I can’t use existing subset tool because I need to cut irregural shape, not rectangle.
Yeah, it is, I’ve just checked. I thought for a while that the problem is that one part of the S-2 image is in UTM 33N zone, but another part in UTM 34 zone, but I also tried to mask it not with a external shapefile, but with polygon drawn in SNAP - I still receive totally black image after using land/sea Mask.
Do you mean if I resampled all bands to one size of the pixel? I need only bands 2,3,4 and 8 and these have the same spatial resolution. Do you think I shall resample all bands even that and try to mask all of them?
I need to resample bands before making band subset. However, I still don’t receive expected results. By the way - I can succesufly mask Sentinel-1 imagery with Land/Sea mask even if shapefile layer is in another coordinate system, so I think there is another reason that things don’t happened…
Did you (or could you) check if your SNAP instance is able to mask Sentinel-2 data with shapefile?
I don’t know if I good understood you. Are you asking if I reproject my Sentinel-2 imagery to exactly the same coordinate system as it’s deliver (UTM) or if I reproject the imagery to the same coordinate system as my shapefile with AOI?
I created my shp using the UTM projection that my S2 image has. So both my S2 image and shp have the same projection at the begining of the methodology. However, same as for you, the masking process is producing an empty product. I am trying your solution and would like to know if you re-projected the S2 to the exactly same coordinate system as it’s deliver (I know this is redundant)
I’ve managed to have the correct result by following the methodology of @mkubicki. Just a clarification for new readers, the reprojection is for the S2 image (assuming that both your shp and S2 image have the same CRS). So, if you want to crop an image with the exact shape of your study area, you will need to reproject the S2 before.