• 过滤表filter达式cql相互转化


    CQL----sql字符串表达方式
      Filter---过滤器表达方式
      filter:
      1,cqltofilter
      Filter filter = CQL.toFilter(FilterCQLSample.LESS_FILTER_SAMPLE);---非中文
      2,用FilterFactory filterFactory = CommonFactoryFinder.getFilterFactory(null);创建
      tostring:
      FilterToCQL toCQL = new FilterToCQL();
      String output = filter.accept(toCQL, null).toString();
      3,cqllist
       List list = ECQL.toFilterList("A=1; B<4");
      4,在转化完成后直接用于feature即可
      Filter  filter = CQL.toFilter(filterStr); // filterStr形式 如  name='武汉大学' or code like 'tt123%'  
      SimpleFeatureCollection result = featureSource.getFeatures(filter); 
       
      Filter filter = CQL.toFilter(text.getText());
      Query query = new Query(typeName, filter, new String[] {name});
      SimpleFeatureCollection features = source.getFeatures(query);
      cql:简单的非地理空间属性过滤
      ecql:可以支持复杂的表达式,和空间函数关系
      
      
      cql字符串解析成filter:
      根据一系列初始化方法,在对应编译器中构建出由表达是符号转化的case key 根据对应case key对应的序号,找到对应的构建方法
      
       compiler.compileFilter(); 根据key对应的编码找到具体build方法--CQLCompiler   this.SearchCondition()  jjtreeCloseNodeScope this.build(n) BooleanPrimary 等一系列初始化方法;  
     CQLParser --》 RoutineInvocationRelGeoOp  ---》 AbstractFilterBuilder  buildBbox
      
      构建:
      public DistanceBufferOperator buildSpatialDWithinFilter() throws CQLException {
            String unit = this.resultStack.popStringValue();
            double tolerance = this.resultStack.popDoubleValue();
            Expression geom = this.resultStack.popExpression();
            Expression property = this.resultStack.popExpression();
            FilterFactory2 ff = (FilterFactory2)this.filterFactory;
            return ff.dwithin(property, geom, tolerance, unit);
        }

  • 相关阅读:
    Linux生产者和消费者模型 条件变量 信号量
    解析 IssueVision使用的OBSERVER(观察者)模式和COMMAND(命令)模式
    大模型微调技术LoRA与QLoRA
    CorelDRAW 2022中文精简64位直装版下载
    作用域和作用域链
    twitter推文案例
    服务器远程桌面经常连接不上,造成远程桌面连接不上的原因都有哪些
    Windows11 手把手教授开放端口
    Mysql(二)------Mysql的配置文件位置
    一种基于双MCU协同的多功能押解脚环
  • 原文地址:https://blog.csdn.net/y666666y/article/details/130848883