gdal_translate -of VRT input.tif output.vrt -b 1 -b 2 -b 3 Mike, you can try to adapt that call to a for loop if it does what you expect.
> -------Original Message------- > From: Smith, Michael <[email protected]> > To: [email protected] <[email protected]> > Subject: Re: [gdal-dev] how to gdalwarp 4-band orthoimagery > Sent: Dec 14 '12 15:33 > > Thanks Evan > > BUT > > Firstly in my binaries-only install I don't see any .cpp files > > And secondly the other method (using VRTs) how would one then automate that > (to do, say 1000 tiles in a script). The editing of the VRT would be the tricky part. > > ====================================== > Michael Smith MS GISP > State GIS Manager, Maine Office of GIS > State of Maine, Office of Information Technology > michael.smith _at_ maine.gov > 207-215-5530 > > Board Member, Maine GeoLibrary > Board Member, Maine GIS Users Group > State Rep, National States Geographic Information Council > > | MEGIS | GeoLibrary | MEGUG | NSGIC | > > ***NOTE NEW ADDRESS*** > > State House Station 145 > 51 Commerce Drive > Augusta, ME 04333-0145 > > 69d 47' 58.9"W 44d 21' 54.8"N > -----Original Message----- > From: Even Rouault [mailto:[email protected]] > Sent: Friday, December 14, 2012 1:48 PM > To: [email protected] > Cc: Smith, Michael > Subject: Re: [gdal-dev] how to gdalwarp 4-band orthoimagery > > Le vendredi 14 décembre 2012 19:17:07, Smith, Michael a écrit : > > Seems like this is a straightforward issue but finding it difficult to > > solve online. > > > > > > > > I have a new crop of 4-band orthoimages, as GeoTIFFs. I want to create > > mosaics of some tiles. There is a slight pixel overlap at the edges. > > When I run gdalwarp it always treats the 4th band as alpha, which causes > > the overlap edges to be lighter than everything else in the mosaic, > > creating an odd grid pattern were these edges were (when viewing the CIR > > bands 4-1-2). > > > > > > > > How can I disable this treatment of the 4th band as alpha? > > gdal_translate src.tif tmp.vrt -of VRT > > and edit tmp.vrt to remove the <ColorInterp>Alpha</ColorInterp> on the 4th > band > > or edit apps/gdalwarp.cpp and disable the following lines : > > > /* -------------------------------------------------------------------- */ > /* Do we have a source alpha band? */ > /* -------------------------------------------------------------------- */ > if( GDALGetRasterColorInterpretation( > GDALGetRasterBand(hSrcDS,GDALGetRasterCount(hSrcDS)) ) > == GCI_AlphaBand > && !bEnableSrcAlpha ) > { > bEnableSrcAlpha = TRUE; > if( !bQuiet ) > printf( "Using band %d of source image as alpha.\n", > GDALGetRasterCount(hSrcDS) ); > } > > > > > > > > > > =============================== > > Michael Smith MS GISP > > State GIS Manager, Maine Office of GIS > > State of Maine, Office of Information Technology > > michael.smith _at_ maine.gov > > 207-215-5530 > > > > Board Member, Maine GeoLibrary > > Board Member, Maine GIS Users Group > > State Rep, National States Geographic Information Council > > [cid:[email protected]][icons] > > > > ***NOTE NEW ADDRESS*** > > > > State House Station 145 > > 51 Commerce Drive > > Augusta, ME 04333-0145 > > 69o 47' 58.9"W 44o 21' 54.8"N > _______________________________________________ > gdal-dev mailing list > [email protected] > http://lists.osgeo.org/mailman/listinfo/gdal-dev _______________________________________________ gdal-dev mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/gdal-dev
