deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.model.filterencoding
Class SpatialOperation

java.lang.Object
  extended by org.deegree.model.filterencoding.AbstractOperation
      extended by org.deegree.model.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:
$Revision: 18195 $, $Date: 2009-06-18 17:55:39 +0200 (Do, 18. Jun 2009) $
Author:
Markus Schneider, Luigi Marinucci, last edited by: $Author: mschneider $

Field Summary
 
Fields inherited from class org.deegree.model.filterencoding.AbstractOperation
operatorId
 
Constructor Summary
SpatialOperation(int operatorId, PropertyName propertyName, Geometry geometry)
          Constructs a new SpatialOperation.
SpatialOperation(int operatorId, PropertyName propertyName, Geometry geometry, double d)
          Constructs a new SpatialOperation.
 
Method Summary
static Operation buildFromDOM(Element element)
          Deprecated. use the 1.0.0 filter encoding aware method instead.
static Operation buildFromDOM(Element element, boolean useVersion_1_0_0)
          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.
 double getDistance()
          returns the distance for geo spatial comparsions such as DWithin or Beyond
 Geometry getGeometry()
          Returns the geometry literal used in the operation.
 PropertyName getPropertyName()
           
 void setGeometry(Geometry geometry)
          sets a geometry for a spatial operation
 void setPropertyName(PropertyName name)
          This is necessary for the BBOX operator, where the property name can/must be determined later.
 StringBuffer to100XML()
          Produces an XML representation of this object that complies to Filter Encoding specification 1.0.0.
 StringBuffer to110XML()
          Produces an XML representation of this object that complies to Filter Encoding specification 1.1.0.
 StringBuffer toXML()
          Produces an XML representation of this object.
 
Methods inherited from class org.deegree.model.filterencoding.AbstractOperation
getOperatorId, getOperatorName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpatialOperation

public SpatialOperation(int operatorId,
                        PropertyName propertyName,
                        Geometry geometry)
Constructs a new SpatialOperation.

Parameters:
operatorId - The OperationDefines id
propertyName - name of the property to do the spatial compare to.
geometry - the geometry to do the spatial compare to.
See Also:
OperationDefines

SpatialOperation

public SpatialOperation(int operatorId,
                        PropertyName propertyName,
                        Geometry geometry,
                        double d)
Constructs a new SpatialOperation.

Parameters:
operatorId - The OperationDefines id
propertyName - name of the property to do the spatial compare to.
geometry - the geometry to do the spatial compare to.
d - the distance (a buffer)
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

@Deprecated
public static Operation buildFromDOM(Element element)
                              throws FilterConstructionException
Deprecated. use the 1.0.0 filter encoding aware method instead.

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

buildFromDOM

public static Operation buildFromDOM(Element element,
                                     boolean useVersion_1_0_0)
                              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

getGeometry

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

Returns:
the literal as a GMLGeometry-object.

setGeometry

public void setGeometry(Geometry geometry)
sets a geometry for a spatial operation

Parameters:
geometry -

getPropertyName

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

toXML

public StringBuffer toXML()
Description copied from interface: Operation
Produces an XML representation of this object.

Returns:
an XML representation of this object.

to100XML

public StringBuffer to100XML()
Description copied from interface: Operation
Produces an XML representation of this object that complies to Filter Encoding specification 1.0.0.

Returns:
an XML representation of this object

to110XML

public StringBuffer to110XML()
Description copied from interface: Operation
Produces an XML representation of this object that complies to Filter Encoding specification 1.1.0.

Returns:
an 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

setPropertyName

public void setPropertyName(PropertyName name)
This is necessary for the BBOX operator, where the property name can/must be determined later.

Parameters:
name -

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org