Java源码示例:org.opengis.filter.PropertyIsLessThan
示例1
@Override
public Object visit(final PropertyIsLessThan filter, final Object data) {
final TemporalConstraints leftResult =
(TemporalConstraints) filter.getExpression1().accept(this, data);
final TemporalConstraints rightResult =
(TemporalConstraints) filter.getExpression2().accept(this, data);
if (leftResult.isEmpty() || rightResult.isEmpty()) {
return new TemporalConstraints();
}
if (leftResult instanceof ParameterTimeConstraint) {
return new ParameterTimeConstraint(
new TemporalRange(
TemporalRange.START_TIME,
new Date(rightResult.getStartRange().getStartTime().getTime() - 1)),
leftResult.getName());
} else {
return new ParameterTimeConstraint(
new TemporalRange(
new Date(leftResult.getStartRange().getStartTime().getTime() + 1),
TemporalRange.END_TIME),
rightResult.getName());
}
}
示例2
@Test
public void testPropertyIsLessThan() {
PropertyIsLessThan filter = ff.less(ff.property("doubleAttr"), ff.literal("4.5"));
Map<String,Object> expected = ImmutableMap.of("range",
ImmutableMap.of("doubleAttr", ImmutableMap.of("lt", 4.5)));
builder.visit(filter, null);
assertTrue(builder.createCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例3
@Test
public void testGetFeaturesWithIsLessThanFilter() throws Exception {
init();
FilterFactory ff = dataStore.getFilterFactory();
PropertyIsLessThan f = ff.less(ff.property("speed_is"), ff.literal(150));
SimpleFeatureCollection features = featureSource.getFeatures(f);
assertEquals(0, features.size());
}
示例4
@Override
public Object visit(final PropertyIsLessThan filter, final Object extraData) {
if (!usesProperty(filter)) {
return Filter.INCLUDE;
}
return super.visit(filter, extraData);
}
示例5
@Override
public Object visit(final PropertyIsLessThan filter, final Object extraData) {
if (!usesProperty(filter)) {
return Filter.INCLUDE;
}
return super.visit(filter, extraData);
}
示例6
/** {@inheritDoc} */
@Override
public Object visit(PropertyIsLessThan filter, Object userData) {
String propertyName = getPropertyName(filter.getExpression1());
String finalName = parsePropertyName(propertyName, userData);
Object literal = getLiteralValue(filter.getExpression2());
return Restrictions.lt(finalName, castLiteral(literal, propertyName));
}
示例7
@Override
public Object visit(final PropertyIsLessThan filter, final Object data) {
return new ExtractGeometryFilterVisitorResult(infinity(), null);
}
示例8
/**
* Write the FilterBuilder for this kind of filter
*
* @param filter the filter to visit
* @param extraData extra data (unused by this method)
*
*/
public Object visit(PropertyIsLessThan filter, Object extraData) {
visitBinaryComparisonOperator(filter, "<");
return extraData;
}