Resampling L2A products


I have run into quite a bizarre problem when resampling atmospherically corrected Sentinel-2 images to 10m resolution.
The output format is GeoTIFF-BigTIFF, but when I start the process, the file just gets bigger and bigger, until it fills up my entire free memory (~150gb), terminates the process and shows the following error text: There is not enough space on the disk
at Method)
at Source)
at Source)
at it.geosolutions.imageioimpl.plugins.tiff.TIFFNullCompressor.encode(
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriter.writeTile(
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriter.write(
Caused: javax.imageio.IIOException: I/O error writing TIFF file!
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriter.write(
at it.geosolutions.imageioimpl.plugins.tiff.TIFFImageWriter.write(
at org.esa.snap.dataio.bigtiff.BigGeoTiffProductWriter.writeBandRasterData(
at org.esa.snap.core.gpf.common.WriteOp.writeTileRow(
at org.esa.snap.core.gpf.common.WriteOp.computeTile(
Caused: org.esa.snap.core.gpf.OperatorException: Not able to write product file: ‘F:\Sentinel2\S2A_USER_MTD_SAFL2A_PDMC_20160523T144413_R079_V20160523T095404_20160523T095404_resampled.tif’
at org.esa.snap.core.gpf.common.WriteOp.computeTile(
at org.esa.snap.core.gpf.internal.OperatorImage.computeRect(
Caused: org.esa.snap.core.gpf.OperatorException: Not able to write product file: ‘F:\Sentinel2\S2A_USER_MTD_SAFL2A_PDMC_20160523T144413_R079_V20160523T095404_20160523T095404_resampled.tif’
at org.esa.snap.core.gpf.internal.OperatorExecutor$GPFImagingListener.errorOccurred(
[catch] at

I am pretty sure that a resampled S2 L2A image should not take up 150 gb.

When I resample L1C products, however, it goes smoothly and within an hour I get my result.
Is there a workaround for this? I would like to do some biophysical calculations, but I cannot do them with L2A images, because SNAP requires them to be resampled to a single resolution.

Any help greatly appreciated. :slight_smile:

Are you using the desktop app or gpt? Can you show us your resample configuration and in case of gpt the command line call?
On the first look, it sounds to me like the wrong resolution is specified.

I am using the desktop application for resampling. Would using the command line help? If so, what would be the correct command?

Here are the resampling parameters. Pretty much default.

Running it from the command line will not help.

I’ve calculated the raw size of a L2A product in GeoTiff. It is 243 GB.
The reason for this is that we have to use a common data type for all bands.

You can reduce the size for example by removing all the view bands for the specific bands and keep only the mean bands.
Also you can split your product into 2 products. One for the sun/view bands and one for the other bands.
Then the sun/view bands are stored as float32 data type and the other as uint16.

Additionally you can enable a lossless compression for the BigGeotiff.
Add to the file (in installdir/etc) the following line:


Thank you, I did not know that bands other than the main spectral ones have to be resampled aswell. This solves the problem.

Also, on a bit unrelated note - would it be possible to discern which bands are necessary for the fAPAR calculation? The help menu does give some insight on this, but not on the specific sun and view angle bands that are necessary. Just so that I would know which bands I need to resample. Thanks in advance!

As far as I can tell, these are the bands which are used:

B3, B4, B5, B6, B7, B8A, B11, B12
view_zenith_mean, sun_zenith, sun_azimuth, view_azimuth_mean

Thank you, this worked! The processing time is quite long, but everything works as intended.
Great support from you, Marco!