本文整理汇总了Java中org.opengis.filter.PropertyIsLessThan类的典型用法代码示例。如果您正苦于以下问题:Java PropertyIsLessThan类的具体用法?Java PropertyIsLessThan怎么用?Java PropertyIsLessThan使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyIsLessThan类属于org.opengis.filter包,在下文中一共展示了PropertyIsLessThan类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: comparisonUsingExpressions
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
/**
* Comparison between persons under 18 years old and over 65 years old
* @throws Exception
*/
static private void comparisonUsingExpressions() throws Exception {
// comparisonUsingExpressions start
Filter filter = ECQL.toFilter("(under18YearsOld * 19541453 / 100 ) < (over65YearsOld * 19541453 / 100 )");
// comparisonUsingExpressions end
SimpleFeature city = DataExamples.getInstanceOfCity();
Utility.prittyPrintFilter(filter);
PropertyIsLessThan lessThan =(PropertyIsLessThan) filter;
Expression leftExpr = lessThan.getExpression1();
Expression rightExpr = lessThan.getExpression2();
System.out.println("left expression value: " + leftExpr.evaluate(city));
System.out.println("right expression value: " + rightExpr.evaluate(city));
Boolean result = lessThan.evaluate(city);
System.out.println("Result of filter evaluation: " + result);
}
示例2: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLessThan filter,
final Object data ) {
final ByteArrayId leftResult = (ByteArrayId) filter.getExpression1().accept(
this,
data);
final Object value = filter.getExpression2().accept(
this,
data);
if (value instanceof Number) {
return new PropertyConstraintSet(
new NumericLessThanConstraint(
leftResult,
(Number) value));
}
return new PropertyConstraintSet();
}
示例3: testPropertyIsLessThan
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@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.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例4: testGetFeaturesWithIsLessThanFilter
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@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());
}
示例5: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLessThan filter,
final Object data ) {
return new ExtractGeometryFilterVisitorResult(
infinity(),
null);
}
示例6: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@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());
}
}
示例7: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsLessThan filter,
final Object extraData ) {
if (!usesProperty(filter)) {
return Filter.INCLUDE;
}
return super.visit(
filter,
extraData);
}
示例8: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
/** {@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));
}
示例9: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
@Override
public Object visit(PropertyIsLessThan pilt, Object o) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}
示例10: visit
import org.opengis.filter.PropertyIsLessThan; //导入依赖的package包/类
/**
* 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((BinaryComparisonOperator)filter, "<");
return extraData;
}