org.deegree.filter.spatial
Class SpatialOperator

java.lang.Object
  extended by org.deegree.filter.spatial.SpatialOperator
All Implemented Interfaces:
Operator
Direct Known Subclasses:
BBOX, Beyond, Contains, Crosses, Disjoint, DWithin, Equals, Intersects, Overlaps, Touches, Within

public abstract class SpatialOperator
extends Object
implements Operator

Defines a topological predicate that can be evaluated on Geometry valued objects.

Version:
$Revision:$, $Date:$
Author:
Markus Schneider , last edited by: $Author:$

Nested Class Summary
static class SpatialOperator.SubType
          Convenience enum type for discriminating the different SpatialOperator types.
 
Nested classes/interfaces inherited from interface org.deegree.filter.Operator
Operator.Type
 
Field Summary
protected  Expression propName
           
 
Constructor Summary
protected SpatialOperator(Expression param1)
           
 
Method Summary
protected  Geometry checkGeometryOrNull(TypedObjectNode value)
          Performs a checked cast to Geometry.
protected  Geometry getCompatibleGeometry(Geometry param, Geometry literal)
          Returns a version of the given geometry literal that has the same srs as the given geometry parameter.
 Expression getParam1()
          Returns the first spatial parameter.
abstract  Object[] getParams()
           
 ValueReference getPropName()
          Deprecated. use getParam1() instead
 SpatialOperator.SubType getSubType()
          Returns the type of spatial operator.
 Operator.Type getType()
          Always returns Operator.Type#SPATIAL (for SpatialOperator instances).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.deegree.filter.Operator
evaluate, toString
 

Field Detail

propName

protected final Expression propName
Constructor Detail

SpatialOperator

protected SpatialOperator(Expression param1)
Method Detail

getType

public Operator.Type getType()
Always returns Operator.Type#SPATIAL (for SpatialOperator instances).

Specified by:
getType in interface Operator
Returns:
Operator.Type#SPATIAL

getSubType

public SpatialOperator.SubType getSubType()
Returns the type of spatial operator. Use this to safely determine the subtype of SpatialOperator.

Returns:
type of spatial operator

getParam1

public Expression getParam1()
Returns the first spatial parameter.

Returns:
the first spatial parameter, may be null (target default geometry property of object)

getPropName

public ValueReference getPropName()
Deprecated. use getParam1() instead

Returns the name of the spatial property to be considered.

Returns:
the name of the property, may be null (target default geometry property of object)

checkGeometryOrNull

protected Geometry checkGeometryOrNull(TypedObjectNode value)
                                throws FilterEvaluationException
Performs a checked cast to Geometry. If the given value is neither null nor a Geometry instance, a corresponding FilterEvaluationException is thrown.

Parameters:
value -
Returns:
the very same value (if it is a Geometry or null)
Throws:
FilterEvaluationException - if the value is neither null nor a Geometry

getCompatibleGeometry

protected Geometry getCompatibleGeometry(Geometry param,
                                         Geometry literal)
                                  throws FilterEvaluationException
Returns a version of the given geometry literal that has the same srs as the given geometry parameter.

Parameters:
param - geometry parameter, must not be null
literal - geometry literal, must not be null
Returns:
literal geometry with the same srs as the parameter geometry
Throws:
FilterEvaluationException - if the transformation failed

getParams

public abstract Object[] getParams()


Copyright © 2011. All Rights Reserved.