protected String[] getGeometries() { final ArrayList<String> geometryNames = new ArrayList<>(5); if (sourceProducts != null) { for (Product prod : sourceProducts) { if (sourceProducts.length > 1) { for (String name : prod.getMaskGroup().getNodeNames()) { geometryNames.add(name + "::" + prod.getName()); } } else { geometryNames.addAll(Arrays.asList(prod.getMaskGroup().getNodeNames())); } } } return geometryNames.toArray(new String[geometryNames.size()]); }
@Override public boolean canResample(Product multiSizeProduct) { //check detector footprint String[] maskNames = multiSizeProduct.getMaskGroup().getNodeNames(); if (S2ResamplerUtils.countMatches(maskNames,"detector_footprint-.*-\\d{2}") <= 0) return false; //todo check metadata //todo check band names //String[] bandNames = multiSizeProduct.getBandNames(); //if ((S2ResamplerUtils.countMatches(bandNames,"view_azimuth_.*") <= 0) || (S2ResamplerUtils.countMatches(bandNames,"view_zenith_.*") <= 0)) // return false; //todo check referencebandName return multiSizeProduct.getProductReader() instanceof S2AnglesGeometry; }
String[] maskNames = product.getMaskGroup().getNodeNames(); final String maskName; if (maskNames.length == 1) {
private boolean editAggregatorItem(AggregatorItem aggregatorItem, int rowIndex) { Product contextProduct = binningFormModel.getContextProduct(); if (contextProduct == null) { Dialogs.showInformation("Please select source products before adding aggregators."); return false; } String[] varNames = getVariableNames(binningFormModel.getVariableConfigs()); String[] bandNames = contextProduct.getBandNames(); String[] tiePointGridNames = contextProduct.getTiePointGridNames(); String[] maskNames = contextProduct.getMaskGroup().getNodeNames(); String[] sourceNames = StringUtils.addArrays(varNames, bandNames); sourceNames = StringUtils.addArrays(sourceNames, tiePointGridNames); sourceNames = StringUtils.addArrays(sourceNames, maskNames); boolean isNewAggregatorItem = rowIndex < 0; ModalDialog aggregatorDialog = new AggregatorItemDialog(SwingUtilities.getWindowAncestor(grid), sourceNames, aggregatorItem, isNewAggregatorItem); int result = aggregatorDialog.show(); if (result == ModalDialog.ID_OK) { if (isNewAggregatorItem) { addDataRow(aggregatorItem); } else { updateDataRow(aggregatorItem, rowIndex); } return true; } return false; }
for (String flagCodingName : srcProduct.getFlagCodingGroup().getNodeNames()) { FlagCoding srcFC = srcProduct.getFlagCodingGroup().get(flagCodingName); String[] flagNames = srcFC.getFlagNames(); contextProduct.addTiePointGrid(new TiePointGrid(grid.getName(), 10, 10, 0, 0, 1, 1, new float[100])); for (String vectorDataName : srcProduct.getVectorDataGroup().getNodeNames()) { VectorDataNode vectorData = srcProduct.getVectorDataGroup().get(vectorDataName); contextProduct.getVectorDataGroup().add(new VectorDataNode(vectorDataName, vectorData.getFeatureType())); for (String maskName : srcProduct.getMaskGroup().getNodeNames()) { Mask mask = srcProduct.getMaskGroup().get(maskName); contextProduct.addMask(maskName, mask.getImageType());
final ProductNodeGroup<VectorDataNode> vectorNodeGroup = currentProduct.getVectorDataGroup(); if (vectorNodeGroup != null) { final String[] vectorNames = vectorNodeGroup.getNodeNames(); for (String name : vectorNames) { if (!name.equals("pins") && !name.equals("ground_control_points")) {