Modifier and Type | Method and Description |
---|---|
static TLcdOGCBinaryOperator |
add(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic add operation between
aFirstExpression and aSecondExpression . |
static TLcdOGCBinaryLogicOperator |
and(ILcdOGCCondition... aConditions)
Creates a new 'and' condition that evaluates to true if all of the
conditions in
aConditions are true. |
static TLcdOGCBBoxOperator |
bbox(ILcdBounds aBounds)
Creates a new bounding box operator which can be used to perform a spatial query on an
ILcdModel . |
static TLcdOGCBBoxOperator |
bbox(ILcdBounds aBounds,
ILcdGeoReference aBoundsReference)
Creates a new bounding box operator which can be used to perform a spatial query on an
ILcdModel . |
static TLcdOGCIsBetweenOperator |
between(ILcdOGCExpression aExpression,
ILcdOGCExpression aLowerBounds,
ILcdOGCExpression aUpperBounds)
Creates an operator that evaluates to true when
aExpression is contained in the
[aLowerBounds, aUpperBounds] interval. |
static TLcdOGCBinaryOperator |
div(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic divide operation between
aFirstExpression and aSecondExpression . |
static TLcdOGCBinaryComparisonOperator |
eq(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates a condition that evaluates to true when
aFirstExpression is
equal to aSecondExpression . |
static TLcdOGCBinaryComparisonOperator |
eq(ILcdOGCExpression aExpression,
Object aLiteralContent)
Creates a condition that evaluates to true when
aExpression is
equal to aLiteralContent , which is a static value. |
static TLcdOGCFunction |
function(String aName,
ILcdOGCExpression... aArguments)
Creates a custom OGC function with the given name and arguments.
|
static TLcdOGCBinaryComparisonOperator |
gt(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates a condition that evaluates to true when
aFirstExpression is greater
then aSecondExpression |
static TLcdOGCBinaryComparisonOperator |
gte(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates a condition that evaluates to true when
aFirstExpression is greater then or
equal to aSecondExpression |
static TLcdOGCIsNullOperator |
isNull(TLcdOGCPropertyName aPropertyName)
Creates an operator that evaluates to true when the given property is null.
|
static TLcdOGCIsLikeOperator |
like(TLcdOGCPropertyName aPropertyName,
Object aLiteralPatternContent)
Creates an operator that evaluates to true when the value of
aPropertyName matches the
pattern specified in aLiteralPatternContent . |
static TLcdOGCLiteral |
literal(Object aLiteralValue)
Creates a literal for
aLiteralValue . |
static TLcdOGCBinaryComparisonOperator |
lt(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates a condition that evaluates to true when
aFirstExpression is less
then aSecondExpression |
static TLcdOGCBinaryComparisonOperator |
lte(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates a condition that evaluates to true when
aFirstExpression is less then or
equal to aSecondExpression |
static ILcdOGCCondition |
minBoundsSize(double aMinSizeX,
double aMinSizeY)
Creates a condition that passes objects that have a minimum bounds size.
|
static TLcdOGCBinaryOperator |
mul(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic multiply operation between
aFirstExpression and aSecondExpression . |
static TLcdOGCNotOperator |
not(ILcdOGCCondition aCondition)
Creates a condition that evaluates to true when the given condition is false and vice versa.
|
static TLcdOGCBinaryLogicOperator |
or(ILcdOGCCondition... aConditions)
Creates a new 'or' condition that evaluates to true if one of the
conditions in
aConditions is true. |
static TLcdOGCPropertyName |
property(String aExpression)
Creates a property name based on an xpath expression that only uses the default name space.
|
static TLcdOGCPropertyName |
property(String aExpression,
Map<String,String> aPrefix2Namespace)
Creates a property name based on an xpath expression and a
Map that
maps prefixes to namespaces. |
static TLcdOGCPropertyName |
property(String aExpression,
String aDefaultNameSpace)
Creates a property name based on an xpath expression that only uses the default name space.
|
static TLcdOGCPropertyName |
property(TLcdDataType aDataType,
TLcdDataProperty... aProperties)
Creates a property name that points to the last property in
aProperties , the xpath will start from an object of type
aDataType . |
static TLcdOGCResourceIdsOperator |
resourceIds(String... aResourceIds)
Creates a condition that can be used in an
OGC Filter to match elements based on their ID. |
static TLcdOGCResourceIdsOperator |
resourceIds(TLcdOGCResourceId... aResourceIds)
Creates a condition that can be used in an
OGC Filter to match elements based on their ID. |
static TLcdOGCBinaryOperator |
sub(ILcdOGCExpression aFirstExpression,
ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic subtract operation between
aFirstExpression and aSecondExpression . |
static TLcdOGCBinaryTemporalOperator |
temporal(TLcdOGCPropertyName aPropertyName,
Date aDate,
QName aComparison)
Creates an operator that evaluates to true when
aPropertyName matches in the comparison with aDate
. |
static TLcdOGCBinaryTemporalOperator |
temporalInterval(TLcdOGCPropertyName aPropertyName,
Date aBegin,
Date aEnd,
QName aComparison)
Creates an operator that evaluates to true when
aPropertyName matches in the comparison with time interval
defined by aBegin and aEnd . |
public static TLcdOGCBinaryLogicOperator or(ILcdOGCCondition... aConditions)
aConditions
is true.aConditions
- One or more conditions.public static TLcdOGCBinaryLogicOperator and(ILcdOGCCondition... aConditions)
aConditions
are true.aConditions
- One or more conditions.public static TLcdOGCBinaryComparisonOperator eq(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
aFirstExpression
is
equal to aSecondExpression
.aFirstExpression
- The first expression.aSecondExpression
- The second expression.public static TLcdOGCBinaryComparisonOperator gt(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
aFirstExpression
is greater
then aSecondExpression
aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryComparisonOperator gte(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
aFirstExpression
is greater then or
equal to aSecondExpression
aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryComparisonOperator lt(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
aFirstExpression
is less
then aSecondExpression
aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryComparisonOperator lte(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
aFirstExpression
is less then or
equal to aSecondExpression
aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCNotOperator not(ILcdOGCCondition aCondition)
aCondition
- The condition to invertpublic static TLcdOGCIsNullOperator isNull(TLcdOGCPropertyName aPropertyName)
aPropertyName
- The name of the property to checkpublic static TLcdOGCBinaryComparisonOperator eq(ILcdOGCExpression aExpression, Object aLiteralContent)
aExpression
is
equal to aLiteralContent
, which is a static value.aExpression
- The first expression.aLiteralContent
- An object which can be compared to the result of
aFirstExpressionpublic static TLcdOGCIsLikeOperator like(TLcdOGCPropertyName aPropertyName, Object aLiteralPatternContent)
Creates an operator that evaluates to true when the value of aPropertyName
matches the
pattern specified in aLiteralPatternContent
. It uses the OGC default values for a
wildcard ('*'), a single char ('?') and the escape character ('\').
aPropertyName
- The name of the property to checkaLiteralPatternContent
- An object which can be compared to the given propertypublic static TLcdOGCIsBetweenOperator between(ILcdOGCExpression aExpression, ILcdOGCExpression aLowerBounds, ILcdOGCExpression aUpperBounds)
Creates an operator that evaluates to true when aExpression
is contained in the
[aLowerBounds, aUpperBounds]
interval.
aExpression
- The expression to checkaLowerBounds
- The lower bounds of the interval (inclusive)aUpperBounds
- The upper bounds of the interval (inclusive)public static TLcdOGCFunction function(String aName, ILcdOGCExpression... aArguments)
TLcdOGCFilterEvaluator
, functions can be registered using
TLcdOGCFilterEvaluator.registerFunction(com.luciad.format.xml.TLcdXMLName, com.luciad.ogc.filter.evaluator.ILcdEvaluatorFunction)
.
A function that evaluates to a boolean can be used directly as a condition
.
function
(FUNCTION_NAME, ...)
is equivalent to:
If you use a function as condition, but it evaluates to a non-boolean result, you will get errors while evaluating.eq
(function
(FUNCTION_NAME, ...),literal
(true))
aName
- The name of a custom function, should not be null.aArguments
- The arguments that should be passed to the function.public static TLcdOGCBinaryOperator add(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic add operation between aFirstExpression
and aSecondExpression
.
IllegalArgumentException
when you use this operator in OGC Filter 2.0 XML (for example WFS 2.0).aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryOperator sub(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic subtract operation between aFirstExpression
and aSecondExpression
.
IllegalArgumentException
when you use this operator in OGC Filter 2.0 XML (for example WFS 2.0).aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryOperator mul(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic multiply operation between aFirstExpression
and aSecondExpression
.
IllegalArgumentException
when you use this operator in OGC Filter 2.0 XML (for example WFS 2.0).aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryOperator div(ILcdOGCExpression aFirstExpression, ILcdOGCExpression aSecondExpression)
Creates an operator that corresponds to an arithmetic divide operation between aFirstExpression
and aSecondExpression
.
IllegalArgumentException
when you use this operator in OGC Filter 2.0 XML (for example WFS 2.0).aFirstExpression
- The first expressionaSecondExpression
- The second expressionpublic static TLcdOGCBinaryTemporalOperator temporal(TLcdOGCPropertyName aPropertyName, Date aDate, QName aComparison)
Creates an operator that evaluates to true when aPropertyName
matches in the comparison with aDate
. The aComparison
type determines how the dates are matched.
Example:
Date date = new Date();
TLcdOGCBinaryTemporalOperator operator = temporal(property("timeProperty"), date, TLcdOGCBinaryTemporalOperator.BEFORE);
Date date = new Date();
TLcdOGCBinaryTemporalOperator operator = temporal(property("timeProperty"), date, TLcdOGCBinaryTemporalOperator.BEFORE);
aPropertyName
- the name of the property to checkaDate
- the date to compare withaComparison
- the type of the temporal comparison, see TLcdOGCBinaryTemporalOperator
public static TLcdOGCBinaryTemporalOperator temporalInterval(TLcdOGCPropertyName aPropertyName, Date aBegin, Date aEnd, QName aComparison)
Creates an operator that evaluates to true when aPropertyName
matches in the comparison with time interval
defined by aBegin
and aEnd
. The aComparison
type determines how the dates are matched.
aPropertyName
- the name of the property to checkaBegin
- the begin dateaEnd
- the end dateaComparison
- the type of the temporal comparison, see TLcdOGCBinaryTemporalOperator
public static TLcdOGCPropertyName property(TLcdDataType aDataType, TLcdDataProperty... aProperties)
aProperties
, the xpath will start from an object of type
aDataType
. Each property in aProperties
should be a child
property of its preceding property. The first property in the list does
not have to be a direct child of aDataType
. Returns null if a
suitable path could not be found.
There are some usage considerations:
TLcdDataType
and the first
TLcdDataProperty
in aDataProperties
will be determined
based on a best-effort approach. This means that a result is not
guaranteed, mostly depending on the complexity of the data model.
It is only necessary to specify multiple TLcdDataProperty
instances
if the xpath generation fails to find a path between aDataType
and
the first property in aProperties
.aDataType
- A data type from which to reach the propertyaProperties
- A list of subsequent properties, each property in the list should
be a child property of its preceding property.public static TLcdOGCPropertyName property(String aExpression, Map<String,String> aPrefix2Namespace)
Map
that
maps prefixes to namespaces. An empty string can be used to define the
default namespace.
Example, note that the prefix map can be reused for multiple property names:
Map<String, String> namespaceMap = new HashMap<String, String>(2);
namespaceMap.put("", "DefaultNS");
namespaceMap.put("ogc", "http://www.opengis.net/ogc");
TLcdOGCPropertyName filterProperty = property("MyObject/ogc:Filter", namespaceMap);
aExpression
- An XPath expressionaPrefix2Namespace
- A map containing prefixes.public static TLcdOGCPropertyName property(String aExpression)
property(String, java.util.Map)
with an empty map.aExpression
- An XPath expressionpublic static TLcdOGCPropertyName property(String aExpression, String aDefaultNameSpace)
Creates a property name based on an xpath expression that only uses the default name space. The default name space is specified as a parameter.
Functionally equivalent to property(String, java.util.Map)
with a map containing one
entry ("", aDefaultNameSpace)
.
aExpression
- An XPath expressionaDefaultNameSpace
- The default name space (which uses an empty prefix)public static TLcdOGCLiteral literal(Object aLiteralValue)
Creates a literal for aLiteralValue
.
Short for new TLcdOGCLiteral( aLiteralValue )
aLiteralValue
- The literal valueTLcdOGCLiteral
for aLiteralValue
public static ILcdOGCCondition minBoundsSize(double aMinSizeX, double aMinSizeY)
TLcdOGCVendorSpecificFunctions.MIN_BOUNDS_SIZE_FUNCTION_NAME
for details.
Equivalent to:
which is the same as:function
(MIN_BOUNDS_SIZE_FUNCTION_NAME
,literal
(aMinSizeX),literal
(aMinSizeY))
eq
(function
(MIN_BOUNDS_SIZE_FUNCTION_NAME
,literal
(aMinSizeX),literal
(aMinSizeY)),literal
(true))
aMinSizeX
- The minimum X extent objects should have, in model units.aMinSizeY
- The minimum Y extent objects should have, in model units.public static TLcdOGCResourceIdsOperator resourceIds(TLcdOGCResourceId... aResourceIds)
OGC Filter
to match elements based on their ID.
This operator can be used regardless of what OGC Filter version is used for (de)serialization:
object IDs
resource IDs
public static TLcdOGCResourceIdsOperator resourceIds(String... aResourceIds)
OGC Filter
to match elements based on their ID.
This operator can be used regardless of what OGC Filter version is used for (de)serialization:
object IDs
resource IDs
public static TLcdOGCBBoxOperator bbox(ILcdBounds aBounds)
Creates a new bounding box operator which can be used to perform a spatial query on an ILcdModel
.
This method is equivalent to calling:
bbox(aBounds, null)
aBounds
- The boundspublic static TLcdOGCBBoxOperator bbox(ILcdBounds aBounds, ILcdGeoReference aBoundsReference)
Creates a new bounding box operator which can be used to perform a spatial query on an ILcdModel
.
When using the returned TLcdOGCBBoxOperator
to filter domain objects from a model intersecting with the specified bounds (e.g. using a TLcdOGCFilter
or the query
method),
the operator will compare the geometry of the domain object with those bounds.
The TLcdOGCBBoxOperator
supports:
ILcdDataObject
domain objects which expose their geometry through the TLcdHasGeometryAnnotation
.ILcdShape
interface.
An example how this method can be used to perform a spatial query on a model using the query
method:
//Start by creating the bbox condition
TLcdOGCBBoxOperator bbox = bbox(new TLcdLonLatBounds(10, 10, 10, 10),
new TLcdGeodeticReference());
//use that bbox condition to query the model for all elements that intersect with those bounds
try (TLcdLockUtil.Lock readLock = TLcdLockUtil.readLock(aModel)) {
try (Stream<Object> domainObjects = aModel.query(ILcdModel.filter(bbox))) {
//do something with the found domain objects
long count = domainObjects.count();
System.out.println("Found " + count + " domain objects in those bounds");
}
}
aBounds
- The bounds.aBoundsReference
- The reference of those bounds. When using null
:
null
, the bounds are assumed to be defined in the same reference as the shape for which the bounds check is happening.