Пример #1
0
  protected void addTiePointGridsToProduct(final Product product) {
    final GeoCoding geoCoding = getSourceProduct().getGeoCoding();
    final String latGridName;
    final String lonGridName;
    if (geoCoding instanceof TiePointGeoCoding) {
      final TiePointGeoCoding tiePointGeoCoding = (TiePointGeoCoding) geoCoding;
      final TiePointGrid latGrid = tiePointGeoCoding.getLatGrid();
      final TiePointGrid lonGrid = tiePointGeoCoding.getLonGrid();
      latGridName = latGrid.getName();
      lonGridName = lonGrid.getName();
    } else {
      latGridName = null;
      lonGridName = null;
    }

    for (int i = 0; i < getSourceProduct().getNumTiePointGrids(); i++) {
      final TiePointGrid sourceTiePointGrid = getSourceProduct().getTiePointGridAt(i);
      final String gridName = sourceTiePointGrid.getName();

      if (isNodeAccepted(gridName)
          || (gridName.equals(latGridName) || gridName.equals(lonGridName))) {
        final TiePointGrid tiePointGrid =
            TiePointGrid.createSubset(sourceTiePointGrid, getSubsetDef());
        if (isFullScene(getSubsetDef()) && sourceTiePointGrid.isStxSet()) {
          copyStx(sourceTiePointGrid, tiePointGrid);
        }
        product.addTiePointGrid(tiePointGrid);
        copyImageInfo(sourceTiePointGrid, tiePointGrid);
      }
    }
  }