private void addGeoCodingToProduct(final Product product) { getSourceProduct().transferGeoCodingTo(product, null); } }
/** * Copies the geocoding from the source product to target product. * * @param sourceProduct the source product * @param targetProduct the target product * * @throws IllegalArgumentException if one of the params is <code>null</code>. */ public static void copyGeoCoding(final Product sourceProduct, final Product targetProduct) { Guardian.assertNotNull("sourceProduct", sourceProduct); Guardian.assertNotNull("targetProduct", targetProduct); sourceProduct.transferGeoCodingTo(targetProduct, null); }
protected void addGeoCodingToProduct(final Product product) { if (!getSourceProduct().transferGeoCodingTo(product, getSubsetDef())) { Debug.trace("GeoCoding could not be transferred."); } } }
@Test public void testDestWithoutLatLonBands() { final ProductSubsetDef subsetDef = null; final Product destP = new Product("dest", "dest", sourceP.getSceneRasterWidth(), sourceP.getSceneRasterHeight()); assertEquals(true, sourceP.transferGeoCodingTo(destP, subsetDef)); final GeoCoding destGeoCoding = destP.getGeoCoding(); assertNotNull(destGeoCoding); assertEquals(true, destGeoCoding instanceof BasicPixelGeoCoding); }
private void doTestTransferGeoCoding() throws IOException { Product sourceProduct = createProduct(); GeoCoding newGeoCoding = new PixelGeoCoding(sourceProduct.getBand("latBand"), sourceProduct.getBand("lonBand"), null, 5, ProgressMonitor.NULL); sourceProduct.setGeoCoding(newGeoCoding); Product targetProduct = createProduct(); targetProduct.setGeoCoding(null); // remove geo-coding of target product sourceProduct.transferGeoCodingTo(targetProduct, null); PixelGeoCoding targetGC = (PixelGeoCoding) targetProduct.getGeoCoding(); assertNotNull(targetGC.getPixelPosEstimator()); }
@Test public void testDestLatLonBandsExisting() { final ProductSubsetDef subsetDef = null; final Product destP = new Product("dest", "dest", sourceP.getSceneRasterWidth(), sourceP.getSceneRasterHeight()); copyBandTo(destP, pixelGeoCoding.getLatBand()); copyBandTo(destP, pixelGeoCoding.getLonBand()); assertEquals(true, sourceP.transferGeoCodingTo(destP, subsetDef)); assertNotNull(destP.getGeoCoding()); assertEquals(true, destP.getGeoCoding() instanceof BasicPixelGeoCoding); }
targetProduct.removeBand(targetProduct.getBand("flagomat")); targetProduct.getFlagCodingGroup().removeAll(); sourceProduct.transferGeoCodingTo(targetProduct, def);