org.opengis.filter.FilterFactory2.after()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中org.opengis.filter.FilterFactory2.after()方法的一些代码示例,展示了FilterFactory2.after()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FilterFactory2.after()方法的具体详情如下:
包路径:org.opengis.filter.FilterFactory2
类名称:FilterFactory2
方法名:after

FilterFactory2.after介绍

暂无

代码示例

代码示例来源:origin: geotools/geotools

public Object visit(After after, Object extraData) {
  return getFactory(extraData)
      .after(
          visit(after.getExpression1(), extraData),
          visit(after.getExpression2(), extraData),
          after.getMatchAction());
}

代码示例来源:origin: geotools/geotools

public Object visit(After after, Object extraData) {
  Expression expr1 = optimizeTime(after.getExpression1(), extraData);
  Expression expr2 = optimizeTime(after.getExpression2(), extraData);
  return getFactory(extraData).after(expr1, expr2, after.getMatchAction());
}

代码示例来源:origin: geotools/geotools

Filter filter = fac.after(property, literal, MatchAction.ANY);
Filter expected =
    fac.or(
        new ArrayList<Filter>(
            Arrays.asList(
                fac.after(property, literal1, MatchAction.ANY),
                fac.after(property, literal2, MatchAction.ANY),
                fac.after(property, literal3, MatchAction.ANY))));
filter = fac.after(property, literal, MatchAction.ALL);
expected =
    fac.and(
        new ArrayList<Filter>(
            Arrays.asList(
                fac.after(property, literal1, MatchAction.ALL),
                fac.after(property, literal2, MatchAction.ALL),
                fac.after(property, literal3, MatchAction.ALL))));
