Package org.opengis.filter

Examples of org.opengis.filter.FilterFactory2.featureId()


        FilterFactory2 ffac = CommonFactoryFinder.getFilterFactory2(GeoTools.getDefaultHints());
        Set fids = new HashSet();
        try {
            while (iter.hasNext()) {
                String id = iter.next().getID();
                FeatureId fid = ffac.featureId(id);
                fids.add(fid);
            }
            Id filter = ffac.id(fids);
            return filter;
        } finally {
View Full Code Here


       
        PropertyIsNull null1=ff.isNull( ff.property("name") );
        PropertyIsNull null2=ff.isNull( ff.property("geom") );
       
        HashSet<FeatureId> set = new HashSet<FeatureId>();
        set.add( ff.featureId("FID.1"));       
        Filter filter=ff.or( null2, ff.and( null1,  ff.id( set ) ) );
       
        StringWriter output = new StringWriter();
        XMLHandlerHints hints = new XMLHandlerHints();
        hints.put(XMLHandlerHints.FILTER_COMPLIANCE_STRICTNESS,
View Full Code Here

    }

    public void testStrictHintOR() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        HashSet<FeatureId> set = new HashSet<FeatureId>();
        set.add( ff.featureId("FID.1"));
        set.add( ff.featureId("FID.2"));       
    Filter filter=ff.id( set );
   
        StringWriter output = new StringWriter();
        XMLHandlerHints hints=new XMLHandlerHints();
View Full Code Here

    public void testStrictHintOR() throws Exception {
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null);
        HashSet<FeatureId> set = new HashSet<FeatureId>();
        set.add( ff.featureId("FID.1"));
        set.add( ff.featureId("FID.2"));       
    Filter filter=ff.id( set );
   
        StringWriter output = new StringWriter();
        XMLHandlerHints hints=new XMLHandlerHints();
        hints.put(XMLHandlerHints.FILTER_COMPLIANCE_STRICTNESS, XMLHandlerHints.VALUE_FILTER_COMPLIANCE_MEDIUM);
View Full Code Here

    public void testNOTFids() throws Exception {
        FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(null);
        String fid1 = "FID.1";
        // not id filter does not actually have a valid encoding
        Filter filter = factory.not( factory.id( Collections.singleton( factory.featureId(fid1) ) ) );

        FilterEncodingPreProcessor visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW);
        filter.accept(visitor,null);

        assertEquals(filter, visitor.getFilter());
View Full Code Here

    public void testNOTANDFids() throws Exception {
        FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(null);
        String fid1 = "FID.1";
       
        Filter fidFilter = factory.not( factory.id( Collections.singleton( factory.featureId(fid1) ) ) );
       
         PropertyIsNull nullFilter = factory.isNull( factory.property("name"));

        Filter filter = factory.and(nullFilter,fidFilter);
View Full Code Here

            set = Collections.emptySet();
        }
        else {
            set = new HashSet<FeatureId>();
            for( String f : fid ){
                set.add( factory.featureId(f));
            }
        }
        return factory.id( set );
    }
View Full Code Here

    public void testStraightANDFids() throws Exception {
        FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(null);
        String fid1 = "FID.1";
        String fid2 = "FID.2";
        Filter filter = factory.id(Collections.singleton( factory.featureId(fid1)));
        filter = factory.and( filter, factory.id(Collections.singleton( factory.featureId(fid2))));

        // Test Low compliance
        FilterEncodingPreProcessor visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW);
        filter.accept(visitor,null);
View Full Code Here

    public void testStraightANDFids() throws Exception {
        FilterFactory2 factory = CommonFactoryFinder.getFilterFactory2(null);
        String fid1 = "FID.1";
        String fid2 = "FID.2";
        Filter filter = factory.id(Collections.singleton( factory.featureId(fid1)));
        filter = factory.and( filter, factory.id(Collections.singleton( factory.featureId(fid2))));

        // Test Low compliance
        FilterEncodingPreProcessor visitor = new FilterEncodingPreProcessor(XMLHandlerHints.VALUE_FILTER_COMPLIANCE_LOW);
        filter.accept(visitor,null);
       
View Full Code Here

    }
   
    public void testFidFilter() throws OperationNotSupportedException, IOException{
        FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2();
       
        Id fif = ff.id( ff.featureId("f1"),ff.featureId("f2"),ff.featureId("f3"),ff.featureId("f4"));

        StringWriter output = new StringWriter();
        DocumentWriter.writeFragment(fif,
            FilterSchema.getInstance(), output, null);
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.