Class TLcdOGCBinarySpatialOperator
- All Implemented Interfaces:
ILcdDataObject,ILcdGenericExpression,ILcdOGCCondition,ILcdCloneable,ILcdDeepCloneable,Cloneable
<ogc:BinarySpatialOpType>. Namely:
<ogc:Equals><ogc:Disjoint><ogc:Touches><ogc:Within><ogc:Overlaps><ogc:Crosses><ogc:Intersects><ogc:Contains>
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intSpatial relationship type that corresponds to the<ogc:Contains>element.static final intSpatial relationship type that corresponds to the<ogc:Crosses>element.static final intSpatial relationship type that corresponds to the<ogc:Disjoint>element.static final intSpatial relationship type that corresponds to the<ogc:Equals>element.static final intSpatial relationship type that corresponds to the<ogc:Intersects>element.static final intSpatial relationship type that corresponds to the<ogc:Overlaps>element.static final intSpatial relationship type that corresponds to the<ogc:Touches>element.static final intSpatial relationship type that corresponds to the<ogc:Within>element. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.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. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGets the first argument of the spatial relationship.Deprecated.Gets the second argument of the spatial relationship.getShape()Deprecated.UsegetSecondArgument()instead.Gets the spatial reference of the geometries used in this spatial relationship.intgetType()Returns the type of the spatial relationship.getValue(TLcdDataProperty aProperty) Returns the value of the given property.inthashCode()voidsetFirstArgument(Object aObject) Sets the first argument of the spatial relationship.voidsetPropertyName(TLcdOGCPropertyName aPropertyName) Deprecated.UsesetFirstArgument(Object)instead.voidsetSecondArgument(Object aObject) Sets the second argument of the spatial relationship.voidDeprecated.UsesetSecondArgument(Object)instead.voidsetShapeGeoReference(ILcdGeoReference aShapeGeoReference) Sets the spatial reference of the geometries used in this spatial relationship.These geometries can be set viasetShape(ILcdShape),setFirstArgument(Object)and/orsetSecondArgument(Object).voidsetType(int aType) Sets the type of the spatial relationship.voidsetValue(TLcdDataProperty aProperty, Object aValue) Sets the value of the given property for this data object.toString()Methods inherited from class com.luciad.datamodel.TLcdDataObject
clone, clone, getDataType, getValue, hasValue, hasValue, setValue
-
Field Details
-
DISJOINT
public static final int DISJOINTSpatial relationship type that corresponds to the<ogc:Disjoint>element.- See Also:
-
CROSSES
public static final int CROSSESSpatial relationship type that corresponds to the<ogc:Crosses>element.- See Also:
-
OVERLAPS
public static final int OVERLAPSSpatial relationship type that corresponds to the<ogc:Overlaps>element.- See Also:
-
WITHIN
public static final int WITHINSpatial relationship type that corresponds to the<ogc:Within>element.- See Also:
-
INTERSECTS
public static final int INTERSECTSSpatial relationship type that corresponds to the<ogc:Intersects>element.- See Also:
-
TOUCHES
public static final int TOUCHESSpatial relationship type that corresponds to the<ogc:Touches>element.- See Also:
-
CONTAINS
public static final int CONTAINSSpatial relationship type that corresponds to the<ogc:Contains>element.- See Also:
-
EQUALS
public static final int EQUALSSpatial 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 thefirst argumentof the spatial relationship.aShape- the geometry that identifies thesecond argumentof 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.UsegetFirstArgument()instead.Gets the first argument of the spatial relationship, if it is of typeTLcdOGCPropertyName. Otherwise,nullis returned.- Returns:
- the first argument of the spatial relationship if it is of type
TLcdOGCPropertyName,nullotherwise. - See Also:
-
setPropertyName
Deprecated.UsesetFirstArgument(Object)instead.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 thefirst argumentin the spatial relationship.- See Also:
-
getShape
Deprecated.UsegetSecondArgument()instead.Gets the second argument of the spatial relationship, if it is of typeILcdShape. Otherwise,nullis returned.- Returns:
- the second argument of the spatial relationship if it is of type
ILcdShape,nullotherwise. - See Also:
-
setShape
Deprecated.UsesetSecondArgument(Object)instead.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 thesecond argumentin the spatial relationship.- See Also:
-
getShapeGeoReference
Gets the spatial reference of the geometries used in this spatial relationship. These geometries can be set viasetShape(ILcdShape),setFirstArgument(Object)and/orsetSecondArgument(Object).- Returns:
- the spatial reference of the geometries used in this spatial relationship.
-
setShapeGeoReference
Sets the spatial reference of the geometries used in this spatial relationship.These geometries can be set via
setShape(ILcdShape),setFirstArgument(Object)and/orsetSecondArgument(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
Gets the first argument of the spatial relationship.- Returns:
- the first argument of the spatial relationship.
- Since:
- 2026.1
-
setFirstArgument
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 ofTLcdOGCPropertyName.- Parameters:
aObject- the first argument to be considered in the spatial relationship.- Since:
- 2026.1
-
getSecondArgument
Gets the second argument of the spatial relationship.- Returns:
- the second argument of the spatial relationship.
- Since:
- 2026.1
-
setSecondArgument
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 ofILcdShape.- Parameters:
aObject- the second argument of the spatial relationship.- Since:
- 2026.1
-
getValue
Description copied from interface:ILcdDataObjectReturns 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 typeor in one of its super types. Otherwise anIllegalArgumentExceptionis thrown.- Specified by:
getValuein interfaceILcdDataObject- Overrides:
getValuein classTLcdDataObject- Parameters:
aProperty- the property for which the value is to be returned- Returns:
- the value of the given property for this data object
-
setValue
Description copied from interface:ILcdDataObjectSets 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 thedata object's typeor in one of its super types. In other words, getDataType().getProperties().contains( aProperty ) should always be true. Otherwise, the implementation should throw anIllegalArgumentException.- Specified by:
setValuein interfaceILcdDataObject- Overrides:
setValuein classTLcdDataObject- Parameters:
aProperty- the property for which the value is to be setaValue- the value to set- See Also:
-
equals
-
hashCode
public int hashCode() -
toString
- Overrides:
toStringin classTLcdDataObject
-
getFirstArgument()instead.