Class TLcdOGCBinarySpatialOperator

java.lang.Object
com.luciad.datamodel.TLcdDataObject
com.luciad.ogc.filter.model.TLcdOGCBinarySpatialOperator
All Implemented Interfaces:
ILcdDataObject, ILcdGenericExpression, ILcdOGCCondition, ILcdCloneable, ILcdDeepCloneable, Cloneable

public class TLcdOGCBinarySpatialOperator extends TLcdDataObject implements ILcdOGCCondition
This class represents the elements of type <ogc:BinarySpatialOpType>. Namely:
  • <ogc:Equals>
  • <ogc:Disjoint>
  • <ogc:Touches>
  • <ogc:Within>
  • <ogc:Overlaps>
  • <ogc:Crosses>
  • <ogc:Intersects>
  • <ogc:Contains>
According to the OGC Filter specification, the spatial operator determines whether its geometric arguments satisfy the stated spatial relationship. The operator evaluates to true if the spatial relationship is satisfied. Otherwise, the operator evaluates to false.

A TLcdOGCBinarySpatialOperator instance is composed of a spatial relationship type that must be one of the constants defined in this class, a first and second argument to be considered in this spatial relationship and an ILcdGeoReference that indicates the spatial reference of the involved shape(s) in case the shape(s) don't contain one.