filter = fac.after(property, literal, MatchAction.ONE);
expected =
    fac.or(
                    new ArrayList<Filter>(
                        Arrays.asList(
                            fac.after(
                                property,
                                literal1,
                                MatchAction.ONE),
                            fac.not(

代码示例来源:origin: geotools/geotools

@Test
public void testAndTemporalAfter() throws Exception {
  final Instant start = instant("2016-01-01T00:00:00.000-0500");
  final Filter f =
      ff.and(
          ff.bbox("geom", -10, -10, 10, 10, null),
          ff.after(ff.literal("someDate"), ff.literal(start)));
  final Envelope env = (Envelope) f.accept(visitor, null);
  assertEquals(new Envelope(-10, 10, -10, 10), env);
}

代码示例来源:origin: org.locationtech.geomesa/geomesa-native-api

/**
 * Converts the current start- and end-point into a valid temporal filter.
 *
 * @return the net temporal filter that results from the current temporal bounds
 */
public Filter getTemporalFilter() {
  // if neither end-point is set, there is no valid filter
  if (start == null && end == null) return Filter.INCLUDE;
  // if the start-point alone is defined, this is an AFTER query
  if (end == null) return ff.after(DTGProperty, ff.literal(start));
  // if the end-point alone is defined, this is a BEFORE query
  if (start == null) return ff.before(DTGProperty, ff.literal(end));
  // both are defined; if they are ordered correctly, this is a DURING query
  if (start.getTime() <= end.getTime()) return ff.between(DTGProperty, ff.literal(start), ff.literal(end));
  // if you get this far, you have non-null temporal bounds that are improperly ordered;
  // this is equivalent to having no valid temporal bounds
  // TODO:  log this occurrence, because it is unexpected, and the developer should be informed
  return Filter.INCLUDE;
}

代码示例来源:origin: org.geotools/gt-main

public Object visit(After after, Object extraData) {
  return getFactory(extraData).after(visit(after.getExpression1(), extraData), 
    visit(after.getExpression2(), extraData));
}

代码示例来源:origin: geotools/geotools

public void testCapablities() {
  Capabilities capabilities = new Capabilities();
  capabilities.addType(Beyond.class); // add to SpatialCapabilities
  capabilities.addType(After.class); // add to TemporalCapabilities
  capabilities.addType(PropertyIsEqualTo.class); // add to ScalarCapabilities
  capabilities.addName("NullCheck"); // will enable PropertyIsNull use
  capabilities.addName("Mul"); // will enable hasSimpleArithmatic
  capabilities.addName("random"); // a function returning a random number
  capabilities.addName("Length", 1); // single argument function
  capabilities.addName("toDegrees", "radians"); // single argument function
  capabilities.addName("length", "expression");
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
  Filter filter = ff.between(ff.literal(0), ff.property("x"), ff.literal(2));
  assertFalse("supports", capabilities.supports(filter));
  filter = ff.equals(ff.property("x"), ff.literal(2));
  assertTrue("supports", capabilities.supports(filter));
  filter = ff.after(ff.property("x"), ff.literal("1970-01-01 00:00:00"));
  assertTrue("supports", capabilities.supports(filter));
  assertTrue("fullySupports", capabilities.fullySupports(filter));
  Capabilities capabilities2 = new Capabilities();
  capabilities2.addAll(capabilities);
  capabilities2.addType(And.class);
  assertTrue(capabilities2.getContents().getScalarCapabilities().hasLogicalOperators());
  assertFalse(capabilities.getContents().getScalarCapabilities().hasLogicalOperators());
}

代码示例来源:origin: org.locationtech.geogig/geogig-datastore

@Test
public void testAfterFilter() throws Exception {
  Date previousDate = new Date();
  previousDate.setTime(DATE_VALUE.getTime() - 1000);
  After filter = ff.after(ff.property("date"), ff.literal(previousDate));
  Predicate<Bounded> predicate = preFilter(filter);
  assertTrue(((PreFilter) predicate).filter instanceof After);
  assertTrue(predicate.apply(testNode));
  assertTrue(predicate.apply(testNodeRef));
  assertTrue(predicate.apply(testBucket));
  filter = ff.after(ff.property("date"), ff.literal(DATE_VALUE));
  predicate = preFilter(filter);
  assertFalse(predicate.apply(testNode));
  assertFalse(predicate.apply(testNodeRef));
  // buckets are evaluated to true for the traversal to continue to its leaf nodes
  assertTrue(predicate.apply(testBucket));
  filter = ff.after(ff.property("nonMaterializedProp"), ff.literal(DATE_VALUE));
  predicate = preFilter(filter);
  assertTrue(isAcceptEverything(predicate));
  assertFalse(predicate instanceof PreFilter);// it's Predicates.alwaysTrue()
  assertTrue(predicate.apply(null));
}

代码示例来源:origin: locationtech/geogig

@Test
public void testAfterFilter() throws Exception {
  Date previousDate = new Date();
  previousDate.setTime(DATE_VALUE.getTime() - 1000);
  After filter = ff.after(ff.property("date"), ff.literal(previousDate));
  PreFilter predicate = preFilter(filter);
  assertTrue(((PreFilter) predicate).filter instanceof After);
  assertTrue(predicate.apply(testNode));
  assertTrue(predicate.apply(testNodeRef));
  assertTrue(predicate.apply(testBucket));
  filter = ff.after(ff.property("date"), ff.literal(DATE_VALUE));
  predicate = preFilter(filter);
  assertFalse(predicate.apply(testNode));
  assertFalse(predicate.apply(testNodeRef));
  // buckets are evaluated to true for the traversal to continue to its leaf nodes
  assertTrue(predicate.apply(testBucket));
  filter = ff.after(ff.property("nonMaterializedProp"), ff.literal(DATE_VALUE));
  predicate = preFilter(filter);
  assertTrue(isAcceptEverything(predicate));
  assertTrue(predicate == PreFilter.INCLUDE);
  assertTrue(predicate.apply(null));
}

代码示例来源:origin: locationtech/geogig

Literal dateLiteral = ff.literal(dateVal);
assertFullySupported(ff.after(dateProp, dateLiteral));
assertFullySupported(ff.after(dateLiteral, dateProp));
assertFullyUnsupported(ff.after(dateLiteral, nonMaterializedProp));

代码示例来源:origin: org.locationtech.geogig/geogig-datastore

Literal dateLiteral = ff.literal(dateVal);
assertFullySupported(ff.after(dateProp, dateLiteral));
assertFullySupported(ff.after(dateLiteral, dateProp));
assertFullyUnsupported(ff.after(dateLiteral, nonMaterializedProp));

相关文章