


Greclass(2G)         GRASS Reference Manual          Greclass(2G)



NAME
     Greclass - Create new cell layer based on existing cell
     layer
     (G Language Tool)

SYNOPSIS
     Greclass input_layer output_layer [title]

DESCRIPTION
     Greclass allows a user to create an output grid cell data
     layer based on an input data layer.  This output layer will
     be a reclassification of the input map based on reclass
     rules input to Greclass. A title for the output layer may be
     (optionally) specified on the command line.  The reclass
     rules are read from standard input (i.e., from the keyboard,
     redirected from a file, or piped through another program).

RECLASS RULES
     Once the user has specified an input file, output file, and
     (optionally) output layer title by typing
     Greclass input_layer output_layer title
     each line of input must have the following format:

          input_categories = output_category  [label]

     where list specifies the values in the input layer to be
     reclassified to the new value.  Specification of a label to
     be associated with the new output layer category is
     optional. If specified it is recorded as the category label
     for the new value.  The equal sign = is required. The
     input_category(ies) may consist of single category numbers
     or a range of numbers in the format "low thru high." The
     word "thru" must be present.

     A line containing only the word end terminates the input.

EXAMPLES
     The following examples may help clarify the reclass rules.


     1  This example reclassifies categories 1, 3 and 5 in the
        input map layer to category 1 with category label "poor
        quality" in the output layer, and reclassifies input
        layer categories 2, 4, and 6 to category 2 with the label
        "good quality" in the output layer.

             1 3 5   =   1   poor quality
             2 4 6   =   2   good quality


     2  This example reclassifies input layer categories 1 thru
        10 to output layer category 1, input layer categories 11



GRASS 3.0                U.S. Army CERL                         1






Greclass(2G)         GRASS Reference Manual          Greclass(2G)



        thru 20 to output layer category 2, and input layer
        categories 21 thru 30 to output layer category 3, all
        without labels.

              1 thru 10   =   1
             11 thru 20   =   2
             21 thru 30   =   3


     3  Subsequent rules override previous rules.  Therefore, the
        below example reclassifies input file categories 1 thru
        19 and 51 thru 100 to category 1 in the output file,
        input map layer categories 20 thru 24 and 26 thru 50 to
        the output layer category 2, and input layer category 25
        to the output category 3.

             1 thru 100   =   1   poor quality
             20 thru 50   =   2   medium quality
                 25       =   3   good quality


     4  The previous example could also have been entered as:

              1 thru 19  51 thru 100   =   1   poor quality
             20 thru 24  26 thru 50    =   2   medium quality
                       25              =   3   good quality

        or as:

              1 thru 19    =   1   poor quality
             51 thru 100   =   1
             20 thru 24    =   2
             26 thru 50    =   2   medium quality
                 25        =   3   good quality


     The final example was given to show how the labels are
     handled. If a new value appears in more than one rule (as is
     the case with new values 1 and 2) the last label which was
     specified becomes the label for that category.  In this case
     the labels are assigned exactly as in the two previous
     examples.

BEWARE
     A reclass file is not a true cell file.  Rather, it is a
     table of reclassification values which reference the input
     cell file (see manual entry reclass[1] for a detailed
     description of reclass files).  Therefore, users who wish to
     retain reclassified maps must also save the original input
     map layers from which they were generated.

     Values which are not explicitly reclassified will be



GRASS 3.0                U.S. Army CERL                         2






Greclass(2G)         GRASS Reference Manual          Greclass(2G)



     reclassified to 0.

NOTES
     To convert a reclass file to a regular cell file, set your
     window to match the header for the reclass file and then run
     resample.

SEE ALSO
     reclass[1]
     resample[1]

AUTHOR
     Michael Shapiro, U.S. Army Construction Engineering Research
     Laboratory









































GRASS 3.0                U.S. Army CERL                         3



