protected Product processProduct(Product existingProduct) throws IOException { initInput(); Document dom = readDom(); this.product = existingProduct == null ? DimapProductHelpers.createProduct(dom) : existingProduct; this.product.setProductReader(this); if (existingProduct == null) { readTiePointGrids(dom); } bindBandsToFiles(dom); if (existingProduct == null) { readVectorData(ImageManager.DEFAULT_IMAGE_CRS, true); // read GCPs and pins from DOM (old-style) DimapProductHelpers.addGcps(dom, this.product); DimapProductHelpers.addPins(dom, this.product); initGeoCodings(dom); readVectorData(ImageManager.getModelCrs(product.getGeoCoding()), false); DimapProductHelpers.addMaskUsages(dom, this.product); } this.product.setProductReader(this); this.product.setFileLocation(inputFile); this.product.setModified(false); return this.product; }