Band subset to GeoTiff: already exists error


#1

Hey all,

I’m trying to subset a .dim file, created with C2RCC, to specific GeoTiff’s containing just one band from the original .dim file.
See the GPT graph below:

<graph id="2018-04-06 10:36:58">
  <version>1.0</version>
  <node id="Reader">
    <operator>Read</operator>
    <sources/>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>Landsat8\preprocessed\classified\C2RCC\LC08_L1TP_198024_20140205_20170426_01_T1.tar.dim</file>
    </parameters>
  </node>
  <node id="Subset">
    <operator>Subset</operator>
    <sources>
      <sourceProduct refid="Reader"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <bandNames>iop_agelb</bandNames>
      <copyMetadata>true</copyMetadata>
    </parameters>
  </node>
  <node id="Writer">
    <operator>Write</operator>
    <sources>
      <sourceProduct refid="Subset"/>
    </sources>
    <parameters class="com.bc.ceres.binding.dom.XppDomElement">
      <file>Landsat8\IoP\LC08_L1TP_198024_20140205_20170426_01_T1\iop_agelb.tif</file>
      <formatName>GeoTIFF+XML</formatName>
    </parameters>
  </node>
</graph>

However, when I execute this graph, I get the following error message:

Error: The Product ‘Subset_LC08_L1TP_198024_20140205_20170426_01_T1.tar’ already contains a raster data node with the name ‘iop_agelb’.

This is weird, since I do not define the file ‘Subset_LC08_L1TP_198024_20140205_20170426_01_T1.tar’ anywhere.
Anyone sees what i’m doing wrong here?


#2

Anyone out there with an idea? :slight_smile:


#3

I get the same error when I am processing my images. So I would be happy too, if somebody knows a solution for this problem :slight_smile:


#4

We’re getting the same issue too. It isn’t clear why this GPT XML file is invalid.


#5

Hi,

I think that the problem is produced when you use a file name in the writer operator that is the same as one of the band names selected in the product. We will try to fix this bug. Meanwhile, the workaround is to change the output file name.


#6

Hi Obarrilero,

Thanks for the reply. That does seem to be the problem. In the XML below, when I add a “_foo” to the filename, it works.

Thank you!

-k.

  <node id="BandSelect_albedo_bb_planar_sw">
    <operator>BandSelect</operator>
    <sources>
      <source>ReprojectAlbedo</source>
    </sources>
    <parameters>
      <sourceBands>albedo_bb_planar_sw</sourceBands>
    </parameters>
  </node>
  <node id="Write_albedo_bb_planar_sw">
    <operator>Write</operator>
    <sources>
      <sourceProduct>BandSelect_albedo_bb_planar_sw</sourceProduct>
    </sources>
    <parameters>
      <file>${targetFolder}/albedo_bb_planar_sw_foo.tif</file>
      <formatName>GeoTIFF</formatName>
    </parameters>
  </node>