Specific resamplers - proposal

Every new Specific resampler will extend the existing interface Resampler.

We could add a new option in the ResamplingDialog to show to the user the available specific resamplers in a combo. To find the available resamplers, the dialog will use the method “boolean canResample(Product multiSizeProduct);” in every class extending the resampler interface.

The final dialog should be similar to:

 

When the new checkbox is not selected, the default Resampling operator will be used as it has been the case until now. When it is selected, the specific resampler will be used instead.

In order to integrate the new resamplers, there are two options:

-        To define a new operator for every resampler. If they are created as not internal, they will be accesible via GPT or GraphBuilder.

-        Not to define a new operator for each resampler: the resampler will be called directly by the resamplingOp in initialize(). For that, a new parameter “SpecificResampler” will be created in ReamplingOp. If it is null, it will have the same behavior as before, if not, it will call the method resample(Product multiSizeProduct) in the corresponding Resampler to get the target product.

Most of the functions needed by  the S2Resampler are already defined in the package org.esa.snap.core.gpf.common.resample, but they should be made public (for example AggregatedOpImage, InterpolatedOpImage) and we could also define a new public static class (ResamplingUtils) where we can define some common functions that are going to be used probably by some of the resamplers.