org.geotools.filter
Class CategorizeFunction

java.lang.Object
  extended by org.geotools.filter.CategorizeFunction
All Implemented Interfaces:
org.opengis.filter.expression.Expression, org.opengis.filter.expression.Function

public class CategorizeFunction
extends java.lang.Object
implements org.opengis.filter.expression.Function

Implementation of "Categorize" as a normal function.

This implementation is compatible with the Function interface; the parameter list can be used to set the threshold values etc...

This function expects:

  1. PropertyName; use "Rasterdata" to indicate this is a color map
  2. Literal: lookup value
  3. Literal: threshold 1
  4. Literal: value 1
  5. Literal: threshold 2
  6. Literal: value 2
  7. Literal: (Optional) succeeding or preceding
In reality any expression will do.

Author:
Jody Garnett, Johann Sorel (Geomatys)

Nested Class Summary
static class CategorizeFunction.Name
          Describe how this function works.
 
Field Summary
static org.opengis.filter.capability.FunctionName NAME
          Make the instance of FunctionName available in a consistent spot.
static java.lang.String PRECEDING
          Use as a literal value to indicate behaviour of threshold boundary
static java.lang.String RASTER_DATA
          Use as a PropertyName when defining a color map.
static java.lang.String SUCCEEDING
          Use as a literal value to indicate behaviour of threshold boundary
 
Fields inherited from interface org.opengis.filter.expression.Expression
NIL
 
Constructor Summary
CategorizeFunction()
           
CategorizeFunction(java.util.List<org.opengis.filter.expression.Expression> parameters, org.opengis.filter.expression.Literal fallback)
           
 
Method Summary
 java.lang.Object accept(org.opengis.filter.expression.ExpressionVisitor visitor, java.lang.Object extraData)
           
 java.lang.Object evaluate(java.lang.Object object)
           
<T> T
evaluate(java.lang.Object object, java.lang.Class<T> context)
           
 org.opengis.filter.expression.Literal getFallbackValue()
           
 java.lang.String getName()
           
 java.util.List<org.opengis.filter.expression.Expression> getParameters()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCEEDING

public static final java.lang.String SUCCEEDING
Use as a literal value to indicate behaviour of threshold boundary

See Also:
Constant Field Values

PRECEDING

public static final java.lang.String PRECEDING
Use as a literal value to indicate behaviour of threshold boundary

See Also:
Constant Field Values

RASTER_DATA

public static final java.lang.String RASTER_DATA
Use as a PropertyName when defining a color map. The "Raterdata" is expected to apply to only a single band; if multiple bands are provided it is probably a mistake; but we will use the maximum value (since we are working against a threshold).

See Also:
Constant Field Values

NAME

public static final org.opengis.filter.capability.FunctionName NAME
Make the instance of FunctionName available in a consistent spot.

Constructor Detail

CategorizeFunction

public CategorizeFunction()

CategorizeFunction

public CategorizeFunction(java.util.List<org.opengis.filter.expression.Expression> parameters,
                          org.opengis.filter.expression.Literal fallback)
Method Detail

getName

public java.lang.String getName()
Specified by:
getName in interface org.opengis.filter.expression.Function

getParameters

public java.util.List<org.opengis.filter.expression.Expression> getParameters()
Specified by:
getParameters in interface org.opengis.filter.expression.Function

accept

public java.lang.Object accept(org.opengis.filter.expression.ExpressionVisitor visitor,
                               java.lang.Object extraData)
Specified by:
accept in interface org.opengis.filter.expression.Expression

evaluate

public java.lang.Object evaluate(java.lang.Object object)
Specified by:
evaluate in interface org.opengis.filter.expression.Expression

evaluate

public <T> T evaluate(java.lang.Object object,
                      java.lang.Class<T> context)
Specified by:
evaluate in interface org.opengis.filter.expression.Expression

getFallbackValue

public org.opengis.filter.expression.Literal getFallbackValue()
Specified by:
getFallbackValue in interface org.opengis.filter.expression.Function


Copyright © 1996-2010 Geotools. All Rights Reserved.