Hi everyone,
I am trying to export an image as a GeoTIFF file with the GPT. The input file(iFile.dim) is a Landsat 8 C1 image that I processed with L2gen, reprojected and subsetted to keep a few bands only.
I used the following command:
gpt.sh write.xml -Ssource=iFile.dim -t test.tif
where "write.xml" is:
<node id="anyNodeId">
<operator>Write</operator>
<sources>
<source>${anySourceNodeId}</source>
</sources>
<parameters>
<file>test.tif</file>
<formatName>GeoTIFF</formatName>
<deleteOutputOnFailure>true</deleteOutputOnFailure>
<writeEntireTileRows>true</writeEntireTileRows>
<clearCacheAfterRowWrite>true</clearCacheAfterRowWrite>
</parameters>
</node>
I am getting the error message below. Can anyone help me figure this out?
Thank you!
Alice
java.lang.ClassCastException: org.esa.beam.framework.gpf.graph.Node cannot be cast to org.esa.beam.framework.gpf.graph.Graph
at org.esa.beam.framework.gpf.graph.GraphIO.read(GraphIO.java:83)
at org.esa.beam.framework.gpf.main.DefaultCommandLineContext.readGraph(DefaultCommandLineContext.java:71)
at org.esa.beam.framework.gpf.main.CommandLineTool.readGraph(CommandLineTool.java:504)
at org.esa.beam.framework.gpf.main.CommandLineTool.runGraph(CommandLineTool.java:305)
at org.esa.beam.framework.gpf.main.CommandLineTool.runGraphOrOperator(CommandLineTool.java:249)
at org.esa.beam.framework.gpf.main.CommandLineTool.run(CommandLineTool.java:150)
at org.esa.beam.framework.gpf.main.CommandLineTool.run(CommandLineTool.java:122)
at org.esa.beam.framework.gpf.main.GPT.run(GPT.java:54)
at org.esa.beam.framework.gpf.main.GPT.main(GPT.java:34)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.bc.ceres.launcher.Launcher.launch(Launcher.java:154)
at com.bc.ceres.launcher.Launcher.main(Launcher.java:56)
Error: org.esa.beam.framework.gpf.graph.Node cannot be cast to org.esa.beam.framework.gpf.graph.Graph
Write/Export image as a GeoTIFF file with GPT
Write/Export image as a GeoTIFF file with GPT
Alright, I figured it out:
Instead of going through two consecutive steps (1. subset selected bands and save as .dim file with Subset operator; 2. export as .TIF with Write operator), I subsets the bands AND save as .tif file with the Subset operator. That simple. Beginner beginning.
Instead of going through two consecutive steps (1. subset selected bands and save as .dim file with Subset operator; 2. export as .TIF with Write operator), I subsets the bands AND save as .tif file with the Subset operator. That simple. Beginner beginning.
-
- Subject Matter Expert
- Posts: 306
- Joined: Mon Apr 07, 2008 4:40 pm America/New_York
- Been thanked: 3 times
Write/Export image as a GeoTIFF file with GPT
Alice,
The reason why your first post failed was because you only included the node tag. A graph xml must look like this:
<graph id="someGraphId">
<version>1.0</version>
<node id="someNodeId">
......
</node>
<node id="someOtherNodeId">
......
</node>
</graph>
Danny
The reason why your first post failed was because you only included the node tag. A graph xml must look like this:
<graph id="someGraphId">
<version>1.0</version>
<node id="someNodeId">
......
</node>
<node id="someOtherNodeId">
......
</node>
</graph>
Danny