GRASS
Class Range

java.lang.Object
  |
  +--GRASS.Range

public class Range
extends java.lang.Object

This class wraps GRASS library struct Range. See the GRASS 4.2 Programmer's Manual, Section 12.20.5 struct Range

See Also:
libgis

Constructor Summary
Range()
          Constructs an empty object and allocates memory for GRASS struct Range.
Range(java.lang.String name, java.lang.String mapset)
          Reads and creates range object for the raster file in the specified mapset.
 
Method Summary
 void G_init_range()
          Initializes the range structure for updates.
 void G_row_update_range(CELL buf, int n)
          This routine updates the range data just like G_update_range, but for values from the row of cell values.
 void G_update_range(int cat)
          Compares the cat value with the minimum and maximum values in the range structure, modifying the range if cat extends the range.
 void G_write_range(java.lang.String name)
          Writes the range information for the raster file name in the current mapset from the range structure.
 int max()
          Extracts the maximum value from the range structure.
 int min()
          Extracts the minimum value from the range structure.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Range

public Range()
Constructs an empty object and allocates memory for GRASS struct Range.

Range

public Range(java.lang.String name,
             java.lang.String mapset)
      throws GRASSException
Reads and creates range object for the raster file in the specified mapset. Wraps GRASS library routine:
 G_read_range (name, mapset, range)
 char *name;
 char *mapset;
 struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File
Parameters:
name - GRASS raster file name
mapset - Name of mapset where raster file should reside
Throws:
GRASSException - Exception with an appropriate error message is thrown if some error occured while reading raster Range information.
Method Detail

G_write_range

public void G_write_range(java.lang.String name)
                   throws GRASSException
Writes the range information for the raster file name in the current mapset from the range structure. Wraps GRASS library routine:
 G_write_range (name, range) write raster range file
          char *name;
  struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File
Parameters:
name - GRASS raster file name
Throws:
GRASSException - Exception with an appropriate error message is thrown if some error occured while reading raster Range information.

G_init_range

public void G_init_range()
Initializes the range structure for updates. Wraps GRASS library routine:
 G_init_range (range)
      struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File

G_update_range

public void G_update_range(int cat)
Compares the cat value with the minimum and maximum values in the range structure, modifying the range if cat extends the range. Wraps GRASS library routine:
 G_update_range (cat, range)
            CELL cat;
            struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File
Parameters:
cat - category value

G_row_update_range

public void G_row_update_range(CELL buf,
                               int n)
This routine updates the range data just like G_update_range, but for values from the row of cell values. Wraps GRASS library routine:
 G_row_update_range (cell, n, range)
         CELL *cell;
         int n;
         struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File
Parameters:
buf - buffer of cell values
n - number of values to be used for update

min

public int min()
Extracts the minimum value from the range structure. Wraps GRASS library routine:
 G_get_range_min_max (range, min, max)
       struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File
Returns:
the minimum value

max

public int max()
Extracts the maximum value from the range structure. Wraps GRASS library routine:
 G_get_range_min_max (range, min, max)
       struct Range *range;
 
See the GRASS 4.2 Programmer's Manual, Section 12.10.5 Raster Range File
Returns:
the maximum value

toString

public java.lang.String toString()
Returns a string representation of the object.
Returns:
String that represents this object
Overrides:
toString in class java.lang.Object


GRASS-JNI Home Page