Quantcast

[gdal-dev] [gdal 2.1] reordering band

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[gdal-dev] [gdal 2.1] reordering band

Vincent BERNAT

Hi all,


I got some products which have a wrong band ordering in raster but the good one in metadata.

In my c++ application, what are the gdal functions to call  to set the new band ordering ?

Is it possible?


Thanks.


Regards,

Vincent



_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [gdal 2.1] reordering band

Even Rouault-2

On mercredi 14 d├ęcembre 2016 14:21:39 CET Vincent BERNAT wrote:

> Hi all,

>

>

> I got some products which have a wrong band ordering in raster but the good

> one in metadata.

>

> In my c++ application, what are the gdal functions to call to set the new

> band ordering ?

>

> Is it possible?

 

Vincent,

 

Are you talking about the order of th band regarding their color interpretation ? You can indeed have Band 1 = Blue, Band 2 = Green, Band 3 = Red in some cases. GDAL drivers will not reorder them to be in R,G,B order. If you need this, you need to handle that at the application level, by for example issuing Dataset RasterIO with the 3,2,1 order. You could also create a VRT that reorder the bands.

 

gdal_translate -b 3 -b 2 -b 1 -of VRT in_bgr.tif out_rgb.vrt

 

(you can do that with GDALTranslate() API)

 

Even

 

--

Spatialys - Geospatial professional services

http://www.spatialys.com


_______________________________________________
gdal-dev mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/gdal-dev
Loading...