Package org.geotools.filter.spatial

Examples of org.geotools.filter.spatial.DefaultCRSFilterVisitor


            return filter;
        }
       
        // all right, we need to default the literals to the declaredCRS and then reproject to
        // the native one
        DefaultCRSFilterVisitor defaulter = new DefaultCRSFilterVisitor(filterFactory, declaredCRS);
        Filter defaulted = (Filter) filter.accept(defaulter, null);
        ReprojectingFilterVisitor reprojector = new ReprojectingFilterVisitor(filterFactory, schema);
        Filter reprojected = (Filter) defaulted.accept(reprojector, null);
        return reprojected;
    }
View Full Code Here


    public SimpleFeatureCollection subCollection(Filter filter) {
        // reproject the filter to the delegate native crs
        CoordinateReferenceSystem crs = getSchema().getCoordinateReferenceSystem();
        CoordinateReferenceSystem crsDelegate = delegate.getSchema().getCoordinateReferenceSystem();
        if(crs != null) {
            DefaultCRSFilterVisitor defaulter = new DefaultCRSFilterVisitor(FF, crs);
            filter = (Filter) filter.accept(defaulter, null);
            if(crsDelegate != null && !CRS.equalsIgnoreMetadata(crs, crsDelegate)) {
                ReprojectingFilterVisitor reprojector = new ReprojectingFilterVisitor(FF, delegate.getSchema());
                filter = (Filter) filter.accept(reprojector, null);
            }
View Full Code Here

     * @param nativeCRS
     * @param wfsVersion
     * @return
     */
    public static Filter applyDefaultCRS(Filter filter, CoordinateReferenceSystem defaultCRS) {
        DefaultCRSFilterVisitor defaultVisitor = new DefaultCRSFilterVisitor(ff, defaultCRS);
        return (Filter) filter.accept(defaultVisitor, null);
    }
View Full Code Here

        .getCoordinateReferenceSystem();
    CoordinateReferenceSystem declaredCRS = this.request.getCrs();
    Filter transformedFilter = filter;
    Unit<?> unit = CRSUtilities.getUnit(crs.getCoordinateSystem());
    if (declaredCRS != null) {
      DefaultCRSFilterVisitor defaultVisitor = new DefaultCRSFilterVisitor(
          CommonFactoryFinder.getFilterFactory2(GeoTools
              .getDefaultHints()), declaredCRS);
      Filter defaulted = (Filter) filter.accept(defaultVisitor, null);
      ReprojectingFilterVisitor visitor = new ReprojectingFilterVisitor(
          CommonFactoryFinder.getFilterFactory2(GeoTools
View Full Code Here

    CoordinateReferenceSystem crs = source.getSchema()
        .getCoordinateReferenceSystem();
    CoordinateReferenceSystem declaredCRS = this.request.getCrs();
    Filter transformedFilter = filter;
    if (declaredCRS != null) {
      DefaultCRSFilterVisitor defaultVisitor = new DefaultCRSFilterVisitor(
          CommonFactoryFinder.getFilterFactory2(GeoTools
              .getDefaultHints()), declaredCRS);
      Filter defaulted = (Filter) filter.accept(defaultVisitor, null);
      ReprojectingFilterVisitor visitor = new ReprojectingFilterVisitor(
          CommonFactoryFinder.getFilterFactory2(GeoTools
View Full Code Here

                defaultCRS = nativeCRS;
                targetCRS = nativeCRS;
            }
           
            // now we apply a default to all geometries and bbox in the filter
            DefaultCRSFilterVisitor defaultCRSVisitor = new DefaultCRSFilterVisitor(ff, defaultCRS);
            Filter filter = query.getFilter() != null ? query.getFilter() : Filter.INCLUDE;
            Filter defaultedFilter = (Filter) filter.accept(defaultCRSVisitor, null);
           
            // and then we reproject all geometries so that the datastore receives
            // them in the native projection system (or the forced one, in case of force)
View Full Code Here

                }
                if (crs != null) {
                    try {
                        // apply the default srs into the spatial filters
                        CoordinateReferenceSystem sourceCrs = CRS.decode("EPSG:" + crs, true);
                        DefaultCRSFilterVisitor crsForcer = new DefaultCRSFilterVisitor(FF,
                                sourceCrs);
                        result = (Filter) result.accept(crsForcer, null);
                    } catch (Exception e) {
                        throw new RestletException("Uknown EPSG code '" + crs + "'",
                                Status.CLIENT_ERROR_BAD_REQUEST);
View Full Code Here

    public SimpleFeatureCollection subCollection(Filter filter) {
        // reproject the filter to the delegate native crs
        CoordinateReferenceSystem crs = getSchema().getCoordinateReferenceSystem();
        CoordinateReferenceSystem crsDelegate = delegate.getSchema().getCoordinateReferenceSystem();
        if(crs != null) {
            DefaultCRSFilterVisitor defaulter = new DefaultCRSFilterVisitor(FF, crs);
            filter = (Filter) filter.accept(defaulter, null);
            if(crsDelegate != null && !CRS.equalsIgnoreMetadata(crs, crsDelegate)) {
                ReprojectingFilterVisitor reprojector = new ReprojectingFilterVisitor(FF, delegate.getSchema());
                filter = (Filter) filter.accept(reprojector, null);
            }
View Full Code Here

TOP

Related Classes of org.geotools.filter.spatial.DefaultCRSFilterVisitor

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.