예제 #1
0
  private Product createProduct() {
    Product sourceProduct = getSourceProduct();
    Debug.assertNotNull(sourceProduct);
    Debug.assertTrue(getSceneRasterWidth() > 0);
    Debug.assertTrue(getSceneRasterHeight() > 0);
    final String newProductName;
    if (this.newProductName == null || this.newProductName.length() == 0) {
      newProductName = sourceProduct.getName();
    } else {
      newProductName = this.newProductName;
    }
    final Product product =
        new Product(
            newProductName,
            sourceProduct.getProductType(),
            getSceneRasterWidth(),
            getSceneRasterHeight(),
            this);
    product.setPointingFactory(sourceProduct.getPointingFactory());
    if (newProductDesc == null || newProductDesc.length() == 0) {
      product.setDescription(sourceProduct.getDescription());
    } else {
      product.setDescription(newProductDesc);
    }
    if (!isMetadataIgnored()) {
      ProductUtils.copyMetadata(sourceProduct, product);
      addTiePointGridsToProduct(product);
      addFlagCodingsToProduct(product);
      addIndexCodingsToProduct(product);
    }
    addBandsToProduct(product);
    if (!isMetadataIgnored()) {
      addGeoCodingToProduct(product);
    }
    ProductUtils.copyVectorData(sourceProduct, product);
    ProductUtils.copyMasks(sourceProduct, product);
    ProductUtils.copyOverlayMasks(sourceProduct, product);
    ProductUtils.copyPreferredTileSize(sourceProduct, product);
    setSceneRasterStartAndStopTime(product);
    addSubsetInfoMetadata(product);

    return product;
  }
예제 #2
0
 @Override
 public void copyVectorData() {
   ProductUtils.copyVectorData(getSourceProduct(), getTargetProduct());
 }