Package org.geotools.filter.visitor

Examples of org.geotools.filter.visitor.AbstractFilterVisitor


                                return name;
                            }
                            ;
                        };
                    query.getFilter().accept(new AbstractFilterVisitor(visitor), null);
                   
                    //2. ensure any spatial predicate is made against a property
                    // that is actually special
                    AbstractFilterVisitor fvisitor = new AbstractFilterVisitor() {
                     
                        protected Object visit( BinarySpatialOperator filter, Object data ) {
                            PropertyName name = null;
                            if ( filter.getExpression1() instanceof PropertyName ) {
                                name = (PropertyName) filter.getExpression1();
                            }
                            else if ( filter.getExpression2() instanceof PropertyName ) {
                                name = (PropertyName) filter.getExpression2();
                            }
                           
                            if ( name != null ) {
                                //check against fetaure type to make sure its
                                // a geometric type
                                AttributeDescriptor att = (AttributeDescriptor) name.evaluate(featureType);
                                if ( !( att instanceof GeometryDescriptor ) ) {
                                    throw new WFSException("Property " + name + " is not geometric", "InvalidParameterValue");
                                }
                            }
                           
                            return filter;
                        }
                    };
                    query.getFilter().accept(fvisitor, null);
                   
                    //3. ensure that any bounds specified as part of the query
                    // are valid with respect to the srs defined on the query
                    if ( wfs.isCiteCompliant() ) {
                       
                        if ( query.getSrsName() != null ) {
                            final QueryType fquery = query;
                            fvisitor = new AbstractFilterVisitor() {
                                public Object visit(BBOX filter, Object data) {
                                    if ( filter.getSRS() != null &&
                                            !fquery.getSrsName().toString().equals( filter.getSRS() ) ) {
                                       
                                        //back project bounding box into geographic coordinates
View Full Code Here


                                return name;
                            }
                            ;
                        };

                    filter.accept(new AbstractFilterVisitor(visitor), null);
                }

                // extract collection
                VersioningFeatureSource store = (VersioningFeatureSource) source;
                FeatureCollection<SimpleFeatureType, SimpleFeature> logs = store.getLog(query
View Full Code Here

                                return name;
                            }
                            ;
                        };

                    filter.accept(new AbstractFilterVisitor(visitor), null);
                }

                // extract collection
                VersioningFeatureSource store = (VersioningFeatureSource) source;
                FeatureDiffReader differences = store.getDifferences(query.getFromFeatureVersion(),
View Full Code Here

                                return name;
                            }
                            ;
                        };

                    filter.accept(new AbstractFilterVisitor(visitor), null);
                }

                // extract collection
                VersioningFeatureSource store = (VersioningFeatureSource) source;
                SimpleFeatureCollection logs = store.getLog(query
View Full Code Here

                                return name;
                            }
                            ;
                        };
                    query.getFilter().accept(new AbstractFilterVisitor(visitor), null);
                   
                    //2. ensure any spatial predicate is made against a property
                    // that is actually special
                    AbstractFilterVisitor fvisitor = new AbstractFilterVisitor() {
                     
                        protected Object visit( BinarySpatialOperator filter, Object data ) {
                            PropertyName name = null;
                            if ( filter.getExpression1() instanceof PropertyName ) {
                                name = (PropertyName) filter.getExpression1();
                            }
                            else if ( filter.getExpression2() instanceof PropertyName ) {
                                name = (PropertyName) filter.getExpression2();
                            }
                           
                            if ( name != null ) {
                                //check against fetaure type to make sure its
                                // a geometric type
                                AttributeDescriptor att = (AttributeDescriptor) name.evaluate(featureType);
                                if ( !( att instanceof GeometryDescriptor ) ) {
                                    throw new WFSException("Property " + name + " is not geometric", "InvalidParameterValue");
                                }
                            }
                           
                            return filter;
                        }
                    };
                    query.getFilter().accept(fvisitor, null);
                   
                    //3. ensure that any bounds specified as part of the query
                    // are valid with respect to the srs defined on the query
                    if ( wfs.isCiteCompliant() ) {
                       
                        if ( query.getSrsName() != null ) {
                            final QueryType fquery = query;
                            fvisitor = new AbstractFilterVisitor() {
                                public Object visit(BBOX filter, Object data) {
                                    if ( filter.getSRS() != null &&
                                            !fquery.getSrsName().toString().equals( filter.getSRS() ) ) {
                                       
                                        //back project bounding box into geographic coordinates
View Full Code Here

                    return name;
                }
                ;
            };
        filter.accept(new AbstractFilterVisitor(visitor), null);
       
        //2. ensure any spatial predicate is made against a property
        // that is actually spatial
        AbstractFilterVisitor fvisitor = new AbstractFilterVisitor() {
         
            protected Object visit( BinarySpatialOperator filter, Object data ) {
                PropertyName name = null;
                if ( filter.getExpression1() instanceof PropertyName ) {
                    name = (PropertyName) filter.getExpression1();
                }
                else if ( filter.getExpression2() instanceof PropertyName ) {
                    name = (PropertyName) filter.getExpression2();
                }
               
                if ( name != null ) {
                    // check against feataure type to make sure its
                    // a geometric type
                    AttributeDescriptor att = (AttributeDescriptor) name.evaluate(featureType);
                    if ( !( att instanceof GeometryDescriptor ) ) {
                        throw new WFSException(request, "Property " + name
                                + " is not geometric in feature type " + meta.prefixedName(),
                                "InvalidParameterValue");
                    }
                }
               
                return filter;
            }
        };
        filter.accept(fvisitor, null);
       
        //3. ensure that any bounds specified as part of the query
        // are valid with respect to the srs defined on the query
        if ( wfs.isCiteCompliant() ) {
           
            if ( query.getSrsName() != null ) {
                final Query fquery = query;
                fvisitor = new AbstractFilterVisitor() {
                    public Object visit(BBOX filter, Object data) {
                        if ( filter.getSRS() != null &&
                                !fquery.getSrsName().toString().equals( filter.getSRS() ) ) {
                           
                            //back project bounding box into geographic coordinates
View Full Code Here

TOP

Related Classes of org.geotools.filter.visitor.AbstractFilterVisitor

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.