NeoGeographyToolkit / StereoPipeline

The NASA Ames Stereo Pipeline is a suite of automated geodesy & stereogrammetry tools designed for processing planetary imagery captured from orbiting and landed robotic explorers on other planets.
Apache License 2.0
492 stars 173 forks source link

Add a band selection option to dem_mosaic #282

Closed SmithB closed 5 years ago

SmithB commented 5 years ago

It would sometimes be nice to be able to make a mosaic that doesn't include all the bands in a set of geotifs. I'd imagine being able to provide an argument like '--band 1' or like '--bands 2,3,4'. The second would be better, the first would be great.

oleg-alexandrov commented 5 years ago

This tool was made to mosaic DEMs, which are one band (the height above the datum). Having it handle multiple bands would require a wholesale rewrite, as there are many places where we pass around images or pieces of them. It does not help that ASP does not effortlessly support multiple bands. I think now it supports at most 6 of them, and each time a new one is added there is a bunch of boiler plate code in many places.

Since each band would be processed independently of each other in either case, the tried and true approach is to use GDAL for pulling out bands, processing them independently with dem_mosaic, and then using GDAL again to stack them.

dshean commented 5 years ago

I think you can just create a set of vrt that isolate a single band from input multiband tif, then pass to dem_mosaic. If a common operation, you could create a little wrapper to do this.