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

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

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

FilterFactory2.property介绍

[英]Retrieves the value of a org.opengis.feature.Feature's property.
[中]检索组织的值。opengis。特色特征的属性。

代码示例

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

/** Set up parameters for the Interpolate function with a set of input data and output values */
private void setupParameters(Object[] data, Object[] values) {
  if (data.length != values.length) {
    throw new IllegalArgumentException("data and values arrays should be the same length");
  }
  parameters = new ArrayList<Expression>();
  parameters.add(ff2.property("value"));
  for (int i = 0; i < data.length; i++) {
    parameters.add(ff2.literal(data[i]));
    parameters.add(ff2.literal(values[i]));
  }
}

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

private void setupParameters(Object[] categories, Object[] thresholds) {
  if (thresholds.length != categories.length - 1) {
    throw new IllegalArgumentException("should be n thresholds and n+1 categories");
  }
  parameters = new ArrayList<Expression>();
  parameters.add(ff2.property("value"));
  for (int i = 0; i < thresholds.length; i++) {
    parameters.add(ff2.literal(categories[i]));
    parameters.add(ff2.literal(thresholds[i]));
  }
  parameters.add(ff2.literal(categories[categories.length - 1]));
}

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

@BeforeClass
public static void setUpBeforeClass() throws Exception {
  ff = CommonFactoryFinder.getFilterFactory2(null);
  filters = new Filters(ff);
  a = ff.greater(ff.property("zone"), ff.literal(7));
  b = ff.like(ff.property("suburb"), "N%");
  c = ff.equals(ff.property("Subject"), ff.literal("foo"));
  d = ff.equals(ff.property("Subject"), ff.literal("bar"));
}

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

public void testMinFunction() {
  PropertyName a = ff.property("testInteger");
  Literal b = ff.literal(1004.0);
  Function min = ff.function("min", a, b);
  assertNotNull(min);
}

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

private Filter totallyIndexedFilter() {
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
  Filter filter =
      ff.or(
          ff.equals(ff.property("st:Station"), ff.literal("st.1")),
          ff.like(ff.property("st:Station/st:name"), "*fer*"));
  return filter;
}

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

public void testIntPresent() {
  PropertyName exp = ff.property("foo");
  Function func =
      ff.function(FUNCTION_NAME, exp, ff.literal(3), ff.literal(4), ff.literal(5));
  Object result = func.evaluate(feature);
  assertEquals(true, result);
}

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

private Filter partialIndexedFilterXpath() {
    FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
    Filter filter =
        ff.and(
            ff.equals(ff.property("st:Station"), ff.literal("st.1")),
            ff.like(ff.property("st:Station/st:location/st:name"), "*fer*"));
    return filter;
  }
}

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

public void testDoublePresent() {
  PropertyName exp = ff.property("bar");
  Function func =
      ff.function(FUNCTION_NAME, exp, ff.literal(2.5), ff.literal(2.6), ff.literal(3.0));
  Object result = func.evaluate(feature);
  assertEquals(true, result);
}

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

protected Filter totallyIndexedFilter() {
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
  Filter filter =
      ff.or(
          ff.equals(ff.property(attId), ff.literal("st.1")),
          ff.like(ff.property(attName), "*fer*"));
  return filter;
}

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

protected Filter totallyIndexedFilter2() {
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
  Filter filter =
      ff.or(
          ff.equals(ff.property(attName), ff.literal("fer")),
          ff.like(ff.property(attName), "*mariela*"));
  return filter;
}

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

private Filter totallyIndexedFilter2() {
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
  Filter filter =
      ff.or(
          ff.equals(ff.property("st:Station/st:name"), ff.literal("fer")),
          ff.like(ff.property("st:Station/st:name"), "*mariela*"));
  return filter;
}

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

private Filter partialIndexedFilter() {
  FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
  Filter filter =
      ff.and(
          ff.equals(ff.property("ID"), ff.literal("st.1")),
          ff.like(ff.property("LOCATION_NAME"), "*fer*"));
  return filter;
}

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

public void testIntMissing() {
  PropertyName exp = ff.property("foo");
  Function func = ff.function(FUNCTION_NAME, exp, ff.literal(1), ff.literal(2));
  Object result = func.evaluate(feature);
  assertEquals(false, result);
}

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

public void testStringPresent() {
  PropertyName exp = ff.property("group");
  Function func = ff.function(FUNCTION_NAME, exp, ff.literal("Group0"), ff.literal("Group1"));
  Object result = func.evaluate(feature);
  assertEquals(true, result);
}

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

public void testNearest() throws Exception {
  Function func = ff.function("Collection_Nearest", ff.property("foo"), ff.literal(9));
  Object match = func.evaluate(featureCollection);
  assertEquals("Nearest to 9 is 8", 8, match);
}

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

@Test
public void testNoThresholds() throws Exception {
  // System.out.println("   testNoThresholds");
  final int categoryValue = 42;
  parameters.add(ff2.property("value"));
  parameters.add(ff2.literal(categoryValue));
  Function fn = finder.findFunction("categorize", parameters);
  Integer result = fn.evaluate(feature(0), Integer.class);
  assertEquals(categoryValue, result.intValue());
}

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

public void testNullComparison() {
  PropertyName exp = ff.property("not_there");
  Function func = ff.function(FUNCTION_NAME, exp, ff.literal(1), ff.literal(null));
  Object result = func.evaluate(feature);
  assertEquals(true, result);
  func = ff.function(FUNCTION_NAME, exp, ff.literal("1"), ff.literal(2));
  result = func.evaluate(feature);
  assertEquals(false, result);
}

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

public void testSetNumberOfClasses() throws Exception {
  LOGGER.finer("testSetNumberOfClasses");
  Literal classes = ff.literal(3);
  PropertyName exp = ff.property("foo");
  StandardDeviationFunction func =
      (StandardDeviationFunction) ff.function("StandardDeviation", exp, classes);
  assertEquals(3, func.getClasses());
  classes = ff.literal(12);
  func = (StandardDeviationFunction) ff.function("StandardDeviation", exp, classes);
  assertEquals(12, func.getClasses());
}

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

@Test
  public void testOverlaps() {
    ff.overlaps(ff.property("geom"), ff.literal(null)).accept(visitor, null);
    assertTrue(visitor.hasSpatialFilter);
  }
}

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

public void testConstantValuesString() {
    Function function = ff.function("quantile", ff.property("s"), ff.literal(12));
    ExplicitClassifier classifier = (ExplicitClassifier) function.evaluate(constantCollection);
    assertNotNull(classifier);
    assertEquals(1, classifier.getSize());
    assertEquals(1, classifier.getValues(0).size());
    assertEquals("abc", classifier.getValues(0).iterator().next());
  }
}

相关文章