Applying Land/Sea Mask to S2 image with vector as mask generates a black image
Description
None
Environment
None
GitHub Work
None
Activity
Show:
Omar Barrilero 4 September 2017 at 13:41
It seems to be related to the band dataType. Currently, when applying a geometry, a band is computed with the expression "geometry?[BandName]:[Band.NoDataValue]". The problem is that the target band is created with the same datatype than the input band (int in the case of S2) and the value returned by the expression is a float because they are applied the scale and offset and the value cannot be written. The proposed solution is to change the expression to "geometry?[BandName].raw:[Band.NoDataValue]", which will return the value without applying scale and offset.
Omar Barrilero 4 September 2017 at 13:15
"Processing the Sentinel-2 images with Land/Sea Mask results with receiving of entirely black image, regardless using the shapefile with the reference system same as image or with another one. The error vanish when image is reprojected before using the Land/Sea Mask, even if this is reprojection to the same reference system (UTM), but this necessity is not mentioned anywhere in SNAP Help, so it seems to be a bug."
It seems to be related to the band dataType. Currently, when applying a geometry, a band is computed with the expression "geometry?[BandName]:[Band.NoDataValue]". The problem is that the target band is created with the same datatype than the input band (int in the case of S2) and the value returned by the expression is a float because they are applied the scale and offset and the value cannot be written. The proposed solution is to change the expression to "geometry?[BandName].raw:[Band.NoDataValue]", which will return the value without applying scale and offset.