/** * This method returns the name of the tiff files for the masks, as they appear in the metadata file, under the tags: * <ul><li>METADATA/FILES/MASK_SATURATION</li></ul> * <ul><li>METADATA/FILES/MASK_CLOUDS</li></ul> * <ul><li>METADATA/FILES/MASK_DIVERSE</li></ul> * NB: for N2 products, the metadata contains the name of the grouping folder, in which the mask files are to be found * * @return a map of String values, representing pairs of the tag of the file and the file name, as they appear in the metadata file */ public Map<String, String> getMaskFiles() { if (this.maskFiles != null && this.maskFiles.size() > 0) { return this.maskFiles; } MetadataAttribute currentElement; MetadataElement filesElement; if (((filesElement = rootElement.getElement(SpotConstants.SPOT4_TAKE5_TAG_FILES)) != null)) { this.maskFiles = new HashMap<>(); if ((currentElement = filesElement.getAttribute(SpotConstants.SPOT4_TAKE5_TAG_SATURATION)) != null) { this.maskFiles.put(SpotConstants.SPOT4_TAKE5_TAG_SATURATION, currentElement.getData().toString()); } if ((currentElement = filesElement.getAttribute(SpotConstants.SPOT4_TAKE5_TAG_CLOUDS)) != null) { this.maskFiles.put(SpotConstants.SPOT4_TAKE5_TAG_CLOUDS, currentElement.getData().toString()); } if ((currentElement = filesElement.getAttribute(SpotConstants.SPOT4_TAKE5_TAG_DIVERSE)) != null) { this.maskFiles.put(SpotConstants.SPOT4_TAKE5_TAG_DIVERSE, currentElement.getData().toString()); } } return this.maskFiles; }
public String getMasksFolder() { String maskFolderName = null; MetadataAttribute currentElement; MetadataElement filesElement; if (((filesElement = rootElement.getElement(SpotConstants.SPOT4_TAKE5_TAG_FILES)) != null)) { if ((currentElement = filesElement.getAttribute(SpotConstants.SPOT4_TAKE5_TAG_MASK_N2)) != null) { ProductData data = currentElement.getData(); maskFolderName = data != null ? data.toString() : null; } } return maskFolderName; }
protected void validateMetadata(final Product trgProduct) throws Exception { final MetadataElement absRoot = AbstractMetadata.getAbstractedMetadata(trgProduct); final MetadataAttribute[] attribs = absRoot.getAttributes(); for(MetadataAttribute attrib : attribs) { System.out.println(attrib.getName() +"= "+ attrib.getData().toString()); } } }
this.tiffFiles = new HashMap<String, String>(); if ((currentElement = filesElement.getAttribute(SpotConstants.SPOT4_TAKE5_TAG_GEOTIFF)) != null) { this.tiffFiles.put(SpotConstants.SPOT4_TAKE5_TAG_GEOTIFF, currentElement.getData().toString()); this.tiffFiles.put(SpotConstants.SPOT4_TAKE5_TAG_ORTHO_SURF_AOT, currentElement.getData().toString()); this.tiffFiles.put(SpotConstants.SPOT4_TAKE5_TAG_ORTHO_SURF_CORR_ENV, currentElement.getData().toString()); this.tiffFiles.put(SpotConstants.SPOT4_TAKE5_TAG_ORTHO_SURF_CORR_PENTE, currentElement.getData().toString()); this.tiffFiles.put(SpotConstants.SPOT4_TAKE5_TAG_ORTHO_VAP_EAU, currentElement.getData().toString());