Tabnine Logo
org.geotools.filter
Code IndexAdd Tabnine to your IDE (free)

How to use org.geotools.filter

Best Java code snippets using org.geotools.filter (Showing top 20 results out of 360)

origin: geotools/geotools

/**
 * Gets the left or first expression.
 *
 * @throws IllegalFilterException
 */
public void setExpression1(org.opengis.filter.expression.Expression expression) {
  if (isGeometryExpression(Filters.getExpressionType(expression))) {
    throw new IllegalFilterException(
        "Attempted to add Geometry expression to math expression.");
  }
  this.leftValue = expression;
}
origin: geotools/geotools

public PropertyName property(String name, NamespaceSupport namespaceContext) {
  if (namespaceContext == null) {
    return property(name);
  }
  return new AttributeExpressionImpl(name, namespaceContext);
}
origin: geotools/geotools

private void addFilterToParent() throws IllegalFilterException {
  parent.filter(filterFactory.create());
  expressionFactory = new ExpressionSAXParser(schema);
}
origin: geotools/geotools

public void testAdd() {
  capabilities.addType(FilterType.COMPARE_GREATER_THAN);
  capabilities.addType(FilterType.COMPARE_LESS_THAN_EQUAL);
  capabilities.addType(AbstractFilter.NULL);
  assertTrue(capabilities.supports(AbstractFilter.NULL));
}
origin: geotools/geotools

public SortBy sort(String propertyName, SortOrder order) {
  return new SortByImpl(property(propertyName), order);
}
origin: geotools/geotools

public void testNullFilter() throws IllegalFilterException {
  testExp1 = new AttributeExpressionImpl(testSchema, "testDouble");
  testExp2 = new AttributeExpressionImpl(testSchema, "testDouble");
  testExp3 = new AttributeExpressionImpl(testSchema, "testBoolean");
  NullFilterImpl nullFilter1 = new NullFilterImpl();
  NullFilterImpl nullFilter2 = new NullFilterImpl();
  nullFilter1.setExpression(testExp1);
  nullFilter2.setExpression(testExp2);
  assertTrue(nullFilter1.equals(nullFilter2));
  nullFilter1.setExpression(testExp3);
  assertTrue(!nullFilter1.equals(nullFilter2));
  assertTrue(!nullFilter1.equals(new BetweenFilterImpl()));
}
origin: geotools/geotools

public void testGetArgs() {
  final List expected = Collections.singletonList(new LiteralExpressionImpl(10d));
  function.setParameters(expected);
  List<Expression> actual = function.getParameters();
  assertEquals(expected, actual);
}
origin: geotools/geotools

public void testToString() throws Exception {
  FunctionImpl func = new FunctionImpl();
  Expression param = new LiteralExpressionImpl(42);
  func.setName("TestFunction");
  func.setParameters(Collections.singletonList(param));
  String result = func.toString();
  assertEquals("TestFunction([42])", result);
}
origin: geotools/geotools

public void testSetArgs() {
  final List expected = Collections.singletonList(new LiteralExpressionImpl(10d));
  function.setParameters(expected);
  assertEquals(expected, function.params);
}
origin: geotools/geotools

public PropertyIsLike like(
    Expression expr,
    String pattern,
    String wildcard,
    String singleChar,
    String escape,
    boolean matchCase) {
  LikeFilterImpl filter = new LikeFilterImpl();
  filter.setExpression(expr);
  filter.setPattern(pattern, wildcard, singleChar, escape);
  filter.setMatchingCase(matchCase);
  return filter;
}
origin: geotools/geotools

public void testShortSupports() {
  assertTrue(capabilities.supports(AbstractFilter.LOGIC_AND));
  assertTrue(!(capabilities.supports(AbstractFilter.LIKE)));
}
origin: geotools/geotools

public void testGetParameters() {
  final List expected = Collections.singletonList(new LiteralExpressionImpl(10d));
  // do not try this at home
  function.params = expected;
  assertEquals(expected, function.getParameters());
}
origin: geotools/geotools

private void addFilterToLogicFactory() throws IllegalFilterException {
  logicFactory.add(filterFactory.create());
  expressionFactory = new ExpressionSAXParser(schema);
}
origin: geotools/geotools

public void testFidFilter() {
  FidFilterImpl ff = new FidFilterImpl();
  ff.addFid("1");
  FidFilterImpl ff2 = new FidFilterImpl("1");
  assertNotNull(ff2);
  assertEquals(ff, ff2);
  assertTrue(!ff.equals(null));
  assertTrue(!ff.equals("a string not even a filter"));
  ff2.addFid("2");
  assertTrue(!ff.equals(ff2));
  ff.addFid("2");
  assertEquals(ff, ff2);
}
origin: geoserver/geoserver

List<FunctionName> functionNames = factory.getFunctionNames();
Function f = factory.function(IsInstanceOf.NAME.getFunctionName(), args, null);
assertNotNull(f);
f = factory.function(IsInstanceOf.NAME.getName(), args, null);
assertNotNull(f);
  f = factory.function(IsInstanceOf.NAME.getName(), args, null);
} catch (IllegalArgumentException e) {
  catchedException = true;
try {
  f = factory.function(IsInstanceOf.NAME.getName(), null, null);
} catch (NullPointerException e) {
  catchedException = true;
origin: geotools/geotools

public void testGetName() {
  FunctionExpressionImpl anonymous =
      new FunctionExpressionImpl(
          FunctionExpressionImpl.functionName("testFunction", "text:String")) {};
  assertEquals("testFunction", anonymous.getName());
}
origin: geotools/geotools

public void testGetType() {
  assertEquals(ExpressionType.FUNCTION, Filters.getExpressionType(function));
}
origin: geotools/geotools

public void testSetParameters() {
  final List expected = Collections.singletonList(new LiteralExpressionImpl(10d));
  // do not try this at home
  function.setParameters(expected);
  assertEquals(expected, function.params);
}
origin: geotools/geotools

/**
 * Gets the second expression.
 *
 * @throws IllegalFilterException
 */
public void setExpression2(org.opengis.filter.expression.Expression expression) {
  // Check to see if this is a valid math expression before adding.
  if (isGeometryExpression(Filters.getExpressionType(expression))) {
    throw new IllegalFilterException(
        "Attempted to add Geometry expression to math expression.");
  }
  this.rightValue = expression;
}
origin: geotools/geotools

public void testFilterSupports() {
  assertTrue(capabilities.supports(compFilter));
  assertTrue(!(capabilities.supports(gFilter)));
}
org.geotools.filter

Most used classes

  • ECQL
    Extended Contextual Query Language (ECQL) is an extension of CQL. This class presents the operations
  • CQL
    Utility class to parse CQL predicates and expressions to GeoAPI Filters and Expressions, respectivel
  • FeatureIdImpl
    Implementation of org.opengis.filter.identity.FeatureId
  • FilterAttributeExtractor
    A simple visitor that extracts every attribute used by a filter or an expression Access to this cla
  • FilterCapabilities
    Represents the Filter capabilities that are supported by a SQLEncoder. Each SQLEncoder class should
  • Filters,
  • DuplicatingFilterVisitor,
  • CQLException,
  • OGCConfiguration,
  • SortByImpl,
  • EnvFunction,
  • OGCConfiguration,
  • PostPreProcessFilterSplittingVisitor,
  • IllegalFilterException,
  • CompareFilter,
  • LiteralExpression,
  • AttributeExpressionImpl,
  • FidFilter,
  • LikeFilterImpl
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now