When compatibility is desired with OGC Filter 1.x, the first argument needs to be of type TLcdOGCPropertyName and the second argument needs to be of type ILcdShape. You can rely on the constructor to ease creating such binary spatial operators. In OGC Filter 2.0, you can use both a TLcdOGCPropertyName or ILcdShape for each argument.

  • Field Details

    • DISJOINT

      public static final int DISJOINT
      Spatial relationship type that corresponds to the <ogc:Disjoint> element.
      See Also:
    • CROSSES

      public static final int CROSSES
      Spatial relationship type that corresponds to the <ogc:Crosses> element.
      See Also:
    • OVERLAPS

      public static final int OVERLAPS
      Spatial relationship type that corresponds to the <ogc:Overlaps> element.
      See Also:
    • WITHIN

      public static final int WITHIN
      Spatial relationship type that corresponds to the <ogc:Within> element.
      See Also:
    • INTERSECTS

      public static final int INTERSECTS
      Spatial relationship type that corresponds to the <ogc:Intersects> element.
      See Also:
    • TOUCHES

      public static final int TOUCHES
      Spatial relationship type that corresponds to the <ogc:Touches> element.
      See Also:
    • CONTAINS

      public static final int CONTAINS
      Spatial relationship type that corresponds to the <ogc:Contains> element.
      See Also:
    • EQUALS

      public static final int EQUALS
      Spatial relationship type that corresponds to the <ogc:Equals> element.
      See Also:
  • Constructor Details

    • TLcdOGCBinarySpatialOperator

      public TLcdOGCBinarySpatialOperator()
      Default constructor.
    • TLcdOGCBinarySpatialOperator

      public TLcdOGCBinarySpatialOperator(int aType, TLcdOGCPropertyName aPropertyName, ILcdShape aShape, ILcdGeoReference aShapeGeoReference)

      Constructs an instance for a given spatial relationship type, a property name, a shape and a spatial reference.

      When evaluating a filter containing this condition, the shape will have to be transformed to the same reference as the shape under evaluation to perform the spatial test. When this conversion is not possible, evaluating the filter will result in an IllegalArgumentException. If you know the reference of the shapes you will be evaluating in advance, it is therefore recommended to construct this condition with a shape expressed in the same reference as the shapes you will be evaluating.

      Currently, we only support automatic conversion between references for point and bounds shapes.

      Parameters:
      aType - the type of the spatial relationship. It must be one of the constants of this class.
      aPropertyName - the property name that identifies the first argument of the spatial relationship.
      aShape - the geometry that identifies the second argument of the spatial relationship.
      aShapeGeoReference - the spatial reference of the geometry in case it doesn't contain one.
  • Method Details

    • getType

      public int getType()
      Returns the type of the spatial relationship.
      Returns:
      the type of the spatial relationship. It will be one of the constants of this class.
    • setType

      public void setType(int aType)
      Sets the type of the spatial relationship.
      Parameters:
      aType - the type of the spatial relationship. It must be one of the constants of this class.
    • getPropertyName

      @Deprecated public TLcdOGCPropertyName getPropertyName()
      Deprecated.
      Use getFirstArgument() instead.
      Gets the first argument of the spatial relationship, if it is of type TLcdOGCPropertyName. Otherwise, null is returned.
      Returns:
      the first argument of the spatial relationship if it is of type TLcdOGCPropertyName, null otherwise.
      See Also:
    • setPropertyName

      @Deprecated public void setPropertyName(TLcdOGCPropertyName aPropertyName)
      Deprecated.
      Sets the property name that identifies a geometric property and that needs to be the first argument in the spatial relationship.
      Parameters:
      aPropertyName - the property name that needs to be the first argument in the spatial relationship.
      See Also:
    • getShape

      @Deprecated public ILcdShape getShape()
      Deprecated.
      Use getSecondArgument() instead.
      Gets the second argument of the spatial relationship, if it is of type ILcdShape. Otherwise, null is returned.
      Returns:
      the second argument of the spatial relationship if it is of type ILcdShape, null otherwise.
      See Also:
    • setShape

      @Deprecated public void setShape(ILcdShape aShape)
      Deprecated.

      Sets the geometry that needs to the second argument in the spatial relationship.

      When evaluating a filter containing this condition, the shape will have to be transformed to the same reference as the shape under evaluation to perform the spatial test. When this conversion is not possible, evaluating the filter will result in an IllegalArgumentException. If you know the reference of the shapes you will be evaluating in advance, it is therefore recommended to construct this condition with a shape expressed in the same reference as the shapes you will be evaluating.

      Currently, we only support automatic conversion between references for point and bounds shapes.

      Parameters:
      aShape - the geometry that needs to be the second argument in the spatial relationship.
      See Also:
    • getShapeGeoReference

      public ILcdGeoReference getShapeGeoReference()
      Gets the spatial reference of the geometries used in this spatial relationship. These geometries can be set via setShape(ILcdShape), setFirstArgument(Object) and/or setSecondArgument(Object).
      Returns:
      the spatial reference of the geometries used in this spatial relationship.
    • setShapeGeoReference

      public void setShapeGeoReference(ILcdGeoReference aShapeGeoReference)

      Sets the spatial reference of the geometries used in this spatial relationship.These geometries can be set via setShape(ILcdShape), setFirstArgument(Object) and/or setSecondArgument(Object).

      When evaluating a filter containing this condition, the shape will have to be transformed to the same reference as the shape under evaluation to perform the spatial test. When this conversion is not possible, evaluating the filter will result in an IllegalArgumentException. If you know the reference of the shapes you will be evaluating in advance, it is therefore recommended to construct this condition with a shape expressed in the same reference as the shapes you will be evaluating.

      Currently, we only support automatic conversion between references for point and bounds shapes.

      Parameters:
      aShapeGeoReference - the spatial reference of the geometry.
      See Also:
    • getFirstArgument

      public Object getFirstArgument()
      Gets the first argument of the spatial relationship.
      Returns:
      the first argument of the spatial relationship.
      Since:
      2026.1
    • setFirstArgument

      public void setFirstArgument(Object aObject)
      Sets the first argument of the spatial relationship.

      For compatibility with OGC Filter 1.1.0, for example when encoding the filter using TLcdOGCFilterEncoder, this argument should be an instance of TLcdOGCPropertyName.

      Parameters:
      aObject - the first argument to be considered in the spatial relationship.
      Since:
      2026.1
    • getSecondArgument

      public Object getSecondArgument()
      Gets the second argument of the spatial relationship.
      Returns:
      the second argument of the spatial relationship.
      Since:
      2026.1
    • setSecondArgument

      public void setSecondArgument(Object aObject)
      Sets the second argument of the spatial relationship.

      For compatibility with OGC Filter 1.1.0, for example when encoding the filter using TLcdOGCFilterEncoder, this argument should be an instance of ILcdShape.

      Parameters:
      aObject - the second argument of the spatial relationship.
      Since:
      2026.1
    • getValue

      public Object getValue(TLcdDataProperty aProperty)
      Description copied from interface: ILcdDataObject

      Returns the value of the given property.

      If the property is a collection, the returned value will never be null. If the property has not been set, an empty collection of the appropriate type will be returned (Set, List or Map).

      The property must not be null, and must be declared in the data object's type or in one of its super types. Otherwise an IllegalArgumentException is thrown.

      Specified by:
      getValue in interface ILcdDataObject
      Overrides:
      getValue in class TLcdDataObject
      Parameters:
      aProperty - the property for which the value is to be returned
      Returns:
      the value of the given property for this data object
    • setValue

      public void setValue(TLcdDataProperty aProperty, Object aValue)
      Description copied from interface: ILcdDataObject

      Sets the value of the given property for this data object. The implementation is allowed to throw an exception if the given value can't be set.

      The given property must be declared in the data object's type or in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw an IllegalArgumentException.

      Specified by:
      setValue in interface ILcdDataObject
      Overrides:
      setValue in class TLcdDataObject
      Parameters:
      aProperty - the property for which the value is to be set
      aValue - the value to set
      See Also:
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class TLcdDataObject