Ciao Jin, a few things: -1- which version of geotools are you using? -2- can you provide some sample data for testing? -3- Can you try using the geotiff writer?
Simone. ------------------------------------------------------- Ing. Simone Giannecchini GeoSolutions S.A.S. Founder - Software Engineer Via Carignoni 51 55041 Camaiore (LU) Italy phone: +39 0584983027 fax: +39 0584983027 mob: +39 333 8128928 http://www.geo-solutions.it http://geo-solutions.blogspot.com/ http://www.linkedin.com/in/simonegiannecchini http://twitter.com/simogeo ------------------------------------------------------- On Tue, May 4, 2010 at 3:27 PM, Jianhui Jin <[email protected]> wrote: > Hi All > > I am learning to write out a raster file as images. using > WorldImageWriter produce false result when I try to read in a raster > then output the exact gridcoverage: > String roofRaster = "C:/Users/OSData/Raw/Bournemouth-03_002_8bit_25cm_o.tif"; > String outputRasterPath = "C:/Users/output/raster/RasterWriteOutTest.tif"; > > AbstractGridCoverage2DReader roofAbstractGridCoverage2DReader; > AbstractGridFormat format = GridFormatFinder.findFormat(roofRaster); > roofAbstractGridCoverage2DReader = format.getReader(new File(roofRaster)); > GridCoverage2D roofCoverage = roofAbstractGridCoverage2DReader.read(null); > > WorldImageWriter imageWriter = new WorldImageWriter(new > File(outputRasterPath)); > imageWriter.write(roofCoverage, null); > > simple codes, however, the output does not look the same as the input > tiff, and i have build a statistics for both in ArcGIS, the min and > max in the input is 0 to 255 for the first 3 bands, and 0 to 16 for > the band 4, but the output raster is 0 to 16 for the first 3, and 0 to > 1 for the band 4. > > > Thank you very much > > Jin. > > ------------------------------------------------------------------------------ > _______________________________________________ > Geotools-gt2-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users > ------------------------------------------------------------------------------ _______________________________________________ Geotools-gt2-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
