I have a tiff image with 4 bands (Red, Green, Blue and Infrared) and I need to extract two of them.

I want to input one image and split it and make two images. I want to do it with GeoTools since I use Java to develop.

How I do that?

PS: I can do it with gdal and command line. (e.g. gdal_translate -b 3 in.tiff out.tiff which 3 is the number of band)

1 Answer 1


You could look into org.geotools.process.raster

BandSelectProcess.execute(GridCoverage2D coverage, int[] sampleDims, Integer visibleSampleDim)

List<ZoneGeometry> RasterZonalStatistics2.execute(GridCoverage2D coverage, int[] bands, List<SimpleFeature> zones, GridCoverage2D classifier, Range nodata, Geometry mask, boolean useROIAccessor, Polygon roi, Statistics.StatsType[] stats, double[] minbounds, double[] maxbounds, int[] numbins, List<Range> rangeData, boolean localStats)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.