本文整理汇总了Java中org.opengis.filter.PropertyIsBetween类的典型用法代码示例。如果您正苦于以下问题:Java PropertyIsBetween类的具体用法?Java PropertyIsBetween怎么用?Java PropertyIsBetween使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PropertyIsBetween类属于org.opengis.filter包,在下文中一共展示了PropertyIsBetween类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsBetween filter,
final Object data ) {
final TemporalConstraints propertyExp = (TemporalConstraints) filter.getExpression().accept(
this,
data);
final TemporalConstraints lowerBound = (TemporalConstraints) filter.getLowerBoundary().accept(
this,
data);
final TemporalConstraints upperBound = (TemporalConstraints) filter.getUpperBoundary().accept(
this,
data);
if (propertyExp.isEmpty()) {
return new TemporalConstraints();
}
return new ParameterTimeConstraint(
new TemporalRange(
lowerBound.getStartRange().getStartTime(),
upperBound.getEndRange().getEndTime()),
propertyExp.getName());
}
示例2: createFilterCapabilities
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
/**
* Sets the capabilities of this filter.
*
* @return FilterCapabilities for this Filter
*/
protected FilterCapabilities createFilterCapabilities() {
FilterCapabilities capabilities = new FilterCapabilities();
capabilities.addAll(FilterCapabilities.LOGICAL_OPENGIS);
capabilities.addAll(FilterCapabilities.SIMPLE_COMPARISONS_OPENGIS);
capabilities.addType(PropertyIsNull.class);
capabilities.addType(PropertyIsBetween.class);
capabilities.addType(Id.class);
capabilities.addType(IncludeFilter.class);
capabilities.addType(ExcludeFilter.class);
capabilities.addType(PropertyIsLike.class);
// spatial filters
capabilities.addType(BBOX.class);
capabilities.addType(Contains.class);
//capabilities.addType(Crosses.class);
capabilities.addType(Disjoint.class);
//capabilities.addType(Equals.class);
capabilities.addType(Intersects.class);
//capabilities.addType(Overlaps.class);
//capabilities.addType(Touches.class);
capabilities.addType(Within.class);
capabilities.addType(DWithin.class);
capabilities.addType(Beyond.class);
//temporal filters
capabilities.addType(After.class);
capabilities.addType(Before.class);
capabilities.addType(Begins.class);
capabilities.addType(BegunBy.class);
capabilities.addType(During.class);
capabilities.addType(Ends.class);
capabilities.addType(EndedBy.class);
capabilities.addType(TContains.class);
capabilities.addType(TEquals.class);
return capabilities;
}
示例3: testPropertyIsBetween
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Test
public void testPropertyIsBetween() {
PropertyIsBetween filter = ff.between(ff.property("doubleAttr"), ff.literal("4.5"), ff.literal("5.5"));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("doubleAttr", ImmutableMap.of("gte", 4.5, "lte", 5.5)));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例4: testUnknownPropertyIsBetween
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Test
public void testUnknownPropertyIsBetween() {
PropertyIsBetween filter = ff.between(ff.property("unknownStr"), ff.literal("a"), ff.literal("c"));
Map<String,Object> expected = ImmutableMap.of("range", ImmutableMap.of("unknownStr", ImmutableMap.of("gte", "a", "lte", "c")));
builder.visit(filter, null);
assertTrue(builder.createFilterCapabilities().fullySupports(filter));
assertEquals(expected, builder.getQueryBuilder());
}
示例5: testReadNumericArrayWithCsvStrategy
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Test
public void testReadNumericArrayWithCsvStrategy() throws Exception {
init();
dataStore.setArrayEncoding(ArrayEncoding.CSV);
FilterFactory ff = dataStore.getFilterFactory();
PropertyIsBetween between = ff.between(ff.property("speed_is"), ff.literal(160), ff.literal(300));
SimpleFeatureCollection features = featureSource.getFeatures(between);
assertEquals(5, features.size());
SimpleFeatureIterator iterator = features.features();
while (iterator.hasNext()) {
SimpleFeature f = iterator.next();
assertFalse(f.getAttribute("speed_is") instanceof List);
}
}
示例6: testGetFeaturesWithIsBetweenFilterOnObjectType
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Test
public void testGetFeaturesWithIsBetweenFilterOnObjectType() throws Exception {
init();
FilterFactory ff = dataStore.getFilterFactory();
PropertyIsBetween f = ff.between(ff.property("object.hejda"), ff.literal(5), ff.literal(15));
SimpleFeatureCollection features = featureSource.getFeatures(f);
assertEquals(5, features.size());
}
示例7: testGetFeaturesWithIsBetweenFilterOnNestedType
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Test
public void testGetFeaturesWithIsBetweenFilterOnNestedType() throws Exception {
init();
FilterFactory ff = dataStore.getFilterFactory();
PropertyIsBetween f = ff.between(ff.property("nested.hej"), ff.literal(5), ff.literal(15));
SimpleFeatureCollection features = featureSource.getFeatures(f);
assertEquals(10, features.size());
}
示例8: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsBetween filter,
final Object data ) {
return new ExtractGeometryFilterVisitorResult(
infinity(),
null);
}
示例9: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsBetween filter,
final Object data ) {
final ByteArrayId leftResult = (ByteArrayId) filter.getExpression().accept(
this,
data);
final Object lower = filter.getLowerBoundary().accept(
this,
data);
final Object upper = filter.getUpperBoundary().accept(
this,
data);
if (lower instanceof Number) {
return new PropertyConstraintSet(
new NumericQueryConstraint(
leftResult,
(Number) lower,
(Number) upper,
true,
true));
}
return new PropertyConstraintSet();
}
示例10: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Override
public Object visit(
final PropertyIsBetween filter,
final Object extraData ) {
if (!usesProperty(filter)) {
return Filter.INCLUDE;
}
return super.visit(
filter,
extraData);
}
示例11: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public Object visit(PropertyIsBetween filter, Object userData) {
String propertyName = getPropertyName(filter.getExpression());
String finalName = parsePropertyName(propertyName, userData);
Object lo = castLiteral(getLiteralValue(filter.getLowerBoundary()), propertyName);
Object hi = castLiteral(getLiteralValue(filter.getUpperBoundary()), propertyName);
return Restrictions.between(finalName, lo, hi);
}
示例12: addFilter
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
/**
* Adds the filter.
*
* @param node the node
* @return the filter
*/
private Filter addFilter(FilterNode node) {
Filter filter = node.getFilter();
FilterConfigInterface filterConfig = node.getFilterConfig();
if (filter instanceof LogicFilterImpl) {
List<Filter> filterList = new ArrayList<Filter>();
createFilterList(node, filterList);
return filterConfig.createLogicFilter(filterList);
}
List<Expression> parameterFilter = new ArrayList<Expression>();
if (filter instanceof FidFilterImpl) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof BinaryTemporalOperator) {
createExpressionParameterList(node, 2, parameterFilter);
} else if (filter instanceof PropertyIsBetween) {
createExpressionParameterList(node, 3, parameterFilter);
} else if (filter instanceof PropertyIsNull) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof PropertyIsLike) {
createExpressionParameterList(node, 6, parameterFilter);
} else if (filter instanceof BinarySpatialOperator) {
createExpressionParameterList(node, 2, parameterFilter);
} else if (filter instanceof BinaryComparisonAbstract) {
if (filter instanceof Not) {
createExpressionParameterList(node, 1, parameterFilter);
} else if (filter instanceof PropertyIsGreaterThan) {
createExpressionParameterList(node, 2, parameterFilter);
} else {
createExpressionParameterList(node, 3, parameterFilter);
}
} else {
return filter;
}
return filterConfig.createFilter(parameterFilter);
}
示例13: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
/**
* Writes the FilterBuilder for the PropertyIsBetween Filter.
*
* @param filter the Filter to be visited.
*
*/
public Object visit(PropertyIsBetween filter, Object extraData) {
LOGGER.finest("exporting PropertyIsBetween");
Expression expr = (Expression) filter.getExpression();
Expression lowerbounds = (Expression) filter.getLowerBoundary();
Expression upperbounds = (Expression) filter.getUpperBoundary();
Class context;
nested = false;
AttributeDescriptor attType = (AttributeDescriptor)expr.evaluate(featureType);
if (attType != null) {
context = attType.getType().getBinding();
if (attType.getUserData().containsKey(NESTED)) {
nested = (Boolean) attType.getUserData().get(NESTED);
}
if (Date.class.isAssignableFrom(context)) {
updateDateFormatter(attType);
}
} else {
//assume it's a string?
context = String.class;
}
expr.accept(this, extraData);
key = (String) field;
lowerbounds.accept(this, context);
lower = field;
upperbounds.accept(this, context);
upper = field;
if(nested) {
path = extractNestedPath(key);
}
queryBuilder = ImmutableMap.of("range", ImmutableMap.of(key, ImmutableMap.of("gte", lower, "lte", upper)));
if(nested) {
queryBuilder = ImmutableMap.of("nested", ImmutableMap.of("path", path, "query", queryBuilder));
}
return extraData;
}
示例14: visit
import org.opengis.filter.PropertyIsBetween; //导入依赖的package包/类
@Override
public Object visit(PropertyIsBetween pib, Object o) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}