public void visit(LogicFilter filter) { Iterator iter = filter.getFilterIterator(); while (iter.hasNext()) { org.opengis.filter.Filter f = (org.opengis.filter.Filter) iter.next(); Filters.accept(f, this); } }
/** * @see org.geotools.filter.FilterVisitor#visit(org.geotools.filter.LogicFilter) * @deprecated use one of {@link #visit(And, Object)},{@link #visit(Or, Object)}, * {@link #visit(Not, Object)} */ public void visit(LogicFilter filter) { for (Iterator it = filter.getFilterIterator(); it.hasNext();) { Filters.accept((org.opengis.filter.Filter)it.next(),this); } }
public void visit(LogicFilter filter) { Iterator iter = filter.getFilterIterator(); while (iter.hasNext()) { org.opengis.filter.Filter f = (org.opengis.filter.Filter) iter.next(); Filters.accept(f, this); } }
/** * @see org.geotools.filter.FilterVisitor#visit(org.geotools.filter.LogicFilter) * @deprecated use one of {@link #visit(And, Object)},{@link #visit(Or, Object)}, * {@link #visit(Not, Object)} */ public void visit(LogicFilter filter) { for (Iterator it = filter.getFilterIterator(); it.hasNext();) { Filters.accept((org.opengis.filter.Filter)it.next(),this); } }
/** * @see org.geotools.filter.FilterVisitor#visit(org.geotools.filter.LogicFilter) */ public void visit(LogicFilter filter) { switch (filter.getFilterType()) { case AbstractFilter.LOGIC_NOT: LOGGER.finest("[NOT] LogicFilter ignored!"); break; case AbstractFilter.LOGIC_OR: LOGGER.finest("[OR] LogicFilter ignored!"); break; case AbstractFilter.LOGIC_AND: Iterator list = filter.getFilterIterator(); while (list.hasNext()) { Filters.accept((org.opengis.filter.Filter)list.next(),this); } break; default: LOGGER.finest("LogicFilter ignored!"); } }
public void visit(LogicFilter filter) { LogicFilter copy = null; Iterator iterator = filter.getFilterIterator(); List subFilters = new ArrayList(); while (iterator.hasNext()) { org.opengis.filter.Filter subFilter = (org.opengis.filter.Filter) iterator.next(); Filters.accept(subFilter,this); subFilters.add(pages.pop()); } try { copy = ff.createLogicFilter(filter.getFilterType()); Iterator copyIterator = subFilters.iterator(); while (copyIterator.hasNext()) { copy.addFilter((org.opengis.filter.Filter) copyIterator.next()); } } catch (IllegalFilterException erp) { throw new RuntimeException(erp); } pages.push(copy); }
/** * Deep copy the filter. * <p> * Filter objects are mutable, when copying a rich * data structure (like SLD) you will need to duplicate * the Filters referenced therein. * </p> */ public Filter duplicate( Filter filter ){ DuplicatorFilterVisitor xerox = new DuplicatorFilterVisitor( ff ); Filters.accept( filter, xerox ); return (Filter) xerox.getCopy(); }
public void visit(org.geotools.filter.LogicFilter filter) { filter.getFilterType(); String type = (String) logical.get(new Integer(filter.getFilterType())); start(type); java.util.Iterator list = filter.getFilterIterator(); while (list.hasNext()) { Filters.accept((org.opengis.filter.Filter)list.next(),this); } end(type); }
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param out the writer to encode the SQL to. * @param filter the Filter to be encoded. * * @throws SQLEncoderException If filter type not supported, or if there * were io problems. */ public void encode(Writer out, org.opengis.filter.Filter filter) throws SQLEncoderException { if (getCapabilities().fullySupports(filter)) { this.out = out; try { out.write("WHERE "); Filters.accept( filter, this ); //out.write(";"); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new SQLEncoderException("Problem writing filter: ", ioe); } } else { throw new SQLEncoderException("Filter type not supported"); } }
/** * Performs the encoding, sends the encoded sql to the writer passed in. * * @param out the writer to encode the SQL to. * @param filter the Filter to be encoded. * * @throws SQLEncoderException If filter type not supported, or if there * were io problems. */ public void encode(Writer out, org.opengis.filter.Filter filter) throws SQLEncoderException { if (getCapabilities().fullySupports(filter)) { this.out = out; try { out.write("WHERE "); Filters.accept( filter, this ); } catch (java.io.IOException ioe) { LOGGER.warning("Unable to export filter" + ioe); throw new SQLEncoderException("Problem writing filter: ", ioe); } } else { throw new SQLEncoderException("Filter type not supported"); } }
protected FeatureReader<SimpleFeatureType, SimpleFeature> wrapWithFilteringFeatureReader(Filter postFilter, FeatureReader<SimpleFeatureType, SimpleFeature> reader, Filter processedFilter) { FilterEncodingPreProcessor visitor = new FilterEncodingPreProcessor(COMPLIANCE_LEVEL); Filters.accept( processedFilter, visitor); if( visitor.requiresPostProcessing() ) return new FilteringFeatureReader<SimpleFeatureType, SimpleFeature>(reader, processedFilter); else return new FilteringFeatureReader<SimpleFeatureType, SimpleFeature>(reader, postFilter); }
Filters.accept(query.getFilter(), visitor); if( !visitor.fids.isEmpty() ) { List recordsFound = queryFidIndex((String[]) visitor.fids.toArray(new String[0]));
protected void init( Transaction transaction, Query query, Integer level ) throws IOException { FilterEncodingPreProcessor visitor = new FilterEncodingPreProcessor(level); Filters.accept( query.getFilter(), visitor ); this.transaction=transaction; if( visitor.requiresPostProcessing() && query.getPropertyNames()!=Query.ALL_NAMES){ FilterAttributeExtractor attributeExtractor=new FilterAttributeExtractor(); query.getFilter().accept( attributeExtractor, null ); Set<String> properties = new HashSet<String>(attributeExtractor.getAttributeNameSet()); properties.addAll(Arrays.asList(query.getPropertyNames())); this.query = new Query(query); this.query.setPropertyNames((String[]) properties.toArray(new String[0])); } else { this.query=query; } this.filter=visitor.getFilter(); Query nonFidQuery=new Query(query); Id fidFilter = visitor.getFidFilter(); nonFidQuery.setFilter(fidFilter); if( fidFilter.getIDs().size()>0 ){ delegate = StrictWFSStrategy.super.createFeatureReader(transaction, nonFidQuery); }else{ delegate=nextReader(); } }
/** * Performs a search on this <code>RTree</code> * * @param filter a <code>Filter</code> * * @return a <code>Collection</code> of <code>Data</code> * * @throws TreeException * @throws UnsupportedFilterException DOCUMENT ME! * @throws LockTimeoutException DOCUMENT ME! */ public List search(Filter filter) throws TreeException, UnsupportedFilterException, LockTimeoutException { // Aquire a read lock Lock lock = this.store.getReadLock(); List ret = null; try { FilterConsumer fc = new FilterConsumer(); Filters.accept( filter,fc); if (fc.getBounds() != null) { ret = this.search(fc.getBounds(), lock); } else { throw new UnsupportedFilterException("Not a valid filter"); } } finally { // Release the lock this.store.releaseLock(lock); } return ret; }
if (filter != null) { FilterConsumer fc = new FilterConsumer(); Filters.accept(filter,fc); bbox = fc.getBounds();
/** * DOCUMENT ME! * * @param filter * * * @throws TreeException * @throws UnsupportedFilterException */ public Envelope getBounds(Filter filter) throws TreeException, UnsupportedFilterException { this.checkOpen(); FilterConsumer fc = new FilterConsumer(); Filters.accept( filter, fc ); Envelope env = fc.getBounds(); if (env == null) { throw new UnsupportedFilterException("Filter not supported"); } Node root = this.store.getRoot(); return env.contains(root.getBounds()) ? root.getBounds() : this.getBoundsInternal(env, root); }