Package org.geotools.data.store

Examples of org.geotools.data.store.ReprojectingFeatureCollection


    public Object evaluate(Object object) {
        String targetCRS = getAttribute(object, 0, String.class, true);
        try {
            CoordinateReferenceSystem crs = CRS.decode(targetCRS);
           
            return new ReprojectingFeatureCollection((SimpleFeatureCollection) object, crs);
        } catch (Exception e) {
            throw new RuntimeException("Failed to reproject the collection");
        }
    }
View Full Code Here


        } else {
            collection = contents.subCollection(query.getFilter());
        }
        // step two: reproject
        if (query.getCoordinateSystemReproject() != null) {
            collection = new ReprojectingFeatureCollection(collection, query
                    .getCoordinateSystemReproject());
        }
        // step two sort! (note this makes a sorted copy)
        if (query.getSortBy() != null && query.getSortBy().length != 0) {
            SimpleFeature array[] = collection.toArray(new SimpleFeature[collection.size()]);
View Full Code Here

            features = new ForceCoordinateSystemFeatureResults(features, forcedCRS, false);
        }
        if (targetCRS != null) {
            // note, using ReprojectFeatureResults would work. However that would
            // just work by accident... see GEOS-4072
            features = new ReprojectingFeatureCollection(features, targetCRS);
        }
        return features;
    }
View Full Code Here

        if (query.getFilter() != null && query.getFilter() != Filter.INCLUDE) {
            features = new FilteringSimpleFeatureCollection(features, query.getFilter());
        }
        // step two: reproject
        if (query.getCoordinateSystemReproject() != null) {
            features = new ReprojectingFeatureCollection(features, query
                    .getCoordinateSystemReproject());
        }
        // step two sort! (note this makes a sorted copy)
        if (query.getSortBy() != null && query.getSortBy().length != 0) {
            SimpleFeature array[] = features.toArray(new SimpleFeature[features.size()]);
View Full Code Here

            features = new ForceCoordinateSystemFeatureResults(features, forcedCRS, false);
        }
        if (targetCRS != null) {
            // note, using ReprojectFeatureResults would work. However that would
            // just work by accident... see GEOS-4072
            features = new ReprojectingFeatureCollection(features, targetCRS);
        }
        return features;
    }
View Full Code Here

                Integer code = CRS.lookupEpsgCode(crs, false);
                if(code != null) {
                    CoordinateReferenceSystem lonLatCrs = CRS.decode("EPSG:" + code, true);
                    if(!CRS.equalsIgnoreMetadata(crs, lonLatCrs)) {
                        // we need axis flipping
                        fc = new ReprojectingFeatureCollection(fc, lonLatCrs);
                    }
                }
            }
        }
       
View Full Code Here

        try {
            SimpleFeatureCollection fc = (SimpleFeatureCollection) input;
            CoordinateReferenceSystem crs = fc.getSchema().getCoordinateReferenceSystem();
            // gpx is defined only in wgs84
            if(crs != null && !CRS.equalsIgnoreMetadata(crs, DefaultGeographicCRS.WGS84)) {
                fc = new ReprojectingFeatureCollection(fc, DefaultGeographicCRS.WGS84);
            }
            encoder.encode(os, fc);
        } catch (Exception e) {
            throw new IOException("Unable to encode in GPX", e);
View Full Code Here

        CRSAuthorityFactory crsFactory = CRS.getAuthorityFactory(true);

        CoordinateReferenceSystem targetCRS = crsFactory
                .createCoordinateReferenceSystem("EPSG:4326");
        collection = new ReprojectingFeatureCollection(collection, targetCRS);

        XMLOutputFactory xmlFactory = XMLOutputFactory.newInstance();
        XMLStreamWriter writer = xmlFactory.createXMLStreamWriter(lFileOutputStream);
        writer.writeStartDocument();
        writer.writeStartElement("gpx");
View Full Code Here

        KMLEncoder encoder = new KMLEncoder();
        SimpleFeatureCollection fcObj = (SimpleFeatureCollection) obj;
        CoordinateReferenceSystem crs = fcObj.getSchema().getCoordinateReferenceSystem();
        // gpx is defined only in wgs84
        if (crs != null && !CRS.equalsIgnoreMetadata(crs, DefaultGeographicCRS.WGS84)) {
            fcObj = new ReprojectingFeatureCollection(fcObj, DefaultGeographicCRS.WGS84);
        }

        List<SimpleFeatureCollection> collections = new ArrayList<SimpleFeatureCollection>();
        collections.add(fcObj);
        KmlEncodingContext context = new WFSKmlEncodingContext(gs.getService(WFSInfo.class),
View Full Code Here

            if (!targetTX.isIdentity()) {
                // avoid doing the transform if this is the identity
                if (LOGGER.isLoggable(Level.FINE)) {
                    LOGGER.log(Level.FINE, "Reprojecting features");
                }
                reprojectedFeatures = new ReprojectingFeatureCollection(originalFeatures, targetCRS);
            } else {
                reprojectedFeatures = originalFeatures;
                DownloadUtilities.checkIsEmptyFeatureCollection(reprojectedFeatures);
            }
        } else {
View Full Code Here

TOP

Related Classes of org.geotools.data.store.ReprojectingFeatureCollection

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.