@Override
public boolean transferGeoCoding(final Scene srcScene, final Scene destScene,
final ProductSubsetDef subsetDef) {
final Band srcLatBand = getLatBand();
final Product destProduct = destScene.getProduct();
Band latBand = destProduct.getBand(srcLatBand.getName());
if (latBand == null) {
latBand = GeoCodingFactory.createSubset(srcLatBand, destScene, subsetDef);
destProduct.addBand(latBand);
}
final Band srcLonBand = getLonBand();
Band lonBand = destProduct.getBand(srcLonBand.getName());
if (lonBand == null) {
lonBand = GeoCodingFactory.createSubset(srcLonBand, destScene, subsetDef);
destProduct.addBand(lonBand);
}
String validMaskExpression = getValidMask();
try {
if (validMaskExpression != null) {
GeoCodingFactory.copyReferencedRasters(validMaskExpression, srcScene, destScene, subsetDef);
}
} catch (ParseException ignored) {
validMaskExpression = null;
}
destScene.setGeoCoding(new PixelGeoCoding2(latBand, lonBand, validMaskExpression));
return true;
}