Examples of ReprojectingFeatureCollection


Examples of org.geotools.data.store.ReprojectingFeatureCollection

            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

Examples of org.geotools.data.store.ReprojectingFeatureCollection

                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

Examples of org.geotools.data.store.ReprojectingFeatureCollection

        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

Examples of org.geotools.data.store.ReprojectingFeatureCollection

        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

Examples of org.geotools.data.store.ReprojectingFeatureCollection

        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

Examples of org.geotools.data.store.ReprojectingFeatureCollection

            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

Examples of org.geotools.data.store.ReprojectingFeatureCollection

            // KML is defined only over wgs84 in lon/lat order, ignore what the WFS thinks the output
            // crs should be
            SimpleFeatureCollection sfc = (SimpleFeatureCollection) fc;
            CoordinateReferenceSystem sourceCRS = sfc.getSchema().getCoordinateReferenceSystem();
            if(sourceCRS != null && !CRS.equalsIgnoreMetadata(sourceCRS, DefaultGeographicCRS.WGS84)) {
                sfc = new ReprojectingFeatureCollection(sfc, DefaultGeographicCRS.WGS84);
            }
            result.add(sfc);
        }
       
        return result;
View Full Code Here

Examples of org.geotools.data.store.ReprojectingFeatureCollection

                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
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.