---------- Forwarded message ----------
From: Jianhui Jin <jianhui....@gmail.com>
Date: Tue, May 4, 2010 at 9:27 PM
Subject: WoldImageWriter write false copy of gridcoverage.
To: geotools-gt2-users@lists.sourceforge.net


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
Geotools-gt2-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to