[SNAP 7.0] Mosaicing L2A: No graphical output

Hello everybody,

my planned workflow is as follows:
Data download -> sen2cor -> Mosaicing -> Spectral/Spatial Subsetting -> Export GeoTIFF

Resampling to 10m must also be a part - but it does not matter if it is done before or after Mosaicing. I followed both tutorial videos (Mosaicing and Multi-Size Mosaic) with the proposed properties, but in the end the output does not show an image. Mosaicing of course quits with the error that there are bands with different resolutions. I even resampled my data before. But after mosaicing, when opening a specific band, there is only shown a black space.

After Multi-size mosaic processing this is produced when I like to show a band:

Has anybody experienced similar difficulties and has a solution on that issue? The only difference to the tutorials is that I am using L2A instead of L1C images.

Many thanks in advance!

1 Like

How did you resample, your tile?

Did you apply resample? Or s2 resample?

After resample step and before subset, did you visualize your data?

Hi all,

I’ve the exact same problem.

I’m trying to do a mosaic between two Sentinel-2B images in SNAP 7.0.1

S2B_MSIL2A_20190907T112119_N0213_R037_T29TPE_20190907T144322.SAFE
S2B_MSIL2A_20190907T112119_N0213_R037_T29TPF_20190907T144322.SAFE

Using Mosaicing algorithm and choosing bands 2, 3, 4, I get the error

“Product ‘sourceProduct2’ contains bands of different sizes. Currently it is not possible to use it for mosaicking.”

Doing the mosaic with Multi-size Mosaic algorithm, the process runs ok, but the result bands are empty, as shown by @lutabwi

However, this only happens if the mosaic is saved to the disc.

If the ‘Save as’ is not checked and the mosaic is created on demand, the output mosaic is viewable in SNAP:

But, for instance, if I export the rgb view as image, the output is also an empty raster (all bands with value zero, except alpha band):

Anyone confirm? @lutabwi do you also confirm that creating the mosaic on demand, works?

Thank you very much!

Best regards,
Pedro Venâncio

What happens if you process it on demand and then write the correctly displayed product to a file (File > Save Product > BEAM DIMAP)?

I already solved it, but the exact workflow is written on paper in my office. I will attach it to this topic tomorrow. As far as I remember, I resampled both datasets, saved that as BEAM-DIMAP, used the normal Mosaicing Tool, saved that again as BEAM-DIMAP, opened a new program window, loaded the BEAM-DIMAP and exported the data to GeoTIFF. In the Save as export dialog there is another button for creating a subset. I used that and magically my bands were there.

I will confirm you the workflow tomorrow!

1 Like

Now the promised workflow:

I used Level-2A data for mosaicing.

  1. Resampling Tool, resampling is based on a band reference
  2. Saving as BEAM-DIMAP
  3. Loading the BEAM-DIMAP into SNAP, Mosaicing Tool:
    In Map Projection Definition I chose UTM/WGS84 (automatic) from the list; in the box “Mosaic Bounds” make sure to change the corresponding field to your required pixel size. In the Variables & Conditions tab I chose my desired bands. Save the new images as BEAM-DIMAP. Now there are still metadata bands included that need to be excluded if you want to export it as a GeoTIFF.
  4. Loading BEAM-DIMAP into SNAP (I did it in a fresh environment).
  5. Export the Image as GeoTIFF. In the export dialog, there is also a subset button. Use that to at least exclude the metadata bands. There will be a warning you can ignore.
  6. Open the the GeoTIFF an a GIS of your choice (tested in ERDAS & QGIS).

I do not know why it is needed to save it several times, but for me it worked like this. :slight_smile:

2 Likes

Hi @ABraun

It takes several hours to save 3 bands (total of 2.83GB) and the output are also empty rasters:

Thank you very much for the workflow @lutabwi!

Anyway, this seems a SNAP 7.0 bug to me, as the standard workflow to generate mosaics is failing when writing to the disk.

I am also not able to connect two bordering (overlapping) S-2A products. Tried several approaches however the result is always the same (picture). I can definitely elaborate steps if needed!

Are you also still using SNAP 7? If so, please update to SNAP 8.

What’s the error in your image? And how have you created it?

My SNAP is 8.0.8

Downloaded images:
S2A_MSIL2A_20210619T100031_N0300_R122_T33UWQ_20210619T131313.zip
S2A_MSIL2A_20210619T100031_N0300_R122_T33UWR_20210619T131313.zip

  1. I’ve resampled the size of the images according to the B2 band (so resolution 10m) and save it on the drive
  2. Raster/Geometric/Mosaicking → open resampled dim files
  3. a) Save as BEAM-DIMAP; Custom CRS; All bands in Variables; No conditions → run
  4. b) Save as BEAM-DIMAP; EPSG 4326, Elevation Model - Copernicus 30m; All bands in Variables; No conditions → run
  5. c) Save as Geotiff; EPSG 4326, Elevation Model - Copernicus 30m; All bands in Variables; No conditions → run

All three combinations resulted in the same output (image in the first contribution). So it is some strange resolution of two merged images? Maybe? I am not quite sure

image

But I don’t see an error in the image. The resolution just seems a bit low.
Maybe you forgot to adjust the pixel size.
image
Try a value of 0.0001 for WGS84

Btw. you should not orthrectify the data. The S2 L1C data is already ortorectified

1 Like

Okay great, it is working. I am so sorry! I didn’t assume that there will be a different default resolution than one of the used images. However, now I see why - 100 gb per one mosaic :slight_smile: Thanks!

Yes, it can become big.:slight_smile:
Maybe you can exclude some bands to reduce the size?
You can also try NetCDF4 as output format. The supported compression would shrink the amount of data.

1 Like