org.deegree_impl.services.wfs.filterencoding
Class SpatialOperation

java.lang.Object
  extended byorg.deegree_impl.services.wfs.filterencoding.AbstractOperation
      extended byorg.deegree_impl.services.wfs.filterencoding.SpatialOperation
All Implemented Interfaces:
Operation

public class SpatialOperation
extends AbstractOperation

Encapsulates the information of a spatial_ops entity (as defined in the Filter DTD).

Version:
$Id: SpatialOperation.java,v 1.23 2004/03/12 15:56:48 poth Exp $
Author:
Markus Schneider, Luigi Marinucci

Field Summary
private  double distance
           
private  GM_Object geometryLiteral
           
private  GMLGeometry gmlGeometry
           
private  PropertyName propertyName
           
 
Fields inherited from class org.deegree_impl.services.wfs.filterencoding.AbstractOperation
operatorId
 
Constructor Summary
SpatialOperation(int operatorId, PropertyName propertyName, GMLGeometry gmlGeometry)
          Constructs a new SpatialOperation.
SpatialOperation(int operatorId, PropertyName propertyName, GMLGeometry gmlGeometry, double d)
          Constructs a new SpatialOperation.
 
Method Summary
static Operation buildFromDOM(org.w3c.dom.Element element)
          Given a DOM-fragment, a corresponding Operation-object is built.
 boolean evaluate(Feature feature)
          Calculates the SpatialOperation's logical value based on the property values of the given Feature.
 GM_Envelope getBoundingBox()
          Deprecated. replaced by getGeometry()
 double getDistance()
          returns the distance for geo spatial comparsions such as DWithin or Beyond
 GMLGeometry getGeometry()
          Returns the geometry literal used in the operation.
 GM_Object getGeometryLiteral()
          Returns the geometry literal used in the operation.
 GM_Object getGeometryProperty(Feature feature)
          Returns the geometry property used in the operation and one concrete feature.
 PropertyName getPropertyName()
          returns the name of the (spatial) property that shall be use for geo spatial comparsions
 java.lang.StringBuffer toXML()
          Produces an indented XML representation of this object.
 
Methods inherited from class org.deegree_impl.services.wfs.filterencoding.AbstractOperation
getOperatorId, getOperatorName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gmlGeometry

private GMLGeometry gmlGeometry

geometryLiteral

private GM_Object geometryLiteral

propertyName

private PropertyName propertyName

distance

private double distance
Constructor Detail

SpatialOperation

public SpatialOperation(int operatorId,
                        PropertyName propertyName,
                        GMLGeometry gmlGeometry)
Constructs a new SpatialOperation.

See Also:
OperationDefines

SpatialOperation

public SpatialOperation(int operatorId,
                        PropertyName propertyName,
                        GMLGeometry gmlGeometry,
                        double d)
Constructs a new SpatialOperation.

See Also:
Calvin added on 10/21/2003
Method Detail

getDistance

public double getDistance()
returns the distance for geo spatial comparsions such as DWithin or Beyond

Returns:
the distance for geo spatial comparsions such as DWithin or Beyond

buildFromDOM

public static Operation buildFromDOM(org.w3c.dom.Element element)
                              throws FilterConstructionException
Given a DOM-fragment, a corresponding Operation-object is built. This method recursively calls other buildFromDOM () - methods to validate the structure of the DOM-fragment.

Throws:
FilterConstructionException - if the structure of the DOM-fragment is invalid

getGeometryProperty

public GM_Object getGeometryProperty(Feature feature)
                              throws FilterEvaluationException
Returns the geometry property used in the operation and one concrete feature.

Parameters:
feature -
Returns:
the property as a GM_Object-object.
Throws:
FilterEvaluationException - if the PropertyName does not denote a GM_Object

getGeometryLiteral

public GM_Object getGeometryLiteral()
                             throws FilterEvaluationException
Returns the geometry literal used in the operation.

Returns:
the literal as a GM_Object-object.
Throws:
FilterEvaluationException - if the Literal can not be converted to a GM_Object

getGeometry

public GMLGeometry getGeometry()
Returns the geometry literal used in the operation.

Returns:
the literal as a GMLGeometry-object.

getBoundingBox

public GM_Envelope getBoundingBox()
Deprecated. replaced by getGeometry()

Returns the (bounding) box of a BBOX operation.


getPropertyName

public PropertyName getPropertyName()
returns the name of the (spatial) property that shall be use for geo spatial comparsions


toXML

public java.lang.StringBuffer toXML()
Produces an indented XML representation of this object.


evaluate

public boolean evaluate(Feature feature)
                 throws FilterEvaluationException
Calculates the SpatialOperation's logical value based on the property values of the given Feature.

TODO: Implement operations: CROSSES, BEYOND, OVERLAPS AND TOUCHES.

Parameters:
feature - that determines the property values
Returns:
true, if the SpatialOperation evaluates to true, else false
Throws:
FilterEvaluationException - if the evaluation fails