Package org.geotools.filter

Examples of org.geotools.filter.FilterFactoryImpl


     */
    @Test
    public void toFilterUsesProvidedFilterFactory() throws Exception {
        final boolean[] called = { false };
       
        FilterFactory ff = new FilterFactoryImpl() {
                public PropertyName property(String propName) {
                    called[0] = true;

                    return super.property(propName);
                }
View Full Code Here


     */
    @Test
    public void toExpressionUsesProvidedFilterFactory() throws Exception {
        final boolean[] called = { false };
       
        FilterFactory ff = new FilterFactoryImpl() {
                public PropertyName property(String propName) {
                    called[0] = true;

                    return super.property(propName);
                }
View Full Code Here

      }
     
      DataStore ds = new MemoryDataStore(mm);
      FeatureCache cache = new GridFeatureCache(ds.getFeatureSource(featureType.getTypeName()), 4, 4, MemoryStorage.createInstance());
     
      FilterFactory ff = new FilterFactoryImpl();
      Filter f1 = ff.bbox("the_geom", 0, 0, 4.4, 4.4, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e1 = new Envelope(0, 4.4, 0, 4.4);
     
      Filter f2 = ff.bbox("the_geom", 0, 4.6, 4.4, 8.5, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e2 = new Envelope(0, 4.4, 4.6, 8.5);
     
      Filter f3 = ff.bbox("the_geom", 4.6, 0, 8.5, 4.4, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e3 = new Envelope(4.6, 8.5, 0, 4.4);
     
      Filter f4 = ff.bbox("the_geom", 4.6, 4.6, 8.5, 8.5, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e4 = new Envelope(4.6, 8.5, 4.6, 8.5);     

      //there should be two features in each region
      FeatureCollection fc = cache.getFeatures(f1);
      assertEquals(2, fc.size());
View Full Code Here

    double y_min = 0;
    double y_max = 100;

    resetDatasets();

    FilterFactory filterFactory = new FilterFactoryImpl();
    FeatureType ft = rawDataset.getFeatureSource("mycollection")
        .getSchema();
    String localname = ft.getGeometryDescriptor().getLocalName();
    String srs = ft.getGeometryDescriptor().getCoordinateReferenceSystem()
        .toString();

    Filter bb = filterFactory.bbox(localname, x_min, y_min, x_max, y_max,
        srs);

    int cnt = rawDataset.getFeatureSource("mycollection").getFeatures(bb)
        .size();
    assertEquals(numFeatures, rawDataset.getFeatureSource("mycollection")
View Full Code Here

    double x_min = 450;
    double x_max = 500;
    double y_min = 450;
    double y_max = 500;

    FilterFactory filterFactory = new FilterFactoryImpl();
    FeatureType ft = rawDataset.getFeatureSource("mycollection").getSchema();
    String localname = ft.getGeometryDescriptor().getLocalName();
    String srs = ft.getGeometryDescriptor().getCoordinateReferenceSystem().toString();

    Filter bb = filterFactory.bbox(localname, x_min, y_min, x_max, y_max,srs);
    assertEquals(numFeatures, rawDataset.getFeatureSource("mycollection").getFeatures().size());

    //cacheFS.resetDidRead();
    assertEquals(numFeatures, cacheDataset.getFeatures().size());
    //assertTrue(cacheFS.didRead());
View Full Code Here

      }
     
      DataStore ds = new MemoryDataStore(mm);
      FeatureCache cache = new StreamingGridFeatureCache(ds.getFeatureSource(featureType.getTypeName()), 4, 4, MemoryStorage.createInstance());
     
      FilterFactory ff = new FilterFactoryImpl();
      Filter f1 = ff.bbox("the_geom", 0, 0, 4.4, 4.4, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e1 = new Envelope(0, 4.4, 0, 4.4);
     
      Filter f2 = ff.bbox("the_geom", 0, 4.6, 4.4, 8.5, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e2 = new Envelope(0, 4.4, 4.6, 8.5);
     
      Filter f3 = ff.bbox("the_geom", 4.6, 0, 8.5, 4.4, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e3 = new Envelope(4.6, 8.5, 0, 4.4);
     
      Filter f4 = ff.bbox("the_geom", 4.6, 4.6, 8.5, 8.5, DefaultEngineeringCRS.CARTESIAN_2D.toString());
      Envelope e4 = new Envelope(4.6, 8.5, 4.6, 8.5);     

      //there should be two features in each region
      FeatureCollection fc = cache.getFeatures(f1);
      assertEquals(2, fc.size());
View Full Code Here

    protected Envelope bbenv;
    protected Envelope bb2env;
    protected Envelope bsoenv;
   
    protected void setUp() {
        ff = new FilterFactoryImpl();
        bb = ff.bbox("geom", 0, 10, 1000, 1100, "srs");
        bbenv = new Envelope(0, 1000, 10, 1100);
        bb2 = ff.bbox("geom", 500, 510, 1500, 1600, "srs");
        bb2env = new Envelope(500, 1500, 510, 1600);
        att = ff.like(ff.property("dummydata"), "Id: 1*");
 
View Full Code Here

  }
 
  @Test
  public void tesFid() {
    FilterFactoryImpl factory = new FilterFactoryImpl();
    Filter f = factory.createFidFilter("123-abc");
  
    String ss = FilterToCQLTool.toCQL(f);
    assertTrue(ss.contains("'123-abc'"));
   
  }
View Full Code Here

   
  }
 
  @Test
  public void test() {
    FilterFactoryImpl factory = new FilterFactoryImpl();
    Expression exp1 = factory.createAttributeExpression(type,"pid");
    Expression exp2 = factory.createLiteralExpression("a89dhd-123-abc");
    Filter f = factory.equal(exp1, exp2, false);
    String ss = FilterToCQLTool.toCQL(f);
    assertTrue(ss.contains("'a89dhd-123-abc'"));
   
  }
View Full Code Here

TOP

Related Classes of org.geotools.filter.FilterFactoryImpl

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.