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

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

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

FilterFactory2.within介绍

[英]Checks if the feature's geometry is completely contained by the specified constant geometry.
[中]检查特征的几何图形是否完全包含在指定的常量几何图形中。

代码示例

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

Object cloneFilter(
      BinarySpatialOperator bso, Object extraData, Expression ex1, Expression ex2) {
    return ff.within(ex1, ex2);
  }
}.transform(filter, extraData);

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

/**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   *
   * @generated modifiable
   */
  public Object parse(ElementInstance instance, Node node, Object value) throws Exception {
    Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory);

    return filterFactory.within(operands[0], operands[1]);
  }
}

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

public BinarySpatialOperator buildSpatialWithinFilter() throws CQLException {
  Literal geom = this.resultStack.popLiteral();
  Expression property = this.resultStack.popExpression();
  FilterFactory2 ff =
      (FilterFactory2)
          filterFactory; // TODO this cast must be removed. It depends of Geometry
  // implementation
  return ff.within(property, geom);
}

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

public Object visit(Within filter, Object arg1) {
  Expression[][] exps = visitBinarySpatialOp(filter);
  List combinedFilters = new ArrayList(exps.length);
  for (int i = 0; i < exps.length; i++) {
    Expression left = exps[i][0];
    Expression right = exps[i][1];
    Filter unrolled = ff.within(left, right, filter.getMatchAction());
    combinedFilters.add(unrolled);
  }
  Filter unrolled = combineOred(combinedFilters);
  return unrolled;
}

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

/**
 * @return new instance of {@link Within} operation
 * @throws CQLException
 */
public Within buildWithin() throws CQLException {
  Expression[] params = buildParameters();
  return getFilterFactory().within(params[0], params[1]);
}

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

return FILTER_FACT.within(left, right);

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

static Within withinWithFunction() {
  return f.within(f.property("the_geom"), function());
}

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

public Object visit(Within filter, Object extraData) {
  Expression geometry1 = visit(filter.getExpression1(), extraData);
  Expression geometry2 = visit(filter.getExpression2(), extraData);
  return getFactory(extraData).within(geometry1, geometry2, filter.getMatchAction());
}

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

static Within within() {
  return f.within(f.property("the_geom"), f.literal(geometry()));
}

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

public static Within within() {
  return f.within(f.property("the_geom"), f.literal(geometry()));
}

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

Object cloneFilter(BinarySpatialOperator bso, Object extraData, Expression ex1,
      Expression ex2) {
    return ff.within(ex1, ex2);
  }
}.transform(filter, extraData);

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

return factory.within(geometry1, geometry2);

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

PropertyName expr1 = new AttributeExpressionImpl(testSchema, "testGeometry");
Within filter = fac.within(expr1, expr2);
filter = fac.within(expr1, function);
LOGGER.finer(filter.toString());
LOGGER.finer("contains feature: " + filter.evaluate(testFeature));
assertTrue(filter.evaluate(testFeature));
filter = fac.within(expr2, expr1);
    new LiteralExpressionImpl(
        gf.createPolygon(gf.createLinearRing(coords), new LinearRing[0]));
filter = fac.within(expr2, expr1);
filter = fac.within(expr2, expr1);

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

/** Sets up a schema and a test feature. */
protected void setUp() {
  LOGGER.finer("Setting up FilterCapabilitiesTest");
  if (setup) {
    return;
  }
  setup = true;
  capabilities = new FilterCapabilities();
  try {
    gFilter = fact.within(fact.property("geom"), fact.literal(null));
    compFilter = fact.less(fact.property("size"), fact.literal(3));
  } catch (IllegalFilterException ife) {
    LOGGER.fine("Bad filter " + ife);
  }
  capabilities.addType(AbstractFilter.LOGIC_OR);
  capabilities.addType(AbstractFilter.LOGIC_AND);
  capabilities.addType(AbstractFilter.LOGIC_NOT);
  capabilities.addType(FilterType.COMPARE_EQUALS);
  capabilities.addType(FilterType.COMPARE_LESS_THAN);
  capabilities.addType(AbstractFilter.BETWEEN);
}

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

/**
 * Same as contains, with roles reversed
 *
 * @throws Exception
 */
public void testWithinFilter() throws Exception {
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
  // should match only "r2"
  GeometryFactory gf = new GeometryFactory();
  PackedCoordinateSequenceFactory sf = new PackedCoordinateSequenceFactory();
  LinearRing shell =
      gf.createLinearRing(sf.create(new double[] {2, -1, 2, 5, 4, 5, 4, -1, 2, -1}, 2));
  Polygon polygon = gf.createPolygon(shell, null);
  Within wt = ff.within(ff.property(aname("geom")), ff.literal(polygon));
  FeatureCollection features = dataStore.getFeatureSource(tname("road")).getFeatures(wt);
  checkSingleResult(features, "r2");
}

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

Filter areaFilter = ff.within(ff.property(dataGeomName), ff.literal(zoneGeom));
SimpleFeatureCollection zoneCollection = data.subCollection(areaFilter);
Results stats =

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

assertTrue(filter.evaluate(null));
filter = fac.within(new LiteralExpressionImpl(list), new LiteralExpressionImpl(geom1));
assertFalse(filter.evaluate(null));
filter = fac.within(new LiteralExpressionImpl(list), new LiteralExpressionImpl(geom1));
assertTrue(filter.evaluate(null));

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

fac.within(
    new LiteralExpressionImpl(list),
    new LiteralExpressionImpl(geom1),

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

fac.within(
    new LiteralExpressionImpl(list),
    new LiteralExpressionImpl(geom1),
fac.within(
    new LiteralExpressionImpl(list),
    new LiteralExpressionImpl(geom1),

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

filter = fac.touches(expr1, expr2);
assertEquals(filter.getMatchAction(), MatchAction.ANY);
filter = fac.within(expr1, expr2);
assertEquals(filter.getMatchAction(), MatchAction.ANY);
filter = fac.touches(expr1, expr2, MatchAction.ONE);
assertEquals(filter.getMatchAction(), MatchAction.ONE);
filter = fac.within(expr1, expr2, MatchAction.ALL);
assertEquals(filter.getMatchAction(), MatchAction.ALL);

相关文章