org.geotools.coverage.grid
Class GridCoverageBuilder.Variable

java.lang.Object
  extended by org.geotools.coverage.grid.GridCoverageBuilder.Variable
Enclosing class:
GridCoverageBuilder

public class GridCoverageBuilder.Variable
extends java.lang.Object

A variable to be mapped to a sample dimension. Variables are created by GridCoverageBuilder.newVariable(java.lang.CharSequence, javax.measure.unit.Unit).

Since:
2.5
Version:
$Id: GridCoverageBuilder.java 33885 2009-09-10 17:35:27Z simonegiannecchini $
Author:
Martin Desruisseaux

Constructor Summary
protected GridCoverageBuilder.Variable(java.lang.CharSequence name, javax.measure.unit.Unit<?> units)
          Creates a new variable of the given name and units.
 
Method Summary
 void addNodataValue(java.lang.CharSequence name, int value)
          Adds a "nodata" value.
 GridSampleDimension getSampleDimension()
          Returns a sample dimension for the current range of sample values.
 org.opengis.referencing.operation.MathTransform1D getTransform()
          Returns the "sample to geophysics" transform, or null if none.
 void setLinearTransform(double scale, double offset)
          Sets the "sample to geophysics" transform from a scale and an offset.
 void setLogarithmicTransform(double base, double offset)
          Sets the "sample to geophysics" logarithmic transform from a scale and an offset.
 void setTransform(org.opengis.referencing.operation.MathTransform1D transform)
          Sets the "sample to geophysics" transform.
 java.lang.String toString()
          Returns a string representation of this variable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

GridCoverageBuilder.Variable

protected GridCoverageBuilder.Variable(java.lang.CharSequence name,
                                       javax.measure.unit.Unit<?> units)
Creates a new variable of the given name and units.

Parameters:
name - The variable name, or null for a default name.
units - The variable units, or null if unknown.
See Also:
GridCoverageBuilder.newVariable(java.lang.CharSequence, javax.measure.unit.Unit)
Method Detail

getTransform

public org.opengis.referencing.operation.MathTransform1D getTransform()
Returns the "sample to geophysics" transform, or null if none.


setTransform

public void setTransform(org.opengis.referencing.operation.MathTransform1D transform)
Sets the "sample to geophysics" transform.


setLinearTransform

public void setLinearTransform(double scale,
                               double offset)
Sets the "sample to geophysics" transform from a scale and an offset. The transformation formula will be:
geophysics = scale × sample + offset

Parameters:
scale - The scale term in the linear equation.
offset - The offset term in the linear equation.

setLogarithmicTransform

public void setLogarithmicTransform(double base,
                                    double offset)
Sets the "sample to geophysics" logarithmic transform from a scale and an offset. The transformation formula will be:
geophysics = logbase(sample) + offset

Parameters:
base - The base of the logarithm (typically 10).
offset - The offset to add to the logarithm.

addNodataValue

public void addNodataValue(java.lang.CharSequence name,
                           int value)
                    throws java.lang.IllegalArgumentException
Adds a "nodata" value.

Parameters:
name - The name for the "nodata" value.
value - The pixel value to assign to "nodata".
Throws:
java.lang.IllegalArgumentException - if the given pixel value is already assigned.

getSampleDimension

public GridSampleDimension getSampleDimension()
Returns a sample dimension for the current range of sample values.


toString

public java.lang.String toString()
Returns a string representation of this variable.

Overrides:
toString in class java.lang.Object


Copyright © 1996-2010 Geotools. All Rights Reserved.