Combination View Flat View Tree View
Threads [ Previous | Next ]
RE: Bands decomposition
toggle
Bands decomposition
8/3/12 11:07 AM
Dear all,
I have asome GeoTIFF products, the product contains two bands, and I want to decompose it to two single GeoTIFF files, which contains only one band.
How to do it batch processing using gpt or command line, or APIs?
Flag Flag
RE: Bands decomposition
Answer Answer (Unmark)
8/3/12 12:09 PM as a reply to pan xiong.
With gpt on the command line you need to runs
1gpt Subset -f GeoTIFF -PbandNames=<bandNameOne> -Ssource=<sourceProductPath> -t <targetFile1>
2gpt Subset -f GeoTIFF -PbandNames=<bandNameTwo> -Ssource=<sourceProductPath> -t <targetFile2>


With the API you can do:
 1ProductSubsetDef subsetDef1 = new ProductSubsetDef();
 2subsetDef1.setNodeNames(new String[]{"name_1"});
 3Product p1 = source.createSubset(subsetDef1, source.getName(), source.getDescription());
 4ProductSubsetDef subsetDef2 = new ProductSubsetDef();
 5subsetDef2.setNodeNames(new String[]{"name_2"});
 6Product p2 = source.createSubset(subsetDef2, source.getName(), source.getDescription());
 7
 8ProductIO.writeProduct(p1,new File("file/location/file1.tif"),"GeoTIFF",false, ProgressMonitor.NULL);
 9ProductIO.writeProduct(p2,new File("file/location/file2.tif"),"GeoTIFF",false, ProgressMonitor.NULL);


regards
Marco
Flag Flag
RE: Bands decomposition
8/3/12 5:23 PM as a reply to Marco Peters.
Thanks a lot
Flag Flag

 

Welcome to the BEAM Forum!

We encourage you to sign in our forum and participate in the BEAM community. The forum is maintained by the BEAM project team who will most likely answer your questions within 24 hours (except during common holidays) - if not done by other community members. Collaborate, share your knowledge and learn from other users!

If you don't find what you are looking for, please also consider the following external forums: