ucar.nc2.geotiff
Class GeotiffWriter

java.lang.Object
  extended by ucar.nc2.geotiff.GeotiffWriter

public class GeotiffWriter
extends java.lang.Object

Write GeoTIFF files.

Author:
caron, yuan

Constructor Summary
GeotiffWriter(java.lang.String fileOut)
          Geotiff writer.
 
Method Summary
 void close()
           
 Array getYXDataInBox(Array data, int x1, int x2, int y1, int y2)
           
static void main(java.lang.String[] args)
          test
 void writeGrid(GridDataset dataset, GridDatatype grid, Array data, boolean greyScale)
          Write Grid data to the geotiff file.
 void writeGrid(GridDatatype grid, Array data, boolean greyScale, double xStart, double yStart, double xInc, double yInc, int imageNumber)
          Write Grid data to the geotiff file.
 void writeGrid(java.lang.String fileName, java.lang.String gridName, int time, int level, boolean greyScale, LatLonRect pt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeotiffWriter

public GeotiffWriter(java.lang.String fileOut)
Geotiff writer.

Parameters:
fileOut - name of output file.
Method Detail

writeGrid

public void writeGrid(GridDataset dataset,
                      GridDatatype grid,
                      Array data,
                      boolean greyScale)
               throws java.io.IOException
Write Grid data to the geotiff file.

Parameters:
dataset - grid in contained in this dataset
grid - data is in this grid
data - 2D array in YX order
greyScale - if true, write greyScale image, else dataSample.
Throws:
java.io.IOException - on i/o error

writeGrid

public void writeGrid(java.lang.String fileName,
                      java.lang.String gridName,
                      int time,
                      int level,
                      boolean greyScale,
                      LatLonRect pt)
               throws java.io.IOException
Throws:
java.io.IOException

getYXDataInBox

public Array getYXDataInBox(Array data,
                            int x1,
                            int x2,
                            int y1,
                            int y2)
                     throws java.io.IOException
Throws:
java.io.IOException

writeGrid

public void writeGrid(GridDatatype grid,
                      Array data,
                      boolean greyScale,
                      double xStart,
                      double yStart,
                      double xInc,
                      double yInc,
                      int imageNumber)
               throws java.io.IOException
Write Grid data to the geotiff file. Grid currently must:
  1. have a 1D X and Y coordinate axes.
  2. be lat/lon or Lambert Conformal Projection
  3. be equally spaced

Parameters:
grid - original grid
data - 2D array in YX order
greyScale - if true, write greyScale image, else dataSample.
xStart -
yStart -
xInc -
yInc -
imageNumber -
Throws:
java.io.IOException - on i/o error
java.lang.IllegalArgumentException - if above assumptions not valid

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
test

Throws:
java.io.IOException